// ships required in order to run this code
#ship debug : Debug
-#ship dcache : Dcache
+#ship dscratch : Dscratch
#ship fifo : Fifo
// dumb configurations
debug.data: [*] take, deliver;
-dcache.write_addr: [*] take, deliver;
-dcache.write_data: [*] take, deliver;
-dcache.read_addr: [*] take, deliver;
+dscratch.write_addr: [*] take, deliver;
+dscratch.write_data: [*] take, deliver;
+dscratch.read_addr: [*] take, deliver;
fifo.in: [*] take, deliver;
-// addresses and values to initialize the dcache with
-1: sendto dcache.write_addr;
-2: sendto dcache.write_addr;
-3: sendto dcache.write_addr;
-4: sendto dcache.write_addr;
-11: sendto dcache.write_data;
-12: sendto dcache.write_data;
-13: sendto dcache.write_data;
-14: sendto dcache.write_data;
+// addresses and values to initialize the dscratch with
+1: sendto dscratch.write_addr;
+2: sendto dscratch.write_addr;
+3: sendto dscratch.write_addr;
+4: sendto dscratch.write_addr;
+11: sendto dscratch.write_data;
+12: sendto dscratch.write_data;
+13: sendto dscratch.write_data;
+14: sendto dscratch.write_data;
// send write-completion tokens to the fifo output
-dcache.write_done:
+dscratch.write_done:
[*] take, sendto fifo.out;
// when the write-completion tokens accumulate, unleash
// the read addresses
fifo.out:
[4] wait;
- [4] take, sendto dcache.read_addr;
+ [4] take, sendto dscratch.read_addr;
// read addresses
4: sendto fifo.in;
2: sendto fifo.in;
1: sendto fifo.in;
-// data read from dcache goes to the debug ship
-dcache.read_data:
+// data read from dscratch goes to the debug ship
+dscratch.read_data:
[*] take, sendto debug.data;
import java.util.*;
import java.io.*;
import edu.berkeley.fleet.ships.*;
-/*
-
-debug alsoneeds port
-
- DataInbox command = new DataInbox(this, "command", true);
- DataOutbox ihorn = new DataOutbox(this, "ihorn", true, true, false);
- DataOutbox dhorn = new DataOutbox(this, "dhorn", true, false, true);
-
-
- */
public class Slipway extends Interpreter {
createShip("Alu2", "alu2c");
createShip("Alu2", "alu2d");
createShip("Debug", "debug");
- createShip("Execute", "execute");
+ //createShip("Execute", "execute");
createShip("Fifo", "fifo1");
createShip("Fifo", "fifo2");
createShip("Fifo", "fifo3");
createShip("Fifo", "fifo4");
- createShip("Icache", "icache1");
- createShip("Icache", "icache2");
- createShip("Dcache", "dcache1");
- createShip("Dcache", "dcache2");
+ createShip("Iscratch", "iscratch1");
+ createShip("Iscratch", "iscratch2");
+ createShip("Dscratch", "dscratch1");
+ createShip("Dscratch", "dscratch2");
+ dumpFabric(true);
+ }
+
+ public Ship createShip(String type, String name) {
+ InterpreterShip ship = (InterpreterShip)super.createShip(type, name);
+ if (ship.getClass().getSimpleName().equals("Debug")) {
+ new DataOutbox(ship, "out", true);
+
+ } else if (ship.getClass().getSimpleName().equals("Execute")) {
+ new DataOutbox(ship, "ihorn", true, true, false);
+ new DataOutbox(ship, "dhorn", true, false, true);
+
+ } else if (ship.getClass().getSimpleName().equals("Iscratch")) {
+ new DataInbox(ship, "command", true);
+ new DataOutbox(ship, "ihorn", true, true, false);
+ new DataOutbox(ship, "dhorn", true, false, true);
+ }
+ return ship;
}
public FleetProcess run(final byte[] instructions) {
if (quiet) return;
System.out.println("`include \"macros.v\"");
- System.out.println("module fabric(clk, data_Icache0_command_r, data_Icache0_command_a, data_Icache0_command,");
+ System.out.println("module fabric(clk, data_Iscratch0_command_r, data_Iscratch0_command_a, data_Iscratch0_command,");
System.out.println(" data_Debug0_out_r, data_Debug0_out_a, data_Debug0_out);");
System.out.println(" input clk;");
- System.out.println(" input data_Icache0_command_r;");
- System.out.println(" output data_Icache0_command_a;");
+ System.out.println(" input data_Iscratch0_command_r;");
+ System.out.println(" output data_Iscratch0_command_a;");
System.out.println(" output data_Debug0_out_r;");
System.out.println(" input data_Debug0_out_a;");
System.out.println(" output [(`PACKET_WIDTH-1):0] data_Debug0_out;");
- System.out.println(" input [(`PACKET_WIDTH-1):0] data_Icache0_command;");
- //System.out.println(" wire [(`INSTRUCTION_WIDTH-1):0] data_Icache0_ihorn;");
- //System.out.println(" wire [(`PACKET_WIDTH-1):0] data_Icache0_dhorn;");
+ System.out.println(" input [(`PACKET_WIDTH-1):0] data_Iscratch0_command;");
+ //System.out.println(" wire [(`INSTRUCTION_WIDTH-1):0] data_Iscratch0_ihorn;");
+ //System.out.println(" wire [(`PACKET_WIDTH-1):0] data_Iscratch0_dhorn;");
System.out.println();
System.out.println();
System.out.println("funnel topfun(clk,"+
" dest_r, dest_a, dest,"+
" source_r, source_a, source,"+
- " data_Icache0_dhorn_r, data_Icache0_dhorn_a, data_Icache0_dhorn);");
+ " data_Iscratch0_dhorn_r, data_Iscratch0_dhorn_a, data_Iscratch0_dhorn);");
*/
System.out.println("assign instruction_r = ihorn_r;");
System.out.println("assign ihorn_a = instruction_a;");