From 6ef03737b02fc78dc756dd5065999a39ccac8cee Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 12 Feb 2007 12:23:27 +0100 Subject: [PATCH] updated naming convention --- contrib/dcache-demo.fleet | 34 +++++++++--------- contrib/demo.fleet | 6 ++-- contrib/icache-demo.fleet | 8 ++--- src/edu/berkeley/fleet/slipway/Slipway.java | 52 +++++++++++++++------------ 4 files changed, 54 insertions(+), 46 deletions(-) diff --git a/contrib/dcache-demo.fleet b/contrib/dcache-demo.fleet index 8fee352..cdaf598 100644 --- a/contrib/dcache-demo.fleet +++ b/contrib/dcache-demo.fleet @@ -1,35 +1,35 @@ // 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; @@ -37,6 +37,6 @@ fifo.out: 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; diff --git a/contrib/demo.fleet b/contrib/demo.fleet index bd4377e..6c0e50b 100644 --- a/contrib/demo.fleet +++ b/contrib/demo.fleet @@ -1,13 +1,13 @@ #include "contrib/demo.ships" -BOB: sendto icache.cbd; -icache.cbd: [*] take, deliver; +BOB: sendto iscratch.cbd; +iscratch.cbd: [*] take, deliver; debug.data: [*] take, deliver; BOB: { 12: sendto debug.data; 13: sendto debug.data; 14: sendto debug.data; - BOB: sendto icache.cbd; + BOB: sendto iscratch.cbd; } diff --git a/contrib/icache-demo.fleet b/contrib/icache-demo.fleet index c0ebc46..c3f26a3 100644 --- a/contrib/icache-demo.fleet +++ b/contrib/icache-demo.fleet @@ -1,14 +1,14 @@ // ships required in order to run this code #ship debug : Debug -#ship icache : Icache +#ship iscratch : Iscratch // instructions not in any codebag are part of the "root codebag" // which is dispatched when the code is loaded debug.data: deliver; -BOB: sendto icache.cbd; -icache.cbd: [*] take, deliver; +BOB: sendto iscratch.cbd; +iscratch.cbd: [*] take, deliver; debug.data: [*] take, deliver; @@ -20,6 +20,6 @@ BOB: { 12: sendto debug.data; 13: sendto debug.data; 14: sendto debug.data; - BOB: sendto icache.cbd; + BOB: sendto iscratch.cbd; } diff --git a/src/edu/berkeley/fleet/slipway/Slipway.java b/src/edu/berkeley/fleet/slipway/Slipway.java index ca71ce5..b6d96f1 100644 --- a/src/edu/berkeley/fleet/slipway/Slipway.java +++ b/src/edu/berkeley/fleet/slipway/Slipway.java @@ -12,16 +12,6 @@ import edu.berkeley.sbp.util.*; 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 { @@ -31,15 +21,33 @@ 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) { @@ -94,17 +102,17 @@ public class Slipway extends Interpreter { 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(); @@ -176,7 +184,7 @@ public class Slipway extends Interpreter { 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;"); -- 1.7.10.4