add Context.disableInstructionFifoOverflowCheck()
authoradam <adam@megacz.com>
Mon, 3 Nov 2008 10:09:34 +0000 (11:09 +0100)
committeradam <adam@megacz.com>
Mon, 3 Nov 2008 10:09:34 +0000 (11:09 +0100)
src/edu/berkeley/fleet/ir/Context.java

index 436b49a..8d430ed 100644 (file)
@@ -70,6 +70,11 @@ public class Context {
      *
      */
     public class LoopFactory {
+
+    // FIXME: vet this to see if it is sensible
+    private boolean instructionFifoSizeCheckDisabled = false;
+    public void disableInstructionFifoOverflowCheck() { instructionFifoSizeCheckDisabled = true; }
+
         public final Dock dock;
         public final String friendlyName;
         public final int count;
@@ -295,8 +300,9 @@ public class Context {
             }
 
             if (count==1) {
-                if (numInstructionsNotIncludingNonblockingPrefix > dock.getInstructionFifoSize())
-                    throw new RuntimeException("instruction sequence is too long for instruction fifo");
+                if (!instructionFifoSizeCheckDisabled &&
+                    numInstructionsNotIncludingNonblockingPrefix > dock.getInstructionFifoSize())
+                    throw new RuntimeException("instruction sequence is too long for instruction fifo at " + dock);
             } else {
                 if (count != 0) {
                     ic.add(new Instruction.Set(dock, true, Predicate.Default, SetDest.OuterLoopCounter, SetSource.Decrement));
@@ -305,7 +311,8 @@ public class Context {
                     loopSize++;
                 }
                 ic.add(new Instruction.Tail(dock));
-                if (loopSize > dock.getInstructionFifoSize())
+                if (!instructionFifoSizeCheckDisabled &&
+                    loopSize > dock.getInstructionFifoSize())
                     throw new RuntimeException("instruction loop is too long for instruction fifo");
             }