fix bug in Interpreter.getDestAddr()
authormegacz <adam@megacz.com>
Sat, 13 Dec 2008 06:14:31 +0000 (22:14 -0800)
committermegacz <adam@megacz.com>
Sat, 13 Dec 2008 06:14:31 +0000 (22:14 -0800)
src/edu/berkeley/fleet/interpreter/Interpreter.java

index 1964f05..b6a68ce 100644 (file)
@@ -76,12 +76,14 @@ public class Interpreter extends FleetTwoFleet implements Parser.FleetWithDynami
 
     public BitVector getDestAddr(Path path) {
         long ret = ((InterpreterDestination)path.getDestination()).addr;
-        BitVector bv = path.getSignal();
-        if (bv != null) {
-            if (bv.length() > 1) throw new RuntimeException("signal was " + bv.length() + " bits long!");
-            if (bv.length() > 0 && bv.get(0)) ret |= 1;
+        BitVector sig = path.getSignal();
+        BitVector bv = new BitVector(DISPATCH_PATH.valmaskwidth+1);
+        bv.set(ret);
+        if (sig != null) {
+            if (sig.length() > 1) throw new RuntimeException("signal was " + sig.length() + " bits long!");
+            if (sig.length() > 0 && sig.get(0)) bv.set(bv.length()-1,true);
         }
-        throw new RuntimeException("fixme");
+        return bv;
     }