From: adam Date: Mon, 3 Nov 2008 13:01:31 +0000 (+0100) Subject: add Port.getTokensToAbsorb() X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=7dac94d9a7776ce89f2978dd64342b8866392d90;p=fleet.git add Port.getTokensToAbsorb() --- diff --git a/src/edu/berkeley/fleet/ir/Process.java b/src/edu/berkeley/fleet/ir/Process.java index ad27f6a..7527121 100644 --- a/src/edu/berkeley/fleet/ir/Process.java +++ b/src/edu/berkeley/fleet/ir/Process.java @@ -91,6 +91,8 @@ public class Process { public abstract void recvToken(Context.LoopFactory loopfactory_at_output_dock); /** this port's peer (an OutPort) invokes this to have "sendWord" or equivalent inserted */ public abstract void sendWord(Context.LoopFactory loopfactory_at_output_dock); + + public int getTokensToAbsorb() { return 0; } } public abstract class OutPort extends Port { @@ -129,6 +131,7 @@ public class Process { // number-in-flight is considered a property of the input dock in a pair //public int getInflight() { return 4; } public int getInflight() { return 1; } + public int getTokensToAbsorb() { return getInflight(); } public void reset(Context ctx, int phase) { if (dock.getShip().getType().equals("Debug")) { return; @@ -216,13 +219,13 @@ public class Process { case 1: { reset_count++; Context.LoopFactory lf = ctx.new LoopFactory(dock, 1); - if (peer instanceof DockInPort) { - DockInPort dip_peer = (DockInPort)peer; - for(int i=0; i