GUIAm2901's RAM/Qn/n+3 now are tristate pins (also updated SWTHelper)
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Wed, 4 Sep 2019 21:06:22 +0000 (23:06 +0200)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Wed, 4 Sep 2019 21:06:57 +0000 (23:06 +0200)
SWTHelper
net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2901/GUIAm2901.json
net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/am2901/TestableAm2901Impl.java

index 5d095c6..675171d 160000 (submodule)
--- a/SWTHelper
+++ b/SWTHelper
@@ -1 +1 @@
-Subproject commit 5d095c6ec38999a30aea50212e0637d41cb25c2b
+Subproject commit 675171d7c711e4d699b44c40d2b68d18709b7b90
index 64f12af..5b251e4 100644 (file)
     },
     {
       "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": {
         },
         "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",
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#21",
         "pos": {
-          "x": 329.0,
-          "y": 949.0
+          "x": 334.0,
+          "y": 2319.0
         },
         "params": 1
       },
         },
         "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",
       },
       {
         "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
           }
         ]
       },
       },
       {
         "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": {
         "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",
         "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",
           }
         ]
       },
+      {
+        "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",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#4",
+          "compName": "WireCrossPoint#46",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#6",
-          "pinName": ""
-        },
-        "pin2": {
           "compName": "GUIsel3_4#1",
           "pinName": "SC"
         },
+        "pin2": {
+          "compName": "WireCrossPoint#44",
+          "pinName": ""
+        },
         "name": "unnamedWire#26",
         "path": [
           {
           "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": {
       },
       {
         "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": {
       },
       {
         "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": {
       },
       {
         "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": {
           "pinName": ""
         },
         "pin2": {
-          "compName": "_submodelinterface",
-          "pinName": "ORAMn+3"
+          "compName": "GUIsel3_4#0",
+          "pinName": "C4"
         },
         "name": "unnamedWire#96",
         "path": []
         },
         "pin2": {
           "compName": "_submodelinterface",
-          "pinName": "F3"
+          "pinName": "RAMn+3"
         },
         "name": "unnamedWire#97",
         "path": [
           {
-            "x": 330.0,
-            "y": 750.0
+            "x": 335.0,
+            "y": 950.0
           }
         ]
       },
index 22ee120..43e01d4 100644 (file)
@@ -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