do not write ucf file if fleet has no instances of a given ship
[fleet.git] / src / edu / berkeley / fleet / fpga / Fpga.java
index 372b9fb..6a6734c 100644 (file)
@@ -78,8 +78,8 @@ public class Fpga extends FleetTwoFleet {
         this.top = top;
         debugShip = createShip("Debug");
 
-        boolean small = true;
-        //boolean small = false;
+        //boolean small = true;
+        boolean small = false;
 
         if (small) {
             for(int i=0; i<2; i++) createShip("Alu");
@@ -89,31 +89,25 @@ public class Fpga extends FleetTwoFleet {
             createShip("CarrySaveAdder");
             createShip("Rotator");
             createShip("Lut3");
-            createShip("Timer");
-            createShip("DDR2");
-            createShip("Dvi");
 
         } else {
 
-            for(int i=0; i<3; i++)  createShip("Memory");
-            for(int i=0; i<3; i++)  createShip("Alu");
-            for(int i=0; i<2; i++)  createShip("Fifo");
-            for(int i=0; i<14; i++) createShip("Counter");
-
-            /*
-            // "really big" configuration: 138 docks
-            for(int i=0; i<4; i++)  createShip("Alu");
-            */
+            for(int i=0; i<2; i++)  createShip("Memory");
+            for(int i=0; i<8; i++)  createShip("Alu");
+            for(int i=0; i<1; i++)  createShip("Fifo");
+            for(int i=0; i<12; i++) createShip("Counter");
 
             //createShip("CarrySaveAdder");
             //createShip("Rotator");
-            //createShip("Lut3");
+            createShip("Random");
+            createShip("Button");
 
-            createShip("Timer");
-            createShip("DDR2");
-            createShip("Dvi");
         }
 
+        createShip("Timer");
+        createShip("DDR2");
+        createShip("Dvi");
+
         // for FifoShip
         new Module.InstantiatedModule(top, new FifoModule(8, WIDTH_WORD));
 
@@ -170,6 +164,7 @@ public class Fpga extends FleetTwoFleet {
     public void expand(ShipDescription sd) {
         try {
             if (sd.getSection("fpga")==null) return;
+            if (getShip(sd.getName(),0)==null) return;  // no ships of this type
             String filename = sd.getName().toLowerCase();
 
             if (sd.getSection("ucf") != null) {