better error messages in LoopFactory
[fleet.git] / src / edu / berkeley / fleet / loops / LoopFactory.java
index 5bdfc2a..769a6fc 100644 (file)
@@ -224,7 +224,7 @@ public class LoopFactory {
     public void sendWord(Destination dest, BitVector signal) {
         if (!dock.isOutputDock()) throw new RuntimeException("sendWord() may only be used at output docks");
         if (pending_sendToken) flush_pending();
-        pending_path = dock.getPath(dest, signal);
+        pending_path = dest==null ? null : dock.getPath(dest, signal);
         flush_pending(true);
     }
     public void sendWord(Dock dock) { sendWord(dock.getDataDestination()); }
@@ -372,7 +372,8 @@ public class LoopFactory {
 
         if (!olc_loop) {
             if (numInstructionsNotIncludingNonblockingPrefix > capacity)
-                throw new RuntimeException("instruction sequence is too long for instruction fifo at " + dock);
+                throw new RuntimeException("instruction sequence is too long for instruction fifo at " +
+                                           dock + " ("+numInstructionsNotIncludingNonblockingPrefix+">"+capacity+")");
         } else {
             if (count != 0) {
                 ic.add(new Instruction.Set(dock, Predicate.Default, SetDest.OuterLoopCounter, SetSource.Decrement));
@@ -397,7 +398,8 @@ public class LoopFactory {
         if (olc_loop) {
             ic.add(new Instruction.Tail(dock));
             if (loopSize > capacity)
-                throw new RuntimeException("instruction loop is too long for instruction fifo at " + dock);
+                throw new RuntimeException("instruction loop is too long for instruction fifo at " +
+                                           dock + " ("+loopSize+">"+capacity+")");
         }
 
         if (next != null) {