From 5836624be1f5fe4819c5a4f18691fbf7b7855ab6 Mon Sep 17 00:00:00 2001 From: megacz Date: Sun, 15 Mar 2009 09:01:19 -0700 Subject: [PATCH] fix bug wherein Instruction.toString() would print the Dock rather than the Destination --- src/edu/berkeley/fleet/api/Instruction.java | 4 ++-- src/edu/berkeley/fleet/fpga/FpgaDestination.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) 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" : ""); } } -- 1.7.10.4