make getDestAddr() return a BitVector
[fleet.git] / src / edu / berkeley / fleet / fpga / Fpga.java
index bc0aca5..7566cee 100644 (file)
@@ -51,6 +51,10 @@ public class Fpga extends FleetTwoFleet {
         } catch (Exception e) { throw new RuntimeException(e); }
     }
 
+    public BitVector getDestAddr(Path path) {
+        return ((FpgaPath)path).toBitVector();
+    }
+
     // Setup //////////////////////////////////////////////////////////////////////////////
 
     public Ship createShip(String type, String name) throws IOException {
@@ -70,8 +74,12 @@ public class Fpga extends FleetTwoFleet {
         createShip("Memory",      "memory1");
 
         if (small) {
-            createShip("Fifo", "fifo");
-            createShip("Alu",  "alu");
+            createShip("Fifo",           "fifo");
+            createShip("Alu",            "alu");
+            createShip("Counter",        "counter");
+            createShip("CarrySaveAdder", "csa1");
+            createShip("Rotator",        "rotator");
+            createShip("Lut3",           "lut");
         } else {
             //createShip("Memory",    "memory2");
             //createShip("Memory",    "memory3");
@@ -142,7 +150,7 @@ public class Fpga extends FleetTwoFleet {
         dests.addAll(outbox_dests);
         top_horn = mkNode((FabricElement[])dests.toArray(new FabricElement[0]), true);
         FabricElement   source  = mkNode((FabricElement[])sources.toArray(new FabricElement[0]), false);
-        FunnelModule.FunnelInstance top_funnel = new FunnelModule.FunnelInstance(top, null, source.getOutputPort());
+        FunnelModule.FunnelInstance top_funnel = new FunnelModule.FunnelInstance(this, top, null, source.getOutputPort());
         ((FunnelModule.FunnelInstance)source).out = top_funnel;
         //top_horn.addInput(top_funnel, top_funnel.getOutputPort());
         top_funnel.addOutput(top_horn, top_horn.getInputPort());
@@ -178,8 +186,8 @@ public class Fpga extends FleetTwoFleet {
                 FabricElement leftPort  = mkNode(ports, is_horn,  start,         (end+start)/2);
                 FabricElement rightPort = mkNode(ports, is_horn,  (end+start)/2, end);
                 return is_horn
-                    ? new HornModule.HornInstance(top,     leftPort, rightPort)
-                    : new FunnelModule.FunnelInstance(top, leftPort, rightPort);
+                    ? new HornModule.HornInstance(this, top,     leftPort, rightPort)
+                    : new FunnelModule.FunnelInstance(this, top, leftPort, rightPort);
             }
         }
     }
@@ -398,15 +406,4 @@ public class Fpga extends FleetTwoFleet {
         } catch (Exception e) { throw new RuntimeException(e); }
     }
 
-    public long getDestAddr(Path path) {
-        return ((FpgaPath)path).toLong();
-    }
-    public Dock getBoxByInstAddr(long dest) {
-        for(Ship ship : Fpga.this)
-            for(Dock bb : ship)
-                if (((FpgaDestination)((FpgaDock)bb).getInstructionDestination()).getAddr() == dest)
-                    return bb;
-        return null;
-    }
-
 }