move Gadgets to MemoryUtils, discard a ton of obsolete junk
[fleet.git] / src / edu / berkeley / fleet / ir / Process.java
index 6b35112..47a6604 100644 (file)
@@ -521,7 +521,7 @@ public class Process {
         fp = null;
 
         fp = fleet.run(new Instruction[0]);
-        Gadgets.writeMem(fp, mem1, 0, bv(vals));
+        MemoryUtils.writeMem(fp, mem1, 0, bv(vals));
         int vals_length = vals.length;
 
         // Disable readback/writeback inside the loop
@@ -550,7 +550,7 @@ public class Process {
         }
 
         BitVector[] bvs = new BitVector[vals_length];
-        Gadgets.readMem(fp, mem1, 0, bvs);
+        MemoryUtils.readMem(fp, mem1, 0, bvs);
         System.out.println("results:");
         for(int i=0; i<vals_length; i++)
             System.out.println(bvs[i].toLong());
@@ -570,7 +570,7 @@ public class Process {
         lf.deliver();
         lf.literal(5);
         lf.deliver();
-        Gadgets.dispatch(fp, ctx);
+        ctx.dispatch(fp);
         fp.flush();
 
         System.out.println("checking debug.in");
@@ -616,7 +616,7 @@ public class Process {
                     lf.sendToken(debugIn.getDataDestination(), new BitVector(1).set(1));
                     lf.setPredicate(null);
 
-                    Gadgets.dispatch(fp, ctx);
+                    ctx.dispatch(fp);
                     fp.flush();
 
                     long kk;
@@ -639,7 +639,7 @@ public class Process {
         if (vals != null) {
             BitVector[] mem = new BitVector[vals_length];
             for(int i=0; i<mem.length; i++) mem[i] = new BitVector(fleet.getWordWidth()).set(vals[i]);
-            Gadgets.writeMem(fp, memoryShip1, 0, mem);
+            MemoryUtils.writeMem(fp, memoryShip1, 0, mem);
         }
 
         //////////////////////////////////////////////////////////////////////////////
@@ -729,7 +729,7 @@ public class Process {
         lf.recvToken();
         lf.deliver();
 
-        Gadgets.dispatch(fp, ctx2);
+        ctx2.dispatch(fp);
         fp.flush();
 
         int count = 0;
@@ -762,10 +762,10 @@ public class Process {
             lf.collectWord();
             lf.sendToken(counter.getDock("in2").getInstructionDestination());  // HACK: we don't check to make sure this hits
             lf.sendToken(debugIn.getDataDestination());
-            Gadgets.dispatch(fp, ctx3);  // HACK: we don't check to make sure that this is "firmly in place"
+            ctx3.dispatch(fp);  // HACK: we don't check to make sure that this is "firmly in place"
 
             for(Dock dock : torpedoes) fp.sendToken(dock.getInstructionDestination());
-            Gadgets.dispatch(fp, ctx2);
+            ctx2.dispatch(fp);
             fp.flush();
             System.out.println("flushed");
 
@@ -786,7 +786,7 @@ public class Process {
         if (vals != null) {
             ret = new long[vals_length];
             BitVector[] mem = new BitVector[vals_length];
-            Gadgets.readMem(fp, memoryShip2, 0, mem);
+            MemoryUtils.readMem(fp, memoryShip2, 0, mem);
             for(int i=0; i<ret.length; i++) ret[i] = mem[i].toLong();
         }
         return ret;