- ArrayList inputports = new ArrayList<InterpreterBenkoBox>();
- for(InterpreterShip ship : shiplist)
- for(BenkoBox port : ship.getBenkoBoxes())
- if (!((InterpreterBenkoBox)port).special())
- inputports.add(port);
- FabricTree inputs =
- new FabricTree((InterpreterBenkoBox[])inputports.toArray(new InterpreterBenkoBox[0]),
- "horn",
- "dest");
-
- ArrayList outputports = new ArrayList<InterpreterBenkoBox>();
- for(InterpreterShip ship : shiplist)
- for(BenkoBox port : ship.getBenkoBoxes())
- if (!((InterpreterBenkoBox)port).special())
- outputports.add(port);
- FabricTree outputs =
- new FabricTree((InterpreterBenkoBox[])outputports.toArray(new InterpreterBenkoBox[0]),
- "funnel",
- "source");
-
- if (quiet) return;
- System.out.println("`include \"macros.v\"");
- /*
- HashSet<Class> added = new HashSet<Class>();
- for(Ship ship : shiplist)
- if (!added.contains(ship.getClass())) {
- added.add(ship.getClass());
- System.out.println("import ["+ship.getBalsaName()+"]");
- }
- */
- System.out.println("module fabric(clk, data_Execute0_in_r, data_Execute0_in_a, data_Execute0_in,");
- System.out.println(" data_Debug0_out_r, data_Debug0_out_a, data_Debug0_out);");
- System.out.println(" input clk;");
- System.out.println(" input data_Execute0_in_r;");
- System.out.println(" output data_Execute0_in_a;");
- System.out.println(" input [(`PACKET_WIDTH-1):0] data_Execute0_in;");
- 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(" wire [(`INSTRUCTION_WIDTH-1):0] data_Execute0_ihorn;");
- System.out.println(" wire [(`PACKET_WIDTH-1):0] data_Execute0_dhorn;");
- System.out.println();
-
- System.out.println();
-
- instructions.dumpChannels(true);
- outputs.dumpChannels(true);
- inputs.dumpChannels(true);
- for(InterpreterShip ship : shiplist)
- for(BenkoBox port : ship.getBenkoBoxes()) {
- if (ship instanceof Execute && port instanceof Outbox) continue;
- System.out.println(" wire [(`PACKET_WIDTH-1):0] data_"+getUniqueName(ship)+"_"+port.getName()+";");
- }
-
- System.out.println("");
- instructions.dumpChannels(false);
- System.out.println("");
- outputs.dumpChannels(false);
- System.out.println("");
- inputs.dumpChannels(false);
- System.out.println("");
- for(InterpreterShip ship : shiplist) {
- System.out.print(ship.getClass().getSimpleName().toLowerCase());
- System.out.print(" ");
- System.out.print("krunk"+(krunk++));
- System.out.print("(clk, ");
- boolean first = true;
- for(BenkoBox port : ship.getBenkoBoxes()) {
- if (!first) System.out.print(", ");
- first = false;
- System.out.print("data_"+getUniqueName(port.getShip())+"_"+port.getName()+"_r, ");
- System.out.print("data_"+getUniqueName(port.getShip())+"_"+port.getName()+"_a, ");
- System.out.print("data_"+getUniqueName(port.getShip())+"_"+port.getName());
- System.out.print(" ");
- }
- System.out.println(");");