From acc7e48d4084929c01ef640e2e82ad9574857c32 Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 3 Nov 2008 11:15:14 +0100 Subject: [PATCH] add Context.setAutoflush(boolean) --- src/edu/berkeley/fleet/ir/Context.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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()) -- 1.7.10.4