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,");
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("");
}
}
+
+ 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");
}
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;
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);
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;
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);