major overhaul of FPGA code to support both ML509 and Bee2 at the same time
[fleet.git] / src / edu / berkeley / fleet / fpga / Fpga.java
index 26bbc8f..ec2ef1c 100644 (file)
@@ -132,6 +132,8 @@ public abstract class Fpga extends FleetTwoFleet {
 
     // Expand //////////////////////////////////////////////////////////////////////////////
 
+    protected abstract String getDirName();
+
     public void expand(ShipDescription sd) {
         try {
             if (sd.getSection("fpga")==null) return;
@@ -139,7 +141,7 @@ public abstract class Fpga extends FleetTwoFleet {
             String filename = sd.getName().toLowerCase();
 
             if (sd.getSection("ucf") != null) {
-                File outf = new File("build/fpga/"+filename+".ucf");
+                File outf = new File("build/"+getDirName()+"/"+filename+".ucf");
                 FileOutputStream out = new FileOutputStream(outf);
                 PrintWriter pw = new PrintWriter(out);
                 pw.println(sd.getSection("ucf"));
@@ -147,7 +149,7 @@ public abstract class Fpga extends FleetTwoFleet {
                 pw.close();
             }
 
-            File outf = new File("build/fpga/"+filename+".v");
+            File outf = new File("build/"+getDirName()+"/"+filename+".v");
             new File(outf.getParent()).mkdirs();
             System.err.println("writing to " + outf);
             FileOutputStream out = new FileOutputStream(outf);