X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=net.mograsim.logic.model.am2900%2Ftest%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fam2900%2Fam2904%2FTestableAm2904Impl.java;h=cebd986bf2ec015695333aa921362d425d561b8e;hb=d853ecb20f0ab96aac8994dbe9699a827c96a730;hp=2e84000477e9bde203e2df61a8f3436c34fa1f3d;hpb=c97e7e60186ded3b41fe09494a18aac06a1c3a6b;p=Mograsim.git diff --git a/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/am2904/TestableAm2904Impl.java b/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/am2904/TestableAm2904Impl.java index 2e840004..cebd986b 100644 --- a/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/am2904/TestableAm2904Impl.java +++ b/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/am2904/TestableAm2904Impl.java @@ -26,7 +26,7 @@ public class TestableAm2904Impl implements TestableAm2904 private SwitchWithDisplay SIO0, SIOn, QIO0, QIOn; private SwitchWithDisplay YC, YN, YOVR, YZ; - private final TestEnvironmentHelper testHelper = new TestEnvironmentHelper(this, "file:components/am2904/GUIAm2904.json"); + private final TestEnvironmentHelper testHelper = new TestEnvironmentHelper(this, "GUIAm2904"); @Override public void setup() @@ -208,6 +208,12 @@ public class TestableAm2904Impl implements TestableAm2904 am2904.setHighLevelState(regToStateID(r), bv); } + @Override + public void setDirectly(CompleteStatus r, String z_c_n_ovr) + { + am2904.setHighLevelState(regToStateID(r), BitVector.parse(z_c_n_ovr)); + } + @Override public String getC0() { @@ -262,11 +268,25 @@ public class TestableAm2904Impl implements TestableAm2904 return bv.getMSBit(r.ordinal() % 4).getSymbol(); } + @Override + public String getDirectly(CompleteStatus r) + { + var bv = (BitVector) am2904.getHighLevelState(regToStateID(r)); + return bv.toString(); + } + private static String regToStateID(Register r) { - if (r.ordinal() > 3) - return "msr.q"; - return "musr.q"; + if (r.ordinal() < 4) + return "musr.q"; + return "msr.q"; + } + + private static String regToStateID(CompleteStatus r) + { + if (r == CompleteStatus.micro) + return "musr.q"; + return "msr.q"; } @Override