Quickfix for Wire.fuse(...)
[Mograsim.git] / net.mograsim.logic.core / src / net / mograsim / logic / core / wires / Wire.java
index 20bcad1..13e8359 100644 (file)
@@ -567,8 +567,11 @@ public class Wire
                @Override\r
                public void update(LogicObservable initiator)\r
                {\r
-                       ReadWriteEnd read = (ReadWriteEnd) initiator;\r
-                       target.setValues(fromTarget, read.wireValuesExcludingMe().subVector(fromSource, fromSource + length));\r
+                       ReadWriteEnd source = (ReadWriteEnd) initiator;\r
+                       BitVector targetInput = (source.getWire().inputs.size() > 1)\r
+                                       ? source.wireValuesExcludingMe().subVector(fromSource, fromSource + length)\r
+                                       : BitVector.of(Bit.Z, length);\r
+                       target.setValues(fromTarget, targetInput);\r
                }\r
        }\r
 }
\ No newline at end of file