Changed getCurrentMicroInstructionAddress to use HighLevelStates
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Tue, 1 Oct 2019 14:35:04 +0000 (16:35 +0200)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Wed, 2 Oct 2019 13:36:25 +0000 (15:36 +0200)
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/Am2900.json
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/Am2900Machine.java

index a83e7ad..37f08e5 100644 (file)
           "compName": "WireCrossPoint#43",
           "pinName": ""
         },
-        "name": "wire_mpm_address",
+        "name": "unnamedWire#163",
         "path": [
           {
             "x": 205.0,
         }
       }
     },
-    "atomicHighLevelStates": {}
+    "atomicHighLevelStates": {
+      "mpm_address": {
+        "id": "wireForcing",
+        "params": {
+          "wiresToForce": [
+            "unnamedWire#163"
+          ],
+          "wiresToForceInverted": []
+        }
+      }
+    }
   },
   "version": "0.1.5"
 }
\ No newline at end of file
index 759fda9..ab0643f 100644 (file)
@@ -165,8 +165,7 @@ public class Am2900Machine implements Machine
 
        private long getCurrentMicroInstructionAddress()
        {
-               // TODO: replace with highlevelstate
-               BitVector vector = logicModel.getWireBySubmodelPath("Am2900.wire_mpm_address").getWireValues();
+               BitVector vector = (BitVector) am2900.getHighLevelState("mpm_address");
                return vector.isBinary() ? vector.getUnsignedValueLong() : -1;
        }