From: megacz Date: Sun, 15 Mar 2009 16:01:19 +0000 (-0700) Subject: fix bug wherein Instruction.toString() would print the Dock rather than the Destination X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=5836624be1f5fe4819c5a4f18691fbf7b7855ab6;p=fleet.git fix bug wherein Instruction.toString() would print the Dock rather than the Destination --- diff --git a/src/edu/berkeley/fleet/api/Instruction.java b/src/edu/berkeley/fleet/api/Instruction.java index 1dfc8b5..0eda440 100644 --- a/src/edu/berkeley/fleet/api/Instruction.java +++ b/src/edu/berkeley/fleet/api/Instruction.java @@ -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; diff --git a/src/edu/berkeley/fleet/fpga/FpgaDestination.java b/src/edu/berkeley/fleet/fpga/FpgaDestination.java index c20ccd0..79eb4bd 100644 --- a/src/edu/berkeley/fleet/fpga/FpgaDestination.java +++ b/src/edu/berkeley/fleet/fpga/FpgaDestination.java @@ -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" : ""); } }