MemoryNode: make sure not to do phase 0 of reset on out port
authorAdam Megacz <adam@megacz.com>
Sun, 30 Aug 2009 00:12:10 +0000 (17:12 -0700)
committerAdam Megacz <adam@megacz.com>
Sun, 30 Aug 2009 00:12:10 +0000 (17:12 -0700)
src/edu/berkeley/fleet/dataflow/MemoryNode.java

index a892672..e72f1c1 100644 (file)
@@ -80,6 +80,12 @@ public class MemoryNode extends Node {
                 public void sendToken(LoopFactory lf) { inAddrWrite.peer.sendToken(lf); }
                 public void recvWord(LoopFactory lf) { lf.recvWord(); }
                 public int getTokensToAbsorb() { return 0; }
+                public int reset(CodeBag ctx, int phase, Destination ackDestination) {
+                    // ugly-ass hack
+                    if (phase!=0)
+                        return DoneNode.doReset(ctx, phase, dock, this, peer, ackDestination, true);
+                    return 0;
+                }
                 protected void build(CodeBag ctx, LoopFactory lf) {
                     lf = lf.makeNext(0);
                     lf.abortLoopIfTorpedoPresent();