From f8f097e66b6b61d050cc73af6f43a525509b54a4 Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 10 Nov 2008 06:57:23 +0100 Subject: [PATCH] some updates to edu.berkeley.fleet.ir --- src/edu/berkeley/fleet/ir/Context.java | 17 ++- src/edu/berkeley/fleet/ir/Process.java | 233 ++++++++++++++++---------------- 2 files changed, 136 insertions(+), 114 deletions(-) diff --git a/src/edu/berkeley/fleet/ir/Context.java b/src/edu/berkeley/fleet/ir/Context.java index c9e6471..170c2a5 100644 --- a/src/edu/berkeley/fleet/ir/Context.java +++ b/src/edu/berkeley/fleet/ir/Context.java @@ -176,6 +176,21 @@ public class Context { pending_path = null; } + public void interruptibleNop() { + flush_pending(); + instructions.add(new Move(dock, + count!=1, + predicate, + true, + null, + false, + false, + false, + false, + false, + false)); + } + /** sets the predicate which will be applied to subsequent instructions, or null for the default predicate */ public void setPredicate(Predicate p) { if (p==null) p = Predicate.Default; @@ -359,7 +374,7 @@ public class Context { } } if (autoflush && !"Debug".equals(dock.getShip().getType()) && next==null) { - if (dock.isInputDock() && !"inAddrRead".equals(dock.getName())) + if (dock.isInputDock()) ic.add(new Instruction.Flush(dock, true, Predicate.OLCZero)); } if (count!=1) { diff --git a/src/edu/berkeley/fleet/ir/Process.java b/src/edu/berkeley/fleet/ir/Process.java index c864931..1c8f706 100644 --- a/src/edu/berkeley/fleet/ir/Process.java +++ b/src/edu/berkeley/fleet/ir/Process.java @@ -127,40 +127,39 @@ public class Process { } public void recvToken(Context.LoopFactory lf) { lf.recvToken(); } public void sendWord(Context.LoopFactory lf) { lf.sendWord(dock.getDataDestination()); } - public void build(Context ctx) { - if (peer==null && pattern.length==1 && pattern[0]==null) return; - build(ctx, ctx.new LoopFactory(dock, 1)); - } + public void build(Context ctx) { build(ctx, ctx.new LoopFactory(dock, 1)); } // 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(); } + private boolean peerUsed() { + if (peer==null) return false; + for(int i=0; i " + fp.recvWord().toLong() + " " + (ii+1) + " / " + reset_count); + for(int ii=0; ii " + (ii+1) + " / " + reset_count); + fp.recvWord(); + } System.out.println(); } - /* - ctx2 = new Context(fp.getFleet()); - ai = new ArrayList(); - for(Ship ship : ctx.allocatedShips) - if (!ship.getType().equals("Debug")) - for(Dock dock : ship) - if (dock.isInputDock()) { - lf = ctx2.new LoopFactory(dock, 0); - lf.recvWord(); - - } - */ - fp.sendToken(debugIn.getInstructionDestination()); fp.flush(); System.out.println("verifying cleanup:"); - verifyClean(fp); - - Gadgets.readMem(fp, memoryShip2, 0, mem); - //for(int i=0; i