From: adam Date: Mon, 3 Nov 2008 10:15:14 +0000 (+0100) Subject: add Context.setAutoflush(boolean) X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=acc7e48d4084929c01ef640e2e82ad9574857c32;p=fleet.git add Context.setAutoflush(boolean) --- diff --git a/src/edu/berkeley/fleet/ir/Context.java b/src/edu/berkeley/fleet/ir/Context.java index b7b22ac..624ab5c 100644 --- a/src/edu/berkeley/fleet/ir/Context.java +++ b/src/edu/berkeley/fleet/ir/Context.java @@ -287,6 +287,9 @@ public class Context { // FEATURE: clever instruction re-oredering? } + private boolean autoflush = false; + public void setAutoflush(boolean a) { this.autoflush = a; } + /** * The code emitted by this method makes the following assumptions: * @@ -328,6 +331,12 @@ public class Context { numInstructionsNotIncludingNonblockingPrefix++; loopSize++; } + } + if (autoflush && !"Debug".equals(dock.getShip().getType()) && next==null) { + if (dock.isInputDock() && !"inAddrRead".equals(dock.getName())) + ic.add(new Instruction.Flush(dock, true, Predicate.OLCZero)); + } + if (count!=1) { ic.add(new Instruction.Tail(dock)); if (!instructionFifoSizeCheckDisabled && loopSize > dock.getInstructionFifoSize())