updated naming convention
[fleet.git] / src / edu / berkeley / fleet / slipway / Slipway.java
index ca71ce5..b6d96f1 100644 (file)
@@ -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;");