unified horn for data and instructions
authoradam <adam@megacz.com>
Thu, 23 Aug 2007 01:40:16 +0000 (02:40 +0100)
committeradam <adam@megacz.com>
Thu, 23 Aug 2007 01:40:16 +0000 (02:40 +0100)
ships/Alu3.ship
src/edu/berkeley/fleet/fpga/Fpga.java
src/edu/berkeley/fleet/fpga/Generator.java
src/edu/berkeley/fleet/ies44/InstructionEncoder.java
tests/recycle/test-recycle.fleet

index 261f535..b79ef58 100644 (file)
@@ -123,7 +123,7 @@ public void service() {
 0:                  sendto bitfifo.inEnqueue;
 bitfifo.inEnqueue:  [*] take, deliver;
 bitfifo.outDequeue: [*] wait, take, sendto lut3.in2;
-lut3.in2:           [5] notify bitfifo.outDequeue;
+lut3.in2:           [4] notify bitfifo.outDequeue;
                     [74] take, deliver, notify bitfifo.outDequeue;
 
 // mux on second input
index eabc55a..5c9494a 100644 (file)
@@ -115,7 +115,7 @@ public class Fpga extends Fleet {
             new FabricTree((FpgaBenkoBox[])ihornports.toArray(new FpgaBenkoBox[0]),
                            "funnel",
                            "ihorn");
-        
+
         if (quiet) return;
         System.out.println("`include \"macros.v\"");
         System.out.println("module fabric(clk, data_Memory0_command_r, data_Memory0_command_a, data_Memory0_command,");
@@ -143,6 +143,8 @@ public class Fpga extends Fleet {
                     System.out.println("  wire [(`PACKET_WIDTH-1):0] data_"
                                        +getUniqueName(ship)+"_"+port.getName()+";");
 
+        System.out.println("wire [(`PACKET_WIDTH-1):0] ihornleft;");
+
         System.out.println("");
         instructions.dumpChannels(false);
         System.out.println("");
@@ -196,18 +198,23 @@ public class Fpga extends Fleet {
             }
 
         }
+
+        System.out.println("funnel ihornfun(clk,"+
+                           "             ihornleft_r, ihornleft_a, ihornleft,"+
+                           "             ihorn_r, ihorn_a, ihorn,"+
+                           "             source_r, source_a, source);");
+        System.out.println("horn tophorn(clk,"+
+                           "             ihornleft_r, ihornleft_a, ihornleft,"+
+                           "             instruction_r, instruction_a, instruction,"+
+                           "             dest_r, dest_a, dest);");
         /*
-        System.out.println("funnel topfun(clk,"+
-                           "              dest_r, dest_a, dest,"+
-                           "              source_r, source_a, source,"+
-                           "              data_Memory0_dhorn_r, data_Memory0_dhorn_a, data_Memory0_dhorn);");
-        */
         System.out.println("assign instruction_r = ihorn_r;");
         System.out.println("assign ihorn_a = instruction_a;");
         System.out.println("assign instruction = ihorn;");
         System.out.println("assign dest_r = source_r;");
         System.out.println("assign source_a = dest_a;");
         System.out.println("assign dest = source;");
+        */
         System.out.println("endmodule");
     }
 
@@ -226,11 +233,11 @@ public class Fpga extends Fleet {
             if (end-start == 1) {
                 FpgaBenkoBox p = ports[start];
                 if (prefix.equals("instruction")) {
-                    p.instr_addr = addr;
-                    p.instr_bits = bits;
+                    p.instr_addr = (addr<<1);
+                    p.instr_bits = bits+1;
                 } else if (prefix.equals("dest")) {
-                    p.addr = addr;
-                    p.bits = bits;
+                    p.addr = (addr << 1) | 1;
+                    p.bits = bits+1;
                     if (bits >= 11)
                         throw new RuntimeException("too many benkoboxen!");
                     int count = 0;
index 78432a4..8053896 100644 (file)
@@ -419,7 +419,7 @@ public class Generator {
 
         mkfunnel("funnel", prefix);
         mkhorn(    "horn", prefix, WIDTH_PACKET-1, WIDTH_DEST_ADDR-1, 0, 0);
-        mkhorn(   "ihorn", prefix, WIDTH_PACKET-1, 34, 24, 0);
+        mkhorn(   "ihorn", prefix, WIDTH_PACKET-1, WIDTH_DEST_ADDR-1, 0, 0);
 
         Module fifostage = mkfifo("fifostage", 0, null,      prefix);
         Module fifo4     = mkfifo("fifo4",     4, fifostage, prefix);
index abe7f58..8ec338f 100644 (file)
@@ -12,7 +12,8 @@ public abstract class InstructionEncoder {
     public static final int WIDTH_DEST_ADDR     = 11;
     public static final int WIDTH_COUNT         = 7;
 
-    public static final int OFFSET_COUNT        = 0;
+    public static final int OFFSET_PUMP_ADDR    = 0;
+    public static final int OFFSET_COUNT        = OFFSET_PUMP_ADDR+WIDTH_PUMP_ADDR;
     public static final int OFFSET_DEST         = OFFSET_COUNT+WIDTH_COUNT;
     public static final int OFFSET_CONTROL      = OFFSET_DEST+WIDTH_DEST_ADDR;
     public static final int OFFSET_RQ           = OFFSET_CONTROL+0;
@@ -21,7 +22,6 @@ public abstract class InstructionEncoder {
     public static final int OFFSET_DL           = OFFSET_CONTROL+3;
     public static final int OFFSET_DI           = OFFSET_CONTROL+4;
     public static final int OFFSET_TI           = OFFSET_CONTROL+5;
-    public static final int OFFSET_PUMP_ADDR    = 24;
 
     /** get the bits describing this box's location on the DESTINATION HORN */
     protected abstract long getDestAddr(Destination box);
index 0da0052..0699b33 100644 (file)
@@ -52,8 +52,8 @@
 #ship alu   : Alu2
 #ship debug : Debug
 
-2:         sendto alu.in1;
-4:         sendto alu.in2;
+2:               sendto alu.in1;
+4:               sendto alu.in2;
 Alu2.inOp[ADD]:  sendto alu.inOp;
 alu.in1:   [*] nop;
            (*) take, deliver;