From c6181cf9a7b6a2f5dc927939d98d61c565f97917 Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Wed, 4 Sep 2019 23:06:22 +0200 Subject: [PATCH] GUIAm2901's RAM/Qn/n+3 now are tristate pins (also updated SWTHelper) --- SWTHelper | 2 +- .../am2900/components/am2901/GUIAm2901.json | 567 +++++++++++++----- .../am2900/am2901/TestableAm2901Impl.java | 22 +- 3 files changed, 419 insertions(+), 172 deletions(-) diff --git a/SWTHelper b/SWTHelper index 5d095c6e..675171d7 160000 --- a/SWTHelper +++ b/SWTHelper @@ -1 +1 @@ -Subproject commit 5d095c6ec38999a30aea50212e0637d41cb25c2b +Subproject commit 675171d7c711e4d699b44c40d2b68d18709b7b90 diff --git a/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2901/GUIAm2901.json b/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2901/GUIAm2901.json index 64f12afe..5b251e42 100644 --- a/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2901/GUIAm2901.json +++ b/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2901/GUIAm2901.json @@ -238,84 +238,48 @@ }, { "location": { - "x": 0.0, - "y": 255.0 - }, - "name": "IQn", - "logicWidth": 1, - "usage": "INPUT" - }, - { - "location": { - "x": 0.0, - "y": 265.0 - }, - "name": "IQn+3", - "logicWidth": 1, - "usage": "INPUT" - }, - { - "location": { - "x": 0.0, - "y": 235.0 + "x": 35.0, + "y": 65.0 }, - "name": "IRAMn", + "name": "OVR", "logicWidth": 1, - "usage": "INPUT" + "usage": "OUTPUT" }, { "location": { "x": 0.0, - "y": 245.0 - }, - "name": "IRAMn+3", - "logicWidth": 1, - "usage": "INPUT" - }, - { - "location": { - "x": 35.0, - "y": 105.0 + "y": 255.0 }, - "name": "OQn", + "name": "Qn", "logicWidth": 1, - "usage": "OUTPUT" + "usage": "TRISTATE" }, { "location": { "x": 35.0, "y": 115.0 }, - "name": "OQn+3", + "name": "Qn+3", "logicWidth": 1, - "usage": "OUTPUT" + "usage": "TRISTATE" }, { "location": { - "x": 35.0, - "y": 85.0 + "x": 0.0, + "y": 235.0 }, - "name": "ORAMn", + "name": "RAMn", "logicWidth": 1, - "usage": "OUTPUT" + "usage": "TRISTATE" }, { "location": { "x": 35.0, "y": 95.0 }, - "name": "ORAMn+3", - "logicWidth": 1, - "usage": "OUTPUT" - }, - { - "location": { - "x": 35.0, - "y": 65.0 - }, - "name": "OVR", + "name": "RAMn+3", "logicWidth": 1, - "usage": "OUTPUT" + "usage": "TRISTATE" }, { "location": { @@ -391,6 +355,54 @@ }, "params": 1 }, + { + "id": "GUITriStateBuffer", + "name": "GUITriStateBuffer#0", + "pos": { + "x": 255.0, + "y": 2485.0 + }, + "params": { + "logicWidth": 1, + "orientation": "RIGHT" + } + }, + { + "id": "GUITriStateBuffer", + "name": "GUITriStateBuffer#1", + "pos": { + "x": 270.0, + "y": 2435.0 + }, + "params": { + "logicWidth": 1, + "orientation": "DOWN" + } + }, + { + "id": "GUITriStateBuffer", + "name": "GUITriStateBuffer#3", + "pos": { + "x": 300.0, + "y": 2515.0 + }, + "params": { + "logicWidth": 1, + "orientation": "RIGHT" + } + }, + { + "id": "GUITriStateBuffer", + "name": "GUITriStateBuffer#4", + "pos": { + "x": 300.0, + "y": 2310.0 + }, + "params": { + "logicWidth": 1, + "orientation": "RIGHT_ALT" + } + }, { "id": "GUIand", "name": "GUIand#0", @@ -593,8 +605,8 @@ "id": "WireCrossPoint", "name": "WireCrossPoint#21", "pos": { - "x": 329.0, - "y": 949.0 + "x": 334.0, + "y": 2319.0 }, "params": 1 }, @@ -787,6 +799,69 @@ }, "params": 1 }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#41", + "pos": { + "x": 4.0, + "y": 2549.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#42", + "pos": { + "x": 4.0, + "y": 2349.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#43", + "pos": { + "x": 339.0, + "y": 2524.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#44", + "pos": { + "x": 29.0, + "y": 2469.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#45", + "pos": { + "x": 264.0, + "y": 2469.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#46", + "pos": { + "x": 39.0, + "y": 2474.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#47", + "pos": { + "x": 309.0, + "y": 2474.0 + }, + "params": 1 + }, { "id": "WireCrossPoint", "name": "WireCrossPoint#5", @@ -1151,22 +1226,18 @@ }, { "pin1": { - "compName": "_submodelinterface", - "pinName": "IRAMn" + "compName": "GUIsel3_4#1", + "pinName": "A1" }, "pin2": { - "compName": "GUIsel3_4#0", - "pinName": "A1" + "compName": "WireCrossPoint#41", + "pinName": "" }, "name": "unnamedWire#117", "path": [ { "x": 5.0, - "y": 2350.0 - }, - { - "x": 5.0, - "y": 2345.0 + "y": 2545.0 } ] }, @@ -1405,24 +1476,15 @@ }, { "pin1": { - "compName": "_submodelinterface", - "pinName": "IRAMn+3" + "compName": "WireCrossPoint#16", + "pinName": "" }, "pin2": { - "compName": "GUIsel3_4#0", - "pinName": "C4" + "compName": "GUITriStateBuffer#3", + "pinName": "IN" }, "name": "unnamedWire#135", - "path": [ - { - "x": 5.0, - "y": 2450.0 - }, - { - "x": 5.0, - "y": 2455.0 - } - ] + "path": [] }, { "pin1": { @@ -1791,6 +1853,55 @@ "name": "unnamedWire#156", "path": [] }, + { + "pin1": { + "compName": "GUITriStateBuffer#3", + "pinName": "OUT" + }, + "pin2": { + "compName": "WireCrossPoint#43", + "pinName": "" + }, + "name": "unnamedWire#157", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#41", + "pinName": "" + }, + "pin2": { + "compName": "GUITriStateBuffer#0", + "pinName": "OUT" + }, + "name": "unnamedWire#158", + "path": [ + { + "x": 5.0, + "y": 2690.0 + }, + { + "x": 280.0, + "y": 2690.0 + }, + { + "x": 280.0, + "y": 2495.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#19", + "pinName": "" + }, + "pin2": { + "compName": "GUITriStateBuffer#1", + "pinName": "IN" + }, + "name": "unnamedWire#159", + "path": [] + }, { "pin1": { "compName": "WireCrossPoint#3", @@ -1803,6 +1914,163 @@ "name": "unnamedWire#16", "path": [] }, + { + "pin1": { + "compName": "WireCrossPoint#42", + "pinName": "" + }, + "pin2": { + "compName": "GUIsel3_4#0", + "pinName": "A1" + }, + "name": "unnamedWire#160", + "path": [ + { + "x": 5.0, + "y": 2345.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#42", + "pinName": "" + }, + "pin2": { + "compName": "GUITriStateBuffer#1", + "pinName": "OUT" + }, + "name": "unnamedWire#161", + "path": [ + { + "x": 5.0, + "y": 2465.0 + }, + { + "x": 280.0, + "y": 2465.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#20", + "pinName": "" + }, + "pin2": { + "compName": "_submodelinterface", + "pinName": "F3" + }, + "name": "unnamedWire#162", + "path": [ + { + "x": 330.0, + "y": 2145.0 + }, + { + "x": 330.0, + "y": 750.0 + } + ] + }, + { + "pin1": { + "compName": "_submodelinterface", + "pinName": "Qn+3" + }, + "pin2": { + "compName": "WireCrossPoint#43", + "pinName": "" + }, + "name": "unnamedWire#163", + "path": [ + { + "x": 340.0, + "y": 1150.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#44", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#6", + "pinName": "" + }, + "name": "unnamedWire#164", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#45", + "pinName": "" + }, + "pin2": { + "compName": "GUITriStateBuffer#1", + "pinName": "EN" + }, + "name": "unnamedWire#165", + "path": [ + { + "x": 290.0, + "y": 2470.0 + }, + { + "x": 290.0, + "y": 2445.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#45", + "pinName": "" + }, + "pin2": { + "compName": "GUITriStateBuffer#0", + "pinName": "EN" + }, + "name": "unnamedWire#166", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#45", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#44", + "pinName": "" + }, + "name": "unnamedWire#167", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#46", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#4", + "pinName": "" + }, + "name": "unnamedWire#168", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#46", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#47", + "pinName": "" + }, + "name": "unnamedWire#169", + "path": [] + }, { "pin1": { "compName": "WireCrossPoint#3", @@ -1828,6 +2096,35 @@ } ] }, + { + "pin1": { + "compName": "GUITriStateBuffer#3", + "pinName": "EN" + }, + "pin2": { + "compName": "WireCrossPoint#47", + "pinName": "" + }, + "name": "unnamedWire#170", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#20", + "pinName": "" + }, + "pin2": { + "compName": "GUITriStateBuffer#4", + "pinName": "IN" + }, + "name": "unnamedWire#171", + "path": [ + { + "x": 295.0, + "y": 2320.0 + } + ] + }, { "pin1": { "compName": "GUIAm2901DestDecode#0", @@ -1962,7 +2259,7 @@ }, { "pin1": { - "compName": "WireCrossPoint#4", + "compName": "WireCrossPoint#46", "pinName": "" }, "pin2": { @@ -1996,13 +2293,13 @@ }, { "pin1": { - "compName": "WireCrossPoint#6", - "pinName": "" - }, - "pin2": { "compName": "GUIsel3_4#1", "pinName": "SC" }, + "pin2": { + "compName": "WireCrossPoint#44", + "pinName": "" + }, "name": "unnamedWire#26", "path": [ { @@ -2814,20 +3111,11 @@ "pinName": "" }, "pin2": { - "compName": "_submodelinterface", - "pinName": "OQn" + "compName": "GUITriStateBuffer#0", + "pinName": "IN" }, "name": "unnamedWire#69", - "path": [ - { - "x": 335.0, - "y": 2495.0 - }, - { - "x": 335.0, - "y": 1050.0 - } - ] + "path": [] }, { "pin1": { @@ -2864,24 +3152,15 @@ }, { "pin1": { - "compName": "WireCrossPoint#16", - "pinName": "" + "compName": "_submodelinterface", + "pinName": "Qn" }, "pin2": { - "compName": "_submodelinterface", - "pinName": "OQn+3" + "compName": "WireCrossPoint#41", + "pinName": "" }, "name": "unnamedWire#71", - "path": [ - { - "x": 340.0, - "y": 2525.0 - }, - { - "x": 340.0, - "y": 1150.0 - } - ] + "path": [] }, { "pin1": { @@ -2992,45 +3271,27 @@ }, { "pin1": { - "compName": "_submodelinterface", - "pinName": "IQn+3" + "compName": "WireCrossPoint#43", + "pinName": "" }, "pin2": { "compName": "GUIsel3_4#1", "pinName": "C4" }, "name": "unnamedWire#77", - "path": [ - { - "x": 5.0, - "y": 2650.0 - }, - { - "x": 5.0, - "y": 2655.0 - } - ] + "path": [] }, { "pin1": { "compName": "_submodelinterface", - "pinName": "IQn" + "pinName": "RAMn" }, "pin2": { - "compName": "GUIsel3_4#1", - "pinName": "A1" + "compName": "WireCrossPoint#42", + "pinName": "" }, "name": "unnamedWire#78", - "path": [ - { - "x": 5.0, - "y": 2550.0 - }, - { - "x": 5.0, - "y": 2545.0 - } - ] + "path": [] }, { "pin1": { @@ -3324,41 +3585,27 @@ }, { "pin1": { - "compName": "WireCrossPoint#19", - "pinName": "" + "compName": "GUITriStateBuffer#4", + "pinName": "OUT" }, "pin2": { - "compName": "_submodelinterface", - "pinName": "ORAMn" + "compName": "WireCrossPoint#21", + "pinName": "" }, "name": "unnamedWire#94", - "path": [ - { - "x": 325.0, - "y": 2115.0 - }, - { - "x": 325.0, - "y": 850.0 - } - ] + "path": [] }, { "pin1": { - "compName": "WireCrossPoint#20", + "compName": "WireCrossPoint#47", "pinName": "" }, "pin2": { - "compName": "WireCrossPoint#21", - "pinName": "" + "compName": "GUITriStateBuffer#4", + "pinName": "EN" }, "name": "unnamedWire#95", - "path": [ - { - "x": 330.0, - "y": 2145.0 - } - ] + "path": [] }, { "pin1": { @@ -3366,8 +3613,8 @@ "pinName": "" }, "pin2": { - "compName": "_submodelinterface", - "pinName": "ORAMn+3" + "compName": "GUIsel3_4#0", + "pinName": "C4" }, "name": "unnamedWire#96", "path": [] @@ -3379,13 +3626,13 @@ }, "pin2": { "compName": "_submodelinterface", - "pinName": "F3" + "pinName": "RAMn+3" }, "name": "unnamedWire#97", "path": [ { - "x": 330.0, - "y": 750.0 + "x": 335.0, + "y": 950.0 } ] }, diff --git a/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/am2901/TestableAm2901Impl.java b/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/am2901/TestableAm2901Impl.java index 22ee120d..43e01d43 100644 --- a/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/am2901/TestableAm2901Impl.java +++ b/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/am2901/TestableAm2901Impl.java @@ -4,9 +4,10 @@ import net.mograsim.logic.core.components.BitDisplay; import net.mograsim.logic.core.components.ManualSwitch; import net.mograsim.logic.core.types.Bit; import net.mograsim.logic.core.types.BitVector; +import net.mograsim.logic.model.am2900.util.SwitchWithDisplay; import net.mograsim.logic.model.am2900.util.TestEnvironmentHelper; -import net.mograsim.logic.model.am2900.util.TestUtil; import net.mograsim.logic.model.am2900.util.TestEnvironmentHelper.DebugState; +import net.mograsim.logic.model.am2900.util.TestUtil; import net.mograsim.logic.model.model.components.GUIComponent; public class TestableAm2901Impl implements TestableAm2901 @@ -18,10 +19,9 @@ public class TestableAm2901Impl implements TestableAm2901 private ManualSwitch D1, D2, D3, D4; private ManualSwitch A0, A1, A2, A3; private ManualSwitch B0, B1, B2, B3; - private ManualSwitch IRAMn, IRAMn_3, IQn, IQn_3; private BitDisplay Y1, Y2, Y3, Y4; private BitDisplay F_0, Cn_4, OVR, F3; - private BitDisplay ORAMn, ORAMn_3, OQn, OQn_3; + private SwitchWithDisplay RAMn, RAMn_3, Qn, Qn_3; private final TestEnvironmentHelper testHelper = new TestEnvironmentHelper(this, "GUIAm2901"); @@ -109,25 +109,25 @@ public class TestableAm2901Impl implements TestableAm2901 @Override public void setQ_0(String val_1_bit) { - IQn.setState(Bit.parse(val_1_bit)); + Qn.setState(Bit.parse(val_1_bit).toVector()); } @Override public void setQ_3(String val_1_bit) { - IQn_3.setState(Bit.parse(val_1_bit)); + Qn_3.setState(Bit.parse(val_1_bit).toVector()); } @Override public void setRAM_0(String val_1_bit) { - IRAMn.setState(Bit.parse(val_1_bit)); + RAMn.setState(Bit.parse(val_1_bit).toVector()); } @Override public void setRAM_3(String val_1_bit) { - IRAMn_3.setState(Bit.parse(val_1_bit)); + RAMn_3.setState(Bit.parse(val_1_bit).toVector()); } @Override @@ -139,25 +139,25 @@ public class TestableAm2901Impl implements TestableAm2901 @Override public String getQ_0() { - return OQn.getDisplayedValue().toString(); + return Qn.getDisplayedValue().toString(); } @Override public String getQ_3() { - return OQn_3.getDisplayedValue().toString(); + return Qn_3.getDisplayedValue().toString(); } @Override public String getRAM_0() { - return ORAMn.getDisplayedValue().toString(); + return RAMn.getDisplayedValue().toString(); } @Override public String getRAM_3() { - return ORAMn_3.getDisplayedValue().toString(); + return RAMn_3.getDisplayedValue().toString(); } @Override -- 2.17.1