remove dead code from MemoryUtils
authorAdam Megacz <adam@megacz.com>
Sat, 1 Aug 2009 00:32:15 +0000 (17:32 -0700)
committerAdam Megacz <adam@megacz.com>
Sat, 1 Aug 2009 00:32:15 +0000 (17:32 -0700)
src/edu/berkeley/fleet/loops/MemoryUtils.java

index 3f0bfe6..8d5ad97 100644 (file)
@@ -40,92 +40,6 @@ public class MemoryUtils {
         doMem(false, fp, pool, memory, offset, vals);
     }
 
-    /*
-    public static void clearMem(FleetProcess fp,
-                                Ship memory,
-                                ShipPool pool,
-                                long offset,
-                                long count) throws RuntimeException {
-        if (fp.getFleet() != memory.getFleet())
-            throw new RuntimeException("Fleet mismatch");
-
-        Ship counter1 = pool.allocateShip("Counter");
-        Ship counter2 = pool.allocateShip("Counter");
-        //Ship alu      = pool.allocateShip("Alu");
-
-        final Dock debugIn     = fp.getDebugInputDock();
-
-        CodeBag ctx = new CodeBag(fp.getFleet());
-        LoopFactory lf;
-
-        lf = ctx.loopFactory(counter1.getDock("inOp"), 1);
-        lf.literal(counter1.getDock("inOp").getConstant("COUNT"));
-        lf.deliver();
-
-        lf = ctx.loopFactory(counter1.getDock("in1"), 1);
-        lf.literal(count);
-        lf.deliver();
-
-        lf = ctx.loopFactory(counter1.getDock("in2"), 1);
-        lf.literal(1);
-        lf.deliver();
-
-        lf = ctx.loopFactory(counter1.getDock("out"), 0);
-        lf.abortLoopIfTorpedoPresent();
-        lf.recvToken();
-        lf.collect();
-        lf.send(memory.getDock("inAddrWrite").getDataDestination());
-
-        lf = ctx.loopFactory(memory.getDock("inDataWrite"), 0);
-        lf.literal(0);
-        lf.abortLoopIfTorpedoPresent();
-        lf.deliver();
-
-        lf = ctx.loopFactory(memory.getDock("inAddrWrite"), 1);
-        lf.sendToken(counter1.getDock("out").getDataDestination());
-        lf = lf.makeNext(0);
-        lf.abortLoopIfTorpedoPresent();
-        lf.recvWord();
-        lf.deliver();
-        lf.sendToken(counter1.getDock("out").getDataDestination());
-
-        lf = ctx.loopFactory(memory.getDock("out"), 0);
-        lf.recvToken();
-        lf.recvWord();
-        lf.send(counter2.getDock("in2").getDataDestination());
-
-        lf = ctx.loopFactory(counter2.getDock("inOp"), 1);
-        lf.literal(counter2.getDock("inOp").getConstant("DROP_C1_V2"));
-        lf.deliver();
-        lf.literal(counter2.getDock("inOp").getConstant("PASS_C1_V2"));
-        lf.deliver();
-
-        lf = ctx.loopFactory(counter2.getDock("in2"), 0);
-        lf.recvWord();
-        lf.deliver();
-
-        fp.sendToken(counter1.getDock("out").getInstructionDestination());
-        fp.sendToken(memory.getDock("inDataWrite").getInstructionDestination());
-        fp.sendToken(memory.getDock("inAddrWrite").getInstructionDestination());
-        fp.sendToken(memory.getDock("out").getInstructionDestination());
-        fp.sendToken(counter2.getDock("in2").getInstructionDestination());
-        
-        lf = ctx.loopFactory(counter2.getDock("in1"), 1);
-        lf.literal(count-1);
-        lf.deliver();
-        lf.literal(1);
-        lf.deliver();
-        
-        lf = ctx.loopFactory(counter2.getDock("out"), 1);
-        lf.collect();
-        lf.send(debugIn.getDataDestination());
-
-        pool.releaseShip(counter1);
-        pool.releaseShip(counter2);
-        //pool.releaseShip(alu);
-    }
-    */
-
     public static void doMem(final boolean read,
                              final FleetProcess fp,
                              final ShipPool pool,