fix bug wherein Instruction.toString() would print the Dock rather than the Destination
authormegacz <adam@megacz.com>
Sun, 15 Mar 2009 16:01:19 +0000 (09:01 -0700)
committermegacz <adam@megacz.com>
Sun, 15 Mar 2009 16:01:19 +0000 (09:01 -0700)
src/edu/berkeley/fleet/api/Instruction.java
src/edu/berkeley/fleet/fpga/FpgaDestination.java

index 1dfc8b5..0eda440 100644 (file)
@@ -317,8 +317,8 @@ public abstract class Instruction {
                 else                             ret.append(!dock.isInputDock() ? ", collect nothing" : ", recv nothing");
             }
             if (dataOut && dock.isInputDock())  ret.append(", deliver");
-            if (dataOut && !dock.isInputDock()) ret.append(path==null ? ", send"  : ", send to "  + path.getDestination().getDock());
-            if (tokenOut)                       ret.append(path==null ? ", token" : ", send token to " + path.getDestination().getDock());
+            if (dataOut && !dock.isInputDock()) ret.append(path==null ? ", send"  : ", send to "  + path.getDestination());
+            if (tokenOut)                       ret.append(path==null ? ", token" : ", send token to " + path.getDestination());
             String s = ret.toString();
             s = s.equals("") ? "nop" : s.substring(2);
             if (interruptible) s = "[T] " + s;
index c20ccd0..79eb4bd 100644 (file)
@@ -18,12 +18,14 @@ import java.util.*;
 
 public class FpgaDestination extends Destination implements FabricElement {
     private Module.Port port;
+    private boolean isInstructionDestination;
     FpgaDock dock;
 
     public FpgaDestination(FpgaDock dock, Module.Port port, boolean isInstructionDestination) {
         super(dock);
         this.port = port;
         this.dock = dock;
+        this.isInstructionDestination = isInstructionDestination;
     }
 
     public Module.SourcePort getOutputPort() { throw new RuntimeException(); }
@@ -38,6 +40,6 @@ public class FpgaDestination extends Destination implements FabricElement {
         ((Module.SourcePort)inPort).connect((Module.SinkPort)port);
     }
     public String toString() {
-        return dock.toString();
+        return dock.toString() + (isInstructionDestination ? ":i" : "");
     }
 }