Merge branch 'development' into 'master'
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Tue, 31 Mar 2020 19:05:32 +0000 (21:05 +0200)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Tue, 31 Mar 2020 19:08:06 +0000 (21:08 +0200)
119 files changed:
.github/workflows/maven.yml [new file with mode: 0644]
.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
features/net.mograsim.feature/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
plugins/net.mograsim.logic.core/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
plugins/net.mograsim.logic.core/src/net/mograsim/logic/core/types/BitVectorFormatter.java [deleted file]
plugins/net.mograsim.logic.model.am2900/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/Am2900.json
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2901/Am2901.json
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2901/Am2901ALUInclSourceDecodeInclFunctionDecode.json
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2904/Am2904MSR.json
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2904/Am2904muSR.json
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2910/Am2910.json
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2910/Am2910InstrPLA.json [new file with mode: 0644]
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/and.json
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/and41.json
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/andor414.json
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff12.json [new file with mode: 0644]
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff4_finewe.json [new file with mode: 0755]
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/fulladder.json
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/halfadder.json
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/halfadder_invz.json [new file with mode: 0755]
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/inc12.json [new file with mode: 0755]
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/inc16.json [new file with mode: 0755]
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/inc4.json [new file with mode: 0755]
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/nor12.json [new file with mode: 0644]
plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/xnor.json [new file with mode: 0644]
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modeldff12.java [deleted file]
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modeldff4_finewe.java [deleted file]
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelinc.java [deleted file]
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelnor12.java [deleted file]
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/am2910/ModelAm2910InstrPLA.java [deleted file]
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/am2910/ModelAm2910RegCntr.java
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/registers/InstrRegister.java
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/registers/PCRegister.java
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/machine/registers/muInstrRegister.java
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/standardComponentIDMapping.json
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/CountGatesPerComponent.java [new file with mode: 0755]
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ModelComponentTestbench.java
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ReserializeAndVerifyJSONs.java
plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/VerilogExporter.java [new file with mode: 0644]
plugins/net.mograsim.logic.model.editor/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
plugins/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/Editor.java
plugins/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/EditorUserInput.java
plugins/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/states/CreateWireState.java
plugins/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/states/EditorState.java
plugins/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/states/SelectionState.java
plugins/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/ui/EditorCanvas.java
plugins/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/ui/EditorGUI.java
plugins/net.mograsim.logic.model/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
plugins/net.mograsim.logic.model/META-INF/MANIFEST.MF
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/BitVectorFormatter.java [new file with mode: 0644]
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/LogicExecuter.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/LogicUICanvas.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/LogicUIRenderer.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/LogicUIStandaloneGUI.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/SimpleLogicUIStandalone.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/ModelComponent.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/ModelBitDisplay.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/ModelClock.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/ModelFixedOutput.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/ModelManualSwitch.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/ModelSplitter.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/ModelTextComponent.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/ModelTriStateBuffer.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularHardcodedModelComponent.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularModelGate.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/submodels/SubmodelComponent.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/submodels/SubmodelInterface.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/ModelWire.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/ModelWireCrossPoint.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/Pin.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/modeladapter/LogicCoreAdapter.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/preferences/DefaultRenderPreferences.java [new file with mode: 0755]
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/preferences/RenderPreferences.java [new file with mode: 0755]
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/Renderer.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/outlinerenderers/DefaultOutlineRenderer.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/symbolrenderers/CenteredTextSymbolRenderer.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/symbolrenderers/DefaultSymbolRenderer.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/symbolrenderers/PinNamesSymbolRenderer.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/symbolrenderers/SimpleRectangularLikeSymbolRenderer.java
plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/util/ModellingTool.java
plugins/net.mograsim.machine/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
plugins/net.mograsim.machine/src/net/mograsim/machine/ModelMemory.java
plugins/net.mograsim.plugin.branding/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
plugins/net.mograsim.plugin.core.nl_de/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
plugins/net.mograsim.plugin.core/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
plugins/net.mograsim.plugin.core/META-INF/MANIFEST.MF
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/EclipsePreferences.java [deleted file]
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/MograsimActivator.java
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/SimulationPreview.java
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MachineRegister.java
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MainMemoryBlockExtension.java
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/DefaultPluginPreferences.java [new file with mode: 0755]
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/EclipsePluginPreferences.java [new file with mode: 0755]
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/EclipsePreferences.java [new file with mode: 0755]
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/EclipseRenderPreferences.java [new file with mode: 0755]
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/PluginPreferences.java [new file with mode: 0755]
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionTable.java
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java
plugins/net.mograsim.plugin.docs/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
plugins/net.mograsim.preferences/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
plugins/net.mograsim.preferences/src/net/mograsim/preferences/DefaultPreferences.java
plugins/net.mograsim.preferences/src/net/mograsim/preferences/Preferences.java
products/net.mograsim.product/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
releng/net.mograsim.configuration/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
releng/net.mograsim.plugin.updatesite/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
releng/net.mograsim.target/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
tests/net.mograsim.logic.core.tests/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
tests/net.mograsim.logic.core.tests/src/net/mograsim/logic/core/types/BitVectorTest.java
tests/net.mograsim.logic.model.am2900.tests/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
tests/net.mograsim.logic.model.am2900.tests/src/net/mograsim/logic/model/am2900/TestGCD.java
tests/net.mograsim.logic.model.am2900.tests/src/net/mograsim/logic/model/am2900/am2901/Am2901Test.java
tests/net.mograsim.logic.model.am2900.tests/src/net/mograsim/logic/model/am2900/am2901/Am2901Testbench.java
tests/net.mograsim.logic.model.am2900.tests/src/net/mograsim/logic/model/am2900/am2904/Am2904Test.java
tests/net.mograsim.logic.model.am2900.tests/src/net/mograsim/logic/model/am2900/am2904/Am2904Testbench.java
tests/net.mograsim.logic.model.am2900.tests/src/net/mograsim/logic/model/am2900/am2910/Am2910Test.java
tests/net.mograsim.logic.model.am2900.tests/src/net/mograsim/logic/model/am2900/util/SwitchWithDisplay.java
tests/net.mograsim.logic.model.am2900.tests/src/net/mograsim/logic/model/am2900/util/TestEnvironmentHelper.java
tests/net.mograsim.machine.tests/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]

diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
new file mode 100644 (file)
index 0000000..d9ea203
--- /dev/null
@@ -0,0 +1,23 @@
+name: Java CI
+
+on: [push]
+
+jobs:
+  build:
+
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2
+    - name: Checkout submodules # See https://github.com/actions/checkout#Checkout-submodules
+      shell: bash
+      run: |
+         auth_header="$(git config --local --get http.https://github.com/.extraheader)"
+         git submodule sync --recursive
+         git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
+    - name: Set up JDK 11
+      uses: actions/setup-java@v1
+      with:
+        java-version: 11
+    - name: Build with Maven
+      run: mvn --batch-mode --errors --fail-at-end --show-version clean verify --file pom.xml
diff --git a/.settings/org.eclipse.core.runtime.prefs b/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/features/net.mograsim.feature/.settings/org.eclipse.core.runtime.prefs b/features/net.mograsim.feature/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/net.mograsim.logic.core/.settings/org.eclipse.core.runtime.prefs b/plugins/net.mograsim.logic.core/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/net.mograsim.logic.core/src/net/mograsim/logic/core/types/BitVectorFormatter.java b/plugins/net.mograsim.logic.core/src/net/mograsim/logic/core/types/BitVectorFormatter.java
deleted file mode 100644 (file)
index a369b05..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-package net.mograsim.logic.core.types;
-
-import java.math.BigInteger;
-
-import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
-import net.mograsim.preferences.ColorDefinition;
-import net.mograsim.preferences.ColorDefinition.BuiltInColor;
-import net.mograsim.preferences.Preferences;
-
-public class BitVectorFormatter
-{
-       public static String formatValueAsString(ReadEnd end, boolean useDashInsteadOfZ)
-       {
-               return formatAsString(end == null ? null : end.getValues(), useDashInsteadOfZ);
-       }
-
-       public static String toBitstring(BitVector bitVector)
-       {
-               return bitVector.toBitstring();
-       }
-
-       public static String formatAsString(BitVector bitVector, boolean useDashInsteadOfZ)
-       {
-               if (bitVector == null)
-                       return "null";
-               if (useDashInsteadOfZ && bitVector.isHighImpedance())
-                       return "-";
-               if (bitVector.length() == 1)
-                       return bitVector.toBitstring();
-               if (bitVector.isBinary())
-               {
-                       String hexdigits = bitVector.getUnsignedValue().toString(16);
-                       StringBuilder sb = new StringBuilder();
-                       sb.append("0x");
-                       sb.append("0".repeat((bitVector.length() + 3) / 4 - hexdigits.length()));
-                       sb.append(hexdigits);
-                       return sb.toString();
-               }
-               return bitVector.toBitstring();
-       }
-
-       // TODO this method overlaps in functionality with AsmNumberUtil (in plugin.core)
-       public static BitVector parseUserBitVector(String userInput, int width)
-       {
-               BitVector bitvector = null;
-               if (width > 0 && userInput.matches("0x[0-9a-fA-F]+"))
-                       // TODO should we check for overflows?
-                       bitvector = BitVector.from(new BigInteger(userInput.substring(2), 16), width);
-               else if (width <= 0 || userInput.length() == width)
-                       // TODO do this without exceptions
-                       try
-                       {
-                               bitvector = BitVector.parseBitstring(userInput);
-                       }
-                       catch (@SuppressWarnings("unused") NullPointerException x)
-                       {
-                               // ignore
-                       }
-               if (bitvector == null && width > 0)
-                       try
-                       {
-                               // TODO should we check for overflows?
-                               bitvector = BitVector.from(new BigInteger(userInput), width);
-                       }
-                       catch (@SuppressWarnings("unused") NumberFormatException x)
-                       {
-                               // ignore
-                       }
-               return bitvector;
-       }
-
-       // TODO doesn't this belong to logic.model?
-       public static ColorDefinition formatAsColor(ReadEnd end)
-       {
-               return formatAsColor(end == null ? null : end.getValues());
-       }
-
-       public static ColorDefinition formatAsColor(BitVector bitVector)
-       {
-               // TODO maybe find a color assignment for multiple-bit bit vectors?
-               if (bitVector == null || bitVector.length() != 1)
-                       return new ColorDefinition(BuiltInColor.COLOR_BLACK);
-               switch (bitVector.getLSBit(0))
-               {
-               case ONE:
-                       return Preferences.current().getColorDefinition("net.mograsim.logic.model.color.bit.one");
-               case U:
-                       return Preferences.current().getColorDefinition("net.mograsim.logic.model.color.bit.u");
-               case X:
-                       return Preferences.current().getColorDefinition("net.mograsim.logic.model.color.bit.x");
-               case Z:
-                       return Preferences.current().getColorDefinition("net.mograsim.logic.model.color.bit.z");
-               case ZERO:
-                       return Preferences.current().getColorDefinition("net.mograsim.logic.model.color.bit.zero");
-               default:
-                       throw new IllegalArgumentException("Unknown enum constant: " + bitVector.getLSBit(0));
-               }
-       }
-
-       private BitVectorFormatter()
-       {
-               throw new UnsupportedOperationException("No BitVectorFormatter instances");
-       }
-}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.am2900/.settings/org.eclipse.core.runtime.prefs b/plugins/net.mograsim.logic.model.am2900/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
index ae825b1..eadd2da 100644 (file)
         }
       },
       {
-        "id": "inc",
-        "name": "inc#0",
+        "id": "inc16",
+        "name": "inc16#0",
         "pos": {
-          "x": 315.0,
-          "y": 135.0
-        },
-        "params": 16
+          "x": 335.0,
+          "y": 115.0
+        }
       },
       {
         "id": "mux1_4",
       },
       {
         "pin1": {
-          "compName": "inc#0",
+          "compName": "inc16#0",
           "pinName": "Y"
         },
         "pin2": {
           "pinName": "D"
         },
         "name": "unnamedWire#128",
-        "path": [
-          {
-            "x": 335.0,
-            "y": 130.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "inc#0",
+          "compName": "inc16#0",
           "pinName": "A"
         },
         "pin2": {
         "name": "unnamedWire#129",
         "path": [
           {
-            "x": 335.0,
+            "x": 315.0,
+            "y": 130.0
+          },
+          {
+            "x": 315.0,
             "y": 160.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "inc#0",
+          "compName": "inc16#0",
           "pinName": "CI"
         },
         "pin2": {
         },
         "name": "unnamedWire#130",
         "path": [
+          {
+            "x": 330.0,
+            "y": 120.0
+          },
+          {
+            "x": 330.0,
+            "y": 160.0
+          },
           {
             "x": 360.0,
-            "y": 145.0
+            "y": 160.0
           },
           {
             "x": 360.0,
index dc92688..1f272d1 100644 (file)
         "id": "Splitter",
         "name": "Splitter#3",
         "pos": {
-          "x": 670.0,
-          "y": 335.0
+          "x": 365.0,
+          "y": 535.0
         },
         "params": {
           "logicWidth": 4,
-          "orientation": "LEFT"
+          "orientation": "DOWN"
         }
       },
       {
         "id": "Splitter",
         "name": "Splitter#4",
         "pos": {
-          "x": 475.0,
-          "y": 615.0
+          "x": 840.0,
+          "y": 790.0
+        },
+        "params": {
+          "logicWidth": 6,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#5",
+        "pos": {
+          "x": 300.0,
+          "y": 695.0
         },
         "params": {
           "logicWidth": 4,
-          "orientation": "DOWN"
+          "orientation": "LEFT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#6",
+        "pos": {
+          "x": 360.0,
+          "y": 450.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#7",
+        "pos": {
+          "x": 485.0,
+          "y": 405.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#8",
+        "pos": {
+          "x": 110.0,
+          "y": 765.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#9",
+        "pos": {
+          "x": 110.0,
+          "y": 800.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#10",
+        "pos": {
+          "x": 110.0,
+          "y": 835.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#11",
+        "pos": {
+          "x": 135.0,
+          "y": 1000.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#12",
+        "pos": {
+          "x": 485.0,
+          "y": 365.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#13",
+        "pos": {
+          "x": 760.0,
+          "y": 175.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#14",
+        "pos": {
+          "x": 640.0,
+          "y": 215.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#15",
+        "pos": {
+          "x": 335.0,
+          "y": 930.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#16",
+        "pos": {
+          "x": 240.0,
+          "y": 930.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#17",
+        "pos": {
+          "x": 135.0,
+          "y": 965.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#18",
+        "pos": {
+          "x": 135.0,
+          "y": 1035.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
         }
       },
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#6",
         "pos": {
-          "x": 349.0,
-          "y": 364.0
+          "x": 324.0,
+          "y": 944.0
         },
-        "params": 1
+        "params": 4
       },
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#7",
         "pos": {
-          "x": 344.0,
-          "y": 374.0
+          "x": 254.0,
+          "y": 944.0
         },
-        "params": 1
+        "params": 4
       },
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#8",
         "pos": {
-          "x": 339.0,
-          "y": 384.0
+          "x": 129.0,
+          "y": 1049.0
         },
-        "params": 1
+        "params": 4
       },
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#9",
         "pos": {
-          "x": 334.0,
-          "y": 394.0
+          "x": 364.0,
+          "y": 549.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#10",
         "pos": {
-          "x": 239.0,
-          "y": 929.0
+          "x": 354.0,
+          "y": 464.0
         },
-        "params": 1
+        "params": 4
       },
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#11",
         "pos": {
-          "x": 244.0,
-          "y": 939.0
+          "x": 434.0,
+          "y": 734.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#12",
         "pos": {
-          "x": 249.0,
-          "y": 949.0
+          "x": 339.0,
+          "y": 379.0
         },
-        "params": 1
+        "params": 4
       },
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#13",
         "pos": {
-          "x": 254.0,
-          "y": 959.0
+          "x": 354.0,
+          "y": 509.0
         },
-        "params": 1
+        "params": 4
       },
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#14",
         "pos": {
-          "x": 319.0,
-          "y": 929.0
+          "x": 104.0,
+          "y": 779.0
         },
-        "params": 1
+        "params": 4
       },
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#15",
         "pos": {
-          "x": 334.0,
-          "y": 959.0
+          "x": 104.0,
+          "y": 814.0
         },
-        "params": 1
+        "params": 4
       },
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#16",
         "pos": {
-          "x": 134.0,
-          "y": 1039.0
+          "x": 104.0,
+          "y": 854.0
         },
-        "params": 1
+        "params": 4
       },
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#17",
         "pos": {
-          "x": 139.0,
-          "y": 1049.0
+          "x": 414.0,
+          "y": 449.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#18",
         "pos": {
-          "x": 379.0,
-          "y": 529.0
+          "x": 99.0,
+          "y": 964.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#19",
         "pos": {
-          "x": 394.0,
-          "y": 544.0
+          "x": 99.0,
+          "y": 764.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#20",
         "pos": {
-          "x": 434.0,
-          "y": 734.0
+          "x": 124.0,
+          "y": 889.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#21",
         "pos": {
-          "x": 354.0,
-          "y": 504.0
+          "x": 364.0,
+          "y": 889.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#22",
         "pos": {
-          "x": 359.0,
-          "y": 509.0
+          "x": 134.0,
+          "y": 894.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#23",
         "pos": {
-          "x": 364.0,
-          "y": 514.0
+          "x": 409.0,
+          "y": 894.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#24",
         "pos": {
-          "x": 369.0,
-          "y": 519.0
+          "x": 424.0,
+          "y": 1079.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#25",
         "pos": {
-          "x": 354.0,
-          "y": 449.0
+          "x": 379.0,
+          "y": 529.0
         },
-        "params": 1
+        "params": 4
       },
       {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#26",
+        "id": "and",
+        "name": "and#0",
         "pos": {
-          "x": 359.0,
-          "y": 459.0
-        },
-        "params": 1
+          "x": 495.0,
+          "y": 180.0
+        }
       },
       {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#27",
+        "id": "dff4",
+        "name": "dff4#0",
         "pos": {
-          "x": 364.0,
-          "y": 469.0
-        },
-        "params": 1
+          "x": 200.0,
+          "y": 925.0
+        }
       },
       {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#28",
+        "id": "dlatch4",
+        "name": "dlatch4#0",
         "pos": {
-          "x": 369.0,
-          "y": 479.0
-        },
-        "params": 1
+          "x": 720.0,
+          "y": 170.0
+        }
       },
       {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#29",
+        "id": "dlatch4",
+        "name": "dlatch4#1",
         "pos": {
-          "x": 104.0,
-          "y": 769.0
-        },
-        "params": 1
+          "x": 260.0,
+          "y": 690.0
+        }
       },
       {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#30",
+        "id": "mux1_4",
+        "name": "mux1_4#0",
         "pos": {
-          "x": 109.0,
-          "y": 779.0
-        },
-        "params": 1
+          "x": 500.0,
+          "y": 350.0
+        }
       },
       {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#31",
+        "id": "or4",
+        "name": "or4#0",
         "pos": {
-          "x": 114.0,
-          "y": 789.0
-        },
-        "params": 1
+          "x": 375.0,
+          "y": 445.0
+        }
       },
       {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#32",
+        "id": "ram4",
+        "name": "ram4#0",
         "pos": {
-          "x": 109.0,
-          "y": 809.0
-        },
-        "params": 1
+          "x": 655.0,
+          "y": 170.0
+        }
       },
       {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#33",
+        "id": "sel3_4",
+        "name": "sel3_4#0",
         "pos": {
-          "x": 114.0,
-          "y": 819.0
-        },
-        "params": 1
+          "x": 145.0,
+          "y": 725.0
+        }
       },
       {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#34",
-        "pos": {
-          "x": 119.0,
-          "y": 829.0
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#35",
-        "pos": {
-          "x": 104.0,
-          "y": 799.0
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#36",
-        "pos": {
-          "x": 109.0,
-          "y": 839.0
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#37",
-        "pos": {
-          "x": 114.0,
-          "y": 849.0
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#38",
-        "pos": {
-          "x": 119.0,
-          "y": 859.0
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#39",
-        "pos": {
-          "x": 414.0,
-          "y": 449.0
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#40",
-        "pos": {
-          "x": 99.0,
-          "y": 964.0
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#41",
-        "pos": {
-          "x": 99.0,
-          "y": 764.0
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#42",
-        "pos": {
-          "x": 124.0,
-          "y": 889.0
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#43",
-        "pos": {
-          "x": 364.0,
-          "y": 889.0
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#44",
-        "pos": {
-          "x": 134.0,
-          "y": 894.0
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#45",
-        "pos": {
-          "x": 409.0,
-          "y": 894.0
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#46",
-        "pos": {
-          "x": 424.0,
-          "y": 1079.0
-        },
-        "params": 1
-      },
-      {
-        "id": "and",
-        "name": "and#0",
-        "pos": {
-          "x": 495.0,
-          "y": 180.0
-        }
-      },
-      {
-        "id": "dff4",
-        "name": "dff4#0",
-        "pos": {
-          "x": 200.0,
-          "y": 925.0
-        }
-      },
-      {
-        "id": "dlatch4",
-        "name": "dlatch4#0",
-        "pos": {
-          "x": 720.0,
-          "y": 170.0
-        }
-      },
-      {
-        "id": "dlatch4",
-        "name": "dlatch4#1",
-        "pos": {
-          "x": 260.0,
-          "y": 690.0
-        }
-      },
-      {
-        "id": "mux1_4",
-        "name": "mux1_4#0",
-        "pos": {
-          "x": 500.0,
-          "y": 350.0
-        }
-      },
-      {
-        "id": "or4",
-        "name": "or4#0",
-        "pos": {
-          "x": 375.0,
-          "y": 445.0
-        }
-      },
-      {
-        "id": "ram4",
-        "name": "ram4#0",
-        "pos": {
-          "x": 655.0,
-          "y": 170.0
-        }
-      },
-      {
-        "id": "sel3_4",
-        "name": "sel3_4#0",
-        "pos": {
-          "x": 145.0,
-          "y": 725.0
-        }
-      },
-      {
-        "id": "sel3_4",
-        "name": "sel3_4#1",
+        "id": "sel3_4",
+        "name": "sel3_4#1",
         "pos": {
           "x": 150.0,
           "y": 925.0
       },
       {
         "pin1": {
-          "compName": "Splitter#0",
+          "compName": "Splitter#4",
           "pinName": "O5"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "I5"
+          "compName": "Splitter#0",
+          "pinName": "O5"
         },
         "name": "unnamedWire#1",
-        "path": [
-          {
-            "x": 805.0,
-            "y": 790.0
-          },
-          {
-            "x": 805.0,
-            "y": 615.0
-          },
-          {
-            "x": 585.0,
-            "y": 615.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "Splitter#0",
+          "compName": "Splitter#4",
           "pinName": "O4"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "I4"
+          "compName": "Splitter#0",
+          "pinName": "O4"
         },
         "name": "unnamedWire#2",
-        "path": [
-          {
-            "x": 800.0,
-            "y": 800.0
-          },
-          {
-            "x": 800.0,
-            "y": 610.0
-          },
-          {
-            "x": 575.0,
-            "y": 610.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "Splitter#0",
+          "compName": "Splitter#4",
           "pinName": "O3"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "I3"
+          "compName": "Splitter#0",
+          "pinName": "O3"
         },
         "name": "unnamedWire#3",
-        "path": [
-          {
-            "x": 795.0,
-            "y": 810.0
-          },
-          {
-            "x": 795.0,
-            "y": 605.0
-          },
-          {
-            "x": 565.0,
-            "y": 605.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
           "pinName": "O2"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "I2"
+          "compName": "Splitter#4",
+          "pinName": "O2"
         },
         "name": "unnamedWire#4",
-        "path": [
-          {
-            "x": 790.0,
-            "y": 820.0
-          },
-          {
-            "x": 790.0,
-            "y": 600.0
-          },
-          {
-            "x": 555.0,
-            "y": 600.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "Splitter#0",
+          "compName": "Splitter#4",
           "pinName": "O1"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "I1"
+          "compName": "Splitter#0",
+          "pinName": "O1"
         },
         "name": "unnamedWire#5",
-        "path": [
-          {
-            "x": 785.0,
-            "y": 830.0
-          },
-          {
-            "x": 785.0,
-            "y": 595.0
-          },
-          {
-            "x": 545.0,
-            "y": 595.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
           "pinName": "O0"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "I0"
+          "compName": "Splitter#4",
+          "pinName": "O0"
         },
         "name": "unnamedWire#6",
-        "path": [
-          {
-            "x": 780.0,
-            "y": 840.0
-          },
-          {
-            "x": 780.0,
-            "y": 590.0
-          },
-          {
-            "x": 535.0,
-            "y": 590.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#44",
+          "compName": "WireCrossPoint#22",
           "pinName": ""
         },
         "pin2": {
           "pinName": "SC"
         },
         "pin2": {
-          "compName": "WireCrossPoint#42",
+          "compName": "WireCrossPoint#20",
           "pinName": ""
         },
         "name": "unnamedWire#26",
       },
       {
         "pin1": {
-          "compName": "ram4#0",
-          "pinName": "B3"
+          "compName": "Splitter#14",
+          "pinName": "O0"
         },
         "pin2": {
-          "compName": "Splitter#3",
-          "pinName": "O3"
+          "compName": "ram4#0",
+          "pinName": "B0"
         },
         "name": "unnamedWire#28",
-        "path": [
-          {
-            "x": 650.0,
-            "y": 245.0
-          },
-          {
-            "x": 650.0,
-            "y": 335.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "ram4#0",
-          "pinName": "B2"
+          "compName": "Splitter#14",
+          "pinName": "I"
         },
         "pin2": {
-          "compName": "Splitter#3",
-          "pinName": "O2"
+          "compName": "_submodelinterface",
+          "pinName": "B"
         },
         "name": "unnamedWire#29",
         "path": [
           {
-            "x": 645.0,
-            "y": 235.0
+            "x": 635.0,
+            "y": 230.0
           },
           {
-            "x": 645.0,
-            "y": 345.0
+            "x": 635.0,
+            "y": 350.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "Splitter#3",
-          "pinName": "O1"
+          "compName": "WireCrossPoint#12",
+          "pinName": ""
         },
         "pin2": {
-          "compName": "ram4#0",
-          "pinName": "B1"
+          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
+          "pinName": "A"
         },
         "name": "unnamedWire#30",
         "path": [
           {
-            "x": 640.0,
-            "y": 355.0
-          },
-          {
-            "x": 640.0,
-            "y": 225.0
+            "x": 340.0,
+            "y": 665.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "Splitter#4",
+          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
           "pinName": "I"
         },
         "pin2": {
-          "compName": "_submodelinterface",
-          "pinName": "D"
+          "compName": "Splitter#4",
+          "pinName": "I"
         },
         "name": "unnamedWire#31",
         "path": [
           {
-            "x": 490.0,
-            "y": 480.0
+            "x": 560.0,
+            "y": 605.0
           },
           {
-            "x": 600.0,
-            "y": 480.0
+            "x": 785.0,
+            "y": 605.0
+          },
+          {
+            "x": 785.0,
+            "y": 815.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "D4"
+          "compName": "WireCrossPoint#9",
+          "pinName": ""
         },
         "pin2": {
-          "compName": "Splitter#4",
-          "pinName": "O3"
+          "compName": "_submodelinterface",
+          "pinName": "F3"
         },
         "name": "unnamedWire#32",
-        "path": [
-          {
-            "x": 475.0,
-            "y": 645.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "Splitter#4",
-          "pinName": "O2"
+          "compName": "Splitter#3",
+          "pinName": "O3"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "D3"
+          "compName": "WireCrossPoint#9",
+          "pinName": ""
         },
         "name": "unnamedWire#33",
-        "path": [
-          {
-            "x": 485.0,
-            "y": 640.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "D2"
+          "compName": "TriStateBuffer#1",
+          "pinName": "IN"
         },
         "pin2": {
-          "compName": "Splitter#4",
-          "pinName": "O1"
+          "compName": "Splitter#3",
+          "pinName": "O0"
         },
         "name": "unnamedWire#34",
         "path": [
           {
-            "x": 495.0,
-            "y": 635.0
+            "x": 380.0,
+            "y": 845.0
+          },
+          {
+            "x": 395.0,
+            "y": 845.0
           }
         ]
       },
       },
       {
         "pin1": {
-          "compName": "dlatch4#0",
-          "pinName": "Q1"
+          "compName": "Splitter#13",
+          "pinName": "O3"
         },
         "pin2": {
-          "compName": "WireCrossPoint#6",
-          "pinName": ""
+          "compName": "dlatch4#0",
+          "pinName": "Q4"
         },
         "name": "unnamedWire#48",
-        "path": [
-          {
-            "x": 765.0,
-            "y": 175.0
-          },
-          {
-            "x": 765.0,
-            "y": 80.0
-          },
-          {
-            "x": 350.0,
-            "y": 80.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "dlatch4#0",
-          "pinName": "Q2"
+          "compName": "Splitter#13",
+          "pinName": "O2"
         },
         "pin2": {
-          "compName": "WireCrossPoint#7",
-          "pinName": ""
+          "compName": "dlatch4#0",
+          "pinName": "Q3"
         },
         "name": "unnamedWire#49",
-        "path": [
-          {
-            "x": 770.0,
-            "y": 185.0
-          },
-          {
-            "x": 770.0,
-            "y": 75.0
-          },
-          {
-            "x": 345.0,
-            "y": 75.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
           "compName": "dlatch4#0",
-          "pinName": "Q3"
+          "pinName": "Q2"
         },
         "pin2": {
-          "compName": "WireCrossPoint#8",
-          "pinName": ""
+          "compName": "Splitter#13",
+          "pinName": "O1"
         },
         "name": "unnamedWire#50",
-        "path": [
-          {
-            "x": 775.0,
-            "y": 195.0
-          },
-          {
-            "x": 775.0,
-            "y": 70.0
-          },
-          {
-            "x": 340.0,
-            "y": 70.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
           "compName": "dlatch4#0",
-          "pinName": "Q4"
+          "pinName": "Q1"
         },
         "pin2": {
-          "compName": "WireCrossPoint#9",
-          "pinName": ""
+          "compName": "Splitter#13",
+          "pinName": "O0"
         },
         "name": "unnamedWire#51",
-        "path": [
-          {
-            "x": 780.0,
-            "y": 205.0
-          },
-          {
-            "x": 780.0,
-            "y": 65.0
-          },
-          {
-            "x": 335.0,
-            "y": 65.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#6",
-          "pinName": ""
+          "compName": "Splitter#12",
+          "pinName": "O3"
         },
         "pin2": {
           "compName": "mux1_4#0",
-          "pinName": "I0_1"
+          "pinName": "I0_4"
         },
         "name": "unnamedWire#52",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#7",
-          "pinName": ""
+          "compName": "Splitter#12",
+          "pinName": "O2"
         },
         "pin2": {
           "compName": "mux1_4#0",
-          "pinName": "I0_2"
+          "pinName": "I0_3"
         },
         "name": "unnamedWire#53",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#8",
-          "pinName": ""
+          "compName": "Splitter#12",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "mux1_4#0",
-          "pinName": "I0_3"
+          "pinName": "I0_2"
         },
         "name": "unnamedWire#54",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#9",
-          "pinName": ""
+          "compName": "mux1_4#0",
+          "pinName": "I0_1"
         },
         "pin2": {
-          "compName": "mux1_4#0",
-          "pinName": "I0_4"
+          "compName": "Splitter#12",
+          "pinName": "O0"
         },
         "name": "unnamedWire#55",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#6",
+          "compName": "WireCrossPoint#12",
           "pinName": ""
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "A1"
+          "compName": "Splitter#13",
+          "pinName": "I"
         },
         "name": "unnamedWire#56",
         "path": [
           {
-            "x": 350.0,
-            "y": 655.0
+            "x": 340.0,
+            "y": 70.0
+          },
+          {
+            "x": 770.0,
+            "y": 70.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#7",
-          "pinName": ""
+          "compName": "Splitter#14",
+          "pinName": "O1"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "A2"
+          "compName": "ram4#0",
+          "pinName": "B1"
         },
         "name": "unnamedWire#57",
-        "path": [
-          {
-            "x": 345.0,
-            "y": 660.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#8",
-          "pinName": ""
+          "compName": "Splitter#14",
+          "pinName": "O2"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "A3"
+          "compName": "ram4#0",
+          "pinName": "B2"
         },
         "name": "unnamedWire#58",
-        "path": [
-          {
-            "x": 340.0,
-            "y": 665.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#9",
-          "pinName": ""
+          "compName": "Splitter#14",
+          "pinName": "O3"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "A4"
+          "compName": "ram4#0",
+          "pinName": "B3"
         },
         "name": "unnamedWire#59",
-        "path": [
-          {
-            "x": 335.0,
-            "y": 670.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "dlatch4#1",
-          "pinName": "Q1"
+          "compName": "Splitter#5",
+          "pinName": "O3"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "B1"
+          "compName": "dlatch4#1",
+          "pinName": "Q4"
         },
         "name": "unnamedWire#60",
-        "path": [
-          {
-            "x": 300.0,
-            "y": 695.0
-          },
-          {
-            "x": 300.0,
-            "y": 680.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "dlatch4#1",
-          "pinName": "Q2"
+          "compName": "Splitter#5",
+          "pinName": "O2"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "B2"
+          "compName": "dlatch4#1",
+          "pinName": "Q3"
         },
         "name": "unnamedWire#61",
-        "path": [
-          {
-            "x": 305.0,
-            "y": 705.0
-          },
-          {
-            "x": 305.0,
-            "y": 685.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
           "compName": "dlatch4#1",
-          "pinName": "Q3"
+          "pinName": "Q2"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "B3"
+          "compName": "Splitter#5",
+          "pinName": "O1"
         },
         "name": "unnamedWire#62",
-        "path": [
-          {
-            "x": 310.0,
-            "y": 715.0
-          },
-          {
-            "x": 310.0,
-            "y": 690.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
           "compName": "dlatch4#1",
-          "pinName": "Q4"
+          "pinName": "Q1"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "B4"
+          "compName": "Splitter#5",
+          "pinName": "O0"
         },
         "name": "unnamedWire#63",
-        "path": [
-          {
-            "x": 315.0,
-            "y": 725.0
-          },
-          {
-            "x": 315.0,
-            "y": 695.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "dff4#0",
-          "pinName": "Q1"
+          "compName": "Splitter#16",
+          "pinName": "O3"
         },
         "pin2": {
-          "compName": "WireCrossPoint#10",
-          "pinName": ""
+          "compName": "dff4#0",
+          "pinName": "Q4"
         },
         "name": "unnamedWire#64",
         "path": []
       },
       {
         "pin1": {
-          "compName": "dff4#0",
-          "pinName": "Q2"
+          "compName": "Splitter#16",
+          "pinName": "O2"
         },
         "pin2": {
-          "compName": "WireCrossPoint#11",
-          "pinName": ""
+          "compName": "dff4#0",
+          "pinName": "Q3"
         },
         "name": "unnamedWire#65",
         "path": []
       {
         "pin1": {
           "compName": "dff4#0",
-          "pinName": "Q3"
+          "pinName": "Q2"
         },
         "pin2": {
-          "compName": "WireCrossPoint#12",
-          "pinName": ""
+          "compName": "Splitter#16",
+          "pinName": "O1"
         },
         "name": "unnamedWire#66",
         "path": []
       },
       {
         "pin1": {
-          "compName": "dff4#0",
-          "pinName": "Q4"
+          "compName": "Splitter#16",
+          "pinName": "O0"
         },
         "pin2": {
-          "compName": "WireCrossPoint#13",
-          "pinName": ""
+          "compName": "dff4#0",
+          "pinName": "Q1"
         },
         "name": "unnamedWire#67",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#10",
-          "pinName": ""
+          "compName": "Splitter#16",
+          "pinName": "I"
         },
         "pin2": {
-          "compName": "WireCrossPoint#14",
+          "compName": "WireCrossPoint#7",
           "pinName": ""
         },
         "name": "unnamedWire#68",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#14",
-          "pinName": ""
+          "compName": "sel3_4#1",
+          "pinName": "B4"
         },
         "pin2": {
-          "compName": "TriStateBuffer#0",
-          "pinName": "IN"
+          "compName": "Splitter#11",
+          "pinName": "O3"
         },
         "name": "unnamedWire#69",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#13",
-          "pinName": ""
+          "compName": "Splitter#11",
+          "pinName": "O2"
         },
         "pin2": {
-          "compName": "WireCrossPoint#15",
-          "pinName": ""
+          "compName": "sel3_4#1",
+          "pinName": "B3"
         },
         "name": "unnamedWire#70",
         "path": []
           "pinName": "Qn"
         },
         "pin2": {
-          "compName": "WireCrossPoint#40",
+          "compName": "WireCrossPoint#18",
           "pinName": ""
         },
         "name": "unnamedWire#71",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#11",
-          "pinName": ""
+          "compName": "Splitter#18",
+          "pinName": "O2"
         },
         "pin2": {
-          "compName": "WireCrossPoint#16",
-          "pinName": ""
+          "compName": "sel3_4#1",
+          "pinName": "C2"
         },
         "name": "unnamedWire#72",
-        "path": [
-          {
-            "x": 245.0,
-            "y": 1095.0
-          },
-          {
-            "x": 130.0,
-            "y": 1095.0
-          },
-          {
-            "x": 130.0,
-            "y": 1050.0
-          },
-          {
-            "x": 135.0,
-            "y": 1050.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#12",
-          "pinName": ""
+          "compName": "Splitter#18",
+          "pinName": "O1"
         },
         "pin2": {
-          "compName": "WireCrossPoint#17",
-          "pinName": ""
+          "compName": "sel3_4#1",
+          "pinName": "C1"
         },
         "name": "unnamedWire#73",
-        "path": [
-          {
-            "x": 250.0,
-            "y": 1100.0
-          },
-          {
-            "x": 135.0,
-            "y": 1100.0
-          },
-          {
-            "x": 135.0,
-            "y": 1055.0
-          },
-          {
-            "x": 140.0,
-            "y": 1055.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#16",
+          "compName": "WireCrossPoint#8",
           "pinName": ""
         },
         "pin2": {
-          "compName": "sel3_4#1",
-          "pinName": "C1"
+          "compName": "Splitter#18",
+          "pinName": "I"
         },
         "name": "unnamedWire#74",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#17",
+          "compName": "WireCrossPoint#8",
           "pinName": ""
         },
         "pin2": {
-          "compName": "sel3_4#1",
-          "pinName": "C2"
+          "compName": "WireCrossPoint#7",
+          "pinName": ""
         },
         "name": "unnamedWire#75",
-        "path": []
+        "path": [
+          {
+            "x": 130.0,
+            "y": 1090.0
+          },
+          {
+            "x": 255.0,
+            "y": 1090.0
+          }
+        ]
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#13",
+          "compName": "WireCrossPoint#6",
           "pinName": ""
         },
         "pin2": {
-          "compName": "sel3_4#1",
-          "pinName": "C3"
+          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
+          "pinName": "Q"
         },
         "name": "unnamedWire#76",
         "path": [
           {
-            "x": 255.0,
-            "y": 1105.0
-          },
-          {
-            "x": 140.0,
-            "y": 1105.0
-          },
-          {
-            "x": 140.0,
-            "y": 1060.0
+            "x": 325.0,
+            "y": 700.0
           }
         ]
       },
           "pinName": "RAMn"
         },
         "pin2": {
-          "compName": "WireCrossPoint#41",
+          "compName": "WireCrossPoint#19",
           "pinName": ""
         },
         "name": "unnamedWire#78",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#10",
-          "pinName": ""
+          "compName": "Splitter#17",
+          "pinName": "I"
         },
         "pin2": {
-          "compName": "sel3_4#1",
-          "pinName": "A2"
+          "compName": "WireCrossPoint#8",
+          "pinName": ""
         },
         "name": "unnamedWire#79",
         "path": [
-          {
-            "x": 240.0,
-            "y": 1090.0
-          },
-          {
-            "x": 125.0,
-            "y": 1090.0
-          },
-          {
-            "x": 125.0,
-            "y": 1045.0
-          },
-          {
-            "x": 130.0,
-            "y": 1045.0
-          },
           {
             "x": 130.0,
-            "y": 970.0
+            "y": 980.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#14",
+          "compName": "WireCrossPoint#6",
           "pinName": ""
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "Q1"
+          "compName": "WireCrossPoint#7",
+          "pinName": ""
         },
         "name": "unnamedWire#80",
-        "path": [
-          {
-            "x": 320.0,
-            "y": 705.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#11",
-          "pinName": ""
+          "compName": "sel3_4#1",
+          "pinName": "B2"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "Q2"
+          "compName": "Splitter#11",
+          "pinName": "O1"
         },
         "name": "unnamedWire#81",
-        "path": [
-          {
-            "x": 325.0,
-            "y": 940.0
-          },
-          {
-            "x": 325.0,
-            "y": 710.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#12",
-          "pinName": ""
+          "compName": "Splitter#11",
+          "pinName": "O0"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "Q3"
+          "compName": "sel3_4#1",
+          "pinName": "B1"
         },
         "name": "unnamedWire#82",
-        "path": [
-          {
-            "x": 330.0,
-            "y": 950.0
-          },
-          {
-            "x": 330.0,
-            "y": 715.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#15",
-          "pinName": ""
+          "compName": "Splitter#17",
+          "pinName": "O0"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "Q4"
+          "compName": "sel3_4#1",
+          "pinName": "A2"
         },
         "name": "unnamedWire#83",
-        "path": [
-          {
-            "x": 335.0,
-            "y": 720.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#16",
-          "pinName": ""
+          "compName": "Splitter#18",
+          "pinName": "O3"
         },
         "pin2": {
           "compName": "sel3_4#1",
-          "pinName": "A3"
+          "pinName": "C3"
         },
         "name": "unnamedWire#84",
-        "path": [
-          {
-            "x": 135.0,
-            "y": 980.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#17",
-          "pinName": ""
+          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
+          "pinName": "D"
         },
         "pin2": {
-          "compName": "sel3_4#1",
-          "pinName": "A4"
+          "compName": "_submodelinterface",
+          "pinName": "D"
         },
         "name": "unnamedWire#85",
         "path": [
           {
-            "x": 140.0,
-            "y": 990.0
+            "x": 505.0,
+            "y": 630.0
+          },
+          {
+            "x": 505.0,
+            "y": 475.0
+          },
+          {
+            "x": 600.0,
+            "y": 475.0
           }
         ]
       },
       },
       {
         "pin1": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "F1"
+          "compName": "WireCrossPoint#9",
+          "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#18",
-          "pinName": ""
+          "compName": "TriStateBuffer#3",
+          "pinName": "IN"
         },
         "name": "unnamedWire#92",
         "path": [
           {
-            "x": 635.0,
-            "y": 625.0
-          },
-          {
-            "x": 635.0,
-            "y": 530.0
+            "x": 365.0,
+            "y": 735.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "F4"
+          "compName": "Splitter#6",
+          "pinName": "O0"
         },
         "pin2": {
-          "compName": "WireCrossPoint#19",
-          "pinName": ""
+          "compName": "or4#0",
+          "pinName": "A1"
         },
         "name": "unnamedWire#93",
-        "path": [
-          {
-            "x": 620.0,
-            "y": 655.0
-          },
-          {
-            "x": 620.0,
-            "y": 545.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
           "pinName": "OUT"
         },
         "pin2": {
-          "compName": "WireCrossPoint#20",
+          "compName": "WireCrossPoint#11",
           "pinName": ""
         },
         "name": "unnamedWire#94",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#45",
+          "compName": "WireCrossPoint#23",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#20",
+          "compName": "WireCrossPoint#11",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#20",
+          "compName": "WireCrossPoint#11",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#18",
-          "pinName": ""
+          "compName": "Splitter#6",
+          "pinName": "O1"
         },
         "pin2": {
-          "compName": "WireCrossPoint#21",
-          "pinName": ""
+          "compName": "or4#0",
+          "pinName": "A2"
         },
         "name": "unnamedWire#98",
-        "path": [
-          {
-            "x": 380.0,
-            "y": 505.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "F2"
+          "compName": "Splitter#6",
+          "pinName": "O2"
         },
         "pin2": {
-          "compName": "WireCrossPoint#22",
-          "pinName": ""
+          "compName": "or4#0",
+          "pinName": "A3"
         },
         "name": "unnamedWire#99",
-        "path": [
-          {
-            "x": 630.0,
-            "y": 635.0
-          },
-          {
-            "x": 630.0,
-            "y": 535.0
-          },
-          {
-            "x": 385.0,
-            "y": 535.0
-          },
-          {
-            "x": 385.0,
-            "y": 510.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "F3"
+          "compName": "Splitter#6",
+          "pinName": "O3"
         },
         "pin2": {
-          "compName": "WireCrossPoint#23",
-          "pinName": ""
+          "compName": "or4#0",
+          "pinName": "A4"
         },
         "name": "unnamedWire#100",
-        "path": [
-          {
-            "x": 625.0,
-            "y": 645.0
-          },
-          {
-            "x": 625.0,
-            "y": 540.0
-          },
-          {
-            "x": 390.0,
-            "y": 540.0
-          },
-          {
-            "x": 390.0,
-            "y": 515.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#19",
-          "pinName": ""
+          "compName": "Splitter#7",
+          "pinName": "O0"
         },
         "pin2": {
-          "compName": "WireCrossPoint#24",
-          "pinName": ""
+          "compName": "mux1_4#0",
+          "pinName": "I1_1"
         },
         "name": "unnamedWire#101",
-        "path": [
-          {
-            "x": 395.0,
-            "y": 520.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#21",
-          "pinName": ""
+          "compName": "Splitter#7",
+          "pinName": "O1"
         },
         "pin2": {
-          "compName": "WireCrossPoint#25",
-          "pinName": ""
+          "compName": "mux1_4#0",
+          "pinName": "I1_2"
         },
         "name": "unnamedWire#102",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#22",
-          "pinName": ""
+          "compName": "Splitter#7",
+          "pinName": "O2"
         },
         "pin2": {
-          "compName": "WireCrossPoint#26",
-          "pinName": ""
+          "compName": "mux1_4#0",
+          "pinName": "I1_3"
         },
         "name": "unnamedWire#103",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#23",
-          "pinName": ""
+          "compName": "Splitter#7",
+          "pinName": "O3"
         },
         "pin2": {
-          "compName": "WireCrossPoint#27",
-          "pinName": ""
+          "compName": "mux1_4#0",
+          "pinName": "I1_4"
         },
         "name": "unnamedWire#104",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#24",
+          "compName": "WireCrossPoint#10",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#28",
-          "pinName": ""
+          "compName": "Splitter#6",
+          "pinName": "I"
         },
         "name": "unnamedWire#105",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#25",
+          "compName": "WireCrossPoint#10",
           "pinName": ""
         },
         "pin2": {
-          "compName": "or4#0",
-          "pinName": "A1"
+          "compName": "Splitter#7",
+          "pinName": "I"
         },
         "name": "unnamedWire#106",
-        "path": []
-      },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#26",
-          "pinName": ""
-        },
-        "pin2": {
-          "compName": "or4#0",
-          "pinName": "A2"
-        },
-        "name": "unnamedWire#107",
-        "path": []
-      },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#27",
-          "pinName": ""
-        },
-        "pin2": {
-          "compName": "or4#0",
-          "pinName": "A3"
-        },
-        "name": "unnamedWire#108",
-        "path": []
-      },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#28",
-          "pinName": ""
-        },
-        "pin2": {
-          "compName": "or4#0",
-          "pinName": "A4"
-        },
-        "name": "unnamedWire#109",
-        "path": []
-      },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#25",
-          "pinName": ""
-        },
-        "pin2": {
-          "compName": "mux1_4#0",
-          "pinName": "I1_1"
-        },
-        "name": "unnamedWire#110",
         "path": [
           {
             "x": 355.0,
-            "y": 405.0
-          }
-        ]
-      },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#26",
-          "pinName": ""
-        },
-        "pin2": {
-          "compName": "mux1_4#0",
-          "pinName": "I1_2"
-        },
-        "name": "unnamedWire#111",
-        "path": [
-          {
-            "x": 360.0,
-            "y": 415.0
+            "y": 420.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#27",
+          "compName": "WireCrossPoint#10",
           "pinName": ""
         },
         "pin2": {
-          "compName": "mux1_4#0",
-          "pinName": "I1_3"
-        },
-        "name": "unnamedWire#112",
-        "path": [
-          {
-            "x": 365.0,
-            "y": 425.0
-          }
-        ]
-      },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#28",
+          "compName": "WireCrossPoint#13",
           "pinName": ""
         },
-        "pin2": {
-          "compName": "mux1_4#0",
-          "pinName": "I1_4"
-        },
-        "name": "unnamedWire#113",
-        "path": [
-          {
-            "x": 370.0,
-            "y": 435.0
-          }
-        ]
+        "name": "unnamedWire#107",
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#21",
+          "compName": "WireCrossPoint#13",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#29",
+          "compName": "WireCrossPoint#25",
           "pinName": ""
         },
-        "name": "unnamedWire#114",
+        "name": "unnamedWire#108",
         "path": [
           {
-            "x": 105.0,
-            "y": 505.0
+            "x": 380.0,
+            "y": 510.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#22",
+          "compName": "WireCrossPoint#14",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#30",
+          "compName": "WireCrossPoint#13",
           "pinName": ""
         },
-        "name": "unnamedWire#115",
+        "name": "unnamedWire#109",
         "path": [
           {
-            "x": 110.0,
+            "x": 105.0,
             "y": 510.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#23",
+          "compName": "WireCrossPoint#14",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#31",
-          "pinName": ""
+          "compName": "Splitter#8",
+          "pinName": "I"
         },
-        "name": "unnamedWire#116",
-        "path": [
-          {
-            "x": 115.0,
-            "y": 515.0
-          }
-        ]
+        "name": "unnamedWire#110",
+        "path": []
       },
       {
         "pin1": {
-          "compName": "sel3_4#1",
-          "pinName": "A1"
+          "compName": "sel3_4#0",
+          "pinName": "A4"
         },
         "pin2": {
-          "compName": "WireCrossPoint#40",
-          "pinName": ""
+          "compName": "Splitter#8",
+          "pinName": "O2"
         },
-        "name": "unnamedWire#117",
-        "path": [
-          {
-            "x": 100.0,
-            "y": 960.0
-          }
-        ]
+        "name": "unnamedWire#111",
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#29",
-          "pinName": ""
+          "compName": "Splitter#8",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "sel3_4#0",
-          "pinName": "A2"
+          "pinName": "A3"
         },
-        "name": "unnamedWire#118",
+        "name": "unnamedWire#112",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#30",
-          "pinName": ""
+          "compName": "Splitter#8",
+          "pinName": "O0"
         },
         "pin2": {
           "compName": "sel3_4#0",
-          "pinName": "A3"
+          "pinName": "A2"
         },
-        "name": "unnamedWire#119",
+        "name": "unnamedWire#113",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#31",
-          "pinName": ""
+          "compName": "Splitter#9",
+          "pinName": "O0"
         },
         "pin2": {
           "compName": "sel3_4#0",
-          "pinName": "A4"
+          "pinName": "B1"
         },
-        "name": "unnamedWire#120",
+        "name": "unnamedWire#114",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#30",
-          "pinName": ""
+          "compName": "Splitter#9",
+          "pinName": "O1"
         },
         "pin2": {
-          "compName": "WireCrossPoint#32",
-          "pinName": ""
+          "compName": "sel3_4#0",
+          "pinName": "B2"
         },
-        "name": "unnamedWire#121",
+        "name": "unnamedWire#115",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#31",
-          "pinName": ""
+          "compName": "Splitter#9",
+          "pinName": "O2"
         },
         "pin2": {
-          "compName": "WireCrossPoint#33",
-          "pinName": ""
+          "compName": "sel3_4#0",
+          "pinName": "B3"
         },
-        "name": "unnamedWire#122",
+        "name": "unnamedWire#116",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#24",
-          "pinName": ""
+          "compName": "sel3_4#1",
+          "pinName": "A1"
         },
         "pin2": {
-          "compName": "WireCrossPoint#34",
+          "compName": "WireCrossPoint#18",
           "pinName": ""
         },
-        "name": "unnamedWire#123",
+        "name": "unnamedWire#117",
         "path": [
           {
-            "x": 120.0,
-            "y": 520.0
+            "x": 100.0,
+            "y": 960.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#29",
-          "pinName": ""
-        },
-        "pin2": {
-          "compName": "WireCrossPoint#35",
-          "pinName": ""
-        },
-        "name": "unnamedWire#124",
-        "path": []
-      },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#35",
-          "pinName": ""
-        },
-        "pin2": {
-          "compName": "sel3_4#0",
-          "pinName": "B1"
-        },
-        "name": "unnamedWire#125",
-        "path": []
-      },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#32",
-          "pinName": ""
+          "compName": "Splitter#9",
+          "pinName": "O3"
         },
         "pin2": {
           "compName": "sel3_4#0",
-          "pinName": "B2"
+          "pinName": "B4"
         },
-        "name": "unnamedWire#126",
+        "name": "unnamedWire#118",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#33",
-          "pinName": ""
+          "compName": "Splitter#9",
+          "pinName": "I"
         },
         "pin2": {
-          "compName": "sel3_4#0",
-          "pinName": "B3"
-        },
-        "name": "unnamedWire#127",
-        "path": []
-      },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#34",
+          "compName": "WireCrossPoint#15",
           "pinName": ""
         },
-        "pin2": {
-          "compName": "sel3_4#0",
-          "pinName": "B4"
-        },
-        "name": "unnamedWire#128",
+        "name": "unnamedWire#119",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#32",
+          "compName": "WireCrossPoint#15",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#36",
+          "compName": "WireCrossPoint#14",
           "pinName": ""
         },
-        "name": "unnamedWire#129",
+        "name": "unnamedWire#120",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#33",
-          "pinName": ""
+          "compName": "Splitter#10",
+          "pinName": "O3"
         },
         "pin2": {
-          "compName": "WireCrossPoint#37",
-          "pinName": ""
+          "compName": "sel3_4#0",
+          "pinName": "C3"
         },
-        "name": "unnamedWire#130",
+        "name": "unnamedWire#121",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#34",
-          "pinName": ""
+          "compName": "Splitter#10",
+          "pinName": "O2"
         },
         "pin2": {
-          "compName": "WireCrossPoint#38",
-          "pinName": ""
+          "compName": "sel3_4#0",
+          "pinName": "C2"
         },
-        "name": "unnamedWire#131",
+        "name": "unnamedWire#122",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#36",
-          "pinName": ""
+          "compName": "Splitter#10",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "sel3_4#0",
           "pinName": "C1"
         },
-        "name": "unnamedWire#132",
+        "name": "unnamedWire#123",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#37",
+          "compName": "WireCrossPoint#15",
           "pinName": ""
         },
         "pin2": {
-          "compName": "sel3_4#0",
-          "pinName": "C2"
+          "compName": "WireCrossPoint#16",
+          "pinName": ""
         },
-        "name": "unnamedWire#133",
+        "name": "unnamedWire#124",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#38",
+          "compName": "WireCrossPoint#16",
           "pinName": ""
         },
         "pin2": {
-          "compName": "sel3_4#0",
-          "pinName": "C3"
+          "compName": "Splitter#10",
+          "pinName": "I"
         },
-        "name": "unnamedWire#134",
+        "name": "unnamedWire#125",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#15",
-          "pinName": ""
+          "compName": "Splitter#17",
+          "pinName": "O1"
         },
         "pin2": {
-          "compName": "TriStateBuffer#2",
-          "pinName": "IN"
+          "compName": "sel3_4#1",
+          "pinName": "A3"
         },
-        "name": "unnamedWire#135",
+        "name": "unnamedWire#126",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#35",
-          "pinName": ""
+          "compName": "Splitter#17",
+          "pinName": "O2"
         },
         "pin2": {
           "compName": "sel3_4#1",
-          "pinName": "B1"
+          "pinName": "A4"
         },
-        "name": "unnamedWire#136",
+        "name": "unnamedWire#127",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#11",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#16",
+          "pinName": ""
+        },
+        "name": "unnamedWire#128",
         "path": [
           {
             "x": 105.0,
-            "y": 1000.0
+            "y": 1015.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#36",
+          "compName": "WireCrossPoint#25",
           "pinName": ""
         },
         "pin2": {
-          "compName": "sel3_4#1",
-          "pinName": "B2"
+          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
+          "pinName": "F"
         },
-        "name": "unnamedWire#137",
+        "name": "unnamedWire#129",
         "path": [
           {
-            "x": 110.0,
-            "y": 1010.0
+            "x": 610.0,
+            "y": 530.0
+          },
+          {
+            "x": 610.0,
+            "y": 630.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#37",
+          "compName": "WireCrossPoint#12",
           "pinName": ""
         },
         "pin2": {
-          "compName": "sel3_4#1",
-          "pinName": "B3"
+          "compName": "Splitter#12",
+          "pinName": "I"
         },
-        "name": "unnamedWire#138",
-        "path": [
-          {
-            "x": 115.0,
-            "y": 1020.0
-          }
-        ]
+        "name": "unnamedWire#130",
+        "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#38",
-          "pinName": ""
+          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
+          "pinName": "B"
         },
         "pin2": {
-          "compName": "sel3_4#1",
-          "pinName": "B4"
+          "compName": "Splitter#5",
+          "pinName": "I"
         },
-        "name": "unnamedWire#139",
+        "name": "unnamedWire#131",
         "path": [
           {
-            "x": 120.0,
-            "y": 1030.0
+            "x": 315.0,
+            "y": 690.0
+          },
+          {
+            "x": 315.0,
+            "y": 710.0
           }
         ]
       },
+      {
+        "pin1": {
+          "compName": "Splitter#15",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "TriStateBuffer#0",
+          "pinName": "IN"
+        },
+        "name": "unnamedWire#132",
+        "path": []
+      },
       {
         "pin1": {
           "compName": "sel3_4#0",
           "compName": "ram4#0",
           "pinName": "D1"
         },
-        "name": "unnamedWire#140",
+        "name": "unnamedWire#133",
         "path": [
           {
             "x": 195.0,
           "compName": "ram4#0",
           "pinName": "D2"
         },
-        "name": "unnamedWire#141",
+        "name": "unnamedWire#134",
         "path": [
           {
             "x": 200.0,
           "compName": "ram4#0",
           "pinName": "D3"
         },
-        "name": "unnamedWire#142",
+        "name": "unnamedWire#135",
         "path": [
           {
             "x": 205.0,
           "compName": "ram4#0",
           "pinName": "D4"
         },
-        "name": "unnamedWire#143",
+        "name": "unnamedWire#136",
         "path": [
           {
             "x": 210.0,
           "compName": "and#0",
           "pinName": "A"
         },
-        "name": "unnamedWire#144",
+        "name": "unnamedWire#137",
         "path": []
       },
       {
           "compName": "and#0",
           "pinName": "B"
         },
-        "name": "unnamedWire#145"
+        "name": "unnamedWire#138"
       },
       {
         "pin1": {
           "compName": "ram4#0",
           "pinName": "WE"
         },
-        "name": "unnamedWire#146",
+        "name": "unnamedWire#139",
         "path": [
           {
             "x": 630.0,
           "compName": "dff4#0",
           "pinName": "WE"
         },
-        "name": "unnamedWire#147",
+        "name": "unnamedWire#140",
         "path": [
           {
             "x": 450.0,
           "compName": "mux1_4#0",
           "pinName": "S0"
         },
-        "name": "unnamedWire#148",
+        "name": "unnamedWire#141",
         "path": [
           {
             "x": 435.0,
       },
       {
         "pin1": {
-          "compName": "Splitter#4",
-          "pinName": "O0"
+          "compName": "Splitter#15",
+          "pinName": "O3"
         },
         "pin2": {
-          "compName": "Am2901ALUInclSourceDecodeInclFunctionDecode#0",
-          "pinName": "D1"
+          "compName": "TriStateBuffer#2",
+          "pinName": "IN"
         },
-        "name": "unnamedWire#149",
-        "path": [
-          {
-            "x": 505.0,
-            "y": 630.0
-          }
-        ]
+        "name": "unnamedWire#142",
+        "path": []
       },
       {
         "pin1": {
           "compName": "Splitter#1",
           "pinName": "I"
         },
-        "name": "unnamedWire#150",
+        "name": "unnamedWire#143",
         "path": []
       },
       {
           "compName": "Splitter#1",
           "pinName": "O2"
         },
-        "name": "unnamedWire#151",
+        "name": "unnamedWire#144",
         "path": [
           {
             "x": 555.0,
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "WireCrossPoint#39",
+          "compName": "WireCrossPoint#17",
           "pinName": ""
         },
-        "name": "unnamedWire#152",
+        "name": "unnamedWire#145",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#39",
+          "compName": "WireCrossPoint#17",
           "pinName": ""
         },
         "pin2": {
           "compName": "NandGate#1",
           "pinName": "A"
         },
-        "name": "unnamedWire#153",
+        "name": "unnamedWire#146",
         "path": [
           {
             "x": 415.0,
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#39",
+          "compName": "WireCrossPoint#17",
           "pinName": ""
         },
         "pin2": {
           "compName": "NandGate#1",
           "pinName": "B"
         },
-        "name": "unnamedWire#154",
+        "name": "unnamedWire#147",
         "path": [
           {
             "x": 415.0,
           "compName": "_submodelinterface",
           "pinName": "F\u003d0"
         },
-        "name": "unnamedWire#155",
+        "name": "unnamedWire#148",
         "path": [
           {
             "x": 445.0,
           "compName": "mux1_4#0",
           "pinName": "Y1"
         },
-        "name": "unnamedWire#156",
+        "name": "unnamedWire#149",
         "path": [
           {
             "x": 765.0,
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#40",
+          "compName": "WireCrossPoint#18",
           "pinName": ""
         },
         "pin2": {
           "compName": "TriStateBuffer#0",
           "pinName": "OUT"
         },
-        "name": "unnamedWire#157",
+        "name": "unnamedWire#150",
         "path": [
           {
             "x": 100.0,
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#18",
+          "compName": "WireCrossPoint#6",
           "pinName": ""
         },
         "pin2": {
-          "compName": "TriStateBuffer#1",
-          "pinName": "IN"
+          "compName": "Splitter#15",
+          "pinName": "I"
         },
-        "name": "unnamedWire#158",
+        "name": "unnamedWire#151",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#41",
+          "compName": "WireCrossPoint#19",
           "pinName": ""
         },
         "pin2": {
           "compName": "sel3_4#0",
           "pinName": "A1"
         },
-        "name": "unnamedWire#159",
+        "name": "unnamedWire#152",
         "path": [
           {
             "x": 100.0,
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#41",
+          "compName": "WireCrossPoint#19",
           "pinName": ""
         },
         "pin2": {
           "compName": "TriStateBuffer#1",
           "pinName": "OUT"
         },
-        "name": "unnamedWire#160",
+        "name": "unnamedWire#153",
         "path": [
           {
             "x": 100.0,
           }
         ]
       },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#19",
-          "pinName": ""
-        },
-        "pin2": {
-          "compName": "_submodelinterface",
-          "pinName": "F3"
-        },
-        "name": "unnamedWire#161",
-        "path": [
-          {
-            "x": 5.0,
-            "y": 545.0
-          },
-          {
-            "x": 5.0,
-            "y": 550.0
-          }
-        ]
-      },
       {
         "pin1": {
           "compName": "mux1_4#0",
           "compName": "Splitter#1",
           "pinName": "O3"
         },
-        "name": "unnamedWire#162",
+        "name": "unnamedWire#154",
         "path": [
           {
             "x": 550.0,
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#42",
+          "compName": "WireCrossPoint#20",
           "pinName": ""
         },
         "pin2": {
           "compName": "WireCrossPoint#5",
           "pinName": ""
         },
-        "name": "unnamedWire#163",
+        "name": "unnamedWire#155",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#43",
+          "compName": "WireCrossPoint#21",
           "pinName": ""
         },
         "pin2": {
           "compName": "TriStateBuffer#1",
           "pinName": "EN"
         },
-        "name": "unnamedWire#164",
+        "name": "unnamedWire#156",
         "path": [
           {
             "x": 395.0,
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#43",
+          "compName": "WireCrossPoint#21",
           "pinName": ""
         },
         "pin2": {
           "compName": "TriStateBuffer#0",
           "pinName": "EN"
         },
-        "name": "unnamedWire#165",
+        "name": "unnamedWire#157",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#43",
+          "compName": "WireCrossPoint#21",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#42",
+          "compName": "WireCrossPoint#20",
           "pinName": ""
         },
-        "name": "unnamedWire#166",
+        "name": "unnamedWire#158",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#44",
+          "compName": "WireCrossPoint#22",
           "pinName": ""
         },
         "pin2": {
           "compName": "WireCrossPoint#3",
           "pinName": ""
         },
-        "name": "unnamedWire#167",
+        "name": "unnamedWire#159",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#44",
+          "compName": "WireCrossPoint#22",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#45",
+          "compName": "WireCrossPoint#23",
           "pinName": ""
         },
-        "name": "unnamedWire#168",
+        "name": "unnamedWire#160",
         "path": []
       },
       {
           "pinName": "EN"
         },
         "pin2": {
-          "compName": "WireCrossPoint#45",
+          "compName": "WireCrossPoint#23",
           "pinName": ""
         },
-        "name": "unnamedWire#169",
+        "name": "unnamedWire#161",
         "path": []
       },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#19",
-          "pinName": ""
-        },
-        "pin2": {
-          "compName": "TriStateBuffer#3",
-          "pinName": "IN"
-        },
-        "name": "unnamedWire#170",
-        "path": [
-          {
-            "x": 395.0,
-            "y": 735.0
-          }
-        ]
-      },
       {
         "pin1": {
           "compName": "sel3_4#1",
           "pinName": "C4"
         },
         "pin2": {
-          "compName": "WireCrossPoint#46",
+          "compName": "WireCrossPoint#24",
           "pinName": ""
         },
-        "name": "unnamedWire#171",
+        "name": "unnamedWire#162",
         "path": [
           {
             "x": 145.0,
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#46",
+          "compName": "WireCrossPoint#24",
           "pinName": ""
         },
         "pin2": {
           "compName": "TriStateBuffer#2",
           "pinName": "OUT"
         },
-        "name": "unnamedWire#172",
+        "name": "unnamedWire#163",
         "path": [
           {
             "x": 425.0,
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#46",
+          "compName": "WireCrossPoint#24",
           "pinName": ""
         },
         "pin2": {
           "compName": "_submodelinterface",
           "pinName": "Qn+3"
         },
-        "name": "unnamedWire#173",
+        "name": "unnamedWire#164",
         "path": [
           {
             "x": 425.0,
           }
         ]
       },
-      {
-        "pin1": {
-          "compName": "Splitter#3",
-          "pinName": "O0"
-        },
-        "pin2": {
-          "compName": "ram4#0",
-          "pinName": "B0"
-        },
-        "name": "unnamedWire#174",
-        "path": [
-          {
-            "x": 635.0,
-            "y": 365.0
-          },
-          {
-            "x": 635.0,
-            "y": 215.0
-          }
-        ]
-      },
       {
         "pin1": {
           "compName": "Splitter#3",
           "pinName": "I"
         },
         "pin2": {
-          "compName": "_submodelinterface",
-          "pinName": "B"
+          "compName": "WireCrossPoint#25",
+          "pinName": ""
         },
-        "name": "unnamedWire#175",
+        "name": "unnamedWire#165",
         "path": []
       }
     ],
index fdba322..87615ab 100644 (file)
@@ -2,58 +2,13 @@
   "width": 95.0,
   "height": 110.0,
   "interfacePins": [
-    {
-      "location": {
-        "x": 0.0,
-        "y": 35.0
-      },
-      "name": "A1",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 0.0,
-        "y": 40.0
-      },
-      "name": "A2",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
     {
       "location": {
         "x": 0.0,
         "y": 45.0
       },
-      "name": "A3",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 0.0,
-        "y": 50.0
-      },
-      "name": "A4",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 0.0,
-        "y": 60.0
-      },
-      "name": "B1",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 0.0,
-        "y": 65.0
-      },
-      "name": "B2",
-      "logicWidth": 1,
+      "name": "A",
+      "logicWidth": 4,
       "usage": "INPUT"
     },
     {
         "x": 0.0,
         "y": 70.0
       },
-      "name": "B3",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 0.0,
-        "y": 75.0
-      },
-      "name": "B4",
-      "logicWidth": 1,
+      "name": "B",
+      "logicWidth": 4,
       "usage": "INPUT"
     },
     {
         "x": 0.0,
         "y": 10.0
       },
-      "name": "D1",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 0.0,
-        "y": 15.0
-      },
-      "name": "D2",
-      "logicWidth": 1,
+      "name": "D",
+      "logicWidth": 4,
       "usage": "INPUT"
     },
-    {
-      "location": {
-        "x": 0.0,
-        "y": 20.0
-      },
-      "name": "D3",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 0.0,
-        "y": 25.0
-      },
-      "name": "D4",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 95.0,
-        "y": 5.0
-      },
-      "name": "F1",
-      "logicWidth": 1,
-      "usage": "OUTPUT"
-    },
-    {
-      "location": {
-        "x": 95.0,
-        "y": 15.0
-      },
-      "name": "F2",
-      "logicWidth": 1,
-      "usage": "OUTPUT"
-    },
-    {
-      "location": {
-        "x": 95.0,
-        "y": 25.0
-      },
-      "name": "F3",
-      "logicWidth": 1,
-      "usage": "OUTPUT"
-    },
     {
       "location": {
         "x": 95.0,
-        "y": 35.0
+        "y": 10.0
       },
-      "name": "F4",
-      "logicWidth": 1,
+      "name": "F",
+      "logicWidth": 4,
       "usage": "OUTPUT"
     },
     {
       "location": {
-        "x": 25.0,
-        "y": 0.0
-      },
-      "name": "I0",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 35.0,
-        "y": 0.0
-      },
-      "name": "I1",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 45.0,
-        "y": 0.0
-      },
-      "name": "I2",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 55.0,
-        "y": 0.0
-      },
-      "name": "I3",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 65.0,
+        "x": 50.0,
         "y": 0.0
       },
-      "name": "I4",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 75.0,
-        "y": 0.0
-      },
-      "name": "I5",
-      "logicWidth": 1,
+      "name": "I",
+      "logicWidth": 6,
       "usage": "INPUT"
     },
     {
     {
       "location": {
         "x": 0.0,
-        "y": 85.0
-      },
-      "name": "Q1",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 0.0,
-        "y": 90.0
-      },
-      "name": "Q2",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 0.0,
-        "y": 95.0
-      },
-      "name": "Q3",
-      "logicWidth": 1,
-      "usage": "INPUT"
-    },
-    {
-      "location": {
-        "x": 0.0,
-        "y": 100.0
+        "y": 80.0
       },
-      "name": "Q4",
-      "logicWidth": 1,
+      "name": "Q",
+      "logicWidth": 4,
       "usage": "INPUT"
     }
   ],
         "name": "Am2901ALUInclDecode#0",
         "pos": {
           "x": 315.0,
-          "y": 15.0
+          "y": 20.0
         }
       },
       {
           "y": 160.0
         }
       },
+      {
+        "id": "Splitter",
+        "name": "Splitter#0",
+        "pos": {
+          "x": 175.0,
+          "y": 5.0
+        },
+        "params": {
+          "logicWidth": 6,
+          "orientation": "DOWN"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#1",
+        "pos": {
+          "x": 140.0,
+          "y": 165.0
+        },
+        "params": {
+          "logicWidth": 3,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#2",
+        "pos": {
+          "x": 205.0,
+          "y": 20.0
+        },
+        "params": {
+          "logicWidth": 3,
+          "orientation": "UP"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#3",
+        "pos": {
+          "x": 175.0,
+          "y": 20.0
+        },
+        "params": {
+          "logicWidth": 3,
+          "orientation": "UP"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#4",
+        "pos": {
+          "x": 300.0,
+          "y": 25.0
+        },
+        "params": {
+          "logicWidth": 3,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#5",
+        "pos": {
+          "x": 220.0,
+          "y": 110.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#6",
+        "pos": {
+          "x": 355.0,
+          "y": 25.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#7",
+        "pos": {
+          "x": 195.0,
+          "y": 225.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#8",
+        "pos": {
+          "x": 220.0,
+          "y": 265.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#9",
+        "pos": {
+          "x": 220.0,
+          "y": 305.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#0",
     "wires": [
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "I5"
+          "compName": "Splitter#0",
+          "pinName": "O5"
         },
         "pin2": {
-          "compName": "Am2901ALUInclDecode#0",
-          "pinName": "I5"
+          "compName": "Splitter#3",
+          "pinName": "O2"
         },
         "name": "unnamedWire#0",
-        "path": [
-          {
-            "x": 300.0,
-            "y": 20.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
         "path": [
           {
             "x": 40.0,
-            "y": 50.0
+            "y": 55.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "Am2901ALUInclDecode#0",
-          "pinName": "I3"
+          "compName": "Splitter#0",
+          "pinName": "O4"
         },
         "pin2": {
-          "compName": "_submodelinterface",
-          "pinName": "I3"
+          "compName": "Splitter#3",
+          "pinName": "O1"
         },
         "name": "unnamedWire#2",
-        "path": [
-          {
-            "x": 220.0,
-            "y": 40.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "I2"
+          "compName": "Splitter#1",
+          "pinName": "O2"
         },
         "pin2": {
           "compName": "Am2901SourceDecode#0",
           "pinName": "I2"
         },
         "name": "unnamedWire#3",
-        "path": [
-          {
-            "x": 180.0,
-            "y": 5.0
-          },
-          {
-            "x": 150.0,
-            "y": 5.0
-          },
-          {
-            "x": 150.0,
-            "y": 165.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "I1"
+          "compName": "Splitter#1",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "Am2901SourceDecode#0",
           "pinName": "I1"
         },
         "name": "unnamedWire#4",
-        "path": [
-          {
-            "x": 140.0,
-            "y": 175.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "I0"
+          "compName": "Splitter#0",
+          "pinName": "O2"
         },
         "pin2": {
-          "compName": "Am2901SourceDecode#0",
-          "pinName": "I0"
+          "compName": "Splitter#2",
+          "pinName": "O2"
         },
         "name": "unnamedWire#5",
-        "path": [
-          {
-            "x": 100.0,
-            "y": 185.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "D1"
+          "compName": "Splitter#5",
+          "pinName": "O3"
         },
         "pin2": {
           "compName": "sel2_4#0",
-          "pinName": "A1"
+          "pinName": "A4"
         },
         "name": "unnamedWire#7",
-        "path": [
-          {
-            "x": 10.0,
-            "y": 40.0
-          },
-          {
-            "x": 10.0,
-            "y": 55.0
-          },
-          {
-            "x": 185.0,
-            "y": 55.0
-          },
-          {
-            "x": 185.0,
-            "y": 110.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "D2"
+          "compName": "Splitter#5",
+          "pinName": "O2"
         },
         "pin2": {
           "compName": "sel2_4#0",
-          "pinName": "A2"
+          "pinName": "A3"
         },
         "name": "unnamedWire#8",
-        "path": [
-          {
-            "x": 10.0,
-            "y": 60.0
-          },
-          {
-            "x": 10.0,
-            "y": 65.0
-          },
-          {
-            "x": 180.0,
-            "y": 65.0
-          },
-          {
-            "x": 180.0,
-            "y": 120.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "D3"
+          "compName": "Splitter#5",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "sel2_4#0",
-          "pinName": "A3"
+          "pinName": "A2"
         },
         "name": "unnamedWire#9",
-        "path": [
-          {
-            "x": 10.0,
-            "y": 80.0
-          },
-          {
-            "x": 10.0,
-            "y": 75.0
-          },
-          {
-            "x": 175.0,
-            "y": 75.0
-          },
-          {
-            "x": 175.0,
-            "y": 130.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "D4"
+          "compName": "Splitter#5",
+          "pinName": "O0"
         },
         "pin2": {
           "compName": "sel2_4#0",
-          "pinName": "A4"
+          "pinName": "A1"
         },
         "name": "unnamedWire#10",
-        "path": [
-          {
-            "x": 10.0,
-            "y": 100.0
-          },
-          {
-            "x": 10.0,
-            "y": 85.0
-          },
-          {
-            "x": 170.0,
-            "y": 85.0
-          },
-          {
-            "x": 170.0,
-            "y": 140.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
           "compName": "_submodelinterface",
-          "pinName": "A1"
+          "pinName": "A"
         },
         "pin2": {
-          "compName": "WireCrossPoint#0",
-          "pinName": ""
+          "compName": "Splitter#7",
+          "pinName": "I"
         },
         "name": "unnamedWire#11",
         "path": [
           {
-            "x": 55.0,
-            "y": 140.0
+            "x": 90.0,
+            "y": 180.0
           },
           {
-            "x": 55.0,
-            "y": 225.0
+            "x": 90.0,
+            "y": 240.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "A2"
+          "compName": "Splitter#7",
+          "pinName": "O3"
         },
         "pin2": {
-          "compName": "WireCrossPoint#1",
+          "compName": "WireCrossPoint#3",
           "pinName": ""
         },
         "name": "unnamedWire#12",
-        "path": [
-          {
-            "x": 50.0,
-            "y": 160.0
-          },
-          {
-            "x": 50.0,
-            "y": 235.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "A3"
+          "compName": "Splitter#7",
+          "pinName": "O2"
         },
         "pin2": {
           "compName": "WireCrossPoint#2",
           "pinName": ""
         },
         "name": "unnamedWire#13",
-        "path": [
-          {
-            "x": 45.0,
-            "y": 180.0
-          },
-          {
-            "x": 45.0,
-            "y": 245.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "A4"
+          "compName": "Splitter#7",
+          "pinName": "O1"
         },
         "pin2": {
-          "compName": "WireCrossPoint#3",
+          "compName": "WireCrossPoint#1",
           "pinName": ""
         },
         "name": "unnamedWire#14",
-        "path": [
-          {
-            "x": 40.0,
-            "y": 200.0
-          },
-          {
-            "x": 40.0,
-            "y": 255.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "B1"
+          "compName": "Splitter#7",
+          "pinName": "O0"
         },
         "pin2": {
-          "compName": "sel3_4#0",
-          "pinName": "B1"
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
         },
         "name": "unnamedWire#23",
-        "path": [
-          {
-            "x": 25.0,
-            "y": 240.0
-          },
-          {
-            "x": 25.0,
-            "y": 265.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "B2"
+          "compName": "Splitter#8",
+          "pinName": "O3"
         },
         "pin2": {
           "compName": "sel3_4#0",
-          "pinName": "B2"
+          "pinName": "B4"
         },
         "name": "unnamedWire#24",
-        "path": [
-          {
-            "x": 20.0,
-            "y": 260.0
-          },
-          {
-            "x": 20.0,
-            "y": 275.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "B3"
+          "compName": "Splitter#8",
+          "pinName": "O2"
         },
         "pin2": {
           "compName": "sel3_4#0",
           "pinName": "B3"
         },
         "name": "unnamedWire#25",
-        "path": [
-          {
-            "x": 20.0,
-            "y": 280.0
-          },
-          {
-            "x": 20.0,
-            "y": 285.0
-          }
-        ]
-      },
-      {
-        "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "B4"
-        },
-        "pin2": {
-          "compName": "sel3_4#0",
-          "pinName": "B4"
-        },
-        "name": "unnamedWire#26",
-        "path": [
-          {
-            "x": 20.0,
-            "y": 300.0
-          },
-          {
-            "x": 20.0,
-            "y": 295.0
-          }
-        ]
-      },
-      {
-        "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "Q1"
-        },
-        "pin2": {
-          "compName": "sel3_4#0",
-          "pinName": "C1"
-        },
-        "name": "unnamedWire#27",
-        "path": [
-          {
-            "x": 20.0,
-            "y": 340.0
-          },
-          {
-            "x": 20.0,
-            "y": 305.0
-          }
-        ]
-      },
-      {
-        "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "Q2"
-        },
-        "pin2": {
-          "compName": "sel3_4#0",
-          "pinName": "C2"
-        },
-        "name": "unnamedWire#28",
-        "path": [
-          {
-            "x": 25.0,
-            "y": 360.0
-          },
-          {
-            "x": 25.0,
-            "y": 315.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "Q3"
-        },
-        "pin2": {
-          "compName": "sel3_4#0",
-          "pinName": "C3"
-        },
-        "name": "unnamedWire#29",
-        "path": [
-          {
-            "x": 30.0,
-            "y": 380.0
-          },
-          {
-            "x": 30.0,
-            "y": 325.0
-          }
-        ]
+          "compName": "Splitter#8",
+          "pinName": "O1"
+        },
+        "pin2": {
+          "compName": "sel3_4#0",
+          "pinName": "B2"
+        },
+        "name": "unnamedWire#26",
+        "path": []
       },
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "Q4"
+          "compName": "Splitter#9",
+          "pinName": "O0"
         },
         "pin2": {
           "compName": "sel3_4#0",
-          "pinName": "C4"
+          "pinName": "C1"
         },
-        "name": "unnamedWire#30",
-        "path": [
-          {
-            "x": 35.0,
-            "y": 400.0
-          },
-          {
-            "x": 35.0,
-            "y": 335.0
-          }
-        ]
+        "name": "unnamedWire#27",
+        "path": []
       },
       {
         "pin1": {
           "compName": "Am2901SourceDecode#0",
           "pinName": "SQ"
         },
-        "name": "unnamedWire#31",
+        "name": "unnamedWire#28",
         "path": [
           {
             "x": 200.0,
           "compName": "sel2_4#0",
           "pinName": "SA"
         },
-        "name": "unnamedWire#32",
+        "name": "unnamedWire#29",
         "path": [
           {
             "x": 195.0,
           "compName": "sel3_4#0",
           "pinName": "SB"
         },
-        "name": "unnamedWire#33",
+        "name": "unnamedWire#30",
         "path": [
           {
             "x": 205.0,
           "compName": "Am2901SourceDecode#0",
           "pinName": "SA"
         },
-        "name": "unnamedWire#34",
+        "name": "unnamedWire#31",
         "path": []
       },
       {
           "compName": "Am2901ALUInclDecode#0",
           "pinName": "R1"
         },
-        "name": "unnamedWire#35",
+        "name": "unnamedWire#32",
         "path": [
           {
             "x": 275.0,
           },
           {
             "x": 275.0,
-            "y": 60.0
+            "y": 65.0
           }
         ]
       },
           "compName": "Am2901ALUInclDecode#0",
           "pinName": "R2"
         },
-        "name": "unnamedWire#36",
+        "name": "unnamedWire#33",
         "path": [
           {
             "x": 280.0,
           },
           {
             "x": 280.0,
-            "y": 70.0
+            "y": 75.0
           }
         ]
       },
           "compName": "Am2901ALUInclDecode#0",
           "pinName": "R3"
         },
-        "name": "unnamedWire#37",
+        "name": "unnamedWire#34",
         "path": [
           {
             "x": 285.0,
           },
           {
             "x": 285.0,
-            "y": 80.0
+            "y": 85.0
           }
         ]
       },
           "compName": "Am2901ALUInclDecode#0",
           "pinName": "R4"
         },
-        "name": "unnamedWire#38",
+        "name": "unnamedWire#35",
         "path": [
           {
             "x": 290.0,
           },
           {
             "x": 290.0,
-            "y": 90.0
+            "y": 95.0
           }
         ]
       },
           "compName": "Am2901ALUInclDecode#0",
           "pinName": "S1"
         },
-        "name": "unnamedWire#39",
+        "name": "unnamedWire#36",
         "path": [
           {
             "x": 295.0,
           },
           {
             "x": 295.0,
-            "y": 100.0
+            "y": 105.0
           }
         ]
       },
           "compName": "Am2901ALUInclDecode#0",
           "pinName": "S2"
         },
-        "name": "unnamedWire#40",
+        "name": "unnamedWire#37",
         "path": [
           {
             "x": 300.0,
           },
           {
             "x": 300.0,
-            "y": 110.0
+            "y": 115.0
           }
         ]
       },
           "compName": "Am2901ALUInclDecode#0",
           "pinName": "S3"
         },
-        "name": "unnamedWire#41",
+        "name": "unnamedWire#38",
         "path": [
           {
             "x": 305.0,
           },
           {
             "x": 305.0,
-            "y": 120.0
+            "y": 125.0
           }
         ]
       },
           "compName": "Am2901ALUInclDecode#0",
           "pinName": "S4"
         },
-        "name": "unnamedWire#42",
+        "name": "unnamedWire#39",
         "path": [
           {
             "x": 310.0,
           },
           {
             "x": 310.0,
-            "y": 130.0
+            "y": 135.0
           }
         ]
       },
       {
         "pin1": {
+          "compName": "Splitter#6",
+          "pinName": "O3"
+        },
+        "pin2": {
           "compName": "Am2901ALUInclDecode#0",
-          "pinName": "F1"
+          "pinName": "F4"
+        },
+        "name": "unnamedWire#40",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#6",
+          "pinName": "O2"
         },
         "pin2": {
-          "compName": "_submodelinterface",
+          "compName": "Am2901ALUInclDecode#0",
+          "pinName": "F3"
+        },
+        "name": "unnamedWire#41",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#6",
+          "pinName": "O1"
+        },
+        "pin2": {
+          "compName": "Am2901ALUInclDecode#0",
+          "pinName": "F2"
+        },
+        "name": "unnamedWire#42",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Am2901ALUInclDecode#0",
           "pinName": "F1"
         },
+        "pin2": {
+          "compName": "Splitter#6",
+          "pinName": "O0"
+        },
         "name": "unnamedWire#43",
         "path": []
       },
       {
         "pin1": {
           "compName": "Am2901ALUInclDecode#0",
-          "pinName": "F2"
+          "pinName": "Cn+4"
         },
         "pin2": {
           "compName": "_submodelinterface",
-          "pinName": "F2"
+          "pinName": "Cn+4"
         },
         "name": "unnamedWire#44",
         "path": [
           {
-            "x": 375.0,
-            "y": 30.0
+            "x": 360.0,
+            "y": 65.0
           },
           {
-            "x": 375.0,
-            "y": 60.0
+            "x": 360.0,
+            "y": 180.0
           }
         ]
       },
       {
         "pin1": {
           "compName": "Am2901ALUInclDecode#0",
-          "pinName": "F3"
+          "pinName": "OVR"
         },
         "pin2": {
           "compName": "_submodelinterface",
-          "pinName": "F3"
+          "pinName": "OVR"
         },
         "name": "unnamedWire#45",
         "path": [
           {
-            "x": 370.0,
-            "y": 40.0
+            "x": 355.0,
+            "y": 75.0
           },
           {
-            "x": 370.0,
-            "y": 100.0
+            "x": 355.0,
+            "y": 220.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "Am2901ALUInclDecode#0",
-          "pinName": "F4"
+          "compName": "Splitter#0",
+          "pinName": "O3"
         },
         "pin2": {
-          "compName": "_submodelinterface",
-          "pinName": "F4"
+          "compName": "Splitter#3",
+          "pinName": "O0"
         },
         "name": "unnamedWire#46",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Am2901SourceDecode#0",
+          "pinName": "I0"
+        },
+        "name": "unnamedWire#47",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O1"
+        },
+        "pin2": {
+          "compName": "Splitter#2",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#48",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Splitter#2",
+          "pinName": "O0"
+        },
+        "name": "unnamedWire#49",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#2",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#50",
         "path": [
           {
-            "x": 365.0,
-            "y": 50.0
+            "x": 215.0,
+            "y": 45.0
+          },
+          {
+            "x": 135.0,
+            "y": 45.0
           },
           {
-            "x": 365.0,
-            "y": 140.0
+            "x": 135.0,
+            "y": 175.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "Am2901ALUInclDecode#0",
-          "pinName": "Cn+4"
+          "compName": "Splitter#3",
+          "pinName": "I"
         },
         "pin2": {
-          "compName": "_submodelinterface",
-          "pinName": "Cn+4"
+          "compName": "Splitter#4",
+          "pinName": "I"
         },
-        "name": "unnamedWire#47",
+        "name": "unnamedWire#51",
         "path": [
           {
-            "x": 360.0,
-            "y": 60.0
-          },
-          {
-            "x": 360.0,
-            "y": 180.0
+            "x": 185.0,
+            "y": 35.0
           }
         ]
       },
       {
         "pin1": {
+          "compName": "Splitter#4",
+          "pinName": "O2"
+        },
+        "pin2": {
           "compName": "Am2901ALUInclDecode#0",
-          "pinName": "OVR"
+          "pinName": "I5"
+        },
+        "name": "unnamedWire#52",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Am2901ALUInclDecode#0",
+          "pinName": "I4"
+        },
+        "pin2": {
+          "compName": "Splitter#4",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#53",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#4",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Am2901ALUInclDecode#0",
+          "pinName": "I3"
+        },
+        "name": "unnamedWire#54",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "I"
         },
         "pin2": {
           "compName": "_submodelinterface",
-          "pinName": "OVR"
+          "pinName": "I"
         },
-        "name": "unnamedWire#48",
+        "name": "unnamedWire#55",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#6",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "F"
+        },
+        "name": "unnamedWire#56",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#5",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#57",
         "path": [
           {
-            "x": 355.0,
-            "y": 70.0
+            "x": 25.0,
+            "y": 40.0
           },
           {
-            "x": 355.0,
-            "y": 220.0
+            "x": 25.0,
+            "y": 125.0
           }
         ]
       },
       {
         "pin1": {
+          "compName": "sel3_4#0",
+          "pinName": "B1"
+        },
+        "pin2": {
+          "compName": "Splitter#8",
+          "pinName": "O0"
+        },
+        "name": "unnamedWire#58",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#8",
+          "pinName": "I"
+        },
+        "pin2": {
           "compName": "_submodelinterface",
-          "pinName": "I4"
+          "pinName": "B"
+        },
+        "name": "unnamedWire#59",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#9",
+          "pinName": "O1"
         },
         "pin2": {
-          "compName": "Am2901ALUInclDecode#0",
-          "pinName": "I4"
+          "compName": "sel3_4#0",
+          "pinName": "C2"
         },
-        "name": "unnamedWire#49",
-        "path": [
-          {
-            "x": 260.0,
-            "y": 30.0
-          }
-        ]
+        "name": "unnamedWire#60",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#9",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "sel3_4#0",
+          "pinName": "C3"
+        },
+        "name": "unnamedWire#61",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#9",
+          "pinName": "O3"
+        },
+        "pin2": {
+          "compName": "sel3_4#0",
+          "pinName": "C4"
+        },
+        "name": "unnamedWire#62",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#9",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#63",
+        "path": []
       }
     ],
     "version": "0.1.1"
index 6eba852..9ffa28c 100644 (file)
         },
         "pin2": {
           "compName": "dff4_finewe#0",
-          "pinName": "_WE4"
+          "pinName": "_WE1"
         },
         "name": "unnamedWire#1",
         "path": [
         },
         "pin2": {
           "compName": "dff4_finewe#0",
-          "pinName": "_WE3"
+          "pinName": "_WE2"
         },
         "name": "unnamedWire#2",
         "path": [
         },
         "pin2": {
           "compName": "dff4_finewe#0",
-          "pinName": "_WE1"
+          "pinName": "_WE4"
         },
         "name": "unnamedWire#4",
         "path": [
       {
         "pin1": {
           "compName": "dff4_finewe#0",
-          "pinName": "Q1"
+          "pinName": "Q4"
         },
         "pin2": {
           "compName": "WireCrossPoint#1",
       {
         "pin1": {
           "compName": "dff4_finewe#0",
-          "pinName": "Q2"
+          "pinName": "Q3"
         },
         "pin2": {
           "compName": "WireCrossPoint#2",
       {
         "pin1": {
           "compName": "dff4_finewe#0",
-          "pinName": "Q3"
+          "pinName": "Q2"
         },
         "pin2": {
           "compName": "WireCrossPoint#3",
         },
         "pin2": {
           "compName": "dff4_finewe#0",
-          "pinName": "Q4"
+          "pinName": "Q1"
         },
         "name": "unnamedWire#29",
         "path": []
         },
         "pin2": {
           "compName": "dff4_finewe#0",
-          "pinName": "D4"
+          "pinName": "D1"
         },
         "name": "unnamedWire#70",
         "path": [
       {
         "pin1": {
           "compName": "dff4_finewe#0",
-          "pinName": "D3"
+          "pinName": "D2"
         },
         "pin2": {
           "compName": "mux1_4#4",
         },
         "pin2": {
           "compName": "dff4_finewe#0",
-          "pinName": "_WE2"
+          "pinName": "_WE3"
         },
         "name": "unnamedWire#72",
         "path": [
       {
         "pin1": {
           "compName": "dff4_finewe#0",
-          "pinName": "D1"
+          "pinName": "D4"
         },
         "pin2": {
           "compName": "mux1_4#4",
         },
         "pin2": {
           "compName": "dff4_finewe#0",
-          "pinName": "D2"
+          "pinName": "D3"
         },
         "name": "unnamedWire#88",
         "path": [
index 6aa0738..3a5ec33 100644 (file)
       {
         "pin1": {
           "compName": "dff4_finewe#0",
-          "pinName": "Q1"
+          "pinName": "Q4"
         },
         "pin2": {
           "compName": "Splitter#3",
         },
         "pin2": {
           "compName": "dff4_finewe#0",
-          "pinName": "Q2"
+          "pinName": "Q3"
         },
         "name": "unnamedWire#1",
         "path": []
         },
         "pin2": {
           "compName": "dff4_finewe#0",
-          "pinName": "Q3"
+          "pinName": "Q2"
         },
         "name": "unnamedWire#2",
         "path": []
       {
         "pin1": {
           "compName": "dff4_finewe#0",
-          "pinName": "Q4"
+          "pinName": "Q1"
         },
         "pin2": {
           "compName": "WireCrossPoint#3",
       {
         "pin1": {
           "compName": "dff4_finewe#0",
-          "pinName": "_WE1"
+          "pinName": "_WE4"
         },
         "pin2": {
           "compName": "_submodelinterface",
         },
         "pin2": {
           "compName": "dff4_finewe#0",
-          "pinName": "_WE4"
+          "pinName": "_WE1"
         },
         "name": "unnamedWire#38",
         "path": [
       {
         "pin1": {
           "compName": "dff4_finewe#0",
-          "pinName": "_WE3"
+          "pinName": "_WE2"
         },
         "pin2": {
           "compName": "_submodelinterface",
         },
         "pin2": {
           "compName": "dff4_finewe#0",
-          "pinName": "_WE2"
+          "pinName": "_WE3"
         },
         "name": "unnamedWire#40",
         "path": [
       {
         "pin1": {
           "compName": "dff4_finewe#0",
-          "pinName": "D1"
+          "pinName": "D4"
         },
         "pin2": {
           "compName": "mux1_4#1",
         },
         "pin2": {
           "compName": "dff4_finewe#0",
-          "pinName": "D2"
+          "pinName": "D3"
         },
         "name": "unnamedWire#42",
         "path": [
       {
         "pin1": {
           "compName": "dff4_finewe#0",
-          "pinName": "D3"
+          "pinName": "D2"
         },
         "pin2": {
           "compName": "mux1_4#1",
         },
         "pin2": {
           "compName": "dff4_finewe#0",
-          "pinName": "D4"
+          "pinName": "D1"
         },
         "name": "unnamedWire#45",
         "path": [
index 222d667..0519d7f 100644 (file)
         "id": "Am2910SP",
         "name": "Am2910SP#0",
         "pos": {
-          "x": 240.0,
+          "x": 245.0,
           "y": 10.0
         }
       },
         "id": "Am2910InstrPLA",
         "name": "Am2910InstrPLA#0",
         "pos": {
-          "x": 70.0,
+          "x": 30.0,
           "y": 90.0
         }
       },
         "name": "NandGate#2",
         "pos": {
           "x": 205.0,
-          "y": 195.0
+          "y": 200.0
         },
         "params": 1
       },
         "name": "TriStateBuffer#0",
         "pos": {
           "x": 165.0,
-          "y": 180.0
+          "y": 185.0
         },
         "params": {
           "logicWidth": 12,
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#0",
         "pos": {
-          "x": 259.0,
+          "x": 264.0,
           "y": 99.0
         },
         "params": 12
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#1",
         "pos": {
-          "x": 224.0,
+          "x": 229.0,
           "y": 59.0
         },
         "params": 1
         "name": "WireCrossPoint#2",
         "pos": {
           "x": 174.0,
-          "y": 174.0
+          "y": 179.0
         },
         "params": 12
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#6",
         "pos": {
-          "x": 234.0,
+          "x": 239.0,
           "y": 34.0
         },
         "params": 1
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#8",
         "pos": {
-          "x": 234.0,
+          "x": 239.0,
           "y": 69.0
         },
         "params": 1
         "name": "WireCrossPoint#9",
         "pos": {
           "x": 199.0,
-          "y": 209.0
+          "y": 214.0
         },
         "params": 1
       },
         "id": "dff12",
         "name": "dff12#0",
         "pos": {
-          "x": 240.0,
+          "x": 245.0,
           "y": 105.0
         }
       },
       {
-        "id": "inc",
-        "name": "inc#0",
+        "id": "inc12",
+        "name": "inc12#0",
         "pos": {
-          "x": 240.0,
-          "y": 140.0
-        },
-        "params": 12
+          "x": 255.0,
+          "y": 165.0
+        }
       },
       {
         "id": "nor12",
         "name": "nor12#0",
         "pos": {
           "x": 175.0,
-          "y": 50.0
+          "y": 45.0
         }
       },
       {
         "id": "ram5_12",
         "name": "ram5_12#0",
         "pos": {
-          "x": 240.0,
+          "x": 245.0,
           "y": 55.0
         }
       },
       },
       {
         "pin1": {
-          "compName": "inc#0",
+          "compName": "inc12#0",
           "pinName": "Y"
         },
         "pin2": {
           "pinName": "D"
         },
         "name": "unnamedWire#4",
-        "path": []
+        "path": [
+          {
+            "x": 280.0,
+            "y": 180.0
+          },
+          {
+            "x": 280.0,
+            "y": 150.0
+          },
+          {
+            "x": 240.0,
+            "y": 150.0
+          },
+          {
+            "x": 240.0,
+            "y": 125.0
+          }
+        ]
       },
       {
         "pin1": {
           "compName": "dff12#0",
-          "pinName": "Y"
+          "pinName": "Q"
         },
         "pin2": {
           "compName": "WireCrossPoint#0",
           "pinName": ""
         },
         "name": "unnamedWire#5",
-        "path": []
+        "path": [
+          {
+            "x": 290.0,
+            "y": 125.0
+          },
+          {
+            "x": 290.0,
+            "y": 100.0
+          }
+        ]
       },
       {
         "pin1": {
         "name": "unnamedWire#10",
         "path": [
           {
-            "x": 215.0,
+            "x": 225.0,
             "y": 60.0
           },
           {
-            "x": 215.0,
-            "y": 75.0
+            "x": 225.0,
+            "y": 80.0
           },
           {
-            "x": 85.0,
-            "y": 75.0
+            "x": 70.0,
+            "y": 80.0
           }
         ]
       },
       {
         "pin1": {
           "compName": "Am2910InstrPLA#0",
-          "pinName": "RWE"
+          "pinName": "RLD"
         },
         "pin2": {
           "compName": "Am2910RegCntr#0",
-          "pinName": "WE"
+          "pinName": "LD"
         },
         "name": "unnamedWire#11",
         "path": [
           {
-            "x": 105.0,
+            "x": 115.0,
             "y": 95.0
           },
           {
-            "x": 105.0,
+            "x": 115.0,
             "y": 35.0
           }
         ]
         "name": "unnamedWire#12",
         "path": [
           {
-            "x": 110.0,
+            "x": 120.0,
             "y": 105.0
           },
           {
-            "x": 110.0,
+            "x": 120.0,
             "y": 45.0
           }
         ]
         "name": "unnamedWire#13",
         "path": [
           {
-            "x": 225.0,
+            "x": 230.0,
             "y": 155.0
           }
         ]
         "name": "unnamedWire#14",
         "path": [
           {
-            "x": 230.0,
+            "x": 235.0,
             "y": 165.0
           },
           {
-            "x": 230.0,
+            "x": 235.0,
             "y": 25.0
           }
         ]
         "name": "unnamedWire#15",
         "path": [
           {
-            "x": 225.0,
+            "x": 230.0,
             "y": 15.0
           }
         ]
           "pinName": ""
         },
         "pin2": {
-          "compName": "inc#0",
+          "compName": "inc12#0",
           "pinName": "A"
         },
         "name": "unnamedWire#18",
-        "path": [
-          {
-            "x": 260.0,
-            "y": 175.0
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
           },
           {
             "x": 65.0,
+            "y": 85.0
+          },
+          {
+            "x": 25.0,
+            "y": 85.0
+          },
+          {
+            "x": 25.0,
             "y": 95.0
           }
         ]
         "name": "unnamedWire#35",
         "path": [
           {
-            "x": 235.0,
-            "y": 115.0
+            "x": 240.0,
+            "y": 110.0
           }
         ]
       },
       },
       {
         "pin1": {
-          "compName": "inc#0",
+          "compName": "inc12#0",
           "pinName": "CI"
         },
         "pin2": {
           "pinName": "CI"
         },
         "name": "unnamedWire#41",
-        "path": []
+        "path": [
+          {
+            "x": 250.0,
+            "y": 170.0
+          },
+          {
+            "x": 250.0,
+            "y": 160.0
+          },
+          {
+            "x": 290.0,
+            "y": 160.0
+          },
+          {
+            "x": 290.0,
+            "y": 150.0
+          }
+        ]
       },
       {
         "pin1": {
         "name": "unnamedWire#42",
         "path": [
           {
-            "x": 75.0,
+            "x": 45.0,
             "y": 180.0
           },
           {
         "name": "unnamedWire#43",
         "path": [
           {
-            "x": 85.0,
+            "x": 55.0,
             "y": 185.0
           },
           {
         "name": "unnamedWire#44",
         "path": [
           {
-            "x": 95.0,
-            "y": 190.0
+            "x": 65.0,
+            "y": 180.0
           },
           {
             "x": 100.0,
-            "y": 190.0
+            "y": 180.0
           }
         ]
       },
         "name": "unnamedWire#45",
         "path": [
           {
-            "x": 35.0,
+            "x": 25.0,
             "y": 125.0
           },
           {
-            "x": 35.0,
+            "x": 25.0,
             "y": 110.0
           }
         ]
         "path": [
           {
             "x": 200.0,
-            "y": 200.0
+            "y": 205.0
           }
         ]
       },
         "path": [
           {
             "x": 230.0,
-            "y": 190.0
+            "y": 195.0
           },
           {
             "x": 230.0,
-            "y": 205.0
+            "y": 210.0
           }
         ]
       }
diff --git a/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2910/Am2910InstrPLA.json b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2910/Am2910InstrPLA.json
new file mode 100644 (file)
index 0000000..2baa46f
--- /dev/null
@@ -0,0 +1,4920 @@
+{
+  "width": 80.0,
+  "height": 85.0,
+  "interfacePins": [
+    {
+      "location": {
+        "x": 0.0,
+        "y": 20.0
+      },
+      "name": "I",
+      "logicWidth": 4,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 5.0
+      },
+      "name": "PASS",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 40.0,
+        "y": 0.0
+      },
+      "name": "R\u003d0",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 80.0,
+        "y": 15.0
+      },
+      "name": "RDEC",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 80.0,
+        "y": 5.0
+      },
+      "name": "RLD",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 80.0,
+        "y": 65.0
+      },
+      "name": "STKI0",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 80.0,
+        "y": 75.0
+      },
+      "name": "STKI1",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 80.0,
+        "y": 25.0
+      },
+      "name": "YD",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 80.0,
+        "y": 45.0
+      },
+      "name": "YF",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 80.0,
+        "y": 35.0
+      },
+      "name": "YR",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 80.0,
+        "y": 55.0
+      },
+      "name": "YmuPC",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 25.0,
+        "y": 85.0
+      },
+      "name": "_MAP",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 15.0,
+        "y": 85.0
+      },
+      "name": "_PL",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 35.0,
+        "y": 85.0
+      },
+      "name": "_VECT",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    }
+  ],
+  "innerScale": 0.1,
+  "submodel": {
+    "components": [
+      {
+        "id": "NandGate",
+        "name": "NandGate#0",
+        "pos": {
+          "x": 45.0,
+          "y": 105.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#1",
+        "pos": {
+          "x": 45.0,
+          "y": 130.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#2",
+        "pos": {
+          "x": 45.0,
+          "y": 190.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#3",
+        "pos": {
+          "x": 130.0,
+          "y": 330.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#4",
+        "pos": {
+          "x": 45.0,
+          "y": 160.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#5",
+        "pos": {
+          "x": 170.0,
+          "y": 75.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#6",
+        "pos": {
+          "x": 140.0,
+          "y": 95.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#7",
+        "pos": {
+          "x": 140.0,
+          "y": 70.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#8",
+        "pos": {
+          "x": 10.0,
+          "y": 10.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#9",
+        "pos": {
+          "x": 85.0,
+          "y": 5.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#10",
+        "pos": {
+          "x": 135.0,
+          "y": 280.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#11",
+        "pos": {
+          "x": 165.0,
+          "y": 285.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#12",
+        "pos": {
+          "x": 195.0,
+          "y": 280.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#13",
+        "pos": {
+          "x": 490.0,
+          "y": 285.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#14",
+        "pos": {
+          "x": 225.0,
+          "y": 285.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#15",
+        "pos": {
+          "x": 195.0,
+          "y": 190.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#16",
+        "pos": {
+          "x": 135.0,
+          "y": 200.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#17",
+        "pos": {
+          "x": 255.0,
+          "y": 90.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#18",
+        "pos": {
+          "x": 165.0,
+          "y": 200.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#19",
+        "pos": {
+          "x": 225.0,
+          "y": 190.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#20",
+        "pos": {
+          "x": 220.0,
+          "y": 45.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#21",
+        "pos": {
+          "x": 255.0,
+          "y": 280.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#22",
+        "pos": {
+          "x": 255.0,
+          "y": 115.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#23",
+        "pos": {
+          "x": 255.0,
+          "y": 190.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#24",
+        "pos": {
+          "x": 290.0,
+          "y": 115.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#25",
+        "pos": {
+          "x": 135.0,
+          "y": 225.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#26",
+        "pos": {
+          "x": 95.0,
+          "y": 130.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#27",
+        "pos": {
+          "x": 165.0,
+          "y": 230.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#28",
+        "pos": {
+          "x": 195.0,
+          "y": 235.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#29",
+        "pos": {
+          "x": 45.0,
+          "y": 225.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#30",
+        "pos": {
+          "x": 225.0,
+          "y": 235.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#31",
+        "pos": {
+          "x": 290.0,
+          "y": 245.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#32",
+        "pos": {
+          "x": 255.0,
+          "y": 250.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#33",
+        "pos": {
+          "x": 325.0,
+          "y": 165.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#34",
+        "pos": {
+          "x": 295.0,
+          "y": 170.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#35",
+        "pos": {
+          "x": 250.0,
+          "y": 145.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#36",
+        "pos": {
+          "x": 220.0,
+          "y": 150.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#37",
+        "pos": {
+          "x": 115.0,
+          "y": 20.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#38",
+        "pos": {
+          "x": 95.0,
+          "y": 60.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#39",
+        "pos": {
+          "x": 45.0,
+          "y": 15.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#40",
+        "pos": {
+          "x": 145.0,
+          "y": 30.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#41",
+        "pos": {
+          "x": 240.0,
+          "y": 445.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#42",
+        "pos": {
+          "x": 285.0,
+          "y": 460.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#43",
+        "pos": {
+          "x": 510.0,
+          "y": 455.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#44",
+        "pos": {
+          "x": 545.0,
+          "y": 455.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#45",
+        "pos": {
+          "x": 320.0,
+          "y": 295.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#46",
+        "pos": {
+          "x": 360.0,
+          "y": 305.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#47",
+        "pos": {
+          "x": 320.0,
+          "y": 320.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#48",
+        "pos": {
+          "x": 390.0,
+          "y": 315.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#49",
+        "pos": {
+          "x": 425.0,
+          "y": 340.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#50",
+        "pos": {
+          "x": 510.0,
+          "y": 430.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#51",
+        "pos": {
+          "x": 380.0,
+          "y": 345.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#52",
+        "pos": {
+          "x": 340.0,
+          "y": 375.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#53",
+        "pos": {
+          "x": 270.0,
+          "y": 375.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#54",
+        "pos": {
+          "x": 325.0,
+          "y": 60.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#55",
+        "pos": {
+          "x": 410.0,
+          "y": 195.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#56",
+        "pos": {
+          "x": 445.0,
+          "y": 240.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#57",
+        "pos": {
+          "x": 380.0,
+          "y": 260.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#58",
+        "pos": {
+          "x": 415.0,
+          "y": 230.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#59",
+        "pos": {
+          "x": 485.0,
+          "y": 255.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#60",
+        "pos": {
+          "x": 520.0,
+          "y": 265.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#61",
+        "pos": {
+          "x": 335.0,
+          "y": 105.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#62",
+        "pos": {
+          "x": 300.0,
+          "y": 35.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#63",
+        "pos": {
+          "x": 390.0,
+          "y": 50.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#64",
+        "pos": {
+          "x": 435.0,
+          "y": 65.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#65",
+        "pos": {
+          "x": 500.0,
+          "y": 80.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#66",
+        "pos": {
+          "x": 465.0,
+          "y": 110.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#67",
+        "pos": {
+          "x": 130.0,
+          "y": 380.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#68",
+        "pos": {
+          "x": 130.0,
+          "y": 355.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#69",
+        "pos": {
+          "x": 160.0,
+          "y": 355.0
+        },
+        "params": 1
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#0",
+        "pos": {
+          "x": 10.0,
+          "y": 85.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#0",
+        "pos": {
+          "x": 24.0,
+          "y": 109.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#1",
+        "pos": {
+          "x": 29.0,
+          "y": 94.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#2",
+        "pos": {
+          "x": 34.0,
+          "y": 359.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#3",
+        "pos": {
+          "x": 29.0,
+          "y": 134.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#4",
+        "pos": {
+          "x": 39.0,
+          "y": 194.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#5",
+        "pos": {
+          "x": 124.0,
+          "y": 344.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#6",
+        "pos": {
+          "x": 34.0,
+          "y": 104.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#7",
+        "pos": {
+          "x": 34.0,
+          "y": 174.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#8",
+        "pos": {
+          "x": 34.0,
+          "y": 164.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#9",
+        "pos": {
+          "x": 24.0,
+          "y": 99.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#10",
+        "pos": {
+          "x": 74.0,
+          "y": 139.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#11",
+        "pos": {
+          "x": 24.0,
+          "y": 84.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#12",
+        "pos": {
+          "x": 39.0,
+          "y": 114.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#13",
+        "pos": {
+          "x": 89.0,
+          "y": 84.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#14",
+        "pos": {
+          "x": 79.0,
+          "y": 164.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#15",
+        "pos": {
+          "x": 84.0,
+          "y": 199.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#16",
+        "pos": {
+          "x": 29.0,
+          "y": 144.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#17",
+        "pos": {
+          "x": 39.0,
+          "y": 19.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#18",
+        "pos": {
+          "x": 69.0,
+          "y": 134.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#19",
+        "pos": {
+          "x": 74.0,
+          "y": 204.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#20",
+        "pos": {
+          "x": 24.0,
+          "y": 119.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#21",
+        "pos": {
+          "x": 34.0,
+          "y": 304.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#22",
+        "pos": {
+          "x": 24.0,
+          "y": 294.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#23",
+        "pos": {
+          "x": 39.0,
+          "y": 204.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#24",
+        "pos": {
+          "x": 124.0,
+          "y": 369.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#25",
+        "pos": {
+          "x": 79.0,
+          "y": 169.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#26",
+        "pos": {
+          "x": 74.0,
+          "y": 264.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#27",
+        "pos": {
+          "x": 4.0,
+          "y": 24.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#28",
+        "pos": {
+          "x": 124.0,
+          "y": 214.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#29",
+        "pos": {
+          "x": 74.0,
+          "y": 284.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#30",
+        "pos": {
+          "x": 214.0,
+          "y": 74.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#31",
+        "pos": {
+          "x": 129.0,
+          "y": 64.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#32",
+        "pos": {
+          "x": 134.0,
+          "y": 154.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#33",
+        "pos": {
+          "x": 129.0,
+          "y": 74.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#34",
+        "pos": {
+          "x": 134.0,
+          "y": 109.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#35",
+        "pos": {
+          "x": 34.0,
+          "y": 89.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#36",
+        "pos": {
+          "x": 214.0,
+          "y": 49.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#37",
+        "pos": {
+          "x": 214.0,
+          "y": 59.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#38",
+        "pos": {
+          "x": 249.0,
+          "y": 199.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#39",
+        "pos": {
+          "x": 79.0,
+          "y": 144.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#40",
+        "pos": {
+          "x": 69.0,
+          "y": 114.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#41",
+        "pos": {
+          "x": 129.0,
+          "y": 269.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#42",
+        "pos": {
+          "x": 79.0,
+          "y": 64.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#43",
+        "pos": {
+          "x": 4.0,
+          "y": 239.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#44",
+        "pos": {
+          "x": 24.0,
+          "y": 229.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#45",
+        "pos": {
+          "x": 84.0,
+          "y": 214.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#46",
+        "pos": {
+          "x": 29.0,
+          "y": 154.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#47",
+        "pos": {
+          "x": 214.0,
+          "y": 104.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#48",
+        "pos": {
+          "x": 39.0,
+          "y": 64.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#49",
+        "pos": {
+          "x": 109.0,
+          "y": 24.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#50",
+        "pos": {
+          "x": 109.0,
+          "y": 14.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#51",
+        "pos": {
+          "x": 79.0,
+          "y": 49.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#52",
+        "pos": {
+          "x": 24.0,
+          "y": 184.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#53",
+        "pos": {
+          "x": 154.0,
+          "y": 364.0
+        },
+        "params": 1
+      },
+      {
+        "id": "and",
+        "name": "and#0",
+        "pos": {
+          "x": 425.0,
+          "y": 125.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#1",
+        "pos": {
+          "x": 530.0,
+          "y": 120.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#2",
+        "pos": {
+          "x": 45.0,
+          "y": 75.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#3",
+        "pos": {
+          "x": 80.0,
+          "y": 390.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#4",
+        "pos": {
+          "x": 95.0,
+          "y": 210.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#5",
+        "pos": {
+          "x": 95.0,
+          "y": 105.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#6",
+        "pos": {
+          "x": 45.0,
+          "y": 50.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#7",
+        "pos": {
+          "x": 220.0,
+          "y": 70.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#8",
+        "pos": {
+          "x": 95.0,
+          "y": 160.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#9",
+        "pos": {
+          "x": 140.0,
+          "y": 150.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#10",
+        "pos": {
+          "x": 220.0,
+          "y": 20.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#11",
+        "pos": {
+          "x": 95.0,
+          "y": 280.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#12",
+        "pos": {
+          "x": 140.0,
+          "y": 120.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#13",
+        "pos": {
+          "x": 220.0,
+          "y": 100.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#14",
+        "pos": {
+          "x": 315.0,
+          "y": 410.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#15",
+        "pos": {
+          "x": 340.0,
+          "y": 345.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#16",
+        "pos": {
+          "x": 435.0,
+          "y": 290.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#17",
+        "pos": {
+          "x": 365.0,
+          "y": 120.0
+        }
+      },
+      {
+        "id": "and",
+        "name": "and#18",
+        "pos": {
+          "x": 395.0,
+          "y": 85.0
+        }
+      }
+    ],
+    "wires": [
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#0",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O3"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#11",
+          "pinName": ""
+        },
+        "name": "unnamedWire#1",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#16",
+          "pinName": ""
+        },
+        "name": "unnamedWire#2",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O1"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#6",
+          "pinName": ""
+        },
+        "name": "unnamedWire#3",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#12",
+          "pinName": ""
+        },
+        "name": "unnamedWire#4",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#20",
+          "pinName": ""
+        },
+        "name": "unnamedWire#5",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#9",
+          "pinName": ""
+        },
+        "name": "unnamedWire#6",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "name": "unnamedWire#7",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#2",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#8",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#2",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#9",
+        "path": [
+          {
+            "x": 30.0,
+            "y": 80.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#1",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#10",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "name": "unnamedWire#11",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#68",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#12",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#2",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#15",
+          "pinName": ""
+        },
+        "name": "unnamedWire#13",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#5",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#24",
+          "pinName": ""
+        },
+        "name": "unnamedWire#14",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#23",
+          "pinName": ""
+        },
+        "name": "unnamedWire#15",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#0",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#40",
+          "pinName": ""
+        },
+        "name": "unnamedWire#16",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#1",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#10",
+          "pinName": ""
+        },
+        "name": "unnamedWire#17",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#3",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#18",
+        "path": [
+          {
+            "x": 35.0,
+            "y": 395.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "and#4",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#28",
+          "pinName": ""
+        },
+        "name": "unnamedWire#19",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#5",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#3",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#20",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#3",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#67",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#21",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#67",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "_MAP"
+        },
+        "name": "unnamedWire#22",
+        "path": [
+          {
+            "x": 250.0,
+            "y": 390.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "and#2",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#13",
+          "pinName": ""
+        },
+        "name": "unnamedWire#23",
+        "path": [
+          {
+            "x": 90.0,
+            "y": 80.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#3",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "_VECT"
+        },
+        "name": "unnamedWire#24",
+        "path": [
+          {
+            "x": 350.0,
+            "y": 340.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#6",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#35",
+          "pinName": ""
+        },
+        "name": "unnamedWire#25",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#24",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#68",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#26",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#7",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#21",
+          "pinName": ""
+        },
+        "name": "unnamedWire#27",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#69",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "_PL"
+        },
+        "name": "unnamedWire#28",
+        "path": [
+          {
+            "x": 185.0,
+            "y": 365.0
+          },
+          {
+            "x": 185.0,
+            "y": 415.0
+          },
+          {
+            "x": 150.0,
+            "y": 415.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#8",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#7",
+          "pinName": ""
+        },
+        "name": "unnamedWire#29",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "R\u003d0"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#36",
+          "pinName": ""
+        },
+        "name": "unnamedWire#30",
+        "path": [
+          {
+            "x": 200.0,
+            "y": 10.0
+          },
+          {
+            "x": 215.0,
+            "y": 10.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#6",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#8",
+          "pinName": ""
+        },
+        "name": "unnamedWire#31",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#7",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#4",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#32",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#8",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#4",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#33",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#4",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#25",
+          "pinName": ""
+        },
+        "name": "unnamedWire#34",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#0",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#35",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#10",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#5",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#36",
+        "path": [
+          {
+            "x": 75.0,
+            "y": 110.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "and#5",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#34",
+          "pinName": ""
+        },
+        "name": "unnamedWire#37",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#10",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#19",
+          "pinName": ""
+        },
+        "name": "unnamedWire#38",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#9",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#11",
+          "pinName": ""
+        },
+        "name": "unnamedWire#39",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#6",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#5",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#40",
+        "path": [
+          {
+            "x": 165.0,
+            "y": 105.0
+          },
+          {
+            "x": 165.0,
+            "y": 90.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#7",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#5",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#41",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#7",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "RDEC"
+        },
+        "name": "unnamedWire#42",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#7",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "NandGate#5",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#43",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#9",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#6",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#44",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#11",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#6",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#45",
+        "path": [
+          {
+            "x": 25.0,
+            "y": 55.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#12",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "name": "unnamedWire#46",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#12",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#48",
+          "pinName": ""
+        },
+        "name": "unnamedWire#47",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#13",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#3",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#48",
+        "path": [
+          {
+            "x": 90.0,
+            "y": 335.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#13",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#7",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#49",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#6",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#31",
+          "pinName": ""
+        },
+        "name": "unnamedWire#50",
+        "path": [
+          {
+            "x": 130.0,
+            "y": 55.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#14",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#39",
+          "pinName": ""
+        },
+        "name": "unnamedWire#51",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#14",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#8",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#52",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#45",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#4",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#53",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#15",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#8",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#54",
+        "path": [
+          {
+            "x": 85.0,
+            "y": 175.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#16",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#1",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#55",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#8",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "and#9",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#56",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#16",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#46",
+          "pinName": ""
+        },
+        "name": "unnamedWire#57",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "PASS"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#27",
+          "pinName": ""
+        },
+        "name": "unnamedWire#58",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#27",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#8",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#59",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#27",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#8",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#60",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 15.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#18",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#4",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#61",
+        "path": [
+          {
+            "x": 70.0,
+            "y": 225.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#17",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#39",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#62",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#18",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#40",
+          "pinName": ""
+        },
+        "name": "unnamedWire#63",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#10",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "RLD"
+        },
+        "name": "unnamedWire#64",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#9",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#50",
+          "pinName": ""
+        },
+        "name": "unnamedWire#65",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#10",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "and#9",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#66",
+        "path": [
+          {
+            "x": 195.0,
+            "y": 35.0
+          },
+          {
+            "x": 195.0,
+            "y": 155.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#26",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#29",
+          "pinName": ""
+        },
+        "name": "unnamedWire#67",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#29",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#11",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#68",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#20",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#0",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#69",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#20",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#52",
+          "pinName": ""
+        },
+        "name": "unnamedWire#70",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#11",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#10",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#71",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#21",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#10",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#72",
+        "path": [
+          {
+            "x": 130.0,
+            "y": 305.0
+          },
+          {
+            "x": 130.0,
+            "y": 295.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#21",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "name": "unnamedWire#73",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#10",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#11",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#74",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#22",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#11",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#75",
+        "path": [
+          {
+            "x": 25.0,
+            "y": 310.0
+          },
+          {
+            "x": 160.0,
+            "y": 310.0
+          },
+          {
+            "x": 160.0,
+            "y": 300.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#22",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#11",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#76",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#23",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#2",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#77",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#23",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#12",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#78",
+        "path": [
+          {
+            "x": 40.0,
+            "y": 275.0
+          },
+          {
+            "x": 190.0,
+            "y": 275.0
+          },
+          {
+            "x": 190.0,
+            "y": 285.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#11",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#12",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#79",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#24",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#67",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#80",
+        "path": [
+          {
+            "x": 125.0,
+            "y": 385.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#12",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#14",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#81",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#68",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#14",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#82",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#5",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#28",
+          "pinName": ""
+        },
+        "name": "unnamedWire#83",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#16",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#13",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#84",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#52",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#13",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#85",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#44",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#16",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#86",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#35",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#2",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#87",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#27",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#43",
+          "pinName": ""
+        },
+        "name": "unnamedWire#88",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#14",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#21",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#89",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#15",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "and#16",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#90",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#24",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "YD"
+        },
+        "name": "unnamedWire#91",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#29",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#3",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#92",
+        "path": [
+          {
+            "x": 75.0,
+            "y": 405.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#19",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#16",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#93",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#31",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#17",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#94",
+        "path": [
+          {
+            "x": 205.0,
+            "y": 65.0
+          },
+          {
+            "x": 205.0,
+            "y": 95.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#30",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#47",
+          "pinName": ""
+        },
+        "name": "unnamedWire#95",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#32",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#13",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#96",
+        "path": [
+          {
+            "x": 135.0,
+            "y": 145.0
+          },
+          {
+            "x": 175.0,
+            "y": 145.0
+          },
+          {
+            "x": 175.0,
+            "y": 115.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "and#13",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#17",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#97",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#32",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#9",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#98",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#30",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#7",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#99",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#31",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#33",
+          "pinName": ""
+        },
+        "name": "unnamedWire#100",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#17",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#18",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#101",
+        "path": [
+          {
+            "x": 280.0,
+            "y": 100.0
+          },
+          {
+            "x": 280.0,
+            "y": 180.0
+          },
+          {
+            "x": 160.0,
+            "y": 180.0
+          },
+          {
+            "x": 160.0,
+            "y": 205.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#16",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#18",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#102",
+        "path": [
+          {
+            "x": 160.0,
+            "y": 210.0
+          },
+          {
+            "x": 160.0,
+            "y": 215.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#35",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#39",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#103",
+        "path": [
+          {
+            "x": 35.0,
+            "y": 30.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#8",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#17",
+          "pinName": ""
+        },
+        "name": "unnamedWire#104",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#38",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#15",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#105",
+        "path": [
+          {
+            "x": 125.0,
+            "y": 70.0
+          },
+          {
+            "x": 125.0,
+            "y": 195.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#18",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#15",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#106",
+        "path": [
+          {
+            "x": 190.0,
+            "y": 210.0
+          },
+          {
+            "x": 190.0,
+            "y": 205.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#19",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "NandGate#15",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#107",
+        "path": [
+          {
+            "x": 220.0,
+            "y": 195.0
+          },
+          {
+            "x": 220.0,
+            "y": 200.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#19",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "NandGate#21",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#108",
+        "path": [
+          {
+            "x": 220.0,
+            "y": 205.0
+          },
+          {
+            "x": 220.0,
+            "y": 215.0
+          },
+          {
+            "x": 285.0,
+            "y": 215.0
+          },
+          {
+            "x": 285.0,
+            "y": 290.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#33",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#12",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#109",
+        "path": [
+          {
+            "x": 130.0,
+            "y": 125.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#34",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#12",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#110",
+        "path": [
+          {
+            "x": 135.0,
+            "y": 135.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#36",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#20",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#111",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#37",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#20",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#112",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#20",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#22",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#113",
+        "path": [
+          {
+            "x": 250.0,
+            "y": 55.0
+          },
+          {
+            "x": 250.0,
+            "y": 120.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "and#12",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#22",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#114",
+        "path": [
+          {
+            "x": 170.0,
+            "y": 125.0
+          },
+          {
+            "x": 170.0,
+            "y": 130.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#19",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#38",
+          "pinName": ""
+        },
+        "name": "unnamedWire#115",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#38",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#23",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#116",
+        "path": [
+          {
+            "x": 250.0,
+            "y": 195.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#22",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#24",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#117",
+        "path": [
+          {
+            "x": 285.0,
+            "y": 125.0
+          },
+          {
+            "x": 285.0,
+            "y": 120.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#24",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "NandGate#23",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#118",
+        "path": [
+          {
+            "x": 285.0,
+            "y": 130.0
+          },
+          {
+            "x": 285.0,
+            "y": 200.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#28",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#16",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#119",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#33",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#7",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#120",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#34",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#6",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#121",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#17",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#9",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#122",
+        "path": [
+          {
+            "x": 40.0,
+            "y": 10.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#36",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#37",
+          "pinName": ""
+        },
+        "name": "unnamedWire#123",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#37",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#30",
+          "pinName": ""
+        },
+        "name": "unnamedWire#124",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#38",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#23",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#125",
+        "path": [
+          {
+            "x": 250.0,
+            "y": 205.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#39",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#5",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#126",
+        "path": [
+          {
+            "x": 80.0,
+            "y": 120.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#18",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#26",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#127",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#39",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#26",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#128",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#40",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#9",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#129",
+        "path": [
+          {
+            "x": 70.0,
+            "y": 105.0
+          },
+          {
+            "x": 75.0,
+            "y": 105.0
+          },
+          {
+            "x": 75.0,
+            "y": 20.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#26",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#25",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#130",
+        "path": [
+          {
+            "x": 130.0,
+            "y": 140.0
+          },
+          {
+            "x": 130.0,
+            "y": 230.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#41",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#21",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#131",
+        "path": [
+          {
+            "x": 250.0,
+            "y": 270.0
+          },
+          {
+            "x": 250.0,
+            "y": 285.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#41",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#25",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#132",
+        "path": [
+          {
+            "x": 130.0,
+            "y": 240.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#25",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#27",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#133",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#15",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#45",
+          "pinName": ""
+        },
+        "name": "unnamedWire#134",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#27",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#28",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#135",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#29",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#28",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#136",
+        "path": [
+          {
+            "x": 70.0,
+            "y": 235.0
+          },
+          {
+            "x": 70.0,
+            "y": 255.0
+          },
+          {
+            "x": 190.0,
+            "y": 255.0
+          },
+          {
+            "x": 190.0,
+            "y": 250.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#44",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#29",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#137",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#43",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#29",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#138",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#28",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#30",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#139",
+        "path": [
+          {
+            "x": 220.0,
+            "y": 245.0
+          },
+          {
+            "x": 220.0,
+            "y": 240.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#46",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#30",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#140",
+        "path": [
+          {
+            "x": 30.0,
+            "y": 260.0
+          },
+          {
+            "x": 220.0,
+            "y": 260.0
+          },
+          {
+            "x": 220.0,
+            "y": 250.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#30",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#31",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#141",
+        "path": [
+          {
+            "x": 280.0,
+            "y": 245.0
+          },
+          {
+            "x": 280.0,
+            "y": 250.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#31",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "YmuPC"
+        },
+        "name": "unnamedWire#142",
+        "path": [
+          {
+            "x": 350.0,
+            "y": 255.0
+          },
+          {
+            "x": 350.0,
+            "y": 275.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#32",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#31",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#143",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#26",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#32",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#144",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#33",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#32",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#145",
+        "path": [
+          {
+            "x": 350.0,
+            "y": 175.0
+          },
+          {
+            "x": 350.0,
+            "y": 240.0
+          },
+          {
+            "x": 250.0,
+            "y": 240.0
+          },
+          {
+            "x": 250.0,
+            "y": 255.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#34",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#33",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#146",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#52",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#34",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#147",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#35",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#34",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#148",
+        "path": [
+          {
+            "x": 290.0,
+            "y": 155.0
+          },
+          {
+            "x": 290.0,
+            "y": 175.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#36",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#35",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#149",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#47",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#36",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#150",
+        "path": [
+          {
+            "x": 215.0,
+            "y": 155.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#25",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#36",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#151",
+        "path": [
+          {
+            "x": 80.0,
+            "y": 190.0
+          },
+          {
+            "x": 135.0,
+            "y": 190.0
+          },
+          {
+            "x": 135.0,
+            "y": 175.0
+          },
+          {
+            "x": 195.0,
+            "y": 175.0
+          },
+          {
+            "x": 195.0,
+            "y": 165.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#39",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#51",
+          "pinName": ""
+        },
+        "name": "unnamedWire#152",
+        "path": [
+          {
+            "x": 80.0,
+            "y": 25.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#42",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#38",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#153",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#42",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#38",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#154",
+        "path": [
+          {
+            "x": 80.0,
+            "y": 75.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#51",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#35",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#155",
+        "path": [
+          {
+            "x": 135.0,
+            "y": 50.0
+          },
+          {
+            "x": 135.0,
+            "y": 60.0
+          },
+          {
+            "x": 200.0,
+            "y": 60.0
+          },
+          {
+            "x": 200.0,
+            "y": 145.0
+          },
+          {
+            "x": 245.0,
+            "y": 145.0
+          },
+          {
+            "x": 245.0,
+            "y": 150.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#50",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#49",
+          "pinName": ""
+        },
+        "name": "unnamedWire#156",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#50",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#10",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#157",
+        "path": [
+          {
+            "x": 140.0,
+            "y": 15.0
+          },
+          {
+            "x": 140.0,
+            "y": 25.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#40",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#33",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#158",
+        "path": [
+          {
+            "x": 210.0,
+            "y": 40.0
+          },
+          {
+            "x": 210.0,
+            "y": 140.0
+          },
+          {
+            "x": 320.0,
+            "y": 140.0
+          },
+          {
+            "x": 320.0,
+            "y": 170.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#40",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "NandGate#37",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#159",
+        "path": [
+          {
+            "x": 140.0,
+            "y": 35.0
+          },
+          {
+            "x": 140.0,
+            "y": 30.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#48",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#40",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#160",
+        "path": [
+          {
+            "x": 40.0,
+            "y": 45.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#43",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#41",
+          "pinName": ""
+        },
+        "name": "unnamedWire#161",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 270.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#44",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#22",
+          "pinName": ""
+        },
+        "name": "unnamedWire#162",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#45",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#27",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#163",
+        "path": [
+          {
+            "x": 85.0,
+            "y": 250.0
+          },
+          {
+            "x": 160.0,
+            "y": 250.0
+          },
+          {
+            "x": 160.0,
+            "y": 245.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#46",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#32",
+          "pinName": ""
+        },
+        "name": "unnamedWire#164",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#47",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#13",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#165",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#48",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#6",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#166",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#49",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#37",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#167",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#49",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#37",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#168",
+        "path": [
+          {
+            "x": 110.0,
+            "y": 35.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#51",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#42",
+          "pinName": ""
+        },
+        "name": "unnamedWire#169",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#52",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#44",
+          "pinName": ""
+        },
+        "name": "unnamedWire#170",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#25",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#14",
+          "pinName": ""
+        },
+        "name": "unnamedWire#171",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#19",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#26",
+          "pinName": ""
+        },
+        "name": "unnamedWire#172",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#23",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#41",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#173",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#43",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#41",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#174",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#41",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#42",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#175",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#29",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#42",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#176",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#42",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#43",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#177",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#43",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "and#14",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#178",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#14",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#18",
+          "pinName": ""
+        },
+        "name": "unnamedWire#179",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#14",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#25",
+          "pinName": ""
+        },
+        "name": "unnamedWire#180",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#43",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#44",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#181",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#44",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "STKI0"
+        },
+        "name": "unnamedWire#182",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#45",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "and#8",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#183",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#47",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#45",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#184",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#45",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#46",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#185",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#47",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#46",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#186",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#47",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#21",
+          "pinName": ""
+        },
+        "name": "unnamedWire#187",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#43",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#47",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#188",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#46",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#48",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#189",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#29",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#48",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#190",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#48",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#49",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#191",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#49",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#50",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#192",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#50",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#44",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#193",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#50",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#22",
+          "pinName": ""
+        },
+        "name": "unnamedWire#194",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#51",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#49",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#195",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#46",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#15",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#196",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#15",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#23",
+          "pinName": ""
+        },
+        "name": "unnamedWire#197",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#15",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#51",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#198",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#52",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#51",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#199",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#52",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#17",
+          "pinName": ""
+        },
+        "name": "unnamedWire#200",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#53",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#52",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#201",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#53",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#47",
+          "pinName": ""
+        },
+        "name": "unnamedWire#202",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#53",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#21",
+          "pinName": ""
+        },
+        "name": "unnamedWire#203",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#11",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#54",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#204",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#20",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#54",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#205",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#54",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#55",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#206",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#8",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#55",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#207",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#55",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#56",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#208",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#47",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#57",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#209",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#57",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "NandGate#47",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#210",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#57",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#58",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#211",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#58",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#22",
+          "pinName": ""
+        },
+        "name": "unnamedWire#212",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#58",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#56",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#213",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#56",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#59",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#214",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#59",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#10",
+          "pinName": ""
+        },
+        "name": "unnamedWire#215",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#59",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#60",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#216",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#60",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "STKI1"
+        },
+        "name": "unnamedWire#217",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#13",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#60",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#218",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#40",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#61",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#219",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#17",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#220",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#17",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "YR"
+        },
+        "name": "unnamedWire#221",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#61",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "NandGate#40",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#222",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#61",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "and#17",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#223",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#20",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#62",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#224",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#62",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#39",
+          "pinName": ""
+        },
+        "name": "unnamedWire#225",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#62",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#63",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#226",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#47",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#63",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#227",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#63",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#64",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#228",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#18",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#10",
+          "pinName": ""
+        },
+        "name": "unnamedWire#229",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#15",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#18",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#230",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#18",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#64",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#231",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#64",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#65",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#232",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#65",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "and#1",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#233",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#1",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "YF"
+        },
+        "name": "unnamedWire#234",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#11",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "and#1",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#235",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#66",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#65",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#236",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#53",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#66",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#237",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#0",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#66",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#238",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#0",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "and#15",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#239",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "and#0",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#17",
+          "pinName": ""
+        },
+        "name": "unnamedWire#240",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#68",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#53",
+          "pinName": ""
+        },
+        "name": "unnamedWire#241",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#53",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#69",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#242",
+        "path": [
+          {
+            "x": 155.0,
+            "y": 360.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#53",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#69",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#243",
+        "path": [
+          {
+            "x": 155.0,
+            "y": 370.0
+          }
+        ]
+      }
+    ],
+    "version": "0.1.1"
+  },
+  "symbolRendererSnippetID": "simpleRectangularLike",
+  "symbolRendererParams": {
+    "centerText": "Instruction\nPLA",
+    "centerTextHeight": 5.0,
+    "horizontalComponentCenter": 40.0,
+    "pinLabelHeight": 3.5,
+    "pinLabelMargin": 0.5
+  },
+  "outlineRendererSnippetID": "default",
+  "highLevelStateHandlerSnippetID": "default",
+  "version": "0.1.5"
+}
\ No newline at end of file
index 459bca8..c6b24d0 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "width": 35.0,
+  "width": 25.0,
   "height": 20.0,
   "interfacePins": [
     {
@@ -22,7 +22,7 @@
     },
     {
       "location": {
-        "x": 35.0,
+        "x": 25.0,
         "y": 5.0
       },
       "name": "Y",
@@ -37,7 +37,7 @@
         "id": "NandGate",
         "name": "NandGate#0",
         "pos": {
-          "x": 20.0,
+          "x": 10.0,
           "y": 15.0
         },
         "params": 1
@@ -46,7 +46,7 @@
         "id": "NandGate",
         "name": "NandGate#1",
         "pos": {
-          "x": 50.0,
+          "x": 35.0,
           "y": 15.0
         },
         "params": 1
@@ -55,7 +55,7 @@
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#0",
         "pos": {
-          "x": 44.0,
+          "x": 31.5,
           "y": 24.0
         },
         "params": 1
           "compName": "NandGate#0",
           "pinName": "A"
         },
-        "name": "unnamedWire#0"
+        "name": "unnamedWire#0",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 12.5
+          },
+          {
+            "x": 5.0,
+            "y": 20.0
+          }
+        ]
       },
       {
         "pin1": {
           "compName": "NandGate#0",
           "pinName": "B"
         },
-        "name": "unnamedWire#1"
+        "name": "unnamedWire#1",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 37.5
+          },
+          {
+            "x": 5.0,
+            "y": 30.0
+          }
+        ]
       },
       {
         "pin1": {
         "name": "unnamedWire#3",
         "path": [
           {
-            "x": 45.0,
+            "x": 32.5,
             "y": 20.0
           }
         ]
         "name": "unnamedWire#4",
         "path": [
           {
-            "x": 45.0,
+            "x": 32.5,
             "y": 30.0
           }
         ]
           "compName": "_submodelinterface",
           "pinName": "Y"
         },
-        "name": "unnamedWire#5"
+        "name": "unnamedWire#5",
+        "path": [
+          {
+            "x": 57.5,
+            "y": 25.0
+          },
+          {
+            "x": 57.5,
+            "y": 12.5
+          }
+        ]
       }
     ],
     "version": "0.1.1"
index f936d9e..d2ce1ab 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "width": 35.0,
+  "width": 15.0,
   "height": 50.0,
   "interfacePins": [
     {
@@ -49,7 +49,7 @@
     },
     {
       "location": {
-        "x": 35.0,
+        "x": 15.0,
         "y": 5.0
       },
       "name": "Y1",
@@ -58,7 +58,7 @@
     },
     {
       "location": {
-        "x": 35.0,
+        "x": 15.0,
         "y": 15.0
       },
       "name": "Y2",
@@ -67,7 +67,7 @@
     },
     {
       "location": {
-        "x": 35.0,
+        "x": 15.0,
         "y": 25.0
       },
       "name": "Y3",
@@ -76,7 +76,7 @@
     },
     {
       "location": {
-        "x": 35.0,
+        "x": 15.0,
         "y": 35.0
       },
       "name": "Y4",
@@ -91,7 +91,7 @@
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#0",
         "pos": {
-          "x": 24.0,
+          "x": 4.0,
           "y": 46.5
         },
         "params": 1
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#1",
         "pos": {
-          "x": 24.0,
+          "x": 4.0,
           "y": 71.5
         },
         "params": 1
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#2",
         "pos": {
-          "x": 24.0,
+          "x": 4.0,
           "y": 96.5
         },
         "params": 1
         "id": "and",
         "name": "and#0",
         "pos": {
-          "x": 30.0,
+          "x": 7.5,
           "y": 7.5
         }
       },
         "id": "and",
         "name": "and#1",
         "pos": {
-          "x": 30.0,
+          "x": 7.5,
           "y": 32.5
         }
       },
         "id": "and",
         "name": "and#2",
         "pos": {
-          "x": 30.0,
+          "x": 7.5,
           "y": 57.5
         }
       },
         "id": "and",
         "name": "and#3",
         "pos": {
-          "x": 30.0,
+          "x": 7.5,
           "y": 82.5
         }
       }
         "name": "unnamedWire#4",
         "path": [
           {
-            "x": 25.0,
+            "x": 5.0,
             "y": 112.5
           }
         ]
         "name": "unnamedWire#10",
         "path": [
           {
-            "x": 25.0,
+            "x": 5.0,
             "y": 22.5
           }
         ]
index 8bf2bfb..6a1554e 100644 (file)
         "name": "and41#0",
         "pos": {
           "x": 15.0,
-          "y": 137.5
+          "y": 142.5
         }
       },
       {
           },
           {
             "x": 10.0,
-            "y": 142.5
+            "y": 147.5
           }
         ]
       },
           },
           {
             "x": 5.0,
-            "y": 152.5
+            "y": 157.5
           }
         ]
       },
           "pinName": "A3"
         },
         "name": "unnamedWire#2",
-        "path": []
+        "path": [
+          {
+            "x": 10.0,
+            "y": 162.5
+          },
+          {
+            "x": 10.0,
+            "y": 167.5
+          }
+        ]
       },
       {
         "pin1": {
           },
           {
             "x": 5.0,
-            "y": 172.5
+            "y": 177.5
           }
         ]
       },
           },
           {
             "x": 10.0,
-            "y": 182.5
+            "y": 187.5
           }
         ]
       },
         "name": "unnamedWire#9",
         "path": [
           {
-            "x": 70.0,
-            "y": 142.5
+            "x": 50.0,
+            "y": 147.5
           },
           {
-            "x": 70.0,
-            "y": 120.0
+            "x": 50.0,
+            "y": 122.5
           },
           {
             "x": 30.0,
-            "y": 120.0
+            "y": 122.5
           },
           {
             "x": 30.0,
         "name": "unnamedWire#10",
         "path": [
           {
-            "x": 65.0,
-            "y": 152.5
+            "x": 45.0,
+            "y": 157.5
           },
           {
-            "x": 65.0,
-            "y": 125.0
+            "x": 45.0,
+            "y": 127.5
           },
           {
             "x": 25.0,
-            "y": 125.0
+            "y": 127.5
           },
           {
             "x": 25.0,
         "name": "unnamedWire#11",
         "path": [
           {
-            "x": 60.0,
-            "y": 162.5
+            "x": 40.0,
+            "y": 167.5
           },
           {
-            "x": 60.0,
-            "y": 130.0
+            "x": 40.0,
+            "y": 132.5
           },
           {
             "x": 20.0,
-            "y": 130.0
+            "y": 132.5
           },
           {
             "x": 20.0,
         "name": "unnamedWire#12",
         "path": [
           {
-            "x": 55.0,
-            "y": 172.5
+            "x": 35.0,
+            "y": 177.5
           },
           {
-            "x": 55.0,
-            "y": 135.0
+            "x": 35.0,
+            "y": 137.5
           },
           {
             "x": 15.0,
-            "y": 135.0
+            "y": 137.5
           },
           {
             "x": 15.0,
diff --git a/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff12.json b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff12.json
new file mode 100644 (file)
index 0000000..53e5c9a
--- /dev/null
@@ -0,0 +1,1260 @@
+{
+  "width": 40.0,
+  "height": 40.0,
+  "interfacePins": [
+    {
+      "location": {
+        "x": 0.0,
+        "y": 5.0
+      },
+      "name": "C",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 20.0
+      },
+      "name": "D",
+      "logicWidth": 12,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 40.0,
+        "y": 20.0
+      },
+      "name": "Q",
+      "logicWidth": 12,
+      "usage": "TRISTATE"
+    }
+  ],
+  "innerScale": 0.2,
+  "submodel": {
+    "components": [
+      {
+        "id": "Splitter",
+        "name": "Splitter#0",
+        "pos": {
+          "x": 5.0,
+          "y": 45.0
+        },
+        "params": {
+          "logicWidth": 12,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#1",
+        "pos": {
+          "x": 185.0,
+          "y": 45.0
+        },
+        "params": {
+          "logicWidth": 12,
+          "orientation": "LEFT"
+        }
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#0",
+        "pos": {
+          "x": 54.0,
+          "y": 24.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#1",
+        "pos": {
+          "x": 54.0,
+          "y": 49.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#2",
+        "pos": {
+          "x": 54.0,
+          "y": 109.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#3",
+        "pos": {
+          "x": 54.0,
+          "y": 139.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#4",
+        "pos": {
+          "x": 54.0,
+          "y": 79.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#5",
+        "pos": {
+          "x": 109.0,
+          "y": 189.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#6",
+        "pos": {
+          "x": 109.0,
+          "y": 69.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#7",
+        "pos": {
+          "x": 109.0,
+          "y": 159.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#8",
+        "pos": {
+          "x": 54.0,
+          "y": 169.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#9",
+        "pos": {
+          "x": 109.0,
+          "y": 99.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#10",
+        "pos": {
+          "x": 109.0,
+          "y": 129.0
+        },
+        "params": 1
+      },
+      {
+        "id": "dff",
+        "name": "dff#0",
+        "pos": {
+          "x": 115.0,
+          "y": 25.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#1",
+        "pos": {
+          "x": 115.0,
+          "y": 55.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#2",
+        "pos": {
+          "x": 60.0,
+          "y": 5.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#3",
+        "pos": {
+          "x": 60.0,
+          "y": 35.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#4",
+        "pos": {
+          "x": 60.0,
+          "y": 65.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#5",
+        "pos": {
+          "x": 115.0,
+          "y": 145.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#6",
+        "pos": {
+          "x": 115.0,
+          "y": 175.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#7",
+        "pos": {
+          "x": 60.0,
+          "y": 155.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#8",
+        "pos": {
+          "x": 60.0,
+          "y": 125.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#9",
+        "pos": {
+          "x": 115.0,
+          "y": 85.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#10",
+        "pos": {
+          "x": 115.0,
+          "y": 115.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#11",
+        "pos": {
+          "x": 60.0,
+          "y": 95.0
+        }
+      }
+    ],
+    "wires": [
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#6",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#0",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#0",
+        "path": [
+          {
+            "x": 110.0,
+            "y": 40.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#1",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#2",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#8",
+          "pinName": ""
+        },
+        "name": "unnamedWire#3",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O11"
+        },
+        "pin2": {
+          "compName": "dff#2",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#4",
+        "path": [
+          {
+            "x": 20.0,
+            "y": 45.0
+          },
+          {
+            "x": 20.0,
+            "y": 10.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#0",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O10"
+        },
+        "name": "unnamedWire#5",
+        "path": [
+          {
+            "x": 25.0,
+            "y": 30.0
+          },
+          {
+            "x": 25.0,
+            "y": 55.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#3",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O9"
+        },
+        "name": "unnamedWire#6",
+        "path": [
+          {
+            "x": 30.0,
+            "y": 40.0
+          },
+          {
+            "x": 30.0,
+            "y": 65.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O8"
+        },
+        "pin2": {
+          "compName": "dff#1",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#7",
+        "path": [
+          {
+            "x": 35.0,
+            "y": 75.0
+          },
+          {
+            "x": 35.0,
+            "y": 60.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#4",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O7"
+        },
+        "name": "unnamedWire#8",
+        "path": [
+          {
+            "x": 40.0,
+            "y": 70.0
+          },
+          {
+            "x": 40.0,
+            "y": 85.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O6"
+        },
+        "pin2": {
+          "compName": "dff#9",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#9",
+        "path": [
+          {
+            "x": 45.0,
+            "y": 95.0
+          },
+          {
+            "x": 45.0,
+            "y": 90.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#11",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O5"
+        },
+        "name": "unnamedWire#10",
+        "path": [
+          {
+            "x": 45.0,
+            "y": 100.0
+          },
+          {
+            "x": 45.0,
+            "y": 105.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O4"
+        },
+        "pin2": {
+          "compName": "dff#10",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#11",
+        "path": [
+          {
+            "x": 45.0,
+            "y": 115.0
+          },
+          {
+            "x": 45.0,
+            "y": 120.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#8",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#12",
+        "path": [
+          {
+            "x": 45.0,
+            "y": 130.0
+          },
+          {
+            "x": 45.0,
+            "y": 125.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "dff#5",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#13",
+        "path": [
+          {
+            "x": 40.0,
+            "y": 135.0
+          },
+          {
+            "x": 40.0,
+            "y": 150.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#7",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#14",
+        "path": [
+          {
+            "x": 35.0,
+            "y": 160.0
+          },
+          {
+            "x": 35.0,
+            "y": 145.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "dff#6",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#15",
+        "path": [
+          {
+            "x": 30.0,
+            "y": 155.0
+          },
+          {
+            "x": 30.0,
+            "y": 180.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#8",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#7",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#16",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#8",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#5",
+          "pinName": ""
+        },
+        "name": "unnamedWire#17",
+        "path": [
+          {
+            "x": 55.0,
+            "y": 190.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#2",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#18",
+        "path": [
+          {
+            "x": 55.0,
+            "y": 20.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "name": "unnamedWire#19",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "dff#3",
+          "pinName": "C"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "name": "unnamedWire#20",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "name": "unnamedWire#21",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#4",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#22",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "name": "unnamedWire#23",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#11",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#24",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "name": "unnamedWire#25",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#8",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#26",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#5",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#6",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#27",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#5",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#7",
+          "pinName": ""
+        },
+        "name": "unnamedWire#28",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#7",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#5",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#29",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#7",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#10",
+          "pinName": ""
+        },
+        "name": "unnamedWire#30",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "dff#10",
+          "pinName": "C"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#10",
+          "pinName": ""
+        },
+        "name": "unnamedWire#31",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#9",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#10",
+          "pinName": ""
+        },
+        "name": "unnamedWire#32",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#9",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#9",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#33",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#9",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#6",
+          "pinName": ""
+        },
+        "name": "unnamedWire#34",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#6",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#1",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#35",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#36",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O11"
+        },
+        "pin2": {
+          "compName": "dff#2",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#37",
+        "path": [
+          {
+            "x": 180.0,
+            "y": 45.0
+          },
+          {
+            "x": 180.0,
+            "y": 20.0
+          },
+          {
+            "x": 100.0,
+            "y": 20.0
+          },
+          {
+            "x": 100.0,
+            "y": 10.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#0",
+          "pinName": "Q"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O10"
+        },
+        "name": "unnamedWire#38",
+        "path": [
+          {
+            "x": 170.0,
+            "y": 30.0
+          },
+          {
+            "x": 170.0,
+            "y": 55.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O9"
+        },
+        "pin2": {
+          "compName": "dff#3",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#39",
+        "path": [
+          {
+            "x": 165.0,
+            "y": 65.0
+          },
+          {
+            "x": 165.0,
+            "y": 50.0
+          },
+          {
+            "x": 100.0,
+            "y": 50.0
+          },
+          {
+            "x": 100.0,
+            "y": 40.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#1",
+          "pinName": "Q"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O8"
+        },
+        "name": "unnamedWire#40",
+        "path": [
+          {
+            "x": 160.0,
+            "y": 60.0
+          },
+          {
+            "x": 160.0,
+            "y": 75.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O7"
+        },
+        "pin2": {
+          "compName": "dff#4",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#41",
+        "path": [
+          {
+            "x": 160.0,
+            "y": 85.0
+          },
+          {
+            "x": 160.0,
+            "y": 80.0
+          },
+          {
+            "x": 100.0,
+            "y": 80.0
+          },
+          {
+            "x": 100.0,
+            "y": 70.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#9",
+          "pinName": "Q"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O6"
+        },
+        "name": "unnamedWire#42",
+        "path": [
+          {
+            "x": 160.0,
+            "y": 90.0
+          },
+          {
+            "x": 160.0,
+            "y": 95.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O5"
+        },
+        "pin2": {
+          "compName": "dff#11",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#43",
+        "path": [
+          {
+            "x": 160.0,
+            "y": 105.0
+          },
+          {
+            "x": 160.0,
+            "y": 110.0
+          },
+          {
+            "x": 100.0,
+            "y": 110.0
+          },
+          {
+            "x": 100.0,
+            "y": 100.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O4"
+        },
+        "pin2": {
+          "compName": "dff#10",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#44",
+        "path": [
+          {
+            "x": 160.0,
+            "y": 115.0
+          },
+          {
+            "x": 160.0,
+            "y": 120.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O3"
+        },
+        "pin2": {
+          "compName": "dff#8",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#45",
+        "path": [
+          {
+            "x": 165.0,
+            "y": 125.0
+          },
+          {
+            "x": 165.0,
+            "y": 140.0
+          },
+          {
+            "x": 100.0,
+            "y": 140.0
+          },
+          {
+            "x": 100.0,
+            "y": 130.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#5",
+          "pinName": "Q"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O2"
+        },
+        "name": "unnamedWire#46",
+        "path": [
+          {
+            "x": 170.0,
+            "y": 150.0
+          },
+          {
+            "x": 170.0,
+            "y": 135.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O1"
+        },
+        "pin2": {
+          "compName": "dff#7",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#47",
+        "path": [
+          {
+            "x": 175.0,
+            "y": 145.0
+          },
+          {
+            "x": 175.0,
+            "y": 170.0
+          },
+          {
+            "x": 100.0,
+            "y": 170.0
+          },
+          {
+            "x": 100.0,
+            "y": 160.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#6",
+          "pinName": "Q"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O0"
+        },
+        "name": "unnamedWire#48",
+        "path": [
+          {
+            "x": 180.0,
+            "y": 180.0
+          },
+          {
+            "x": 180.0,
+            "y": 155.0
+          }
+        ]
+      }
+    ],
+    "version": "0.1.1"
+  },
+  "symbolRendererSnippetID": "simpleRectangularLike",
+  "symbolRendererParams": {
+    "centerText": "D flip flop\n12 bit",
+    "centerTextHeight": 5.0,
+    "horizontalComponentCenter": 30.0,
+    "pinLabelHeight": 3.5,
+    "pinLabelMargin": 0.5
+  },
+  "outlineRendererSnippetID": "default",
+  "highLevelStateHandlerSnippetID": "standard",
+  "highLevelStateHandlerParams": {
+    "subcomponentHighLevelStates": {},
+    "atomicHighLevelStates": {
+      "q": {
+        "id": "bitVectorSplitting",
+        "params": {
+          "vectorPartTargets": [
+            "q12",
+            "q11",
+            "q10",
+            "q9",
+            "q8",
+            "q7",
+            "q6",
+            "q5",
+            "q4",
+            "q3",
+            "q2",
+            "q1"
+          ],
+          "vectorPartLengthes": [
+            1,
+            1,
+            1,
+            1,
+            1,
+            1,
+            1,
+            1,
+            1,
+            1,
+            1,
+            1
+          ]
+        }
+      },
+      "q1": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#6",
+          "subStateID": "q"
+        }
+      },
+      "q2": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#7",
+          "subStateID": "q"
+        }
+      },
+      "q3": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#5",
+          "subStateID": "q"
+        }
+      },
+      "q4": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#8",
+          "subStateID": "q"
+        }
+      },
+      "q5": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#10",
+          "subStateID": "q"
+        }
+      },
+      "q6": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#11",
+          "subStateID": "q"
+        }
+      },
+      "q7": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#9",
+          "subStateID": "q"
+        }
+      },
+      "q8": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#4",
+          "subStateID": "q"
+        }
+      },
+      "q9": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#1",
+          "subStateID": "q"
+        }
+      },
+      "q10": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#3",
+          "subStateID": "q"
+        }
+      },
+      "q11": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#0",
+          "subStateID": "q"
+        }
+      },
+      "q12": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#2",
+          "subStateID": "q"
+        }
+      }
+    }
+  },
+  "version": "0.1.5"
+}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff4_finewe.json b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff4_finewe.json
new file mode 100755 (executable)
index 0000000..5b42800
--- /dev/null
@@ -0,0 +1,833 @@
+{
+  "width": 35.0,
+  "height": 90.0,
+  "interfacePins": [
+    {
+      "location": {
+        "x": 0.0,
+        "y": 5.0
+      },
+      "name": "C",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 85.0
+      },
+      "name": "D1",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 75.0
+      },
+      "name": "D2",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 65.0
+      },
+      "name": "D3",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 55.0
+      },
+      "name": "D4",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 35.0,
+        "y": 35.0
+      },
+      "name": "Q1",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 35.0,
+        "y": 25.0
+      },
+      "name": "Q2",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 35.0,
+        "y": 15.0
+      },
+      "name": "Q3",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 35.0,
+        "y": 5.0
+      },
+      "name": "Q4",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 45.0
+      },
+      "name": "_WE1",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 35.0
+      },
+      "name": "_WE2",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 25.0
+      },
+      "name": "_WE3",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 15.0
+      },
+      "name": "_WE4",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    }
+  ],
+  "innerScale": 0.2,
+  "submodel": {
+    "components": [
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#0",
+        "pos": {
+          "x": 109.0,
+          "y": 34.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#1",
+        "pos": {
+          "x": 109.0,
+          "y": 84.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#2",
+        "pos": {
+          "x": 109.0,
+          "y": 134.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#3",
+        "pos": {
+          "x": 159.0,
+          "y": 24.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#4",
+        "pos": {
+          "x": 159.0,
+          "y": 74.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#5",
+        "pos": {
+          "x": 159.0,
+          "y": 124.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#6",
+        "pos": {
+          "x": 159.0,
+          "y": 174.0
+        },
+        "params": 1
+      },
+      {
+        "id": "dff",
+        "name": "dff#0",
+        "pos": {
+          "x": 115.0,
+          "y": 20.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#1",
+        "pos": {
+          "x": 115.0,
+          "y": 70.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#2",
+        "pos": {
+          "x": 115.0,
+          "y": 120.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#3",
+        "pos": {
+          "x": 115.0,
+          "y": 170.0
+        }
+      },
+      {
+        "id": "mux1",
+        "name": "mux1#0",
+        "pos": {
+          "x": 65.0,
+          "y": 20.0
+        }
+      },
+      {
+        "id": "mux1",
+        "name": "mux1#1",
+        "pos": {
+          "x": 65.0,
+          "y": 70.0
+        }
+      },
+      {
+        "id": "mux1",
+        "name": "mux1#2",
+        "pos": {
+          "x": 65.0,
+          "y": 120.0
+        }
+      },
+      {
+        "id": "mux1",
+        "name": "mux1#3",
+        "pos": {
+          "x": 65.0,
+          "y": 170.0
+        }
+      }
+    ],
+    "wires": [
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#0",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#0",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "mux1#0",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "dff#0",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#1",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "dff#1",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "mux1#1",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#2",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#3",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#3",
+        "path": [
+          {
+            "x": 110.0,
+            "y": 185.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "name": "unnamedWire#4",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#1",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#5",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "name": "unnamedWire#6",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#2",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#7",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "C"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "name": "unnamedWire#8",
+        "path": [
+          {
+            "x": 10.0,
+            "y": 25.0
+          },
+          {
+            "x": 10.0,
+            "y": 15.0
+          },
+          {
+            "x": 110.0,
+            "y": 15.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "mux1#2",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "dff#2",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#9",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "dff#3",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "mux1#3",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#10",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "mux1#1",
+          "pinName": "I1"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "name": "unnamedWire#11",
+        "path": [
+          {
+            "x": 60.0,
+            "y": 95.0
+          },
+          {
+            "x": 60.0,
+            "y": 105.0
+          },
+          {
+            "x": 160.0,
+            "y": 105.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "mux1#0",
+          "pinName": "I1"
+        },
+        "name": "unnamedWire#12",
+        "path": [
+          {
+            "x": 160.0,
+            "y": 55.0
+          },
+          {
+            "x": 60.0,
+            "y": 55.0
+          },
+          {
+            "x": 60.0,
+            "y": 45.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#0",
+          "pinName": "Q"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "name": "unnamedWire#13",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "Q4"
+        },
+        "name": "unnamedWire#14",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "Q3"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "name": "unnamedWire#15",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#1",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#16",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#5",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "mux1#2",
+          "pinName": "I1"
+        },
+        "name": "unnamedWire#17",
+        "path": [
+          {
+            "x": 160.0,
+            "y": 155.0
+          },
+          {
+            "x": 60.0,
+            "y": 155.0
+          },
+          {
+            "x": 60.0,
+            "y": 145.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#2",
+          "pinName": "Q"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#5",
+          "pinName": ""
+        },
+        "name": "unnamedWire#18",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#5",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "Q2"
+        },
+        "name": "unnamedWire#19",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#6",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "Q1"
+        },
+        "name": "unnamedWire#20",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#6",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#3",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#21",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#6",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "mux1#3",
+          "pinName": "I1"
+        },
+        "name": "unnamedWire#22",
+        "path": [
+          {
+            "x": 160.0,
+            "y": 205.0
+          },
+          {
+            "x": 60.0,
+            "y": 205.0
+          },
+          {
+            "x": 60.0,
+            "y": 195.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "_WE4"
+        },
+        "pin2": {
+          "compName": "mux1#0",
+          "pinName": "S0"
+        },
+        "name": "unnamedWire#23",
+        "path": [
+          {
+            "x": 15.0,
+            "y": 75.0
+          },
+          {
+            "x": 15.0,
+            "y": 25.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "mux1#3",
+          "pinName": "I0"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "D1"
+        },
+        "name": "unnamedWire#24",
+        "path": [
+          {
+            "x": 55.0,
+            "y": 185.0
+          },
+          {
+            "x": 55.0,
+            "y": 425.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "D2"
+        },
+        "pin2": {
+          "compName": "mux1#2",
+          "pinName": "I0"
+        },
+        "name": "unnamedWire#25",
+        "path": [
+          {
+            "x": 50.0,
+            "y": 375.0
+          },
+          {
+            "x": 50.0,
+            "y": 135.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "mux1#1",
+          "pinName": "I0"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "D3"
+        },
+        "name": "unnamedWire#26",
+        "path": [
+          {
+            "x": 45.0,
+            "y": 85.0
+          },
+          {
+            "x": 45.0,
+            "y": 325.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "D4"
+        },
+        "pin2": {
+          "compName": "mux1#0",
+          "pinName": "I0"
+        },
+        "name": "unnamedWire#27",
+        "path": [
+          {
+            "x": 40.0,
+            "y": 275.0
+          },
+          {
+            "x": 40.0,
+            "y": 35.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "mux1#2",
+          "pinName": "S0"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "_WE2"
+        },
+        "name": "unnamedWire#28",
+        "path": [
+          {
+            "x": 25.0,
+            "y": 125.0
+          },
+          {
+            "x": 25.0,
+            "y": 175.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "_WE1"
+        },
+        "pin2": {
+          "compName": "mux1#3",
+          "pinName": "S0"
+        },
+        "name": "unnamedWire#29",
+        "path": [
+          {
+            "x": 30.0,
+            "y": 225.0
+          },
+          {
+            "x": 30.0,
+            "y": 175.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "mux1#1",
+          "pinName": "S0"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "_WE3"
+        },
+        "name": "unnamedWire#30",
+        "path": [
+          {
+            "x": 20.0,
+            "y": 75.0
+          },
+          {
+            "x": 20.0,
+            "y": 125.0
+          }
+        ]
+      }
+    ],
+    "version": "0.1.1"
+  },
+  "symbolRendererSnippetID": "simpleRectangularLike",
+  "symbolRendererParams": {
+    "centerText": "D flip flop\n4 bit",
+    "centerTextHeight": 5.0,
+    "horizontalComponentCenter": 17.5,
+    "pinLabelHeight": 3.5,
+    "pinLabelMargin": 0.5
+  },
+  "outlineRendererSnippetID": "default",
+  "highLevelStateHandlerSnippetID": "standard",
+  "highLevelStateHandlerParams": {
+    "subcomponentHighLevelStates": {},
+    "atomicHighLevelStates": {
+      "q": {
+        "id": "bitVectorSplitting",
+        "params": {
+          "vectorPartTargets": [
+            "q4",
+            "q3",
+            "q2",
+            "q1"
+          ],
+          "vectorPartLengthes": [
+            1,
+            1,
+            1,
+            1
+          ]
+        }
+      },
+      "q1": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#3",
+          "subStateID": "q"
+        }
+      },
+      "q2": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#2",
+          "subStateID": "q"
+        }
+      },
+      "q3": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#1",
+          "subStateID": "q"
+        }
+      },
+      "q4": {
+        "id": "delegating",
+        "params": {
+          "delegateTarget": "dff#0",
+          "subStateID": "q"
+        }
+      }
+    }
+  },
+  "version": "0.1.5"
+}
\ No newline at end of file
index 4ba4b19..37688b3 100644 (file)
         "params": 1
       },
       {
-        "id": "halfadder",
-        "name": "halfadder#0",
+        "id": "halfadder_invz",
+        "name": "halfadder_invz#0",
         "pos": {
           "x": 5.0,
           "y": 40.0
         }
       },
       {
-        "id": "halfadder",
-        "name": "halfadder#1",
+        "id": "halfadder_invz",
+        "name": "halfadder_invz#1",
         "pos": {
           "x": 45.0,
           "y": 7.5
@@ -84,7 +84,7 @@
           "pinName": "A"
         },
         "pin2": {
-          "compName": "halfadder#1",
+          "compName": "halfadder_invz#1",
           "pinName": "A"
         },
         "name": "unnamedWire#0",
@@ -96,7 +96,7 @@
           "pinName": "B"
         },
         "pin2": {
-          "compName": "halfadder#0",
+          "compName": "halfadder_invz#0",
           "pinName": "A"
         },
         "name": "unnamedWire#1"
           "pinName": "C"
         },
         "pin2": {
-          "compName": "halfadder#0",
+          "compName": "halfadder_invz#0",
           "pinName": "B"
         },
         "name": "unnamedWire#2"
       },
       {
         "pin1": {
-          "compName": "halfadder#0",
+          "compName": "halfadder_invz#0",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "halfadder#1",
+          "compName": "halfadder_invz#1",
           "pinName": "B"
         },
         "name": "unnamedWire#3"
       },
       {
         "pin1": {
-          "compName": "halfadder#0",
+          "compName": "halfadder_invz#0",
           "pinName": "_Z"
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "halfadder#1",
+          "compName": "halfadder_invz#1",
           "pinName": "Y"
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "halfadder#1",
+          "compName": "halfadder_invz#1",
           "pinName": "_Z"
         },
         "pin2": {
index f3970fc..63eb1ca 100644 (file)
@@ -1,6 +1,6 @@
 {
-  "width": 35.0,
-  "height": 20.0,
+  "width": 30.0,
+  "height": 30.0,
   "interfacePins": [
     {
       "location": {
@@ -22,7 +22,7 @@
     },
     {
       "location": {
-        "x": 35.0,
+        "x": 30.0,
         "y": 5.0
       },
       "name": "Y",
     },
     {
       "location": {
-        "x": 35.0,
-        "y": 15.0
+        "x": 0.0,
+        "y": 25.0
       },
-      "name": "_Z",
+      "name": "Z",
       "logicWidth": 1,
       "usage": "OUTPUT"
     }
   ],
-  "innerScale": 0.4,
+  "innerScale": 0.5,
   "submodel": {
     "components": [
       {
         "id": "NandGate",
         "name": "NandGate#0",
         "pos": {
-          "x": 10.0,
-          "y": 15.0
-        },
-        "params": 1
-      },
-      {
-        "id": "NandGate",
-        "name": "NandGate#1",
-        "pos": {
-          "x": 40.0,
-          "y": 2.5
-        },
-        "params": 1
-      },
-      {
-        "id": "NandGate",
-        "name": "NandGate#2",
-        "pos": {
-          "x": 40.0,
-          "y": 27.5
-        },
-        "params": 1
-      },
-      {
-        "id": "NandGate",
-        "name": "NandGate#3",
-        "pos": {
-          "x": 65.0,
-          "y": 2.5
+          "x": 25.0,
+          "y": 32.5
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#0",
         "pos": {
-          "x": 4.0,
-          "y": 11.5
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#1",
-        "pos": {
-          "x": 4.0,
+          "x": 19.0,
           "y": 36.5
         },
         "params": 1
       },
       {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#2",
+        "id": "halfadder_invz",
+        "name": "halfadder_invz#0",
         "pos": {
-          "x": 34.0,
-          "y": 24.0
-        },
-        "params": 1
+          "x": 10.0,
+          "y": 5.0
+        }
       }
     ],
     "wires": [
       {
         "pin1": {
-          "compName": "_submodelinterface",
-          "pinName": "A"
+          "compName": "halfadder_invz#0",
+          "pinName": "_Z"
         },
         "pin2": {
           "compName": "WireCrossPoint#0",
           "pinName": ""
         },
         "name": "unnamedWire#0",
-        "path": []
+        "path": [
+          {
+            "x": 50.0,
+            "y": 20.0
+          },
+          {
+            "x": 50.0,
+            "y": 27.5
+          },
+          {
+            "x": 20.0,
+            "y": 27.5
+          }
+        ]
       },
       {
         "pin1": {
           "pinName": ""
         },
         "pin2": {
-          "compName": "NandGate#1",
+          "compName": "NandGate#0",
           "pinName": "A"
         },
         "name": "unnamedWire#1",
-        "path": [
-          {
-            "x": 5.0,
-            "y": 7.5
-          }
-        ]
+        "path": []
       },
       {
         "pin1": {
         },
         "pin2": {
           "compName": "NandGate#0",
-          "pinName": "A"
+          "pinName": "B"
         },
         "name": "unnamedWire#2",
         "path": [
           {
-            "x": 5.0,
-            "y": 20.0
+            "x": 20.0,
+            "y": 47.5
           }
         ]
       },
       {
         "pin1": {
           "compName": "_submodelinterface",
-          "pinName": "B"
+          "pinName": "A"
         },
         "pin2": {
-          "compName": "WireCrossPoint#1",
-          "pinName": ""
+          "compName": "halfadder_invz#0",
+          "pinName": "A"
         },
         "name": "unnamedWire#3",
         "path": []
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#1",
-          "pinName": ""
+          "compName": "_submodelinterface",
+          "pinName": "B"
         },
         "pin2": {
-          "compName": "NandGate#2",
+          "compName": "halfadder_invz#0",
           "pinName": "B"
         },
         "name": "unnamedWire#4",
         "path": [
           {
             "x": 5.0,
-            "y": 42.5
-          }
-        ]
-      },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#1",
-          "pinName": ""
-        },
-        "pin2": {
-          "compName": "NandGate#0",
-          "pinName": "B"
-        },
-        "name": "unnamedWire#5",
-        "path": [
+            "y": 30.0
+          },
           {
             "x": 5.0,
-            "y": 30.0
+            "y": 20.0
           }
         ]
       },
           "compName": "NandGate#0",
           "pinName": "Y"
         },
-        "pin2": {
-          "compName": "WireCrossPoint#2",
-          "pinName": ""
-        },
-        "name": "unnamedWire#6",
-        "path": []
-      },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#2",
-          "pinName": ""
-        },
         "pin2": {
           "compName": "_submodelinterface",
-          "pinName": "_Z"
+          "pinName": "Z"
         },
-        "name": "unnamedWire#7",
+        "name": "unnamedWire#5",
         "path": [
           {
-            "x": 80.0,
-            "y": 25.0
+            "x": 50.0,
+            "y": 42.5
           },
           {
-            "x": 80.0,
-            "y": 37.5
-          }
-        ]
-      },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#2",
-          "pinName": ""
-        },
-        "pin2": {
-          "compName": "NandGate#1",
-          "pinName": "B"
-        },
-        "name": "unnamedWire#8",
-        "path": [
-          {
-            "x": 35.0,
-            "y": 17.5
-          }
-        ]
-      },
-      {
-        "pin1": {
-          "compName": "WireCrossPoint#2",
-          "pinName": ""
-        },
-        "pin2": {
-          "compName": "NandGate#2",
-          "pinName": "A"
-        },
-        "name": "unnamedWire#9",
-        "path": [
-          {
-            "x": 35.0,
-            "y": 32.5
-          }
-        ]
-      },
-      {
-        "pin1": {
-          "compName": "NandGate#1",
-          "pinName": "Y"
-        },
-        "pin2": {
-          "compName": "NandGate#3",
-          "pinName": "A"
-        },
-        "name": "unnamedWire#10",
-        "path": [
-          {
-            "x": 62.5,
-            "y": 12.5
+            "x": 50.0,
+            "y": 55.0
           },
           {
-            "x": 62.5,
-            "y": 7.5
-          }
-        ]
-      },
-      {
-        "pin1": {
-          "compName": "NandGate#2",
-          "pinName": "Y"
-        },
-        "pin2": {
-          "compName": "NandGate#3",
-          "pinName": "B"
-        },
-        "name": "unnamedWire#11",
-        "path": [
-          {
-            "x": 62.5,
-            "y": 37.5
+            "x": 15.0,
+            "y": 55.0
           },
           {
-            "x": 62.5,
-            "y": 17.5
+            "x": 15.0,
+            "y": 50.0
           }
         ]
       },
       {
         "pin1": {
-          "compName": "NandGate#3",
+          "compName": "halfadder_invz#0",
           "pinName": "Y"
         },
         "pin2": {
           "compName": "_submodelinterface",
           "pinName": "Y"
         },
-        "name": "unnamedWire#12",
+        "name": "unnamedWire#6",
         "path": []
       }
     ],
   "symbolRendererParams": {
     "centerText": "halfadder",
     "centerTextHeight": 5.0,
-    "horizontalComponentCenter": 17.5,
+    "horizontalComponentCenter": 15.0,
     "pinLabelHeight": 3.5,
     "pinLabelMargin": 0.5
   },
diff --git a/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/halfadder_invz.json b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/halfadder_invz.json
new file mode 100755 (executable)
index 0000000..f3970fc
--- /dev/null
@@ -0,0 +1,337 @@
+{
+  "width": 35.0,
+  "height": 20.0,
+  "interfacePins": [
+    {
+      "location": {
+        "x": 0.0,
+        "y": 5.0
+      },
+      "name": "A",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 15.0
+      },
+      "name": "B",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 35.0,
+        "y": 5.0
+      },
+      "name": "Y",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 35.0,
+        "y": 15.0
+      },
+      "name": "_Z",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    }
+  ],
+  "innerScale": 0.4,
+  "submodel": {
+    "components": [
+      {
+        "id": "NandGate",
+        "name": "NandGate#0",
+        "pos": {
+          "x": 10.0,
+          "y": 15.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#1",
+        "pos": {
+          "x": 40.0,
+          "y": 2.5
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#2",
+        "pos": {
+          "x": 40.0,
+          "y": 27.5
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#3",
+        "pos": {
+          "x": 65.0,
+          "y": 2.5
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#0",
+        "pos": {
+          "x": 4.0,
+          "y": 11.5
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#1",
+        "pos": {
+          "x": 4.0,
+          "y": 36.5
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#2",
+        "pos": {
+          "x": 34.0,
+          "y": 24.0
+        },
+        "params": 1
+      }
+    ],
+    "wires": [
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "name": "unnamedWire#0",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#1",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#1",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 7.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#0",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#2",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 20.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "name": "unnamedWire#3",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#2",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#4",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 42.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#0",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#5",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 30.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#0",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "name": "unnamedWire#6",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "_Z"
+        },
+        "name": "unnamedWire#7",
+        "path": [
+          {
+            "x": 80.0,
+            "y": 25.0
+          },
+          {
+            "x": 80.0,
+            "y": 37.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#1",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#8",
+        "path": [
+          {
+            "x": 35.0,
+            "y": 17.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#2",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#9",
+        "path": [
+          {
+            "x": 35.0,
+            "y": 32.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#1",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#3",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#10",
+        "path": [
+          {
+            "x": 62.5,
+            "y": 12.5
+          },
+          {
+            "x": 62.5,
+            "y": 7.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#2",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#3",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#11",
+        "path": [
+          {
+            "x": 62.5,
+            "y": 37.5
+          },
+          {
+            "x": 62.5,
+            "y": 17.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#3",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#12",
+        "path": []
+      }
+    ],
+    "version": "0.1.1"
+  },
+  "symbolRendererSnippetID": "simpleRectangularLike",
+  "symbolRendererParams": {
+    "centerText": "halfadder",
+    "centerTextHeight": 5.0,
+    "horizontalComponentCenter": 17.5,
+    "pinLabelHeight": 3.5,
+    "pinLabelMargin": 0.5
+  },
+  "outlineRendererSnippetID": "default",
+  "highLevelStateHandlerSnippetID": "default",
+  "version": "0.1.5"
+}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/inc12.json b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/inc12.json
new file mode 100755 (executable)
index 0000000..bcb0ff4
--- /dev/null
@@ -0,0 +1,645 @@
+{
+  "width": 20.0,
+  "height": 25.0,
+  "interfacePins": [
+    {
+      "location": {
+        "x": 0.0,
+        "y": 15.0
+      },
+      "name": "A",
+      "logicWidth": 12,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 5.0
+      },
+      "name": "CI",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 20.0,
+        "y": 15.0
+      },
+      "name": "Y",
+      "logicWidth": 12,
+      "usage": "OUTPUT"
+    }
+  ],
+  "innerScale": 0.2,
+  "submodel": {
+    "components": [
+      {
+        "id": "Splitter",
+        "name": "Splitter#0",
+        "pos": {
+          "x": 7.5,
+          "y": 10.0
+        },
+        "params": {
+          "logicWidth": 12,
+          "orientation": "RIGHT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#1",
+        "pos": {
+          "x": 82.5,
+          "y": 10.0
+        },
+        "params": {
+          "logicWidth": 12,
+          "orientation": "LEFT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#2",
+        "pos": {
+          "x": 22.5,
+          "y": 10.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#3",
+        "pos": {
+          "x": 22.5,
+          "y": 50.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#4",
+        "pos": {
+          "x": 22.5,
+          "y": 90.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#5",
+        "pos": {
+          "x": 67.5,
+          "y": 10.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#6",
+        "pos": {
+          "x": 67.5,
+          "y": 50.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#7",
+        "pos": {
+          "x": 67.5,
+          "y": 90.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT_ALT"
+        }
+      },
+      {
+        "id": "inc4",
+        "name": "inc4#0",
+        "pos": {
+          "x": 42.5,
+          "y": 10.0
+        }
+      },
+      {
+        "id": "inc4",
+        "name": "inc4#1",
+        "pos": {
+          "x": 42.5,
+          "y": 50.0
+        }
+      },
+      {
+        "id": "inc4",
+        "name": "inc4#2",
+        "pos": {
+          "x": 42.5,
+          "y": 90.0
+        }
+      }
+    ],
+    "wires": [
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "CI"
+        },
+        "pin2": {
+          "compName": "inc4#0",
+          "pinName": "CI"
+        },
+        "name": "unnamedWire#0",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 25.0
+          },
+          {
+            "x": 5.0,
+            "y": 5.0
+          },
+          {
+            "x": 37.5,
+            "y": 5.0
+          },
+          {
+            "x": 37.5,
+            "y": 15.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#2",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "inc4#0",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#1",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#3",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "inc4#1",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#2",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#4",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "inc4#2",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#3",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "inc4#0",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "Splitter#5",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#4",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "inc4#1",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "Splitter#6",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#5",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "inc4#2",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "Splitter#7",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#6",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#7",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 75.0
+          },
+          {
+            "x": 5.0,
+            "y": 65.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Splitter#2",
+          "pinName": "O0"
+        },
+        "name": "unnamedWire#8",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#2",
+          "pinName": "O1"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#9",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#2",
+          "pinName": "O2"
+        },
+        "name": "unnamedWire#10",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#2",
+          "pinName": "O3"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#11",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O4"
+        },
+        "pin2": {
+          "compName": "Splitter#3",
+          "pinName": "O0"
+        },
+        "name": "unnamedWire#12",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O5"
+        },
+        "pin2": {
+          "compName": "Splitter#3",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#13",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#3",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O6"
+        },
+        "name": "unnamedWire#14",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O7"
+        },
+        "pin2": {
+          "compName": "Splitter#3",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#15",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#4",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O8"
+        },
+        "name": "unnamedWire#16",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O9"
+        },
+        "pin2": {
+          "compName": "Splitter#4",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#17",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#4",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O10"
+        },
+        "name": "unnamedWire#18",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O11"
+        },
+        "pin2": {
+          "compName": "Splitter#4",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#19",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "inc4#0",
+          "pinName": "Z"
+        },
+        "pin2": {
+          "compName": "inc4#1",
+          "pinName": "CI"
+        },
+        "name": "unnamedWire#20",
+        "path": [
+          {
+            "x": 37.5,
+            "y": 35.0
+          },
+          {
+            "x": 37.5,
+            "y": 55.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "inc4#1",
+          "pinName": "Z"
+        },
+        "pin2": {
+          "compName": "inc4#2",
+          "pinName": "CI"
+        },
+        "name": "unnamedWire#21",
+        "path": [
+          {
+            "x": 37.5,
+            "y": 75.0
+          },
+          {
+            "x": 37.5,
+            "y": 95.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#5",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O0"
+        },
+        "name": "unnamedWire#22",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O1"
+        },
+        "pin2": {
+          "compName": "Splitter#5",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#23",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#24",
+        "path": [
+          {
+            "x": 95.0,
+            "y": 65.0
+          },
+          {
+            "x": 95.0,
+            "y": 75.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#5",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O2"
+        },
+        "name": "unnamedWire#25",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O3"
+        },
+        "pin2": {
+          "compName": "Splitter#5",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#26",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#6",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O4"
+        },
+        "name": "unnamedWire#27",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O5"
+        },
+        "pin2": {
+          "compName": "Splitter#6",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#28",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#6",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O6"
+        },
+        "name": "unnamedWire#29",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O7"
+        },
+        "pin2": {
+          "compName": "Splitter#6",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#30",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#7",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O8"
+        },
+        "name": "unnamedWire#31",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O9"
+        },
+        "pin2": {
+          "compName": "Splitter#7",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#32",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#7",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O10"
+        },
+        "name": "unnamedWire#33",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O11"
+        },
+        "pin2": {
+          "compName": "Splitter#7",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#34",
+        "path": []
+      }
+    ],
+    "version": "0.1.1"
+  },
+  "symbolRendererSnippetID": "simpleRectangularLike",
+  "symbolRendererParams": {
+    "centerText": "Incrementer\n12 bit",
+    "centerTextHeight": 5.0,
+    "horizontalComponentCenter": 10.0,
+    "pinLabelHeight": 3.5,
+    "pinLabelMargin": 0.5
+  },
+  "outlineRendererSnippetID": "default",
+  "highLevelStateHandlerSnippetID": "default",
+  "version": "0.1.5"
+}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/inc16.json b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/inc16.json
new file mode 100755 (executable)
index 0000000..07609bb
--- /dev/null
@@ -0,0 +1,818 @@
+{
+  "width": 20.0,
+  "height": 35.0,
+  "interfacePins": [
+    {
+      "location": {
+        "x": 0.0,
+        "y": 15.0
+      },
+      "name": "A",
+      "logicWidth": 16,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 5.0
+      },
+      "name": "CI",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 20.0,
+        "y": 15.0
+      },
+      "name": "Y",
+      "logicWidth": 16,
+      "usage": "OUTPUT"
+    }
+  ],
+  "innerScale": 0.2,
+  "submodel": {
+    "components": [
+      {
+        "id": "Splitter",
+        "name": "Splitter#0",
+        "pos": {
+          "x": 7.5,
+          "y": 10.0
+        },
+        "params": {
+          "logicWidth": 16,
+          "orientation": "RIGHT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#1",
+        "pos": {
+          "x": 82.5,
+          "y": 10.0
+        },
+        "params": {
+          "logicWidth": 16,
+          "orientation": "LEFT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#2",
+        "pos": {
+          "x": 22.5,
+          "y": 10.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#3",
+        "pos": {
+          "x": 22.5,
+          "y": 50.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#4",
+        "pos": {
+          "x": 22.5,
+          "y": 90.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#5",
+        "pos": {
+          "x": 22.5,
+          "y": 130.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#6",
+        "pos": {
+          "x": 67.5,
+          "y": 10.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#7",
+        "pos": {
+          "x": 67.5,
+          "y": 50.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#8",
+        "pos": {
+          "x": 67.5,
+          "y": 90.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#9",
+        "pos": {
+          "x": 67.5,
+          "y": 130.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT_ALT"
+        }
+      },
+      {
+        "id": "inc4",
+        "name": "inc4#0",
+        "pos": {
+          "x": 42.5,
+          "y": 10.0
+        }
+      },
+      {
+        "id": "inc4",
+        "name": "inc4#1",
+        "pos": {
+          "x": 42.5,
+          "y": 50.0
+        }
+      },
+      {
+        "id": "inc4",
+        "name": "inc4#2",
+        "pos": {
+          "x": 42.5,
+          "y": 90.0
+        }
+      },
+      {
+        "id": "inc4",
+        "name": "inc4#3",
+        "pos": {
+          "x": 42.5,
+          "y": 130.0
+        }
+      }
+    ],
+    "wires": [
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "CI"
+        },
+        "pin2": {
+          "compName": "inc4#0",
+          "pinName": "CI"
+        },
+        "name": "unnamedWire#0",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 25.0
+          },
+          {
+            "x": 5.0,
+            "y": 5.0
+          },
+          {
+            "x": 37.5,
+            "y": 5.0
+          },
+          {
+            "x": 37.5,
+            "y": 15.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#2",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "inc4#0",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#1",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#3",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "inc4#1",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#2",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#4",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "inc4#2",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#3",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#5",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "inc4#3",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#4",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "inc4#0",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "Splitter#6",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#5",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "inc4#1",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "Splitter#7",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#6",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "inc4#2",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "Splitter#8",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#7",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "inc4#3",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "Splitter#9",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#8",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#9",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 75.0
+          },
+          {
+            "x": 5.0,
+            "y": 85.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Splitter#2",
+          "pinName": "O0"
+        },
+        "name": "unnamedWire#10",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#2",
+          "pinName": "O1"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#11",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#2",
+          "pinName": "O2"
+        },
+        "name": "unnamedWire#12",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#2",
+          "pinName": "O3"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#13",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O4"
+        },
+        "pin2": {
+          "compName": "Splitter#3",
+          "pinName": "O0"
+        },
+        "name": "unnamedWire#14",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O5"
+        },
+        "pin2": {
+          "compName": "Splitter#3",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#15",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#3",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O6"
+        },
+        "name": "unnamedWire#16",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O7"
+        },
+        "pin2": {
+          "compName": "Splitter#3",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#17",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#4",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O8"
+        },
+        "name": "unnamedWire#18",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O9"
+        },
+        "pin2": {
+          "compName": "Splitter#4",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#19",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#4",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O10"
+        },
+        "name": "unnamedWire#20",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O11"
+        },
+        "pin2": {
+          "compName": "Splitter#4",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#21",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#5",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O12"
+        },
+        "name": "unnamedWire#22",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O13"
+        },
+        "pin2": {
+          "compName": "Splitter#5",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#23",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#5",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O14"
+        },
+        "name": "unnamedWire#24",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O15"
+        },
+        "pin2": {
+          "compName": "Splitter#5",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#25",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "inc4#0",
+          "pinName": "Z"
+        },
+        "pin2": {
+          "compName": "inc4#1",
+          "pinName": "CI"
+        },
+        "name": "unnamedWire#26",
+        "path": [
+          {
+            "x": 37.5,
+            "y": 35.0
+          },
+          {
+            "x": 37.5,
+            "y": 55.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "inc4#1",
+          "pinName": "Z"
+        },
+        "pin2": {
+          "compName": "inc4#2",
+          "pinName": "CI"
+        },
+        "name": "unnamedWire#27",
+        "path": [
+          {
+            "x": 37.5,
+            "y": 75.0
+          },
+          {
+            "x": 37.5,
+            "y": 95.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "inc4#2",
+          "pinName": "Z"
+        },
+        "pin2": {
+          "compName": "inc4#3",
+          "pinName": "CI"
+        },
+        "name": "unnamedWire#28",
+        "path": [
+          {
+            "x": 37.5,
+            "y": 115.0
+          },
+          {
+            "x": 37.5,
+            "y": 135.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#6",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O0"
+        },
+        "name": "unnamedWire#29",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O1"
+        },
+        "pin2": {
+          "compName": "Splitter#6",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#30",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#31",
+        "path": [
+          {
+            "x": 95.0,
+            "y": 85.0
+          },
+          {
+            "x": 95.0,
+            "y": 75.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#6",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O2"
+        },
+        "name": "unnamedWire#32",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O3"
+        },
+        "pin2": {
+          "compName": "Splitter#6",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#33",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#7",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O4"
+        },
+        "name": "unnamedWire#34",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O5"
+        },
+        "pin2": {
+          "compName": "Splitter#7",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#35",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#7",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O6"
+        },
+        "name": "unnamedWire#36",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O7"
+        },
+        "pin2": {
+          "compName": "Splitter#7",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#37",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#8",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O8"
+        },
+        "name": "unnamedWire#38",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O9"
+        },
+        "pin2": {
+          "compName": "Splitter#8",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#39",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#8",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O10"
+        },
+        "name": "unnamedWire#40",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O11"
+        },
+        "pin2": {
+          "compName": "Splitter#8",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#41",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#9",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O12"
+        },
+        "name": "unnamedWire#42",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O13"
+        },
+        "pin2": {
+          "compName": "Splitter#9",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#43",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#9",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O14"
+        },
+        "name": "unnamedWire#44",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O15"
+        },
+        "pin2": {
+          "compName": "Splitter#9",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#45",
+        "path": []
+      }
+    ],
+    "version": "0.1.1"
+  },
+  "symbolRendererSnippetID": "simpleRectangularLike",
+  "symbolRendererParams": {
+    "centerText": "Incrementer\n16 bit",
+    "centerTextHeight": 5.0,
+    "horizontalComponentCenter": 10.0,
+    "pinLabelHeight": 3.5,
+    "pinLabelMargin": 0.5
+  },
+  "outlineRendererSnippetID": "default",
+  "highLevelStateHandlerSnippetID": "default",
+  "version": "0.1.5"
+}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/inc4.json b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/inc4.json
new file mode 100755 (executable)
index 0000000..9e1126b
--- /dev/null
@@ -0,0 +1,405 @@
+{
+  "width": 20.0,
+  "height": 30.0,
+  "interfacePins": [
+    {
+      "location": {
+        "x": 0.0,
+        "y": 15.0
+      },
+      "name": "A",
+      "logicWidth": 4,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 5.0
+      },
+      "name": "CI",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 20.0,
+        "y": 15.0
+      },
+      "name": "Y",
+      "logicWidth": 4,
+      "usage": "OUTPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 25.0
+      },
+      "name": "Z",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    }
+  ],
+  "innerScale": 0.2,
+  "submodel": {
+    "components": [
+      {
+        "id": "Splitter",
+        "name": "Splitter#0",
+        "pos": {
+          "x": 5.0,
+          "y": 60.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT_ALT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#1",
+        "pos": {
+          "x": 85.0,
+          "y": 60.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT_ALT"
+        }
+      },
+      {
+        "id": "halfadder",
+        "name": "halfadder#0",
+        "pos": {
+          "x": 40.0,
+          "y": 5.0
+        }
+      },
+      {
+        "id": "halfadder",
+        "name": "halfadder#1",
+        "pos": {
+          "x": 40.0,
+          "y": 40.0
+        }
+      },
+      {
+        "id": "halfadder",
+        "name": "halfadder#2",
+        "pos": {
+          "x": 40.0,
+          "y": 75.0
+        }
+      },
+      {
+        "id": "halfadder",
+        "name": "halfadder#3",
+        "pos": {
+          "x": 40.0,
+          "y": 110.0
+        }
+      }
+    ],
+    "wires": [
+      {
+        "pin1": {
+          "compName": "halfadder#0",
+          "pinName": "Z"
+        },
+        "pin2": {
+          "compName": "halfadder#1",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#0",
+        "path": [
+          {
+            "x": 35.0,
+            "y": 30.0
+          },
+          {
+            "x": 35.0,
+            "y": 45.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "halfadder#1",
+          "pinName": "Z"
+        },
+        "pin2": {
+          "compName": "halfadder#2",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#1",
+        "path": [
+          {
+            "x": 35.0,
+            "y": 65.0
+          },
+          {
+            "x": 35.0,
+            "y": 80.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "halfadder#2",
+          "pinName": "Z"
+        },
+        "pin2": {
+          "compName": "halfadder#3",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#2",
+        "path": [
+          {
+            "x": 35.0,
+            "y": 100.0
+          },
+          {
+            "x": 35.0,
+            "y": 115.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "halfadder#0",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#3",
+        "path": [
+          {
+            "x": 20.0,
+            "y": 60.0
+          },
+          {
+            "x": 20.0,
+            "y": 20.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O1"
+        },
+        "pin2": {
+          "compName": "halfadder#1",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#4",
+        "path": [
+          {
+            "x": 25.0,
+            "y": 70.0
+          },
+          {
+            "x": 25.0,
+            "y": 55.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "halfadder#2",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#5",
+        "path": [
+          {
+            "x": 25.0,
+            "y": 80.0
+          },
+          {
+            "x": 25.0,
+            "y": 90.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O3"
+        },
+        "pin2": {
+          "compName": "halfadder#3",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#6",
+        "path": [
+          {
+            "x": 20.0,
+            "y": 90.0
+          },
+          {
+            "x": 20.0,
+            "y": 125.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "halfadder#0",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#7",
+        "path": [
+          {
+            "x": 80.0,
+            "y": 60.0
+          },
+          {
+            "x": 80.0,
+            "y": 10.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "halfadder#1",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#8",
+        "path": [
+          {
+            "x": 75.0,
+            "y": 45.0
+          },
+          {
+            "x": 75.0,
+            "y": 70.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "halfadder#2",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O2"
+        },
+        "name": "unnamedWire#9",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O3"
+        },
+        "pin2": {
+          "compName": "halfadder#3",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#10",
+        "path": [
+          {
+            "x": 75.0,
+            "y": 90.0
+          },
+          {
+            "x": 75.0,
+            "y": 115.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#11",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "CI"
+        },
+        "pin2": {
+          "compName": "halfadder#0",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#12",
+        "path": [
+          {
+            "x": 10.0,
+            "y": 25.0
+          },
+          {
+            "x": 10.0,
+            "y": 10.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#13",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "halfadder#3",
+          "pinName": "Z"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "Z"
+        },
+        "name": "unnamedWire#14",
+        "path": [
+          {
+            "x": 10.0,
+            "y": 135.0
+          },
+          {
+            "x": 10.0,
+            "y": 125.0
+          }
+        ]
+      }
+    ],
+    "version": "0.1.1"
+  },
+  "symbolRendererSnippetID": "simpleRectangularLike",
+  "symbolRendererParams": {
+    "centerText": "Incrementer\n4 bit",
+    "centerTextHeight": 5.0,
+    "horizontalComponentCenter": 10.0,
+    "pinLabelHeight": 3.5,
+    "pinLabelMargin": 0.5
+  },
+  "outlineRendererSnippetID": "default",
+  "highLevelStateHandlerSnippetID": "default",
+  "version": "0.1.5"
+}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/nor12.json b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/nor12.json
new file mode 100644 (file)
index 0000000..0dddc1e
--- /dev/null
@@ -0,0 +1,726 @@
+{
+  "width": 45.0,
+  "height": 30.0,
+  "interfacePins": [
+    {
+      "location": {
+        "x": 0.0,
+        "y": 15.0
+      },
+      "name": "D",
+      "logicWidth": 12,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 45.0,
+        "y": 15.0
+      },
+      "name": "Y",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    }
+  ],
+  "innerScale": 0.2,
+  "submodel": {
+    "components": [
+      {
+        "id": "NandGate",
+        "name": "NandGate#0",
+        "pos": {
+          "x": 135.0,
+          "y": 65.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#1",
+        "pos": {
+          "x": 70.0,
+          "y": 55.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#2",
+        "pos": {
+          "x": 70.0,
+          "y": 90.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#3",
+        "pos": {
+          "x": 100.0,
+          "y": 65.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#4",
+        "pos": {
+          "x": 135.0,
+          "y": 10.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#5",
+        "pos": {
+          "x": 165.0,
+          "y": 65.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#6",
+        "pos": {
+          "x": 200.0,
+          "y": 65.0
+        },
+        "params": 1
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#0",
+        "pos": {
+          "x": 5.0,
+          "y": 20.0
+        },
+        "params": {
+          "logicWidth": 12,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#0",
+        "pos": {
+          "x": 129.0,
+          "y": 74.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#1",
+        "pos": {
+          "x": 64.0,
+          "y": 59.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#2",
+        "pos": {
+          "x": 64.0,
+          "y": 104.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#3",
+        "pos": {
+          "x": 129.0,
+          "y": 14.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#4",
+        "pos": {
+          "x": 194.0,
+          "y": 74.0
+        },
+        "params": 1
+      },
+      {
+        "id": "or4",
+        "name": "or4#0",
+        "pos": {
+          "x": 25.0,
+          "y": 10.0
+        }
+      },
+      {
+        "id": "or4",
+        "name": "or4#1",
+        "pos": {
+          "x": 25.0,
+          "y": 55.0
+        }
+      },
+      {
+        "id": "or4",
+        "name": "or4#2",
+        "pos": {
+          "x": 25.0,
+          "y": 100.0
+        }
+      }
+    ],
+    "wires": [
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#0",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O11"
+        },
+        "pin2": {
+          "compName": "or4#0",
+          "pinName": "A1"
+        },
+        "name": "unnamedWire#1",
+        "path": [
+          {
+            "x": 20.0,
+            "y": 20.0
+          },
+          {
+            "x": 20.0,
+            "y": 15.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "or4#0",
+          "pinName": "A2"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O10"
+        },
+        "name": "unnamedWire#2",
+        "path": [
+          {
+            "x": 20.0,
+            "y": 25.0
+          },
+          {
+            "x": 20.0,
+            "y": 30.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "or4#0",
+          "pinName": "A3"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O9"
+        },
+        "name": "unnamedWire#3",
+        "path": [
+          {
+            "x": 20.0,
+            "y": 35.0
+          },
+          {
+            "x": 20.0,
+            "y": 40.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O8"
+        },
+        "pin2": {
+          "compName": "or4#0",
+          "pinName": "A4"
+        },
+        "name": "unnamedWire#4",
+        "path": [
+          {
+            "x": 20.0,
+            "y": 50.0
+          },
+          {
+            "x": 20.0,
+            "y": 45.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O7"
+        },
+        "pin2": {
+          "compName": "or4#1",
+          "pinName": "A1"
+        },
+        "name": "unnamedWire#5",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "or4#1",
+          "pinName": "A2"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O6"
+        },
+        "name": "unnamedWire#6",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O5"
+        },
+        "pin2": {
+          "compName": "or4#1",
+          "pinName": "A3"
+        },
+        "name": "unnamedWire#7",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "or4#1",
+          "pinName": "A4"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O4"
+        },
+        "name": "unnamedWire#8",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O3"
+        },
+        "pin2": {
+          "compName": "or4#2",
+          "pinName": "A1"
+        },
+        "name": "unnamedWire#9",
+        "path": [
+          {
+            "x": 20.0,
+            "y": 100.0
+          },
+          {
+            "x": 20.0,
+            "y": 105.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "or4#2",
+          "pinName": "A2"
+        },
+        "name": "unnamedWire#10",
+        "path": [
+          {
+            "x": 20.0,
+            "y": 110.0
+          },
+          {
+            "x": 20.0,
+            "y": 115.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O1"
+        },
+        "pin2": {
+          "compName": "or4#2",
+          "pinName": "A3"
+        },
+        "name": "unnamedWire#11",
+        "path": [
+          {
+            "x": 20.0,
+            "y": 120.0
+          },
+          {
+            "x": 20.0,
+            "y": 125.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "or4#2",
+          "pinName": "A4"
+        },
+        "name": "unnamedWire#12",
+        "path": [
+          {
+            "x": 20.0,
+            "y": 130.0
+          },
+          {
+            "x": 20.0,
+            "y": 135.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#3",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "name": "unnamedWire#13",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#0",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#14",
+        "path": [
+          {
+            "x": 130.0,
+            "y": 80.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#0",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#15",
+        "path": [
+          {
+            "x": 130.0,
+            "y": 70.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "or4#1",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "name": "unnamedWire#16",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#1",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#17",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#1",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#18",
+        "path": [
+          {
+            "x": 65.0,
+            "y": 70.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "or4#2",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "name": "unnamedWire#19",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#2",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#20",
+        "path": [
+          {
+            "x": 65.0,
+            "y": 95.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#2",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#21",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#1",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#3",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#22",
+        "path": [
+          {
+            "x": 95.0,
+            "y": 65.0
+          },
+          {
+            "x": 95.0,
+            "y": 70.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#2",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#3",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#23",
+        "path": [
+          {
+            "x": 95.0,
+            "y": 100.0
+          },
+          {
+            "x": 95.0,
+            "y": 80.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#0",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#5",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#24",
+        "path": [
+          {
+            "x": 160.0,
+            "y": 75.0
+          },
+          {
+            "x": 160.0,
+            "y": 80.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "or4#0",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "name": "unnamedWire#25",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#4",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#26",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#4",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#27",
+        "path": [
+          {
+            "x": 130.0,
+            "y": 25.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#4",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#5",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#28",
+        "path": [
+          {
+            "x": 160.0,
+            "y": 20.0
+          },
+          {
+            "x": 160.0,
+            "y": 70.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#5",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "name": "unnamedWire#29",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#6",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#30",
+        "path": [
+          {
+            "x": 195.0,
+            "y": 70.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#6",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#31",
+        "path": [
+          {
+            "x": 195.0,
+            "y": 80.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#6",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#32",
+        "path": []
+      }
+    ],
+    "version": "0.1.1"
+  },
+  "symbolRendererSnippetID": "simpleRectangularLike",
+  "symbolRendererParams": {
+    "centerText": "nor12",
+    "centerTextHeight": 5.0,
+    "horizontalComponentCenter": 15.0,
+    "pinLabelHeight": 3.5,
+    "pinLabelMargin": 0.5
+  },
+  "outlineRendererSnippetID": "default",
+  "highLevelStateHandlerSnippetID": "default",
+  "version": "0.1.5"
+}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/xnor.json b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/xnor.json
new file mode 100644 (file)
index 0000000..176ee95
--- /dev/null
@@ -0,0 +1,379 @@
+{
+  "width": 45.0,
+  "height": 20.0,
+  "interfacePins": [
+    {
+      "location": {
+        "x": 0.0,
+        "y": 5.0
+      },
+      "name": "A",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 15.0
+      },
+      "name": "B",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 45.0,
+        "y": 5.0
+      },
+      "name": "Y",
+      "logicWidth": 1,
+      "usage": "OUTPUT"
+    }
+  ],
+  "innerScale": 0.4,
+  "submodel": {
+    "components": [
+      {
+        "id": "NandGate",
+        "name": "NandGate#0",
+        "pos": {
+          "x": 35.0,
+          "y": 2.5
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#1",
+        "pos": {
+          "x": 35.0,
+          "y": 27.5
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#2",
+        "pos": {
+          "x": 60.0,
+          "y": 2.5
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#3",
+        "pos": {
+          "x": 10.0,
+          "y": 15.0
+        },
+        "params": 1
+      },
+      {
+        "id": "NandGate",
+        "name": "NandGate#4",
+        "pos": {
+          "x": 85.0,
+          "y": 2.5
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#0",
+        "pos": {
+          "x": 31.5,
+          "y": 11.5
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#1",
+        "pos": {
+          "x": 4.0,
+          "y": 36.5
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#2",
+        "pos": {
+          "x": 4.0,
+          "y": 11.5
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#3",
+        "pos": {
+          "x": 31.5,
+          "y": 36.5
+        },
+        "params": 1
+      }
+    ],
+    "wires": [
+      {
+        "pin1": {
+          "compName": "NandGate#0",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#2",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#0",
+        "path": [
+          {
+            "x": 57.5,
+            "y": 12.5
+          },
+          {
+            "x": 57.5,
+            "y": 7.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#1",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#2",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#1",
+        "path": [
+          {
+            "x": 57.5,
+            "y": 37.5
+          },
+          {
+            "x": 57.5,
+            "y": 17.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#2",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#4",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#2",
+        "path": [
+          {
+            "x": 82.5,
+            "y": 12.5
+          },
+          {
+            "x": 82.5,
+            "y": 7.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#3",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "NandGate#4",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#3",
+        "path": [
+          {
+            "x": 82.5,
+            "y": 25.0
+          },
+          {
+            "x": 82.5,
+            "y": 17.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#0",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#4",
+        "path": [
+          {
+            "x": 32.5,
+            "y": 7.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "B"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "name": "unnamedWire#5",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "name": "unnamedWire#6",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "name": "unnamedWire#7",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#3",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#8",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 20.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#0",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#9",
+        "path": [
+          {
+            "x": 32.5,
+            "y": 17.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#3",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#10",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 30.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "NandGate#4",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "Y"
+        },
+        "name": "unnamedWire#11",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#1",
+          "pinName": "B"
+        },
+        "name": "unnamedWire#12",
+        "path": [
+          {
+            "x": 32.5,
+            "y": 42.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "NandGate#1",
+          "pinName": "A"
+        },
+        "name": "unnamedWire#13",
+        "path": [
+          {
+            "x": 32.5,
+            "y": 32.5
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "A"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "name": "unnamedWire#14",
+        "path": []
+      }
+    ],
+    "version": "0.1.1"
+  },
+  "symbolRendererSnippetID": "simpleRectangularLike",
+  "symbolRendererParams": {
+    "centerText": "xnor",
+    "centerTextHeight": 5.0,
+    "horizontalComponentCenter": 22.5,
+    "pinLabelHeight": 3.5,
+    "pinLabelMargin": 0.5
+  },
+  "outlineRendererSnippetID": "default",
+  "highLevelStateHandlerSnippetID": "default",
+  "version": "0.1.5"
+}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modeldff12.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modeldff12.java
deleted file mode 100644 (file)
index 4abc5d5..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-package net.mograsim.logic.model.am2900.components;
-
-import static net.mograsim.logic.core.types.Bit.ONE;
-import static net.mograsim.logic.core.types.Bit.U;
-import static net.mograsim.logic.core.types.Bit.ZERO;
-
-import java.util.Arrays;
-import java.util.Map;
-
-import net.mograsim.logic.core.types.Bit;
-import net.mograsim.logic.core.types.BitVector;
-import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
-import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd;
-import net.mograsim.logic.model.model.LogicModelModifiable;
-import net.mograsim.logic.model.model.components.atomic.SimpleRectangularHardcodedModelComponent;
-import net.mograsim.logic.model.model.wires.Pin;
-import net.mograsim.logic.model.model.wires.PinUsage;
-import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
-import net.mograsim.logic.model.snippets.symbolrenderers.PinNamesSymbolRenderer.PinNamesParams.Position;
-
-public class Modeldff12 extends SimpleRectangularHardcodedModelComponent
-{
-       public Modeldff12(LogicModelModifiable model, String name)
-       {
-               super(model, "dff12", name, "D flip flop\n12 bits", false);
-               setSize(40, 20);
-               addPin(new Pin(model, this, "D", 12, PinUsage.INPUT, 20, 20), Position.TOP);
-               addPin(new Pin(model, this, "C", 1, PinUsage.INPUT, 0, 10), Position.RIGHT);
-               addPin(new Pin(model, this, "Y", 12, PinUsage.OUTPUT, 20, 0), Position.BOTTOM);
-
-               init();
-       }
-
-       @Override
-       public Object recalculate(Object lastState, Map<String, ReadEnd> readEnds, Map<String, ReadWriteEnd> readWriteEnds)
-       {
-               Bit[] QC = castAndInitState(lastState);
-
-               Bit CVal = readEnds.get("C").getValue();
-
-               if (QC[12] == ZERO && CVal == ONE)
-                       System.arraycopy(readEnds.get("D").getValues().getBits(), 0, QC, 0, 12);
-
-               readWriteEnds.get("Y").feedSignals(Arrays.copyOfRange(QC, 0, 12));
-               QC[12] = CVal;
-
-               return QC;
-       }
-
-       @Override
-       protected Object getHighLevelState(Object state, String stateID)
-       {
-               Bit[] QC = castAndInitState(state);
-
-               switch (stateID)
-               {
-               case "q":
-                       return BitVector.of(Arrays.copyOfRange(QC, 0, 12));
-               default:
-                       return super.getHighLevelState(QC, stateID);
-               }
-       }
-
-       @Override
-       protected Object setHighLevelState(Object lastState, String stateID, Object newHighLevelState)
-       {
-               Bit[] QC = castAndInitState(lastState);
-
-               switch (stateID)
-               {
-               case "q":
-                       BitVector newHighLevelStateCasted = (BitVector) newHighLevelState;
-                       if (newHighLevelStateCasted.length() != 12)
-                               throw new IllegalArgumentException("Expected BitVector of length 12, not " + newHighLevelStateCasted.length());
-                       System.arraycopy(newHighLevelStateCasted.getBits(), 0, QC, 0, 12);
-                       return QC;
-               default:
-                       return super.setHighLevelState(QC, stateID, newHighLevelState);
-               }
-       }
-
-       private static Bit[] castAndInitState(Object state)
-       {
-               Bit[] QC = (Bit[]) state;
-               if (QC == null)
-               {
-                       QC = new Bit[13];
-                       Arrays.fill(QC, U);
-               }
-               return QC;
-       }
-
-       static
-       {
-               IndirectModelComponentCreator.setComponentSupplier(Modeldff12.class.getCanonicalName(), (m, p, n) -> new Modeldff12(m, n));
-       }
-}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modeldff4_finewe.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modeldff4_finewe.java
deleted file mode 100644 (file)
index 6aebcbd..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-package net.mograsim.logic.model.am2900.components;
-
-import static net.mograsim.logic.core.types.Bit.ONE;
-import static net.mograsim.logic.core.types.Bit.U;
-import static net.mograsim.logic.core.types.Bit.X;
-import static net.mograsim.logic.core.types.Bit.Z;
-import static net.mograsim.logic.core.types.Bit.ZERO;
-
-import java.util.Arrays;
-import java.util.Map;
-
-import net.mograsim.logic.core.types.Bit;
-import net.mograsim.logic.core.types.BitVector;
-import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
-import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd;
-import net.mograsim.logic.model.model.LogicModelModifiable;
-import net.mograsim.logic.model.model.components.atomic.SimpleRectangularHardcodedModelComponent;
-import net.mograsim.logic.model.model.wires.Pin;
-import net.mograsim.logic.model.model.wires.PinUsage;
-import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
-import net.mograsim.logic.model.snippets.symbolrenderers.PinNamesSymbolRenderer.PinNamesParams.Position;
-
-public class Modeldff4_finewe extends SimpleRectangularHardcodedModelComponent
-{
-       public Modeldff4_finewe(LogicModelModifiable model, String name)
-       {
-               super(model, "dff4_finewe", name, "D flip flop\n4 bits", false);
-               setSize(35, 90);
-               addPin(new Pin(model, this, "C", 1, PinUsage.INPUT, 0, 5), Position.RIGHT);
-               addPin(new Pin(model, this, "_WE1", 1, PinUsage.INPUT, 0, 15), Position.RIGHT);
-               addPin(new Pin(model, this, "_WE2", 1, PinUsage.INPUT, 0, 25), Position.RIGHT);
-               addPin(new Pin(model, this, "_WE3", 1, PinUsage.INPUT, 0, 35), Position.RIGHT);
-               addPin(new Pin(model, this, "_WE4", 1, PinUsage.INPUT, 0, 45), Position.RIGHT);
-               addPin(new Pin(model, this, "D1", 1, PinUsage.INPUT, 0, 55), Position.RIGHT);
-               addPin(new Pin(model, this, "D2", 1, PinUsage.INPUT, 0, 65), Position.RIGHT);
-               addPin(new Pin(model, this, "D3", 1, PinUsage.INPUT, 0, 75), Position.RIGHT);
-               addPin(new Pin(model, this, "D4", 1, PinUsage.INPUT, 0, 85), Position.RIGHT);
-               addPin(new Pin(model, this, "Q1", 1, PinUsage.OUTPUT, 35, 5), Position.LEFT);
-               addPin(new Pin(model, this, "Q2", 1, PinUsage.OUTPUT, 35, 15), Position.LEFT);
-               addPin(new Pin(model, this, "Q3", 1, PinUsage.OUTPUT, 35, 25), Position.LEFT);
-               addPin(new Pin(model, this, "Q4", 1, PinUsage.OUTPUT, 35, 35), Position.LEFT);
-
-               init();
-       }
-
-       @Override
-       public Object recalculate(Object lastState, Map<String, ReadEnd> readEnds, Map<String, ReadWriteEnd> readWriteEnds)
-       {
-               Bit[] QC = castAndInitState(lastState);
-
-               Bit CVal = readEnds.get("C").getValue();
-
-               if (QC[0] == ZERO && CVal == ONE)
-                       for (int i = 1; i < 5; i++)
-                       {
-                               Bit WEiVal = readEnds.get("_WE" + i).getValue();
-                               if (WEiVal == X || WEiVal == Z)
-                                       QC[i] = X;
-                               else if (WEiVal == U)
-                                       QC[i] = U;
-                               else if (WEiVal == ZERO)
-                                       QC[i] = readEnds.get("D" + i).getValue();
-                       }
-
-               QC[0] = CVal;
-
-               readWriteEnds.get("Q1").feedSignals(QC[1]);
-               readWriteEnds.get("Q2").feedSignals(QC[2]);
-               readWriteEnds.get("Q3").feedSignals(QC[3]);
-               readWriteEnds.get("Q4").feedSignals(QC[4]);
-
-               return QC;
-       }
-
-       @Override
-       protected Object getHighLevelState(Object state, String stateID)
-       {
-               Bit[] QC = castAndInitState(state);
-
-               if ("q".equals(stateID))
-                       return BitVector.of(Arrays.copyOfRange(QC, 1, 5));
-               if (stateID.length() == 2 && stateID.charAt(0) == 'q')
-               {
-                       char secondChar = stateID.charAt(1);
-                       if (secondChar >= '1' && secondChar <= '4')
-                               return BitVector.of(QC[secondChar - '0']);
-               }
-               return super.getHighLevelState(state, stateID);
-       }
-
-       @Override
-       protected Object setHighLevelState(Object lastState, String stateID, Object newHighLevelState)
-       {
-               Bit[] QC = castAndInitState(lastState);
-
-               if ("q".equals(stateID))
-               {
-                       BitVector newHighLevelStateCasted = (BitVector) newHighLevelState;
-                       if (newHighLevelStateCasted.length() != 4)
-                               throw new IllegalArgumentException("Expected BitVector of length 4, not " + newHighLevelStateCasted.length());
-                       System.arraycopy(newHighLevelStateCasted.getBits(), 0, QC, 1, 4);
-                       return QC;
-               }
-               if (stateID.length() == 2 && stateID.charAt(0) == 'q')
-               {
-                       char secondChar = stateID.charAt(1);
-                       if (secondChar >= '1' && secondChar <= '4')
-                       {
-                               Bit newHighLevelStateCasted;
-                               if (newHighLevelState instanceof Bit)
-                                       newHighLevelStateCasted = (Bit) newHighLevelState;
-                               else
-                               {
-                                       BitVector vector = (BitVector) newHighLevelState;
-                                       if (vector.length() != 1)
-                                               throw new IllegalArgumentException("Expected BitVector of length 1, not " + vector.length());
-                                       newHighLevelStateCasted = vector.getMSBit(0);
-                               }
-                               QC[secondChar - '0'] = newHighLevelStateCasted;
-                               return QC;
-                       }
-               }
-               return super.setHighLevelState(QC, stateID, newHighLevelState);
-       }
-
-       private static Bit[] castAndInitState(Object state)
-       {
-               Bit[] QC = (Bit[]) state;
-               if (QC == null)
-                       QC = new Bit[] { U, U, U, U, U };
-               return QC;
-       }
-
-       static
-       {
-               IndirectModelComponentCreator.setComponentSupplier(Modeldff4_finewe.class.getCanonicalName(),
-                               (m, p, n) -> new Modeldff4_finewe(m, n));
-       }
-}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelinc.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelinc.java
deleted file mode 100644 (file)
index 981c848..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-package net.mograsim.logic.model.am2900.components;
-
-import static net.mograsim.logic.core.types.Bit.U;
-import static net.mograsim.logic.core.types.Bit.X;
-import static net.mograsim.logic.core.types.Bit.Z;
-import static net.mograsim.logic.core.types.Bit.ZERO;
-
-import java.util.Arrays;
-import java.util.Map;
-
-import net.mograsim.logic.core.types.Bit;
-import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
-import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd;
-import net.mograsim.logic.model.model.LogicModelModifiable;
-import net.mograsim.logic.model.model.components.atomic.SimpleRectangularHardcodedModelComponent;
-import net.mograsim.logic.model.model.wires.Pin;
-import net.mograsim.logic.model.model.wires.PinUsage;
-import net.mograsim.logic.model.serializing.IdentifyParams;
-import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
-import net.mograsim.logic.model.snippets.symbolrenderers.PinNamesSymbolRenderer.PinNamesParams.Position;
-
-public class Modelinc extends SimpleRectangularHardcodedModelComponent
-{
-       private final int logicWidth;
-
-       public Modelinc(LogicModelModifiable model, String name, int logicWidth)
-       {
-               super(model, "inc", name, "Incrementer", false);
-               this.logicWidth = logicWidth;
-               setSize(40, 20);
-               addPin(new Pin(model, this, "A", logicWidth, PinUsage.INPUT, 20, 20), Position.TOP);
-               addPin(new Pin(model, this, "CI", 1, PinUsage.INPUT, 40, 10), Position.LEFT);
-               addPin(new Pin(model, this, "Y", logicWidth, PinUsage.OUTPUT, 20, 0), Position.BOTTOM);
-
-               init();
-       }
-
-       @Override
-       public Object recalculate(Object lastState, Map<String, ReadEnd> readEnds, Map<String, ReadWriteEnd> readWriteEnds)
-       {
-               Bit[] ABits = readEnds.get("A").getValues().getBits();
-               Bit CIVal = readEnds.get("CI").getValue();
-               Bit[] YBits = new Bit[logicWidth];
-               if (CIVal == X)
-                       Arrays.fill(YBits, X);
-               else if (CIVal == U)
-                       Arrays.fill(YBits, U);
-               else if (CIVal == Z)
-                       Arrays.fill(YBits, X);
-               else if (CIVal == ZERO)
-                       YBits = ABits;
-               else
-               {
-                       Bit carry = Bit.ONE;
-                       // TODO extract to helper. This code almost also exists in ModelAm2910RegCntr.
-                       for (int i = logicWidth - 1; i >= 0; i--)
-                       {
-                               Bit a = ABits[i];
-                               YBits[i] = a.xor(carry);
-                               carry = a.and(carry);
-                       }
-               }
-               readWriteEnds.get("Y").feedSignals(YBits);
-               return null;
-       }
-
-       @Override
-       public Integer getParamsForSerializing(IdentifyParams idParams)
-       {
-               return logicWidth;
-       }
-
-       static
-       {
-               IndirectModelComponentCreator.setComponentSupplier(Modelinc.class.getCanonicalName(),
-                               (m, p, n) -> new Modelinc(m, n, p.getAsInt()));
-       }
-}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelnor12.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelnor12.java
deleted file mode 100644 (file)
index 4304d4a..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-package net.mograsim.logic.model.am2900.components;
-
-import static net.mograsim.logic.core.types.Bit.ONE;
-import static net.mograsim.logic.core.types.Bit.U;
-import static net.mograsim.logic.core.types.Bit.X;
-import static net.mograsim.logic.core.types.Bit.Z;
-import static net.mograsim.logic.core.types.Bit.ZERO;
-
-import java.util.Map;
-
-import net.mograsim.logic.core.types.Bit;
-import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
-import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd;
-import net.mograsim.logic.model.model.LogicModelModifiable;
-import net.mograsim.logic.model.model.components.atomic.SimpleRectangularHardcodedModelComponent;
-import net.mograsim.logic.model.model.wires.Pin;
-import net.mograsim.logic.model.model.wires.PinUsage;
-import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
-import net.mograsim.logic.model.snippets.symbolrenderers.PinNamesSymbolRenderer.PinNamesParams.Position;
-
-public class Modelnor12 extends SimpleRectangularHardcodedModelComponent
-{
-       public Modelnor12(LogicModelModifiable model, String name)
-       {
-               super(model, "nor12", name, "=0", false);
-               setSize(35, 20);
-               addPin(new Pin(model, this, "D", 12, PinUsage.INPUT, 0, 10), Position.RIGHT);
-               addPin(new Pin(model, this, "Y", 1, PinUsage.OUTPUT, 35, 10), Position.LEFT);
-
-               init();
-       }
-
-       @Override
-       public Object recalculate(Object lastState, Map<String, ReadEnd> readEnds, Map<String, ReadWriteEnd> readWriteEnds)
-       {
-               readWriteEnds.get("Y").feedSignals(getResult(readEnds.get("D").getValues().getBits()));
-               return null;
-       }
-
-       private static Bit getResult(Bit[] DValArr)
-       {
-               for (int i = 0; i < 12; i++)
-                       if (DValArr[i] == X)
-                               return X;
-               for (int i = 0; i < 12; i++)
-                       if (DValArr[i] == U)
-                               return U;
-               for (int i = 0; i < 12; i++)
-                       if (DValArr[i] == ONE)
-                               return ZERO;
-               for (int i = 0; i < 12; i++)
-                       if (DValArr[i] == Z)
-                               return X;
-               return ONE;
-       }
-
-       static
-       {
-               IndirectModelComponentCreator.setComponentSupplier(Modelnor12.class.getCanonicalName(), (m, p, n) -> new Modelnor12(m, n));
-       }
-}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/am2910/ModelAm2910InstrPLA.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/am2910/ModelAm2910InstrPLA.java
deleted file mode 100644 (file)
index a00fc30..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-package net.mograsim.logic.model.am2900.components.am2910;
-
-import static net.mograsim.logic.core.types.Bit.ONE;
-import static net.mograsim.logic.core.types.Bit.U;
-import static net.mograsim.logic.core.types.Bit.X;
-import static net.mograsim.logic.core.types.Bit.ZERO;
-
-import java.util.Map;
-
-import net.mograsim.logic.core.types.Bit;
-import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
-import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd;
-import net.mograsim.logic.model.model.LogicModelModifiable;
-import net.mograsim.logic.model.model.components.atomic.SimpleRectangularHardcodedModelComponent;
-import net.mograsim.logic.model.model.wires.Pin;
-import net.mograsim.logic.model.model.wires.PinUsage;
-import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
-import net.mograsim.logic.model.snippets.symbolrenderers.PinNamesSymbolRenderer.PinNamesParams.Position;
-
-public class ModelAm2910InstrPLA extends SimpleRectangularHardcodedModelComponent
-{
-       public ModelAm2910InstrPLA(LogicModelModifiable model, String name)
-       {
-               super(model, "Am2910InstrPLA", name, "Instr.\nPLA", false);
-               setSize(30, 85);
-               addPin(new Pin(model, this, "PASS", 1, PinUsage.INPUT, 0, 5), Position.RIGHT);
-               addPin(new Pin(model, this, "I", 4, PinUsage.INPUT, 0, 20), Position.RIGHT);
-               addPin(new Pin(model, this, "R=0", 1, PinUsage.INPUT, 15, 0), Position.BOTTOM);
-               addPin(new Pin(model, this, "_PL", 1, PinUsage.OUTPUT, 5, 85), Position.TOP);
-               addPin(new Pin(model, this, "_MAP", 1, PinUsage.OUTPUT, 15, 85), Position.TOP);
-               addPin(new Pin(model, this, "_VECT", 1, PinUsage.OUTPUT, 25, 85), Position.TOP);
-               addPin(new Pin(model, this, "RWE", 1, PinUsage.OUTPUT, 30, 5), Position.LEFT);
-               addPin(new Pin(model, this, "RDEC", 1, PinUsage.OUTPUT, 30, 15), Position.LEFT);
-               addPin(new Pin(model, this, "YD", 1, PinUsage.OUTPUT, 30, 25), Position.LEFT);
-               addPin(new Pin(model, this, "YR", 1, PinUsage.OUTPUT, 30, 35), Position.LEFT);
-               addPin(new Pin(model, this, "YF", 1, PinUsage.OUTPUT, 30, 45), Position.LEFT);
-               addPin(new Pin(model, this, "YmuPC", 1, PinUsage.OUTPUT, 30, 55), Position.LEFT);
-               addPin(new Pin(model, this, "STKI0", 1, PinUsage.OUTPUT, 30, 65), Position.LEFT);
-               addPin(new Pin(model, this, "STKI1", 1, PinUsage.OUTPUT, 30, 75), Position.LEFT);
-
-               init();
-       }
-
-       @Override
-       public Object recalculate(Object lastState, Map<String, ReadEnd> readEnds, Map<String, ReadWriteEnd> readWriteEnds)
-       {
-               ReadEnd PASS = readEnds.get("PASS");
-               ReadEnd I = readEnds.get("I");
-               ReadEnd Req0 = readEnds.get("R=0");
-               ReadWriteEnd _PL = readWriteEnds.get("_PL");
-               ReadWriteEnd _MAP = readWriteEnds.get("_MAP");
-               ReadWriteEnd _VECT = readWriteEnds.get("_VECT");
-               ReadWriteEnd RWE = readWriteEnds.get("RWE");
-               ReadWriteEnd RDEC = readWriteEnds.get("RDEC");
-               ReadWriteEnd YD = readWriteEnds.get("YD");
-               ReadWriteEnd YR = readWriteEnds.get("YR");
-               ReadWriteEnd YF = readWriteEnds.get("YF");
-               ReadWriteEnd YmuPC = readWriteEnds.get("YmuPC");
-               ReadWriteEnd STKI0 = readWriteEnds.get("STKI0");
-               ReadWriteEnd STKI1 = readWriteEnds.get("STKI1");
-
-               Bit PASSVal = PASS.getValue();
-               Bit I3Val = I.getValue(3);
-               Bit I2Val = I.getValue(2);
-               Bit I1Val = I.getValue(1);
-               Bit I0Val = I.getValue(0);
-               Bit Req0Val = Req0.getValue();
-
-               if (!I3Val.isBinary() || !I2Val.isBinary() || !I1Val.isBinary() || !I0Val.isBinary())
-                       if ((I3Val == U || I3Val.isBinary()) || (I2Val == U || I2Val.isBinary()) || (I1Val == U || I1Val.isBinary())
-                                       || (I0Val == U || I0Val.isBinary()))
-                       {
-                               _PL.feedSignals(U);
-                               _MAP.feedSignals(U);
-                               _VECT.feedSignals(U);
-                               RWE.feedSignals(U);
-                               RDEC.feedSignals(U);
-                               YD.feedSignals(U);
-                               YR.feedSignals(U);
-                               YF.feedSignals(U);
-                               YmuPC.feedSignals(U);
-                               STKI0.feedSignals(U);
-                               STKI1.feedSignals(U);
-                       } else
-                       {
-                               _PL.feedSignals(X);
-                               _MAP.feedSignals(X);
-                               _VECT.feedSignals(X);
-                               RWE.feedSignals(X);
-                               RDEC.feedSignals(X);
-                               YD.feedSignals(X);
-                               YR.feedSignals(X);
-                               YF.feedSignals(X);
-                               YmuPC.feedSignals(X);
-                               STKI0.feedSignals(X);
-                               STKI1.feedSignals(X);
-                       }
-               else
-               {
-                       int IAsInt = (I3Val == ONE ? 8 : 0) + (I2Val == ONE ? 4 : 0) + (I1Val == ONE ? 2 : 0) + (I0Val == ONE ? 1 : 0);
-                       Bit _PLVal = ONE;
-                       Bit _MAPVal = ONE;
-                       Bit _VECTVal = ONE;
-                       if (IAsInt == 2)
-                               _MAPVal = ZERO;
-                       else if (IAsInt == 6)
-                               _VECTVal = ZERO;
-                       else
-                               _PLVal = ZERO;
-                       _PL.feedSignals(_PLVal);
-                       _MAP.feedSignals(_MAPVal);
-                       _VECT.feedSignals(_VECTVal);
-                       if (IAsInt == 8 || IAsInt == 9 || IAsInt == 15)
-                       {
-                               RWE.feedSignals(Req0Val);
-                               RDEC.feedSignals(Req0Val);// "forward" X/U/Z
-                       } else if (IAsInt == 4)
-                       {
-                               RWE.feedSignals(PASSVal);
-                               RDEC.feedSignals(PASSVal == ONE ? ZERO : PASSVal);// "forward" X/U/Z
-                       } else if (IAsInt == 12)
-                       {
-                               RWE.feedSignals(ONE);
-                               RDEC.feedSignals(ZERO);
-                       } else
-                       {
-                               RWE.feedSignals(ZERO);
-                               RDEC.feedSignals(ZERO);
-                       }
-                       if (!PASSVal.isBinary())
-                       {
-                               YD.feedSignals(PASSVal);// "forward" X/U/Z
-                               YR.feedSignals(PASSVal);// "forward" X/U/Z
-                               YF.feedSignals(PASSVal);// "forward" X/U/Z
-                               YmuPC.feedSignals(PASSVal);// "forward" X/U/Z
-                       } else
-                       {
-                               Bit YDVal = ZERO;
-                               Bit YRVal = ZERO;
-                               Bit YFVal = ZERO;
-                               Bit YmuPCVal = ZERO;
-                               switch (IAsInt + (PASSVal == ONE ? 16 : 0))
-                               {
-                               case 0:
-                               case 0 + 16:
-                                       break;
-                               case 2:
-                               case 1 + 16:
-                               case 2 + 16:
-                               case 3 + 16:
-                               case 5 + 16:
-                               case 6 + 16:
-                               case 7 + 16:
-                               case 11 + 16:
-                                       YDVal = ONE;
-                                       break;
-                               case 5:
-                               case 7:
-                                       YRVal = ONE;
-                                       break;
-                               case 13:
-                               case 10 + 16:
-                                       YFVal = ONE;
-                                       break;
-                               case 1:
-                               case 3:
-                               case 4:
-                               case 6:
-                               case 10:
-                               case 11:
-                               case 12:
-                               case 14:
-                               case 4 + 16:
-                               case 12 + 16:
-                               case 13 + 16:
-                               case 14 + 16:
-                               case 15 + 16:
-                                       YmuPCVal = ONE;
-                                       break;
-                               case 8:
-                               case 8 + 16:
-                                       YFVal = Req0Val.not();// "forward" X/U/Z
-                                       YmuPCVal = Req0Val;// "forward" X/U/Z
-                                       break;
-                               case 9:
-                               case 9 + 16:
-                                       YDVal = Req0Val.not();// "forward" X/U/Z
-                                       YmuPCVal = Req0Val;// "forward" X/U/Z
-                                       break;
-                               case 15:
-                                       YFVal = Req0Val.not();// "forward" X/U/Z
-                                       YDVal = Req0Val;// "forward" X/U/Z
-                                       break;
-                               default:
-                                       throw new IllegalStateException("shouldn't happen");
-                               }
-                               YD.feedSignals(YDVal);
-                               YR.feedSignals(YRVal);
-                               YF.feedSignals(YFVal);
-                               YmuPC.feedSignals(YmuPCVal);
-                               Bit STKI0Val;
-                               Bit STKI1Val;
-                               switch (IAsInt + (PASSVal == ONE ? 16 : 0))
-                               {
-                               case 1:
-                               case 2:
-                               case 3:
-                               case 6:
-                               case 7:
-                               case 9:
-                               case 10:
-                               case 11:
-                               case 12:
-                               case 13:
-                               case 14:
-                               case 2 + 16:
-                               case 3 + 16:
-                               case 6 + 16:
-                               case 7 + 16:
-                               case 9 + 16:
-                               case 12 + 16:
-                               case 14 + 16:
-                                       // HOLD
-                                       STKI1Val = ZERO;
-                                       STKI0Val = ZERO;
-                                       break;
-                               case 4:
-                               case 5:
-                               case 1 + 16:
-                               case 4 + 16:
-                               case 5 + 16:
-                                       // PUSH
-                                       STKI1Val = ZERO;
-                                       STKI0Val = ONE;
-                                       break;
-                               case 0:
-                               case 0 + 16:
-                                       // CLEAR
-                                       STKI1Val = ONE;
-                                       STKI0Val = ZERO;
-                                       break;
-                               case 10 + 16:
-                               case 11 + 16:
-                               case 13 + 16:
-                               case 15 + 16:
-                                       // POP
-                                       STKI1Val = ONE;
-                                       STKI0Val = ONE;
-                                       break;
-                               case 8:
-                               case 15:
-                               case 8 + 16:
-                                       STKI1Val = Req0Val;// "forward" X/U/Z
-                                       STKI0Val = Req0Val;// "forward" X/U/Z
-                                       break;
-                               default:
-                                       throw new IllegalStateException("shouldn't happen");
-                               }
-                               STKI0.feedSignals(STKI0Val);
-                               STKI1.feedSignals(STKI1Val);
-                       }
-               }
-               return null;
-       }
-
-       static
-       {
-               IndirectModelComponentCreator.setComponentSupplier(ModelAm2910InstrPLA.class.getCanonicalName(),
-                               (m, p, n) -> new ModelAm2910InstrPLA(m, n));
-       }
-}
\ No newline at end of file
index 7bdc703..baa19bf 100644 (file)
@@ -26,7 +26,7 @@ public class ModelAm2910RegCntr extends SimpleRectangularHardcodedModelComponent
                setSize(40, 40);
                addPin(new Pin(model, this, "D", 12, PinUsage.INPUT, 20, 0), Position.BOTTOM);
                addPin(new Pin(model, this, "_RLD", 1, PinUsage.INPUT, 0, 5), Position.RIGHT);
-               addPin(new Pin(model, this, "WE", 1, PinUsage.INPUT, 0, 20), Position.RIGHT);
+               addPin(new Pin(model, this, "LD", 1, PinUsage.INPUT, 0, 20), Position.RIGHT);
                addPin(new Pin(model, this, "DEC", 1, PinUsage.INPUT, 0, 30), Position.RIGHT);
                addPin(new Pin(model, this, "C", 1, PinUsage.INPUT, 40, 20), Position.LEFT);
                addPin(new Pin(model, this, "Y", 12, PinUsage.OUTPUT, 20, 40), Position.TOP);
@@ -41,7 +41,7 @@ public class ModelAm2910RegCntr extends SimpleRectangularHardcodedModelComponent
 
                ReadEnd D = readEnds.get("D");
                ReadEnd _RLD = readEnds.get("_RLD");
-               ReadEnd WE = readEnds.get("WE");
+               ReadEnd LD = readEnds.get("LD");
                ReadEnd DEC = readEnds.get("DEC");
                ReadEnd C = readEnds.get("C");
                ReadWriteEnd Y = readWriteEnds.get("Y");
@@ -52,9 +52,9 @@ public class ModelAm2910RegCntr extends SimpleRectangularHardcodedModelComponent
                // TODO handle U/X/Z
                if (oldCVal == ZERO && CVal == ONE)
                {
-                       if ((DEC.getValue() == ZERO && WE.getValue() == ONE) || _RLD.getValue() == ZERO)
+                       if (LD.getValue() == ONE || _RLD.getValue() == ZERO)
                                System.arraycopy(D.getValues().getBits(), 0, QC, 0, 12);
-                       else if (WE.getValue() == ONE)
+                       else if (DEC.getValue() == ONE)
                        {
                                Bit carry = Bit.ZERO;
                                // TODO extract to helper. This code almost also exists in Modelinc.
index 8ab22a4..cea9bdc 100644 (file)
@@ -1,6 +1,5 @@
 package net.mograsim.logic.model.am2900.machine.registers;
 
-import net.mograsim.logic.model.am2900.machine.registers.Am2900Register;
 import net.mograsim.machine.registers.HighLevelStateBasedRegister;
 
 public class InstrRegister extends HighLevelStateBasedRegister implements Am2900Register
index 9c082dd..b625e85 100644 (file)
@@ -1,6 +1,5 @@
 package net.mograsim.logic.model.am2900.machine.registers;
 
-import net.mograsim.logic.model.am2900.machine.registers.Am2900Register;
 import net.mograsim.machine.registers.HighLevelStateBasedRegister;
 
 public class PCRegister extends HighLevelStateBasedRegister implements Am2900Register
index 453dcd8..97dc932 100644 (file)
@@ -1,6 +1,5 @@
 package net.mograsim.logic.model.am2900.machine.registers;
 
-import net.mograsim.logic.model.am2900.machine.registers.Am2900Register;
 import net.mograsim.machine.registers.HighLevelStateBasedRegister;
 
 public class muInstrRegister extends HighLevelStateBasedRegister implements Am2900Register
index df56310..851af05 100644 (file)
@@ -4,13 +4,8 @@
   "Am2900MicroInstructionMemory": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.ModelAm2900MicroInstructionMemory",
   "Am2904RegCTInstrDecode": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.am2904.ModelAm2904RegCTInstrDecode",
   "Am2904ShiftInstrDecode": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.am2904.ModelAm2904ShiftInstrDecode",
-  "Am2910InstrPLA": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.am2910.ModelAm2910InstrPLA",
   "Am2910RegCntr": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.am2910.ModelAm2910RegCntr",
   "Am2910SP": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.am2910.ModelAm2910SP",
-  "dff12": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.Modeldff12",
-  "dff4_finewe": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.Modeldff4_finewe",
-  "inc": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.Modelinc",
-  "nor12": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.Modelnor12",
   "ram5_12": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.Modelram5_12",
   "sel4_12": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.Modelsel4_12",
   "Am2900": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/Am2900.json",
@@ -21,6 +16,7 @@
   "Am2901ALUOneBit": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/am2901/Am2901ALUOneBit.json",
   "Am2904": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/am2904/Am2904.json",
   "Am2910": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/am2910/Am2910.json",
+  "Am2910InstrPLA": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/am2910/Am2910InstrPLA.json",
   "Am2904MSR": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/am2904/Am2904MSR.json",
   "Am2904muSR": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/am2904/Am2904muSR.json",
   "Am2904TestLogic": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/am2904/Am2904TestLogic.json",
   "demux2": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/demux2.json",
   "dff": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff.json",
   "dff4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff4.json",
+  "dff4_finewe": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff4_finewe.json",
   "dff4_invwe": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff4_invwe.json",
   "dff8": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff8.json",
+  "dff12": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff12.json",
   "dff12_we": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff12_we.json",
   "dff16": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff16.json",
   "dff16_we": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff16_we.json",
   "dlatch80": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dlatch80.json",
   "fulladder": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/fulladder.json",
   "halfadder": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/halfadder.json",
+  "halfadder_invz": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/halfadder_invz.json",
+  "inc4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/inc4.json",
+  "inc12": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/inc12.json",
+  "inc16": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/inc16.json",
   "mux1": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/mux1.json",
   "mux1_4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/mux1_4.json",
   "mux1_8": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/mux1_8.json",
@@ -55,6 +57,7 @@
   "mux2": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/mux2.json",
   "mux3": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/mux3.json",
   "nand3": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/nand3.json",
+  "nor12": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/nor12.json",
   "not4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/not4.json",
   "or4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/or4.json",
   "or_4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/or_4.json",
@@ -63,5 +66,6 @@
   "sel1": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/sel1.json",
   "sel2_4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/sel2_4.json",
   "sel3_4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/sel3_4.json",
+  "xnor": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/xnor.json",
   "xor": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/xor.json"
 }
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/CountGatesPerComponent.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/CountGatesPerComponent.java
new file mode 100755 (executable)
index 0000000..cac3aa7
--- /dev/null
@@ -0,0 +1,39 @@
+package net.mograsim.logic.model.examples;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Map.Entry;
+
+import net.mograsim.logic.model.am2900.Am2900Loader;
+import net.mograsim.logic.model.model.LogicModelModifiable;
+import net.mograsim.logic.model.model.components.ModelComponent;
+import net.mograsim.logic.model.modeladapter.CoreModelParameters;
+import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
+import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
+
+public class CountGatesPerComponent
+{
+       public static void main(String[] args) throws IOException
+       {
+               Am2900Loader.setup();
+
+               Path root = Path.of("components");
+               Files.walk(root).map(Path::toString).filter(s -> s.endsWith(".json")).map("jsonfile:"::concat)
+                               .forEach(CountGatesPerComponent::printGatesPerComponent);
+       }
+
+       private static void printGatesPerComponent(String componentID)
+       {
+               LogicModelModifiable model = new LogicModelModifiable();
+               IndirectModelComponentCreator.createComponent(model, componentID);
+
+               LogicCoreAdapter.gateCountsPerComponentClass.clear();
+               LogicCoreAdapter.convert(model, new CoreModelParameters());
+
+               System.out.println(componentID + ':');
+               for (Entry<Class<? extends ModelComponent>, Integer> e : LogicCoreAdapter.gateCountsPerComponentClass.entrySet())
+                       System.out.println("  " + e.getKey().getSimpleName() + ": " + e.getValue());
+               System.out.println();
+       }
+}
\ No newline at end of file
index eb3f0b2..4efc6f7 100644 (file)
@@ -27,6 +27,7 @@ public class ModelComponentTestbench
        {
                Am2900Loader.setup();
                ModelComponent comp = new StrictAm2900MachineDefinition().createNew(model).getAm2900();
+//             ModelComponent comp = IndirectModelComponentCreator.createComponent(model, "inc12");
 
                List<String> inputPinNames = new ArrayList<>();
                List<String> outputPinNames = new ArrayList<>();
@@ -43,14 +44,14 @@ public class ModelComponentTestbench
                for (int i = 0; i < inputPinNames.size(); i++)
                {
                        String pinName = inputPinNames.get(i);
-                       ModelManualSwitch sw = new ModelManualSwitch(model, comp.getPin(pinName).logicWidth);
+                       ModelManualSwitch sw = new ModelManualSwitch(model, comp.getPin(pinName).logicWidth, pinName);
                        sw.moveTo(0, 20 * i);
                        new ModelWire(model, comp.getPin(pinName), sw.getOutputPin());
                }
                for (int i = 0; i < outputPinNames.size(); i++)
                {
                        String pinName = outputPinNames.get(i);
-                       ModelBitDisplay bd = new ModelBitDisplay(model, comp.getPin(pinName).logicWidth);
+                       ModelBitDisplay bd = new ModelBitDisplay(model, comp.getPin(pinName).logicWidth, pinName);
                        bd.moveTo(200, 20 * i);
                        new ModelWire(model, comp.getPin(pinName), bd.getInputPin());
                }
index 1aa7c3a..627ebaf 100644 (file)
@@ -1,5 +1,6 @@
 package net.mograsim.logic.model.examples;
 
+import java.io.FileWriter;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -114,7 +115,12 @@ public class ReserializeAndVerifyJSONs
                                changeWireNames_AfterSerialization(newComponentJSON, wireNameRemapping);
                        sortAllJSONArrays(newComponentJSON);
 
-                       JsonHandler.writeJson(newComponentJSON, componentPath.toString());
+                       try (FileWriter writer = new FileWriter(componentPath.toString()))
+                       {
+                               String json = JsonHandler.toJson(newComponentJSON);
+                               json = json.replace("\u00b5", "\\u00b5");
+                               writer.write(json);
+                       }
                }
                catch (Exception e)
                {
diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/VerilogExporter.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/VerilogExporter.java
new file mode 100644 (file)
index 0000000..fb1fd2f
--- /dev/null
@@ -0,0 +1,598 @@
+package net.mograsim.logic.model.examples;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Scanner;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import com.google.gson.JsonElement;
+import com.google.gson.JsonNull;
+
+import net.mograsim.logic.model.am2900.Am2900Loader;
+import net.mograsim.logic.model.model.LogicModelModifiable;
+import net.mograsim.logic.model.model.components.ModelComponent;
+import net.mograsim.logic.model.model.components.submodels.SubmodelComponent;
+import net.mograsim.logic.model.model.wires.Pin;
+import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
+import net.mograsim.logic.model.serializing.LogicModelParams.ComponentParams;
+import net.mograsim.logic.model.serializing.LogicModelParams.WireParams;
+import net.mograsim.logic.model.serializing.LogicModelParams.WireParams.PinParams;
+import net.mograsim.logic.model.serializing.SubmodelComponentParams;
+import net.mograsim.logic.model.serializing.SubmodelComponentParams.InterfacePinParams;
+import net.mograsim.logic.model.serializing.SubmodelComponentSerializer;
+
+//TODO clean this mess
+public class VerilogExporter
+{
+       private static final String COMPONENT_PREFIX = "mgs_";
+
+       public static void main(String[] args) throws IOException
+       {
+               Am2900Loader.setup();
+               try (Scanner sysin = new Scanner(System.in))
+               {
+                       System.out.print("Directory to export Verilog into >");
+                       Path target = Paths.get(sysin.nextLine());
+                       if (!Files.exists(target))
+                               Files.createDirectories(target);
+                       else if (!Files.isDirectory(target))
+                               throw new IllegalArgumentException("Target exists and is not a directory");
+
+                       System.out.print("Component ID to serialize recursively >");
+                       String rootComponentID = sysin.nextLine();
+                       {
+                               if (!Files.exists(target))
+                                       Files.createDirectories(target);
+                               else if (!Files.isDirectory(target))
+                                       throw new IllegalArgumentException("Target exists and is not a directory");
+                               Map<String, SubmodelComponentParams> componentsById = readComponentIncludingDependencies(rootComponentID);
+                               Map<String, PinIdentifierGenerator> pinIdentifierGeneratorsPerComponentID = new HashMap<>();
+                               Tuple2<Map<String, Map<String, String>>, Map<String, Map<String, Set<String>>>> combinedPinNames = generateCombinedPinNames(
+                                               componentsById, pinIdentifierGeneratorsPerComponentID);
+                               Map<String, Tuple2<List<String>, List<Integer>>> sortedInterfacePinNamesAndWidthsPerComponentID = generateSortedInterfacePinNamesAndWidthesPerComponentID(
+                                               componentsById, combinedPinNames.e1);
+                               writeComponentsVerilog(target, componentsById, pinIdentifierGeneratorsPerComponentID,
+                                               sortedInterfacePinNamesAndWidthsPerComponentID, combinedPinNames);
+                       }
+               }
+       }
+
+       private static Map<String, SubmodelComponentParams> readComponentIncludingDependencies(String rootComponentID)
+       {
+               Map<String, SubmodelComponentParams> result = new HashMap<>();
+               readComponentIncludingDependenciesRecursively(rootComponentID, null, result);
+               return result;
+       }
+
+       private static void readComponentIncludingDependenciesRecursively(String id, JsonElement params,
+                       Map<String, SubmodelComponentParams> result)
+       {
+               if (result.containsKey(id))
+                       return;
+
+               ModelComponent component = IndirectModelComponentCreator.createComponent(new LogicModelModifiable(), id, params);
+               if (component instanceof SubmodelComponent)
+               {
+                       SubmodelComponentParams componentJson = SubmodelComponentSerializer.serialize((SubmodelComponent) component);
+                       result.put(id, componentJson);
+                       for (ComponentParams subcomponentParams : componentJson.submodel.components)
+                               readComponentIncludingDependenciesRecursively(subcomponentParams.id, subcomponentParams.params, result);
+               }
+       }
+
+       private static Tuple2<Map<String, Map<String, String>>, Map<String, Map<String, Set<String>>>> generateCombinedPinNames(
+                       Map<String, SubmodelComponentParams> componentsById, Map<String, PinIdentifierGenerator> pinIdentifierGeneratorsPerComponentID)
+       {
+               Map<String, Map<String, Set<String>>> connectedInnerPinNamesPerComponentID = new HashMap<>();
+
+               generateConnectedInnerPins(componentsById, pinIdentifierGeneratorsPerComponentID, connectedInnerPinNamesPerComponentID);
+
+               Map<String, Map<String, String>> combinedInterfacePinNamesPerComponentID = new HashMap<>();
+
+               for (boolean anyChange = true; anyChange;)
+               {
+                       anyChange = false;
+                       for (Entry<String, SubmodelComponentParams> e : componentsById.entrySet())
+                               anyChange |= checkForConnectedPins(e.getKey(), e.getValue(), componentsById, pinIdentifierGeneratorsPerComponentID,
+                                               connectedInnerPinNamesPerComponentID, combinedInterfacePinNamesPerComponentID);
+               }
+
+               return new Tuple2<>(combinedInterfacePinNamesPerComponentID, connectedInnerPinNamesPerComponentID);
+       }
+
+       private static boolean checkForConnectedPins(String componentID, SubmodelComponentParams componentJson,
+                       Map<String, SubmodelComponentParams> componentsById, Map<String, PinIdentifierGenerator> pinIdentifierGeneratorsPerComponentID,
+                       Map<String, Map<String, Set<String>>> connectedInnerPinNamesPerComponentID,
+                       Map<String, Map<String, String>> combinedPinNamesPerComponentID)
+       {
+               PinIdentifierGenerator pinIdentifierGenerator = pinIdentifierGeneratorsPerComponentID.get(componentID);
+               Map<String, Set<String>> connectedInnerPinNames = connectedInnerPinNamesPerComponentID.get(componentID);
+               Map<String, String> pinNameRemapping = combinedPinNamesPerComponentID.computeIfAbsent(componentID, k ->
+               {
+                       Map<String, String> result = new HashMap<>();
+                       for (InterfacePinParams pinParams : componentJson.interfacePins)
+                               result.put(pinParams.name, pinParams.name);
+                       return result;
+               });
+
+               for (InterfacePinParams pin1Params : componentJson.interfacePins)
+               {
+                       String pin1Name = pinNameRemapping.get(pin1Params.name);
+                       Set<String> connectedInnerPinNamesPin1 = connectedInnerPinNames
+                                       .get(pinIdentifierGenerator.getPinID(SubmodelComponent.SUBMODEL_INTERFACE_NAME, pin1Name));
+                       if (connectedInnerPinNamesPin1 != null)
+                               for (InterfacePinParams pin2Params : componentJson.interfacePins)
+                               {
+                                       String pin2Name = pinNameRemapping.get(pin2Params.name);
+                                       String pin2InnerPinName = pinIdentifierGenerator.getPinID(SubmodelComponent.SUBMODEL_INTERFACE_NAME, pin2Name);
+                                       if (connectedInnerPinNamesPin1.contains(pin2InnerPinName) && !pin1Name.equals(pin2Name))
+                                       {
+                                               System.out.println("These pins of component " + componentID + " are connected: " + pin1Name + " and " + pin2Name);
+                                               for (Entry<String, String> e : pinNameRemapping.entrySet())
+                                                       if (e.getValue().equals(pin2Name))
+                                                               e.setValue(pin1Name);
+                                               connectPinsInSupercomponents(componentID, pin1Name, pin2Name, componentsById, pinIdentifierGeneratorsPerComponentID,
+                                                               connectedInnerPinNamesPerComponentID);
+                                               return true;
+                                       }
+                               }
+               }
+               return false;
+       }
+
+       private static void connectPinsInSupercomponents(String componentID, String pin1Name, String pin2Name,
+                       Map<String, SubmodelComponentParams> componentsById, Map<String, PinIdentifierGenerator> pinIdentifierGeneratorsPerComponentID,
+                       Map<String, Map<String, Set<String>>> connectedInnerPinNamesPerComponentID)
+       {
+               for (Entry<String, SubmodelComponentParams> e : componentsById.entrySet())
+               {
+                       String superComponentID = e.getKey();
+                       SubmodelComponentParams superComponentJson = e.getValue();
+
+                       PinIdentifierGenerator pinIdentifierGenerator = pinIdentifierGeneratorsPerComponentID.get(superComponentID);
+                       Map<String, Set<String>> connectedPinNames = connectedInnerPinNamesPerComponentID.get(superComponentID);
+
+                       for (ComponentParams subcomponentParams : superComponentJson.submodel.components)
+                               if (subcomponentParams.id.equals(componentID))
+                               {
+                                       String pin1ID = pinIdentifierGenerator.getPinID(subcomponentParams.name, pin1Name);
+                                       String pin2ID = pinIdentifierGenerator.getPinID(subcomponentParams.name, pin2Name);
+
+                                       Set<String> connectedPinNamesPin1 = connectedPinNames.get(pin1ID);
+                                       Set<String> connectedPinNamesPin2 = connectedPinNames.get(pin2ID);
+
+                                       if (connectedPinNamesPin2 != null)
+                                       {
+                                               connectedPinNamesPin2.remove(pin2ID);
+                                               if (connectedPinNamesPin1 != null)
+                                               {
+                                                       connectedPinNamesPin2.addAll(connectedPinNamesPin1);
+                                                       for (String pinNameToRewriteMapping : connectedPinNamesPin1)
+                                                               connectedPinNames.put(pinNameToRewriteMapping, connectedPinNamesPin2);
+                                               }
+                                       }
+                               }
+               }
+       }
+
+       private static void generateConnectedInnerPins(Map<String, SubmodelComponentParams> componentsById,
+                       Map<String, PinIdentifierGenerator> pinIdentifierGeneratorsPerComponentID,
+                       Map<String, Map<String, Set<String>>> connectedInnerPinNamesPerComponentID)
+       {
+               for (Entry<String, SubmodelComponentParams> e : componentsById.entrySet())
+               {
+                       String componentID = e.getKey();
+                       SubmodelComponentParams componentJson = e.getValue();
+
+                       PinIdentifierGenerator pinIdentifierGenerator = new PinIdentifierGenerator();
+                       Map<String, Set<String>> connectedInnerPinNames = new HashMap<>();
+                       pinIdentifierGeneratorsPerComponentID.put(componentID, pinIdentifierGenerator);
+                       connectedInnerPinNamesPerComponentID.put(componentID, connectedInnerPinNames);
+
+                       for (WireParams wireJson : componentJson.submodel.wires)
+                       {
+                               String pin1Name = pinIdentifierGenerator.getPinID(wireJson.pin1);
+                               String pin2Name = pinIdentifierGenerator.getPinID(wireJson.pin2);
+
+                               Set<String> oldConnectedPins1 = connectedInnerPinNames.get(pin1Name);
+                               Set<String> oldConnectedPins2 = connectedInnerPinNames.get(pin2Name);
+
+                               if (oldConnectedPins1 == null)
+                                       oldConnectedPins1 = Set.of(pin1Name);
+                               if (oldConnectedPins2 == null)
+                               {
+                                       oldConnectedPins2 = new HashSet<>(Arrays.asList(pin2Name));
+                                       connectedInnerPinNames.put(pin2Name, oldConnectedPins2);
+                               }
+
+                               oldConnectedPins2.addAll(oldConnectedPins1);
+                               for (String pinNameToRewriteMapping : oldConnectedPins1)
+                                       connectedInnerPinNames.put(pinNameToRewriteMapping, oldConnectedPins2);
+                       }
+               }
+       }
+
+       private static Map<String, Tuple2<List<String>, List<Integer>>> generateSortedInterfacePinNamesAndWidthesPerComponentID(
+                       Map<String, SubmodelComponentParams> componentsById, Map<String, Map<String, String>> combinedInterfacePinsPerComponentID)
+       {
+               return combinedInterfacePinsPerComponentID.entrySet().stream().collect(Collectors.toMap(Entry::getKey, e ->
+               {
+                       List<String> names = e.getValue().values().stream().distinct().sorted().collect(Collectors.toList());
+                       System.out.println("Assuming following order for interface pins of " + e.getKey() + ": " + names);
+                       Map<String, Integer> widthesPerName = Arrays.stream(componentsById.get(e.getKey()).interfacePins)
+                                       .collect(Collectors.toMap(p -> p.name, p -> p.logicWidth));
+                       List<Integer> widthes = names.stream().map(widthesPerName::get).collect(Collectors.toList());
+                       return new Tuple2<>(names, widthes);
+               }));
+       }
+
+       private static void writeComponentsVerilog(Path target, Map<String, SubmodelComponentParams> componentsById,
+                       Map<String, PinIdentifierGenerator> pinIdentifierGeneratorsPerComponentID,
+                       Map<String, Tuple2<List<String>, List<Integer>>> sortedInterfacePinNamesAndWidthsPerComponentID,
+                       Tuple2<Map<String, Map<String, String>>, Map<String, Map<String, Set<String>>>> combinedPinNames)
+       {
+               componentsById.forEach((componentID, componentJson) ->
+               {
+                       try
+                       {
+                               String componentPathStr = componentID.replace(File.separator, "_").replace('.', '_');
+                               Path componentPathWithoutPrefix = target.resolve(componentPathStr + ".v");
+                               Path componentParent = componentPathWithoutPrefix.getParent();
+                               String componentName = componentPathWithoutPrefix.getFileName().toString();
+                               Files.createDirectories(componentParent);
+                               Files.writeString(componentParent.resolve(COMPONENT_PREFIX + componentName),
+                                               new VerilogExporter(componentID, componentJson, pinIdentifierGeneratorsPerComponentID,
+                                                               sortedInterfacePinNamesAndWidthsPerComponentID, combinedPinNames).generateVerilog());
+                       }
+                       catch (IOException e)
+                       {
+                               throw new UncheckedIOException(e);
+                       }
+               });
+       }
+
+       private final String componentID;
+       private final SubmodelComponentParams componentJson;
+
+       private final PinIdentifierGenerator pinIdentifierGenerator;
+       private final Map<String, Set<String>> combinedInnerPinNames;
+       private final List<String> sortedInterfacePinNames;
+       private final Map<String, Tuple2<List<String>, List<Integer>>> sortedInterfacePinNamesAndWidthsPerComponentID;
+
+       public VerilogExporter(String componentID, SubmodelComponentParams componentJson,
+                       Map<String, PinIdentifierGenerator> pinIdentifierGeneratorsPerComponentID,
+                       Map<String, Tuple2<List<String>, List<Integer>>> sortedInterfacePinNamesAndWidthsPerComponentID,
+                       Tuple2<Map<String, Map<String, String>>, Map<String, Map<String, Set<String>>>> combinedPinNames)
+       {
+               this.componentID = componentID;
+               this.componentJson = componentJson;
+
+               this.pinIdentifierGenerator = pinIdentifierGeneratorsPerComponentID.get(componentID);
+               this.combinedInnerPinNames = combinedPinNames.e2.get(componentID);
+               this.sortedInterfacePinNames = sortedInterfacePinNamesAndWidthsPerComponentID.get(componentID).e1;
+               this.sortedInterfacePinNamesAndWidthsPerComponentID = sortedInterfacePinNamesAndWidthsPerComponentID;
+       }
+
+       public String generateVerilog()
+       {
+               StringBuilder result = new StringBuilder();
+
+               result.append("module ");
+               result.append(COMPONENT_PREFIX);
+               result.append(sanitizeVerilog(componentID));
+
+               result.append(" (");
+               appendInterface(result);
+               result.append(");\n\n");
+
+               appendComponents(result);
+
+               result.append("endmodule\n");
+
+               return result.toString();
+       }
+
+       private void appendInterface(StringBuilder result)
+       {
+               result.append("input rst, input clk");
+               if (!sortedInterfacePinNames.isEmpty())
+               {
+                       Map<String, Integer> logicWidthsPerInterfacePinName = Arrays.stream(componentJson.interfacePins)
+                                       .collect(Collectors.toMap(p -> p.name, p -> p.logicWidth));
+                       for (int i = 0; i < sortedInterfacePinNames.size(); i++)
+                       {
+                               result.append(",\n");
+                               String interfacePinName = sortedInterfacePinNames.get(i);
+                               int logicWidth = logicWidthsPerInterfacePinName.get(interfacePinName);
+
+                               result.append("  input ");
+                               appendLogicWidth(result, logicWidth);
+                               result.append(sanitizeVerilog(interfacePinName));
+                               result.append("_pre, output ");
+                               appendLogicWidth(result, logicWidth);
+                               result.append(sanitizeVerilog(interfacePinName));
+                               result.append("_out, input ");
+                               appendLogicWidth(result, logicWidth);
+                               result.append(sanitizeVerilog(interfacePinName));
+                               result.append("_res");
+                       }
+                       result.append('\n');
+               }
+       }
+
+       private void appendComponents(StringBuilder result)
+       {
+               Map<Set<String>, String> currentWireNamePerCombinedInnerPinNames = new HashMap<>();
+               Map<Set<String>, String> resultWireNamePerCombinedInnerPinNames = new HashMap<>();
+               for (Set<String> s : combinedInnerPinNames.values())
+               {
+                       currentWireNamePerCombinedInnerPinNames.put(s, "2'b00");
+
+                       String anyInnerPinName = s.iterator().next();
+                       // abuse the pinIdentifierGenerator for generating an unique wire name
+                       String uniqueWireName = pinIdentifierGenerator.getPinID(anyInnerPinName, "res");
+                       resultWireNamePerCombinedInnerPinNames.put(s, uniqueWireName);
+               }
+               for (String interfacePinName : sortedInterfacePinNames)
+               {
+                       String innerPinID = pinIdentifierGenerator.getPinID(SubmodelComponent.SUBMODEL_INTERFACE_NAME, interfacePinName);
+                       Set<String> connectedPins = combinedInnerPinNames.get(innerPinID);
+                       currentWireNamePerCombinedInnerPinNames.put(connectedPins, interfacePinName + "_pre");
+                       resultWireNamePerCombinedInnerPinNames.put(connectedPins, interfacePinName + "_res");
+               }
+
+               for (ComponentParams subcomponentParams : componentJson.submodel.components)
+                       appendComponent(result, currentWireNamePerCombinedInnerPinNames, resultWireNamePerCombinedInnerPinNames, subcomponentParams);
+
+               for (String interfacePinName : sortedInterfacePinNames)
+               {
+                       String innerPinID = pinIdentifierGenerator.getPinID(SubmodelComponent.SUBMODEL_INTERFACE_NAME, interfacePinName);
+                       Set<String> connectedPins = combinedInnerPinNames.get(innerPinID);
+                       String lastWireName = currentWireNamePerCombinedInnerPinNames.remove(connectedPins);
+
+                       result.append("assign ");
+                       result.append(sanitizeVerilog(interfacePinName));
+                       result.append("_out");
+                       result.append(" = ");
+                       result.append(sanitizeVerilog(lastWireName));
+                       result.append(";\n");
+               }
+               for (Set<String> s : currentWireNamePerCombinedInnerPinNames.keySet())
+               {
+                       String lastWireName = currentWireNamePerCombinedInnerPinNames.get(s);
+                       String resultWireName = resultWireNamePerCombinedInnerPinNames.get(s);
+
+                       result.append("wire ");
+                       int logicWidth = -1;
+                       outer: for (ComponentParams subcomponentJson : componentJson.submodel.components)
+                       {
+                               Tuple2<List<String>, List<Integer>> subcomponentInterfacePinNamesAndWidths = getSubcomponentInterfacePinNamesAndWidths(
+                                               subcomponentJson.id, subcomponentJson.params);
+                               List<String> subcomponentInterfacePinNames = subcomponentInterfacePinNamesAndWidths.e1;
+                               List<Integer> subcomponentInterfacePinWidths = subcomponentInterfacePinNamesAndWidths.e2;
+                               for (int i = 0; i < subcomponentInterfacePinNames.size(); i++)
+                                       if (s.contains(pinIdentifierGenerator.getPinID(subcomponentJson.name, subcomponentInterfacePinNames.get(i))))
+                                       {
+                                               logicWidth = subcomponentInterfacePinWidths.get(i);
+                                               break outer;
+                                       }
+                       }
+                       appendLogicWidth(result, logicWidth);
+                       result.append(sanitizeVerilog(resultWireName));
+                       result.append(";\n");
+
+                       result.append("assign ");
+                       result.append(sanitizeVerilog(resultWireName));
+                       result.append(" = rst ? ");
+                       result.append(logicWidth * 2);
+                       result.append("'b");
+                       for (int i = 0; i < logicWidth; i++)
+                               result.append("10");
+                       result.append(" : ");
+                       result.append(sanitizeVerilog(lastWireName));
+                       result.append(";\n");
+               }
+       }
+
+       private void appendComponent(StringBuilder result, Map<Set<String>, String> currentWireNamePerCombinedInnerPinNames,
+                       Map<Set<String>, String> resultWireNamePerCombinedInnerPinNames, ComponentParams subcomponentParams)
+       {
+               {
+                       String subcomponentID = subcomponentParams.id;
+                       String subcomponentName = subcomponentParams.name;
+
+                       Tuple2<List<String>, List<Integer>> subcomponentInterfacePinNamesAndWidths = getSubcomponentInterfacePinNamesAndWidths(
+                                       subcomponentID, subcomponentParams.params);
+                       List<String> subcomponentInterfacePinNames = subcomponentInterfacePinNamesAndWidths.e1;
+                       List<Integer> subcomponentInterfacePinWidths = subcomponentInterfacePinNamesAndWidths.e2;
+                       for (int i = 0; i < subcomponentInterfacePinNames.size(); i++)
+                       {
+                               result.append("wire ");
+                               appendLogicWidth(result, subcomponentInterfacePinWidths.get(i));
+                               result.append(pinIdentifierGenerator.getPinID(subcomponentName, subcomponentInterfacePinNames.get(i)));
+                               result.append(";\n");
+                       }
+
+                       result.append(COMPONENT_PREFIX);
+                       String paramsString = subcomponentParams.params == JsonNull.INSTANCE ? "" : subcomponentParams.params.toString();
+                       result.append(sanitizeVerilog(subcomponentID + paramsString));
+                       result.append(' ');
+                       // abuse the pinIdentifierGenerator for making these unique
+                       result.append(pinIdentifierGenerator.getPinID("comp", subcomponentName));
+                       result.append(" (rst, clk");
+                       for (int i = 0; i < subcomponentInterfacePinNames.size(); i++)
+                       {
+                               result.append(",\n  ");
+                               String innerPinID = pinIdentifierGenerator.getPinID(subcomponentName, subcomponentInterfacePinNames.get(i));
+
+                               String lastWireName;
+                               String nextWireName = innerPinID;
+                               String resultWireName;
+                               Set<String> combinedInnerPinsGroup = combinedInnerPinNames.get(innerPinID);
+                               if (combinedInnerPinsGroup != null)
+                               {
+                                       lastWireName = currentWireNamePerCombinedInnerPinNames.get(combinedInnerPinsGroup);
+                                       resultWireName = resultWireNamePerCombinedInnerPinNames.get(combinedInnerPinsGroup);
+
+                                       currentWireNamePerCombinedInnerPinNames.put(combinedInnerPinsGroup, nextWireName);
+                               } else
+                               {
+                                       lastWireName = "2'b00";
+                                       resultWireName = nextWireName;
+                               }
+
+                               result.append(sanitizeVerilog(lastWireName));
+                               result.append(", ");
+                               result.append(sanitizeVerilog(nextWireName));
+                               result.append(", ");
+                               result.append(sanitizeVerilog(resultWireName));
+                       }
+                       result.append(");\n\n");
+               }
+       }
+
+       private static Map<Tuple2<String, JsonElement>, Tuple2<List<String>, List<Integer>>> atomicComponentInterfaces = new HashMap<>();
+
+       private Tuple2<List<String>, List<Integer>> getSubcomponentInterfacePinNamesAndWidths(String subcomponentID,
+                       JsonElement subcomponentParams)
+       {
+               Tuple2<List<String>, List<Integer>> result = sortedInterfacePinNamesAndWidthsPerComponentID.get(subcomponentID);
+               if (result != null)
+                       return result;
+
+               Tuple2<String, JsonElement> subcomponentKey = new Tuple2<>(subcomponentID, subcomponentParams);
+
+               result = atomicComponentInterfaces.get(subcomponentKey);
+               if (result != null)
+                       return result;
+
+               Map<String, Pin> pins = IndirectModelComponentCreator
+                               .createComponent(new LogicModelModifiable(), subcomponentID, subcomponentParams).getPins();
+               List<String> names = pins.keySet().stream().sorted().collect(Collectors.toList());
+               List<Integer> widthes = pins.entrySet().stream().sorted(Comparator.comparing(e -> e.getKey())).map(Entry::getValue)
+                               .map(p -> p.logicWidth).collect(Collectors.toList());
+               System.out.println(
+                               "Assuming following order for interface pins of " + subcomponentID + " with params " + subcomponentParams + ": " + names);
+               result = new Tuple2<>(names, widthes);
+
+               atomicComponentInterfaces.put(subcomponentKey, result);
+               return result;
+       }
+
+       private static void appendLogicWidth(StringBuilder result, int logicWidth)
+       {
+               result.append('[');
+               String logicWidthStr = Integer.toString(logicWidth * 2 - 1);
+               for (int spaces = logicWidthStr.length(); spaces < 3; spaces++)
+                       result.append(' ');
+               result.append(logicWidthStr);
+               result.append(":0] ");
+       }
+
+       private static class PinIdentifierGenerator
+       {
+               private final Map<String, Map<String, String>> wireNamesPerPinAndComponentName;
+               private final Set<String> usedWireNames;
+
+               public PinIdentifierGenerator()
+               {
+                       wireNamesPerPinAndComponentName = new HashMap<>();
+                       usedWireNames = new HashSet<>();
+               }
+
+               private String getPinID(PinParams pin)
+               {
+                       return getPinID(pin.compName, pin.pinName);
+               }
+
+               private String getPinID(String component, String pin)
+               {
+                       String componentSan = sanitizeVerilog(component);
+                       String pinSan = sanitizeVerilog(pin);
+
+                       Map<String, String> wireNamesPerPinName = wireNamesPerPinAndComponentName.computeIfAbsent(componentSan, k -> new HashMap<>());
+
+                       if (wireNamesPerPinName.containsKey(pinSan))
+                               return wireNamesPerPinName.get(pinSan);
+
+                       String baseName = componentSan + '_' + pinSan;
+                       String combinedName;
+                       if (usedWireNames.add(baseName))
+                               combinedName = baseName;
+                       else
+                       {
+                               int i = 0;
+                               do
+                                       combinedName = baseName + "#" + i++;
+                               while (!usedWireNames.add(combinedName));
+                       }
+                       wireNamesPerPinName.put(pinSan, combinedName);
+                       return combinedName;
+               }
+       }
+
+       private static class Tuple2<E1, E2>
+       {
+               public final E1 e1;
+               public final E2 e2;
+
+               public Tuple2(E1 e1, E2 e2)
+               {
+                       this.e1 = e1;
+                       this.e2 = e2;
+               }
+
+               @Override
+               public int hashCode()
+               {
+                       final int prime = 31;
+                       int result = 1;
+                       result = prime * result + ((e1 == null) ? 0 : e1.hashCode());
+                       result = prime * result + ((e2 == null) ? 0 : e2.hashCode());
+                       return result;
+               }
+
+               @Override
+               public boolean equals(Object obj)
+               {
+                       if (this == obj)
+                               return true;
+                       if (obj == null)
+                               return false;
+                       if (getClass() != obj.getClass())
+                               return false;
+                       Tuple2<?, ?> other = (Tuple2<?, ?>) obj;
+                       if (e1 == null)
+                       {
+                               if (other.e1 != null)
+                                       return false;
+                       } else if (!e1.equals(other.e1))
+                               return false;
+                       if (e2 == null)
+                       {
+                               if (other.e2 != null)
+                                       return false;
+                       } else if (!e2.equals(other.e2))
+                               return false;
+                       return true;
+               }
+       }
+
+       private static String sanitizeVerilog(String str)
+       {
+               return str.replace('#', '_').replace('+', '_').replace('-', '_').replace('=', '_').replace('{', '_').replace('}', '_')
+                               .replace(':', '_').replace('"', '_').replace(',', '_').replace('[', '_').replace(']', '_').replace(' ', '_');
+       }
+}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model.editor/.settings/org.eclipse.core.runtime.prefs b/plugins/net.mograsim.logic.model.editor/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
index 8c60257..b58c947 100644 (file)
@@ -22,6 +22,8 @@ import net.mograsim.logic.model.editor.ui.EditorGUI;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.ModelWire;
+import net.mograsim.logic.model.preferences.DefaultRenderPreferences;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.DeserializedSubmodelComponent;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
 import net.mograsim.logic.model.snippets.highlevelstatehandlers.DefaultHighLevelStateHandler;
@@ -35,6 +37,7 @@ public final class Editor
        public final DeserializedSubmodelComponent toBeEdited;
        public final HandleManager handleManager;
        public final EditorGUI gui;
+       public final RenderPreferences renderPrefs;
        public final StateManager stateManager;
        private final SaveLoadManager saveManager;
        private Snapping snapping = Snapping.ABSOLUTE;
@@ -46,6 +49,7 @@ public final class Editor
        {
                this.toBeEdited = toBeEdited;
                handleManager = new HandleManager(this);
+               renderPrefs = new DefaultRenderPreferences();
                gui = new EditorGUI(this);
                userInput = new EditorUserInput(this);
                stateManager = new StateManager(this);
index 154a81f..4de8683 100644 (file)
@@ -1,10 +1,11 @@
 package net.mograsim.logic.model.editor;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.ACTION_BUTTON;
+
 import org.eclipse.swt.SWT;
 
 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.mograsim.logic.model.editor.ui.EditorGUI;
-import net.mograsim.preferences.Preferences;
 
 public class EditorUserInput
 {
@@ -16,7 +17,7 @@ public class EditorUserInput
                gui.logicCanvas.addListener(SWT.MouseDown, e ->
                {
                        Point clicked = editor.gui.logicCanvas.canvasToWorldCoords(e.x, e.y);
-                       if (e.button == Preferences.current().getInt("net.mograsim.logic.model.button.action"))
+                       if (e.button == editor.renderPrefs.getInt(ACTION_BUTTON))
                                editor.handleManager.click(clicked, e.stateMask);
                });
 
index 1c06c52..a1ba19c 100644 (file)
@@ -7,8 +7,8 @@ import org.eclipse.swt.widgets.Shell;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.haspamelodica.swt.helper.zoomablecanvas.ZoomableCanvas.ZoomedRenderer;
 import net.mograsim.logic.model.editor.Editor;
-import net.mograsim.logic.model.editor.handles.PinHandle;
 import net.mograsim.logic.model.editor.handles.Handle.HandleClickInfo;
+import net.mograsim.logic.model.editor.handles.PinHandle;
 
 public class CreateWireState extends EditorState
 {
index d730194..b50b195 100644 (file)
@@ -2,8 +2,8 @@ package net.mograsim.logic.model.editor.states;
 
 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.mograsim.logic.model.editor.Editor;
-import net.mograsim.logic.model.editor.handles.InterfacePinHandle;
 import net.mograsim.logic.model.editor.handles.Handle.HandleClickInfo;
+import net.mograsim.logic.model.editor.handles.InterfacePinHandle;
 
 public abstract class EditorState
 {
index 7bf5961..ccb85ed 100644 (file)
@@ -8,9 +8,9 @@ import net.haspamelodica.swt.helper.zoomablecanvas.ZoomableCanvas.ZoomedRenderer
 import net.mograsim.logic.model.editor.Editor;
 import net.mograsim.logic.model.editor.Selection;
 import net.mograsim.logic.model.editor.handles.Handle;
+import net.mograsim.logic.model.editor.handles.Handle.HandleClickInfo;
 import net.mograsim.logic.model.editor.handles.PinHandle;
 import net.mograsim.logic.model.editor.handles.WireHandle;
-import net.mograsim.logic.model.editor.handles.Handle.HandleClickInfo;
 import net.mograsim.logic.model.editor.handles.WireHandle.WireHandleClickInfo;
 import net.mograsim.logic.model.editor.ui.DialogManager;
 import net.mograsim.logic.model.model.wires.MovablePin;
index aedaa48..5db38c0 100644 (file)
@@ -2,7 +2,6 @@ package net.mograsim.logic.model.editor.ui;
 
 import java.util.Collection;
 
-import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.widgets.Composite;
 
 import net.haspamelodica.swt.helper.gcs.TranslatedGC;
@@ -10,7 +9,6 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.model.LogicUICanvas;
 import net.mograsim.logic.model.editor.Editor;
 import net.mograsim.logic.model.editor.handles.Handle;
-import net.mograsim.preferences.Preferences;
 
 //TODO: Remove Inheritance 
 public class EditorCanvas extends LogicUICanvas
@@ -19,7 +17,7 @@ public class EditorCanvas extends LogicUICanvas
 
        public EditorCanvas(Composite parent, int style, Editor editor)
        {
-               super(parent, style, editor.toBeEdited.submodel);
+               super(parent, style, editor.toBeEdited.submodel, editor.renderPrefs);
 
                handles = editor.handleManager.getHandles();
                editor.handleManager.addHandleAddedListener(h ->
@@ -37,13 +35,10 @@ public class EditorCanvas extends LogicUICanvas
                addZoomedRenderer(gc ->
                {
                        Rectangle visibleRegion = new Rectangle(-offX / zoom, -offY / zoom, gW / zoom, gH / zoom);
-                       Color background = Preferences.current().getColor("net.mograsim.logic.model.color.background");
-                       if (background != null)
-                               setBackground(background);// this.setBackground, not gc.setBackground to have the background fill the
-                                                                                       // canvas
 
                        TranslatedGC tgc = new TranslatedGC(gc, 0.0d, 0.0d, 1 / editor.toBeEdited.getSubmodelScale(), false);
-                       editor.toBeEdited.getOutlineRenderer().render(tgc, new Rectangle(-offX / zoom, -offY / zoom, gW / zoom, gH / zoom));
+                       editor.toBeEdited.getOutlineRenderer().render(tgc, renderPrefs,
+                                       new Rectangle(-offX / zoom, -offY / zoom, gW / zoom, gH / zoom));
 
                        handles.forEach(h -> h.render(gc, visibleRegion));
                });
index 3dfd62e..6e61b1b 100644 (file)
@@ -1,5 +1,8 @@
 package net.mograsim.logic.model.editor.ui;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.DRAG_BUTTON;
+import static net.mograsim.logic.model.preferences.RenderPreferences.ZOOM_BUTTON;
+
 import java.io.IOException;
 
 import org.eclipse.swt.SWT;
@@ -21,7 +24,6 @@ import net.haspamelodica.swt.helper.zoomablecanvas.helper.ZoomableCanvasUserInpu
 import net.mograsim.logic.model.editor.Editor;
 import net.mograsim.logic.model.editor.SaveLoadManager;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
-import net.mograsim.preferences.Preferences;
 
 public class EditorGUI
 {
@@ -74,8 +76,8 @@ public class EditorGUI
                setupBottomToolBar(innerComp);
 
                ZoomableCanvasUserInput userInput = new ZoomableCanvasUserInput(logicCanvas);
-               userInput.buttonDrag = Preferences.current().getInt("net.mograsim.logic.model.button.drag");
-               userInput.buttonZoom = Preferences.current().getInt("net.mograsim.logic.model.button.zoom");
+               userInput.buttonDrag = editor.renderPrefs.getInt(DRAG_BUTTON);
+               userInput.buttonZoom = editor.renderPrefs.getInt(ZOOM_BUTTON);
                userInput.enableUserInput();
                new ZoomableCanvasOverlay(logicCanvas, null).enableScale();
        }
diff --git a/plugins/net.mograsim.logic.model/.settings/org.eclipse.core.runtime.prefs b/plugins/net.mograsim.logic.model/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
index e6b077a..6a57b8f 100644 (file)
@@ -12,6 +12,7 @@ Export-Package: net.mograsim.logic.model,
  net.mograsim.logic.model.model.wires,
  net.mograsim.logic.model.modeladapter,
  net.mograsim.logic.model.modeladapter.componentadapters,
+ net.mograsim.logic.model.preferences,
  net.mograsim.logic.model.serializing,
  net.mograsim.logic.model.snippets,
  net.mograsim.logic.model.snippets.highlevelstatehandlers,
diff --git a/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/BitVectorFormatter.java b/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/BitVectorFormatter.java
new file mode 100644 (file)
index 0000000..4836ed1
--- /dev/null
@@ -0,0 +1,111 @@
+package net.mograsim.logic.model;
+
+import static net.mograsim.logic.model.preferences.RenderPreferences.BIT_ONE_COLOR;
+import static net.mograsim.logic.model.preferences.RenderPreferences.BIT_U_COLOR;
+import static net.mograsim.logic.model.preferences.RenderPreferences.BIT_X_COLOR;
+import static net.mograsim.logic.model.preferences.RenderPreferences.BIT_ZERO_COLOR;
+import static net.mograsim.logic.model.preferences.RenderPreferences.BIT_Z_COLOR;
+
+import java.math.BigInteger;
+
+import net.mograsim.logic.core.types.BitVector;
+import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
+import net.mograsim.logic.model.preferences.RenderPreferences;
+import net.mograsim.preferences.ColorDefinition;
+import net.mograsim.preferences.ColorDefinition.BuiltInColor;
+
+public class BitVectorFormatter
+{
+       public static String formatValueAsString(ReadEnd end, boolean useDashInsteadOfZ)
+       {
+               return formatAsString(end == null ? null : end.getValues(), useDashInsteadOfZ);
+       }
+
+       public static String toBitstring(BitVector bitVector)
+       {
+               return bitVector.toBitstring();
+       }
+
+       public static String formatAsString(BitVector bitVector, boolean useDashInsteadOfZ)
+       {
+               if (bitVector == null)
+                       return "null";
+               if (useDashInsteadOfZ && bitVector.isHighImpedance())
+                       return "-";
+               if (bitVector.length() == 1)
+                       return bitVector.toBitstring();
+               if (bitVector.isBinary())
+               {
+                       String hexdigits = bitVector.getUnsignedValue().toString(16);
+                       StringBuilder sb = new StringBuilder();
+                       sb.append("0x");
+                       sb.append("0".repeat((bitVector.length() + 3) / 4 - hexdigits.length()));
+                       sb.append(hexdigits);
+                       return sb.toString();
+               }
+               return bitVector.toBitstring();
+       }
+
+       // TODO this method overlaps in functionality with AsmNumberUtil (in plugin.core)
+       public static BitVector parseUserBitVector(String userInput, int width)
+       {
+               BitVector bitvector = null;
+               if (width > 0 && userInput.matches("0x[0-9a-fA-F]+"))
+                       // TODO should we check for overflows?
+                       bitvector = BitVector.from(new BigInteger(userInput.substring(2), 16), width);
+               else if (width <= 0 || userInput.length() == width)
+                       // TODO do this without exceptions
+                       try
+                       {
+                               bitvector = BitVector.parseBitstring(userInput);
+                       }
+                       catch (@SuppressWarnings("unused") NullPointerException x)
+                       {
+                               // ignore
+                       }
+               if (bitvector == null && width > 0)
+                       try
+                       {
+                               // TODO should we check for overflows?
+                               bitvector = BitVector.from(new BigInteger(userInput), width);
+                       }
+                       catch (@SuppressWarnings("unused") NumberFormatException x)
+                       {
+                               // ignore
+                       }
+               return bitvector;
+       }
+
+       // TODO doesn't this belong to logic.model?
+       public static ColorDefinition formatAsColor(RenderPreferences renderPrefs, ReadEnd end)
+       {
+               return formatAsColor(renderPrefs, end == null ? null : end.getValues());
+       }
+
+       public static ColorDefinition formatAsColor(RenderPreferences renderPrefs, BitVector bitVector)
+       {
+               // TODO maybe find a color assignment for multiple-bit bit vectors?
+               if (bitVector == null || bitVector.length() != 1)
+                       return new ColorDefinition(BuiltInColor.COLOR_BLACK);
+               switch (bitVector.getLSBit(0))
+               {
+               case ONE:
+                       return renderPrefs.getColorDefinition(BIT_ONE_COLOR);
+               case U:
+                       return renderPrefs.getColorDefinition(BIT_U_COLOR);
+               case X:
+                       return renderPrefs.getColorDefinition(BIT_X_COLOR);
+               case Z:
+                       return renderPrefs.getColorDefinition(BIT_Z_COLOR);
+               case ZERO:
+                       return renderPrefs.getColorDefinition(BIT_ZERO_COLOR);
+               default:
+                       throw new IllegalArgumentException("Unknown enum constant: " + bitVector.getLSBit(0));
+               }
+       }
+
+       private BitVectorFormatter()
+       {
+               throw new UnsupportedOperationException("No BitVectorFormatter instances");
+       }
+}
\ No newline at end of file
index 52adeba..a7f8c83 100644 (file)
@@ -67,7 +67,7 @@ public class LogicExecuter
                                                }
                                        }
                                        catch (@SuppressWarnings("unused") InterruptedException e)
-                                       {// do nothing; it is normal execution flow to be interrupted
+                                       { // do nothing; it is normal execution flow to be interrupted
                                        }
                                }
                        }
@@ -83,8 +83,11 @@ public class LogicExecuter
                timeline.addEventAddedListener(event ->
                {
                        if (isRunningLive.get())
-                               if (Timeline.timeCmp(event.getTiming(), nextExecSimulTime.get()) < 0)
+                       {
+                               long nextExecSimulTime = this.nextExecSimulTime.get();
+                               if (nextExecSimulTime == -1 || Timeline.timeCmp(event.getTiming(), nextExecSimulTime) < 0)
                                        simulationThread.interrupt();
+                       }
                });
                // not optimal; but we don't expect this to happen very often
                tf.addSimulTimeToRealTimeFactorChangedListener(d -> simulationThread.interrupt());
index 9675167..aabe019 100644 (file)
@@ -1,5 +1,11 @@
 package net.mograsim.logic.model;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.ACTION_BUTTON;
+import static net.mograsim.logic.model.preferences.RenderPreferences.BACKGROUND_COLOR;
+import static net.mograsim.logic.model.preferences.RenderPreferences.DEBUG_HLSSHELL_DEPTH;
+import static net.mograsim.logic.model.preferences.RenderPreferences.DEBUG_OPEN_HLSSHELL;
+import static net.mograsim.logic.model.preferences.RenderPreferences.IMPROVE_TEXT;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -25,12 +31,11 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.haspamelodica.swt.helper.zoomablecanvas.ZoomableCanvas;
 import net.mograsim.logic.core.types.Bit;
 import net.mograsim.logic.core.types.BitVector;
-import net.mograsim.logic.core.types.BitVectorFormatter;
 import net.mograsim.logic.model.model.LogicModel;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.components.submodels.SubmodelComponent;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.snippets.highlevelstatehandlers.DefaultHighLevelStateHandler;
-import net.mograsim.preferences.Preferences;
 
 /**
  * Simulation visualizer canvas.
@@ -39,22 +44,25 @@ import net.mograsim.preferences.Preferences;
  */
 public class LogicUICanvas extends ZoomableCanvas
 {
-       private final LogicModel model;
+       protected final LogicModel model;
+       protected final RenderPreferences renderPrefs;
 
-       public LogicUICanvas(Composite parent, int style, LogicModel model)
+       public LogicUICanvas(Composite parent, int style, LogicModel model, RenderPreferences renderPrefs)
        {
-               super(parent, style, Preferences.current().getBoolean("net.mograsim.logic.model.improvetext"));
+               // TODO add a listener
+               super(parent, style, renderPrefs.getBoolean(IMPROVE_TEXT));
 
+               this.renderPrefs = renderPrefs;
                this.model = model;
 
+               // TODO add listeners for the render prefs
+
+               Color background = renderPrefs.getColor(BACKGROUND_COLOR);
+               if (background != null)
+                       setBackground(background);
+
                LogicUIRenderer renderer = new LogicUIRenderer(model);
-               addZoomedRenderer(gc ->
-               {
-                       Color background = Preferences.current().getColor("net.mograsim.logic.model.color.background");
-                       if (background != null)
-                               setBackground(background);// this.setBackground, not gc.setBackground to have the background fill the canvas
-                       renderer.render(gc, new Rectangle(-offX / zoom, -offY / zoom, gW / zoom, gH / zoom));
-               });
+               addZoomedRenderer(gc -> renderer.render(gc, renderPrefs, new Rectangle(-offX / zoom, -offY / zoom, gW / zoom, gH / zoom)));
                model.setRedrawHandler(() ->
                {
                        if (!isDisposed())
@@ -63,13 +71,13 @@ public class LogicUICanvas extends ZoomableCanvas
 
                addListener(SWT.MouseDown, this::mouseDown);
 
-               if (Preferences.current().getBoolean("net.mograsim.logic.model.debug.openhlsshell"))
-                       openDebugSetHighLevelStateShell(model);
+               if (renderPrefs.getBoolean(DEBUG_OPEN_HLSSHELL))
+                       openDebugSetHighLevelStateShell(model, renderPrefs.getInt(DEBUG_HLSSHELL_DEPTH) - 1);
        }
 
        private void mouseDown(Event e)
        {
-               if (e.button == Preferences.current().getInt("net.mograsim.logic.model.button.action"))
+               if (e.button == renderPrefs.getInt(ACTION_BUTTON))
                {
                        Point click = canvasToWorldCoords(e.x, e.y);
                        for (ModelComponent component : model.getComponentsByName().values())
@@ -81,7 +89,7 @@ public class LogicUICanvas extends ZoomableCanvas
                }
        }
 
-       private void openDebugSetHighLevelStateShell(LogicModel model)
+       private void openDebugSetHighLevelStateShell(LogicModel model, int depth)
        {
                Shell debugShell = new Shell();
                debugShell.setLayout(new GridLayout(2, false));
@@ -96,16 +104,16 @@ public class LogicUICanvas extends ZoomableCanvas
                @SuppressWarnings("unchecked")
                Consumer<? super ModelComponent>[] compRemoved = new Consumer[1];
                compAdded[0] = c -> compsChanged(compAdded[0], compRemoved[0], c, models, componentsByItemIndex, componentSelector, model,
-                               recalculateQueued, true);
+                               recalculateQueued, depth, true);
                compRemoved[0] = c -> compsChanged(compAdded[0], compRemoved[0], c, models, componentsByItemIndex, componentSelector, model,
-                               recalculateQueued, false);
+                               recalculateQueued, depth, false);
                iterateModelTree(compAdded[0], compRemoved[0], model, models, true);
                debugShell.addListener(SWT.Dispose, e -> models.forEach(m ->
                {
                        m.removeComponentAddedListener(compAdded[0]);
                        m.removeComponentRemovedListener(compRemoved[0]);
                }));
-               queueRecalculateComponentSelector(recalculateQueued, componentsByItemIndex, componentSelector, model);
+               queueRecalculateComponentSelector(recalculateQueued, componentsByItemIndex, componentSelector, model, depth);
                new Label(debugShell, SWT.NONE).setText("Target state ID: ");
                Text stateIDText = new Text(debugShell, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
                stateIDText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
@@ -239,10 +247,10 @@ public class LogicUICanvas extends ZoomableCanvas
 
        private void compsChanged(Consumer<? super ModelComponent> compAdded, Consumer<? super ModelComponent> compRemoved, ModelComponent c,
                        List<LogicModel> models, List<ModelComponent> componentsByItemIndex, Combo componentSelector, LogicModel model,
-                       AtomicBoolean recalculateQueued, boolean add)
+                       AtomicBoolean recalculateQueued, int depth, boolean add)
        {
                iterateSubmodelTree(compAdded, compRemoved, c, models, add);
-               queueRecalculateComponentSelector(recalculateQueued, componentsByItemIndex, componentSelector, model);
+               queueRecalculateComponentSelector(recalculateQueued, componentsByItemIndex, componentSelector, model, depth);
        }
 
        private void iterateSubmodelTree(Consumer<? super ModelComponent> compAdded, Consumer<? super ModelComponent> compRemoved,
@@ -274,20 +282,20 @@ public class LogicUICanvas extends ZoomableCanvas
        }
 
        private void queueRecalculateComponentSelector(AtomicBoolean recalculateQueued, List<ModelComponent> componentsByItemIndex,
-                       Combo componentSelector, LogicModel model)
+                       Combo componentSelector, LogicModel model, int depth)
        {
                if (recalculateQueued.compareAndSet(false, true))
-                       getDisplay().asyncExec(() -> recalculateComponentSelector(recalculateQueued, componentsByItemIndex, componentSelector, model));
+                       getDisplay().asyncExec(
+                                       () -> recalculateComponentSelector(recalculateQueued, componentsByItemIndex, componentSelector, model, depth));
        }
 
        private void recalculateComponentSelector(AtomicBoolean recalculateQueued, List<ModelComponent> componentsByItemIndex,
-                       Combo componentSelector, LogicModel model)
+                       Combo componentSelector, LogicModel model, int depth)
        {
                recalculateQueued.set(false);
                componentsByItemIndex.clear();
                componentSelector.setItems();
-               addComponentSelectorItems(componentsByItemIndex, "", componentSelector, model,
-                               Preferences.current().getInt("net.mograsim.logic.model.debug.hlsshelldepth") - 1);
+               addComponentSelectorItems(componentsByItemIndex, "", componentSelector, model, depth);
        }
 
        private void addComponentSelectorItems(List<ModelComponent> componentsByItemIndex, String base, Combo componentSelector,
index 1df2f7b..6f4e0e8 100644 (file)
@@ -1,5 +1,7 @@
 package net.mograsim.logic.model;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.DEFAULT_LINE_WIDTH;
+
 import org.eclipse.swt.SWT;
 
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
@@ -8,7 +10,7 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.model.model.LogicModel;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.Pin;
-import net.mograsim.preferences.Preferences;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 
 public class LogicUIRenderer
 {
@@ -21,28 +23,28 @@ public class LogicUIRenderer
                this.model = model;
        }
 
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
                gc.setAntialias(SWT.ON);
                gc.setClipping(visibleRegion);
-               gc.setLineWidth(Preferences.current().getDouble("net.mograsim.logic.model.linewidth.default"));
+               gc.setLineWidth(renderPrefs.getDouble(DEFAULT_LINE_WIDTH));
                model.getWiresByName().values().forEach(w ->
                {
                        Rectangle bounds = w.getBounds();
                        double lw = gc.getLineWidth();
                        if (visibleRegion.intersects(bounds.x - lw, bounds.y - lw, bounds.width + lw + lw, bounds.height + lw + lw))
-                               w.render(gc);
+                               w.render(gc, renderPrefs);
                });
-               model.getComponentsByName().values().forEach(c -> renderComponent(gc, c, visibleRegion));
+               model.getComponentsByName().values().forEach(c -> renderComponent(gc, renderPrefs, c, visibleRegion));
        }
 
-       private static void renderComponent(GeneralGC gc, ModelComponent component, Rectangle visibleRegion)
+       private static void renderComponent(GeneralGC gc, RenderPreferences renderPrefs, ModelComponent component, Rectangle visibleRegion)
        {
                Rectangle bounds = component.getBounds();
                double lw = gc.getLineWidth();
                if (visibleRegion.intersects(bounds.x - lw, bounds.y - lw, bounds.width + lw + lw, bounds.height + lw + lw))
                {
-                       component.render(gc, visibleRegion);
+                       component.render(gc, renderPrefs, visibleRegion);
                        if (DRAW_PINS)
                        {
                                gc.setBackground(gc.getDevice().getSystemColor(SWT.COLOR_DARK_CYAN));
index 55a96a5..e803c26 100644 (file)
@@ -1,5 +1,8 @@
 package net.mograsim.logic.model;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.DRAG_BUTTON;
+import static net.mograsim.logic.model.preferences.RenderPreferences.ZOOM_BUTTON;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Display;
@@ -8,7 +11,7 @@ import org.eclipse.swt.widgets.Shell;
 import net.haspamelodica.swt.helper.zoomablecanvas.helper.ZoomableCanvasOverlay;
 import net.haspamelodica.swt.helper.zoomablecanvas.helper.ZoomableCanvasUserInput;
 import net.mograsim.logic.model.model.LogicModel;
-import net.mograsim.preferences.Preferences;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 
 /**
  * Standalone simulation visualizer graphical user interface.
@@ -21,16 +24,18 @@ public class LogicUIStandaloneGUI implements Runnable
        private final Shell shell;
        private final LogicUICanvas ui;
 
-       public LogicUIStandaloneGUI(LogicModel model)
+       public LogicUIStandaloneGUI(LogicModel model, RenderPreferences renderPrefs)
        {
                display = new Display();
                shell = new Shell(display);
                shell.setLayout(new FillLayout());
-               ui = new LogicUICanvas(shell, SWT.NONE, model);
+               ui = new LogicUICanvas(shell, SWT.NONE, model, renderPrefs);
 
                ZoomableCanvasUserInput userInput = new ZoomableCanvasUserInput(ui);
-               userInput.buttonDrag = Preferences.current().getInt("net.mograsim.logic.model.button.drag");
-               userInput.buttonZoom = Preferences.current().getInt("net.mograsim.logic.model.button.zoom");
+               // TODO add a listener
+               userInput.buttonDrag = renderPrefs.getInt(DRAG_BUTTON);
+               // TODO add a listener
+               userInput.buttonZoom = renderPrefs.getInt(ZOOM_BUTTON);
                userInput.enableUserInput();
                new ZoomableCanvasOverlay(ui, null).enableScale();
        }
index 48f5cf5..829abaa 100644 (file)
@@ -6,6 +6,7 @@ import net.mograsim.logic.core.timeline.Timeline;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.modeladapter.CoreModelParameters;
 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
+import net.mograsim.logic.model.preferences.DefaultRenderPreferences;
 
 public class SimpleLogicUIStandalone
 {
@@ -39,13 +40,14 @@ public class SimpleLogicUIStandalone
                Timeline timeline = LogicCoreAdapter.convert(logicModel, params);
 
                // initialize UI and executer
-               LogicUIStandaloneGUI ui = new LogicUIStandaloneGUI(logicModel);
+               LogicUIStandaloneGUI ui = new LogicUIStandaloneGUI(logicModel, new DefaultRenderPreferences());
                LogicExecuter exec = new LogicExecuter(timeline);
 
                if (beforeRun != null)
                        beforeRun.accept(new VisualisationObjects(logicModel, timeline, ui, exec));
 
                // run it
+               exec.setSpeedFactor(1);
                exec.startLiveExecution();
                ui.run();
                exec.stopLiveExecution();
index b4d8928..0a9816a 100644 (file)
@@ -11,6 +11,7 @@ import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.wires.Pin;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.serializing.JSONSerializable;
 import net.mograsim.logic.model.snippets.HighLevelStateHandler;
@@ -98,13 +99,6 @@ public abstract class ModelComponent implements JSONSerializable
                model.componentCreated(this, this::destroyed);
        }
 
-       // basic getters
-
-       public String getName()
-       {
-               return name;
-       }
-
        /**
         * Destroys this component. This method is called from {@link LogicModelModifiable#componentDestroyed(ModelComponent)
         * destroyComponent()} of the model this component is a part of.<br>
@@ -117,6 +111,13 @@ public abstract class ModelComponent implements JSONSerializable
                pinsByName.values().forEach(this::removePinWithoutRedraw);
        }
 
+       // basic getters
+
+       public String getName()
+       {
+               return name;
+       }
+
        // pins
 
        /**
@@ -344,7 +345,7 @@ public abstract class ModelComponent implements JSONSerializable
         * 
         * @author Daniel Kirschten
         */
-       public abstract void render(GeneralGC gc, Rectangle visibleRegion);
+       public abstract void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion);
 
        // serializing
 
index 68e8d45..37ab427 100644 (file)
@@ -1,5 +1,8 @@
 package net.mograsim.logic.model.model.components.atomic;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.FOREGROUND_COLOR;
+import static net.mograsim.logic.model.preferences.RenderPreferences.TEXT_COLOR;
+
 import org.eclipse.swt.graphics.Color;
 
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
@@ -7,17 +10,17 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Font;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.core.LogicObserver;
 import net.mograsim.logic.core.components.CoreBitDisplay;
-import net.mograsim.logic.core.types.BitVectorFormatter;
+import net.mograsim.logic.model.BitVectorFormatter;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
 import net.mograsim.logic.model.modeladapter.componentadapters.BitDisplayAdapter;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
 import net.mograsim.logic.model.util.TextRenderingHelper;
-import net.mograsim.preferences.Preferences;
 
 public class ModelBitDisplay extends ModelComponent
 {
@@ -50,9 +53,9 @@ public class ModelBitDisplay extends ModelComponent
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
-               Color foreground = Preferences.current().getColor("net.mograsim.logic.model.color.foreground");
+               Color foreground = renderPrefs.getColor(FOREGROUND_COLOR);
                if (foreground != null)
                        gc.setForeground(foreground);
                gc.drawRectangle(getBounds());
@@ -60,7 +63,7 @@ public class ModelBitDisplay extends ModelComponent
                Font oldFont = gc.getFont();
                Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle());
                gc.setFont(labelFont);
-               Color textColor = Preferences.current().getColor("net.mograsim.logic.model.color.text");
+               Color textColor = renderPrefs.getColor(TEXT_COLOR);
                if (textColor != null)
                        gc.setForeground(textColor);
                TextRenderingHelper.drawTextFitting(gc, label, getBounds(), textMargin, true);
index 3c4eec6..e22ca82 100644 (file)
@@ -1,5 +1,8 @@
 package net.mograsim.logic.model.model.components.atomic;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.FOREGROUND_COLOR;
+import static net.mograsim.logic.model.preferences.RenderPreferences.TEXT_COLOR;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.function.Consumer;
@@ -23,11 +26,11 @@ import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
 import net.mograsim.logic.model.modeladapter.componentadapters.ClockAdapter;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
 import net.mograsim.logic.model.snippets.HighLevelStateHandler;
 import net.mograsim.logic.model.util.JsonHandler;
-import net.mograsim.preferences.Preferences;
 
 public class ModelClock extends ModelComponent
 {
@@ -140,9 +143,9 @@ public class ModelClock extends ModelComponent
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
-               Color foreground = Preferences.current().getColor("net.mograsim.logic.model.color.foreground");
+               Color foreground = renderPrefs.getColor(FOREGROUND_COLOR);
                if (foreground != null)
                        gc.setForeground(foreground);
                gc.drawRectangle(getBounds());
@@ -151,7 +154,7 @@ public class ModelClock extends ModelComponent
                Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle());
                gc.setFont(labelFont);
                Point textExtent = gc.textExtent(label);
-               Color textColor = Preferences.current().getColor("net.mograsim.logic.model.color.text");
+               Color textColor = renderPrefs.getColor(TEXT_COLOR);
                if (textColor != null)
                        gc.setForeground(textColor);
                gc.drawText(label, getPosX() + (oc.width() - textExtent.x) / 2, getPosY() + (oc.height() - textExtent.y) / 2, true);
index 1d70458..86b21bc 100644 (file)
@@ -1,5 +1,8 @@
 package net.mograsim.logic.model.model.components.atomic;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.FOREGROUND_COLOR;
+import static net.mograsim.logic.model.preferences.RenderPreferences.TEXT_COLOR;
+
 import java.util.Objects;
 
 import org.eclipse.swt.graphics.Color;
@@ -8,18 +11,18 @@ import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Font;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.core.types.BitVector;
-import net.mograsim.logic.core.types.BitVectorFormatter;
+import net.mograsim.logic.model.BitVectorFormatter;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
 import net.mograsim.logic.model.modeladapter.componentadapters.FixedOutputAdapter;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
 import net.mograsim.logic.model.util.JsonHandler;
 import net.mograsim.logic.model.util.TextRenderingHelper;
-import net.mograsim.preferences.Preferences;
 
 public class ModelFixedOutput extends ModelComponent
 {
@@ -53,9 +56,9 @@ public class ModelFixedOutput extends ModelComponent
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
-               Color foreground = Preferences.current().getColor("net.mograsim.logic.model.color.foreground");
+               Color foreground = renderPrefs.getColor(FOREGROUND_COLOR);
                if (foreground != null)
                        gc.setForeground(foreground);
                gc.drawRectangle(getBounds());
@@ -63,7 +66,7 @@ public class ModelFixedOutput extends ModelComponent
                Font oldFont = gc.getFont();
                Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle());
                gc.setFont(labelFont);
-               Color textColor = Preferences.current().getColor("net.mograsim.logic.model.color.text");
+               Color textColor = renderPrefs.getColor(TEXT_COLOR);
                if (textColor != null)
                        gc.setForeground(textColor);
                TextRenderingHelper.drawTextFitting(gc, label, getBounds(), textMargin, true);
index 7897982..ef3c817 100644 (file)
@@ -1,5 +1,8 @@
 package net.mograsim.logic.model.model.components.atomic;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.FOREGROUND_COLOR;
+import static net.mograsim.logic.model.preferences.RenderPreferences.TEXT_COLOR;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.function.Consumer;
@@ -13,18 +16,18 @@ import net.mograsim.logic.core.LogicObserver;
 import net.mograsim.logic.core.components.CoreManualSwitch;
 import net.mograsim.logic.core.types.Bit;
 import net.mograsim.logic.core.types.BitVector;
-import net.mograsim.logic.core.types.BitVectorFormatter;
+import net.mograsim.logic.model.BitVectorFormatter;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
 import net.mograsim.logic.model.modeladapter.componentadapters.ManualSwitchAdapter;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
 import net.mograsim.logic.model.snippets.HighLevelStateHandler;
 import net.mograsim.logic.model.util.TextRenderingHelper;
-import net.mograsim.preferences.Preferences;
 
 public class ModelManualSwitch extends ModelComponent
 {
@@ -137,9 +140,9 @@ public class ModelManualSwitch extends ModelComponent
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
-               Color foreground = Preferences.current().getColor("net.mograsim.logic.model.color.foreground");
+               Color foreground = renderPrefs.getColor(FOREGROUND_COLOR);
                if (foreground != null)
                        gc.setForeground(foreground);
                gc.drawRectangle(getBounds());
@@ -147,7 +150,7 @@ public class ModelManualSwitch extends ModelComponent
                Font oldFont = gc.getFont();
                Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle());
                gc.setFont(labelFont);
-               Color textColor = Preferences.current().getColor("net.mograsim.logic.model.color.text");
+               Color textColor = renderPrefs.getColor(TEXT_COLOR);
                if (textColor != null)
                        gc.setForeground(textColor);
                TextRenderingHelper.drawTextFitting(gc, label, getBounds(), textMargin, true);
index b47f50b..b2c3ba1 100644 (file)
@@ -1,11 +1,16 @@
 package net.mograsim.logic.model.model.components.atomic;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.DEFAULT_LINE_WIDTH;
+import static net.mograsim.logic.model.preferences.RenderPreferences.FOREGROUND_COLOR;
+import static net.mograsim.logic.model.preferences.RenderPreferences.WIRE_WIDTH_MULTIBIT;
+import static net.mograsim.logic.model.preferences.RenderPreferences.WIRE_WIDTH_SINGLEBIT;
+
 import org.eclipse.swt.SWT;
 
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
-import net.mograsim.logic.core.types.BitVectorFormatter;
 import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
+import net.mograsim.logic.model.BitVectorFormatter;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.components.Orientation;
@@ -14,12 +19,12 @@ import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
 import net.mograsim.logic.model.modeladapter.componentadapters.SplitterAdapter;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
 import net.mograsim.logic.model.util.JsonHandler;
 import net.mograsim.preferences.ColorDefinition;
 import net.mograsim.preferences.ColorManager;
-import net.mograsim.preferences.Preferences;
 
 public class ModelSplitter extends ModelComponent
 {
@@ -57,30 +62,29 @@ public class ModelSplitter extends ModelComponent
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
                double posX = getPosX();
                double posY = getPosY();
 
-               ColorDefinition c = BitVectorFormatter.formatAsColor(inputEnd);
+               ColorDefinition c = BitVectorFormatter.formatAsColor(renderPrefs, inputEnd);
                if (c != null)
                        gc.setForeground(ColorManager.current().toColor(c));
-               gc.setLineWidth(
-                               Preferences.current().getDouble("net.mograsim.logic.model.linewidth.wire." + (logicWidth == 1 ? "singlebit" : "multibit")));
+               gc.setLineWidth(renderPrefs.getDouble(logicWidth == 1 ? WIRE_WIDTH_SINGLEBIT : WIRE_WIDTH_MULTIBIT));
                double inLineY = heightWithoutOC / 2;
                gc.drawLine(posX + oc.newX(0, inLineY), posY + oc.newY(0, inLineY), posX + oc.newX(width / 2, inLineY),
                                posY + oc.newY(width / 2, inLineY));
-               gc.setLineWidth(Preferences.current().getDouble("net.mograsim.logic.model.linewidth.wire.singlebit"));
+               gc.setLineWidth(renderPrefs.getDouble(WIRE_WIDTH_SINGLEBIT));
                double outputHeight = 0;
                for (int i = 0; i < logicWidth; i++, outputHeight += 10)
                {
-                       c = BitVectorFormatter.formatAsColor(outputEnds[i]);
+                       c = BitVectorFormatter.formatAsColor(renderPrefs, outputEnds[i]);
                        if (c != null)
                                gc.setForeground(ColorManager.current().toColor(c));
                        gc.drawLine(posX + oc.newX(width / 2, outputHeight), posY + oc.newY(width / 2, outputHeight),
                                        posX + oc.newX(width, outputHeight), posY + oc.newY(width, outputHeight));
                }
-               gc.setForeground(Preferences.current().getColor("net.mograsim.logic.model.color.foreground"));
+               gc.setForeground(renderPrefs.getColor(FOREGROUND_COLOR));
                int oldLineCap = gc.getLineCap();
                int lineJoin = gc.getLineJoin();
                // TODO find better "replacement" for JOIN_BEVEL
@@ -88,7 +92,7 @@ public class ModelSplitter extends ModelComponent
                gc.setLineCap(lineJoin == SWT.JOIN_MITER ? SWT.CAP_SQUARE : lineJoin == SWT.JOIN_ROUND ? SWT.CAP_ROUND : SWT.CAP_SQUARE);
                gc.drawLine(posX + oc.newX(width / 2, 0), posY + oc.newY(width / 2, 0), posX + oc.newX(width / 2, heightWithoutOC),
                                posY + oc.newY(width / 2, heightWithoutOC));
-               gc.setLineWidth(Preferences.current().getDouble("net.mograsim.logic.model.linewidth.default"));
+               gc.setLineWidth(renderPrefs.getDouble(DEFAULT_LINE_WIDTH));
                gc.setLineCap(oldLineCap);
        }
 
index ac0f64d..c3a43a1 100644 (file)
@@ -1,5 +1,7 @@
 package net.mograsim.logic.model.model.components.atomic;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.TEXT_COLOR;
+
 import org.eclipse.swt.graphics.Color;
 
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
@@ -9,9 +11,9 @@ import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
 import net.mograsim.logic.model.modeladapter.componentadapters.NoLogicAdapter;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
-import net.mograsim.preferences.Preferences;
 
 //TODO clean size calculation mess
 public class ModelTextComponent extends ModelComponent
@@ -36,7 +38,7 @@ public class ModelTextComponent extends ModelComponent
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
                if (!calculatedSize)
                {
@@ -45,7 +47,7 @@ public class ModelTextComponent extends ModelComponent
                        setSize(textExtent.x, textExtent.y);
                }
 
-               Color textColor = Preferences.current().getColor("net.mograsim.logic.model.color.text");
+               Color textColor = renderPrefs.getColor(TEXT_COLOR);
                if (textColor != null)
                        gc.setForeground(textColor);
                gc.drawText(text, getPosX(), getPosY(), true);
index 93bff32..9bd1dde 100644 (file)
@@ -1,5 +1,7 @@
 package net.mograsim.logic.model.model.components.atomic;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.FOREGROUND_COLOR;
+
 import org.eclipse.swt.graphics.Color;
 
 import com.google.gson.JsonSyntaxException;
@@ -14,10 +16,10 @@ import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
 import net.mograsim.logic.model.modeladapter.componentadapters.TriStateBufferAdapter;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
 import net.mograsim.logic.model.util.JsonHandler;
-import net.mograsim.preferences.Preferences;
 
 public class ModelTriStateBuffer extends ModelComponent
 {
@@ -78,9 +80,9 @@ public class ModelTriStateBuffer extends ModelComponent
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
-               Color foreground = Preferences.current().getColor("net.mograsim.logic.model.color.foreground");
+               Color foreground = renderPrefs.getColor(FOREGROUND_COLOR);
                if (foreground != null)
                        gc.setForeground(foreground);
                double x = getPosX();
index 427a179..6f78a47 100644 (file)
@@ -15,6 +15,7 @@ import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
 import net.mograsim.logic.model.modeladapter.componentadapters.SimpleRectangularHardcodedModelComponentAdapter;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.snippets.HighLevelStateHandler;
 import net.mograsim.logic.model.snippets.outlinerenderers.DefaultOutlineRenderer;
@@ -176,11 +177,11 @@ public abstract class SimpleRectangularHardcodedModelComponent extends ModelComp
        // "graphical" operations
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
-               outlineRenderer.render(gc, visibleRegion);
-               centerTextRenderer.render(gc, visibleRegion);
-               pinNamesRenderer.render(gc, visibleRegion);
+               outlineRenderer.render(gc, renderPrefs, visibleRegion);
+               centerTextRenderer.render(gc, renderPrefs, visibleRegion);
+               pinNamesRenderer.render(gc, renderPrefs, visibleRegion);
        }
 
        // serializing
index 8936601..1a39dc1 100644 (file)
@@ -1,5 +1,8 @@
 package net.mograsim.logic.model.model.components.atomic;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.FOREGROUND_COLOR;
+import static net.mograsim.logic.model.preferences.RenderPreferences.TEXT_COLOR;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -16,8 +19,8 @@ import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.MovablePin;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
-import net.mograsim.preferences.Preferences;
 
 public class SimpleRectangularModelGate extends ModelComponent
 {
@@ -80,9 +83,9 @@ public class SimpleRectangularModelGate extends ModelComponent
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
-               Color foreground = Preferences.current().getColor("net.mograsim.logic.model.color.foreground");
+               Color foreground = renderPrefs.getColor(FOREGROUND_COLOR);
                if (foreground != null)
                        gc.setForeground(foreground);
                double height = (getPins().size() - 1) * pinDistance;
@@ -93,7 +96,7 @@ public class SimpleRectangularModelGate extends ModelComponent
                Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle());
                gc.setFont(labelFont);
                Point textExtent = gc.textExtent(label);
-               Color textColor = Preferences.current().getColor("net.mograsim.logic.model.color.text");
+               Color textColor = renderPrefs.getColor(TEXT_COLOR);
                if (textColor != null)
                        gc.setForeground(textColor);
                gc.drawText(label, getPosX() + (rectWidth - textExtent.x) / 2, getPosY() + (height - textExtent.y) / 2, true);
index 61c97b3..8b087aa 100644 (file)
@@ -1,5 +1,9 @@
 package net.mograsim.logic.model.model.components.submodels;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.DEFAULT_LINE_WIDTH;
+import static net.mograsim.logic.model.preferences.RenderPreferences.SUBMODEL_ZOOM_ALPHA_0;
+import static net.mograsim.logic.model.preferences.RenderPreferences.SUBMODEL_ZOOM_ALPHA_1;
+
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
@@ -17,13 +21,13 @@ import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.MovablePin;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
 import net.mograsim.logic.model.serializing.SubmodelComponentParams;
 import net.mograsim.logic.model.serializing.SubmodelComponentSerializer;
 import net.mograsim.logic.model.snippets.Renderer;
 import net.mograsim.logic.model.util.JsonHandler;
-import net.mograsim.preferences.Preferences;
 
 /**
  * A {@link ModelComponent} consisting of another model. A <code>SubmodelComponent</code> can have so-called "interface pins" connecting the
@@ -357,22 +361,24 @@ public abstract class SubmodelComponent extends ModelComponent
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
                GCConfig conf = new GCConfig(gc);
                GeneralGC tgc = new TranslatedGC(gc, getPosX(), getPosY(), submodelScale, true);
                conf.reset(tgc);
-               double visibleRegionFillRatio = Math.max(getWidth() / visibleRegion.width, getHeight() / visibleRegion.height);
+               double visibleRegionFillRatio = getWidth() * getHeight() / (visibleRegion.width * visibleRegion.height);
                /**
                 * If this {@link SubmodelComponent} fills at least this amount of the visible region vertically or horizontally, the submodel
                 * starts to be visible.
                 */
-               double maxVisibleRegionFillRatioForAlpha0 = Preferences.current().getDouble("net.mograsim.logic.model.submodel.zoomalpha0");
+               // TODO add a listener
+               double maxVisibleRegionFillRatioForAlpha0 = renderPrefs.getDouble(SUBMODEL_ZOOM_ALPHA_0);
                /**
                 * If this {@link SubmodelComponent} fills at least this amount of the visible region vertically or horizontally, the submodel is
                 * fully visible.
                 */
-               double minVisibleRegionFillRatioForAlpha1 = Preferences.current().getDouble("net.mograsim.logic.model.submodel.zoomalpha1");
+               // TODO add a listener
+               double minVisibleRegionFillRatioForAlpha1 = renderPrefs.getDouble(SUBMODEL_ZOOM_ALPHA_1);
                double alphaFactor = map(visibleRegionFillRatio, maxVisibleRegionFillRatioForAlpha0, minVisibleRegionFillRatioForAlpha1, 0, 1);
                alphaFactor = Math.max(0, Math.min(1, alphaFactor));
                // we need to take the old alpha into account to support nested submodules better.
@@ -382,18 +388,19 @@ public abstract class SubmodelComponent extends ModelComponent
                if (submodelAlpha != 0)
                {
                        gc.setAlpha(submodelAlpha);
-                       renderer.render(tgc, visibleRegion.translate(getPosX() / submodelScale, getPosY() / submodelScale, 1 / submodelScale));
+                       renderer.render(tgc, renderPrefs,
+                                       visibleRegion.translate(getPosX() / submodelScale, getPosY() / submodelScale, 1 / submodelScale));
                }
                if (labelAlpha != 0)
                {
                        gc.setAlpha(labelAlpha);
-                       renderSymbol(gc, visibleRegion);
+                       renderSymbol(gc, renderPrefs, visibleRegion);
                }
                conf.reset(gc);
                // reset line width explicitly to avoid rounding errors causing weird glitches
-               gc.setLineWidth(Preferences.current().getDouble("net.mograsim.logic.model.linewidth.default"));
+               gc.setLineWidth(renderPrefs.getDouble(DEFAULT_LINE_WIDTH));
                // draw the outline after all other operations to make interface pins look better
-               renderOutline(gc, visibleRegion);
+               renderOutline(gc, renderPrefs, visibleRegion);
        }
 
        /**
@@ -401,10 +408,10 @@ public abstract class SubmodelComponent extends ModelComponent
         * 
         * @author Daniel Kirschten
         */
-       private void renderSymbol(GeneralGC gc, Rectangle visibleRegion)
+       private void renderSymbol(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
                if (symbolRenderer != null)
-                       symbolRenderer.render(gc, visibleRegion);
+                       symbolRenderer.render(gc, renderPrefs, visibleRegion);
        }
 
        /**
@@ -412,10 +419,10 @@ public abstract class SubmodelComponent extends ModelComponent
         * 
         * @author Daniel Kirschten
         */
-       private void renderOutline(GeneralGC gc, Rectangle visibleRegion)
+       private void renderOutline(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
                if (outlineRenderer != null)
-                       outlineRenderer.render(gc, visibleRegion);
+                       outlineRenderer.render(gc, renderPrefs, visibleRegion);
        }
 
        private static double map(double val, double valMin, double valMax, double mapMin, double mapMax)
index 331db12..233c371 100644 (file)
@@ -5,6 +5,7 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.Pin;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 
 public class SubmodelInterface extends ModelComponent
@@ -15,7 +16,7 @@ public class SubmodelInterface extends ModelComponent
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {// nothing to do here
        }
 
index 8d3cbde..813f06d 100644 (file)
@@ -1,5 +1,9 @@
 package net.mograsim.logic.model.model.wires;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.DEFAULT_LINE_WIDTH;
+import static net.mograsim.logic.model.preferences.RenderPreferences.WIRE_WIDTH_MULTIBIT;
+import static net.mograsim.logic.model.preferences.RenderPreferences.WIRE_WIDTH_SINGLEBIT;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -12,13 +16,13 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.core.LogicObserver;
 import net.mograsim.logic.core.types.BitVector;
-import net.mograsim.logic.core.types.BitVectorFormatter;
 import net.mograsim.logic.core.wires.CoreWire;
 import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
+import net.mograsim.logic.model.BitVectorFormatter;
 import net.mograsim.logic.model.model.LogicModelModifiable;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.preferences.ColorDefinition;
 import net.mograsim.preferences.ColorManager;
-import net.mograsim.preferences.Preferences;
 
 /**
  * A wire connecting exactly two {@link Pin}s.
@@ -363,15 +367,14 @@ public class ModelWire
         * 
         * @author Daniel Kirschten
         */
-       public void render(GeneralGC gc)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs)
        {
-               ColorDefinition wireColor = BitVectorFormatter.formatAsColor(end);
+               ColorDefinition wireColor = BitVectorFormatter.formatAsColor(renderPrefs, end);
                if (wireColor != null)
                        gc.setForeground(ColorManager.current().toColor(wireColor));
-               gc.setLineWidth(
-                               Preferences.current().getDouble("net.mograsim.logic.model.linewidth.wire." + (logicWidth == 1 ? "singlebit" : "multibit")));
+               gc.setLineWidth(renderPrefs.getDouble(logicWidth == 1 ? WIRE_WIDTH_SINGLEBIT : WIRE_WIDTH_MULTIBIT));
                gc.drawPolyline(effectivePath);
-               gc.setLineWidth(Preferences.current().getDouble("net.mograsim.logic.model.linewidth.default"));
+               gc.setLineWidth(renderPrefs.getDouble(DEFAULT_LINE_WIDTH));
        }
 
        // operations concerning the path
index b9a5ccc..5594bdb 100644 (file)
@@ -3,10 +3,11 @@ package net.mograsim.logic.model.model.wires;
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.core.LogicObserver;
-import net.mograsim.logic.core.types.BitVectorFormatter;
 import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
+import net.mograsim.logic.model.BitVectorFormatter;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
 import net.mograsim.preferences.ColorDefinition;
@@ -83,9 +84,9 @@ public class ModelWireCrossPoint extends ModelComponent
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
-               ColorDefinition wireColor = BitVectorFormatter.formatAsColor(end);
+               ColorDefinition wireColor = BitVectorFormatter.formatAsColor(renderPrefs, end);
                if (wireColor != null)
                        gc.setBackground(ColorManager.current().toColor(wireColor));
                gc.fillOval(getPosX(), getPosY(), CIRCLE_DIAM, CIRCLE_DIAM);
index e913641..93f7fb4 100644 (file)
@@ -8,6 +8,7 @@ import java.util.Set;
 import java.util.function.Consumer;
 
 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
+import net.mograsim.logic.model.model.LogicModel;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
 
index 70f256a..8b33dd0 100644 (file)
@@ -18,8 +18,8 @@ import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.components.submodels.SubmodelComponent;
 import net.mograsim.logic.model.model.components.submodels.SubmodelInterface;
 import net.mograsim.logic.model.model.wires.ModelWire;
-import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.ModelWireCrossPoint;
+import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.modeladapter.componentadapters.ComponentAdapter;
 
 public class LogicCoreAdapter
@@ -142,11 +142,14 @@ public class LogicCoreAdapter
                return connectedPinsPerPin;
        }
 
+       public static final Map<Class<? extends ModelComponent>, Integer> gateCountsPerComponentClass = new HashMap<>();
+
        @SuppressWarnings("unchecked")
        private static <G extends ModelComponent> void createAndLinkComponent(Timeline timeline, CoreModelParameters params,
                        ModelComponent modelComponent, Map<Pin, CoreWire> logicWiresPerPin)
        {
                Class<?> cls = modelComponent.getClass();
+               gateCountsPerComponentClass.merge(modelComponent.getClass(), 1, Integer::sum);
                ComponentAdapter<? super G> adapter = null;
                while (cls != ModelComponent.class && adapter == null)
                {
diff --git a/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/preferences/DefaultRenderPreferences.java b/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/preferences/DefaultRenderPreferences.java
new file mode 100755 (executable)
index 0000000..9a97ae1
--- /dev/null
@@ -0,0 +1,86 @@
+package net.mograsim.logic.model.preferences;
+
+import net.mograsim.preferences.ColorDefinition;
+import net.mograsim.preferences.ColorDefinition.BuiltInColor;
+import net.mograsim.preferences.DefaultPreferences;
+
+public class DefaultRenderPreferences extends DefaultPreferences implements RenderPreferences
+{
+       @Override
+       public boolean getBoolean(String name)
+       {
+               switch (name)
+               {
+               case IMPROVE_TEXT:
+                       return true;
+               case DEBUG_OPEN_HLSSHELL:
+                       return false;
+               default:
+                       throw new IllegalArgumentException("Unknown boolean preference name: " + name);
+               }
+       }
+
+       @Override
+       public int getInt(String name)
+       {
+               switch (name)
+               {
+               case DEBUG_HLSSHELL_DEPTH:
+                       return 0;
+               case ACTION_BUTTON:
+                       return 1;
+               case DRAG_BUTTON:
+                       return 3;
+               case ZOOM_BUTTON:
+                       return 2;
+               default:
+                       throw new IllegalArgumentException("Unknown int preference name: " + name);
+               }
+       }
+
+       @Override
+       public double getDouble(String name)
+       {
+               switch (name)
+               {
+               case DEFAULT_LINE_WIDTH:
+                       return 0.5;
+               case WIRE_WIDTH_SINGLEBIT:
+                       return 0.5;
+               case WIRE_WIDTH_MULTIBIT:
+                       return 0.85;
+               case SUBMODEL_ZOOM_ALPHA_0:
+                       return 0.1;
+               case SUBMODEL_ZOOM_ALPHA_1:
+                       return 0.2;
+               default:
+                       throw new IllegalArgumentException("Unknown double preference name: " + name);
+               }
+       }
+
+       @Override
+       public ColorDefinition getColorDefinition(String name)
+       {
+               switch (name)
+               {
+               case BIT_ONE_COLOR:
+                       return new ColorDefinition(BuiltInColor.COLOR_GREEN);
+               case BIT_U_COLOR:
+                       return new ColorDefinition(BuiltInColor.COLOR_CYAN);
+               case BIT_X_COLOR:
+                       return new ColorDefinition(BuiltInColor.COLOR_RED);
+               case BIT_Z_COLOR:
+                       return new ColorDefinition(BuiltInColor.COLOR_YELLOW);
+               case BIT_ZERO_COLOR:
+                       return new ColorDefinition(BuiltInColor.COLOR_GRAY);
+               case BACKGROUND_COLOR:
+                       return new ColorDefinition(BuiltInColor.COLOR_WHITE);
+               case FOREGROUND_COLOR:
+                       return new ColorDefinition(BuiltInColor.COLOR_BLACK);
+               case TEXT_COLOR:
+                       return new ColorDefinition(BuiltInColor.COLOR_BLACK);
+               default:
+                       throw new IllegalArgumentException("Unknown color preference name: " + name);
+               }
+       }
+}
\ No newline at end of file
diff --git a/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/preferences/RenderPreferences.java b/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/preferences/RenderPreferences.java
new file mode 100755 (executable)
index 0000000..fd325c3
--- /dev/null
@@ -0,0 +1,28 @@
+package net.mograsim.logic.model.preferences;
+
+import net.mograsim.preferences.Preferences;
+
+public interface RenderPreferences extends Preferences
+{
+       public static final String PREFIX = "net.mograsim.logic.model.";
+
+       public static final String IMPROVE_TEXT = PREFIX + "improvetext";
+       public static final String TEXT_COLOR = PREFIX + "color.text";
+       public static final String FOREGROUND_COLOR = PREFIX + "color.foreground";
+       public static final String BACKGROUND_COLOR = PREFIX + "color.background";
+       public static final String BIT_ZERO_COLOR = PREFIX + "color.bit.zero";
+       public static final String BIT_Z_COLOR = PREFIX + "color.bit.z";
+       public static final String BIT_X_COLOR = PREFIX + "color.bit.x";
+       public static final String BIT_U_COLOR = PREFIX + "color.bit.u";
+       public static final String BIT_ONE_COLOR = PREFIX + "color.bit.one";
+       public static final String SUBMODEL_ZOOM_ALPHA_1 = PREFIX + "submodel.zoomalpha1";
+       public static final String SUBMODEL_ZOOM_ALPHA_0 = PREFIX + "submodel.zoomalpha0";
+       public static final String WIRE_WIDTH_MULTIBIT = PREFIX + "linewidth.wire.multibit";
+       public static final String WIRE_WIDTH_SINGLEBIT = PREFIX + "linewidth.wire.singlebit";
+       public static final String DEFAULT_LINE_WIDTH = PREFIX + "linewidth.default";
+       public static final String ZOOM_BUTTON = PREFIX + "button.zoom";
+       public static final String DRAG_BUTTON = PREFIX + "button.drag";
+       public static final String ACTION_BUTTON = PREFIX + "button.action";
+       public static final String DEBUG_OPEN_HLSSHELL = PREFIX + "debug.openhlsshell";
+       public static final String DEBUG_HLSSHELL_DEPTH = PREFIX + "debug.hlsshelldepth";
+}
index 5ed33bd..9dff925 100644 (file)
@@ -2,9 +2,10 @@ package net.mograsim.logic.model.snippets;
 
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.JSONSerializable;
 
 public interface Renderer extends JSONSerializable
 {
-       public void render(GeneralGC gc, Rectangle visibleRegion);
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion);
 }
\ No newline at end of file
index 90f25a4..31366a7 100644 (file)
@@ -1,15 +1,17 @@
 package net.mograsim.logic.model.snippets.outlinerenderers;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.FOREGROUND_COLOR;
+
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.model.model.components.ModelComponent;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.snippets.Renderer;
 import net.mograsim.logic.model.snippets.SnippetDefinintion;
 import net.mograsim.logic.model.snippets.SubmodelComponentSnippetSuppliers;
 import net.mograsim.preferences.ColorDefinition;
 import net.mograsim.preferences.ColorManager;
-import net.mograsim.preferences.Preferences;
 
 public class DefaultOutlineRenderer implements Renderer
 {
@@ -26,9 +28,9 @@ public class DefaultOutlineRenderer implements Renderer
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
-               ColorDefinition fg = Preferences.current().getColorDefinition("net.mograsim.logic.model.color.foreground");
+               ColorDefinition fg = renderPrefs.getColorDefinition(FOREGROUND_COLOR);
                if (fg != null)
                        gc.setForeground(ColorManager.current().toColor(fg));
                gc.drawRectangle(component.getBounds());
index 9a6599a..e122cdf 100644 (file)
@@ -1,17 +1,19 @@
 package net.mograsim.logic.model.snippets.symbolrenderers;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.TEXT_COLOR;
+
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Font;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.model.model.components.ModelComponent;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.snippets.Renderer;
 import net.mograsim.logic.model.snippets.SnippetDefinintion;
 import net.mograsim.logic.model.snippets.SubmodelComponentSnippetSuppliers;
 import net.mograsim.preferences.ColorDefinition;
 import net.mograsim.preferences.ColorManager;
-import net.mograsim.preferences.Preferences;
 
 /**
  * Renders a text (<code>"text"</code>) with a given font height (<code>"height"</code>) in the center of the component.
@@ -33,11 +35,11 @@ public class CenteredTextSymbolRenderer implements Renderer
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
                Font oldFont = gc.getFont();
                gc.setFont(new Font(oldFont.getName(), fontHeight, oldFont.getStyle()));
-               ColorDefinition fg = Preferences.current().getColorDefinition("net.mograsim.logic.model.color.text");
+               ColorDefinition fg = renderPrefs.getColorDefinition(TEXT_COLOR);
                if (fg != null)
                        gc.setForeground(ColorManager.current().toColor(fg));
                Point idSize = gc.textExtent(text);
index 28ad8a8..eb883e2 100644 (file)
@@ -1,16 +1,18 @@
 package net.mograsim.logic.model.snippets.symbolrenderers;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.TEXT_COLOR;
+
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.model.model.components.ModelComponent;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.snippets.Renderer;
 import net.mograsim.logic.model.snippets.SnippetDefinintion;
 import net.mograsim.logic.model.snippets.SubmodelComponentSnippetSuppliers;
 import net.mograsim.preferences.ColorDefinition;
 import net.mograsim.preferences.ColorManager;
-import net.mograsim.preferences.Preferences;
 
 public class DefaultSymbolRenderer implements Renderer
 {
@@ -29,9 +31,9 @@ public class DefaultSymbolRenderer implements Renderer
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
-               ColorDefinition fg = Preferences.current().getColorDefinition("net.mograsim.logic.model.color.text");
+               ColorDefinition fg = renderPrefs.getColorDefinition(TEXT_COLOR);
                if (fg != null)
                        gc.setForeground(ColorManager.current().toColor(fg));
                Point idSize = gc.textExtent(id);
index ede8710..06d97e6 100644 (file)
@@ -1,14 +1,19 @@
 package net.mograsim.logic.model.snippets.symbolrenderers;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.TEXT_COLOR;
+
 import java.util.HashMap;
 import java.util.Map;
 
+import org.eclipse.swt.graphics.Color;
+
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Font;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.Pin;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.snippets.Renderer;
 import net.mograsim.logic.model.snippets.SnippetDefinintion;
@@ -47,8 +52,11 @@ public class PinNamesSymbolRenderer implements Renderer
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
+               Color textColor = renderPrefs.getColor(TEXT_COLOR);
+               if (textColor != null)
+                       gc.setForeground(textColor);
                Font oldFont = gc.getFont();
                gc.setFont(new Font(oldFont.getName(), pinLabelHeight, oldFont.getStyle()));
                for (Pin pin : component.getPins().values())
index d57203a..b61bca9 100644 (file)
@@ -1,5 +1,7 @@
 package net.mograsim.logic.model.snippets.symbolrenderers;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.TEXT_COLOR;
+
 import java.util.Map.Entry;
 
 import org.eclipse.swt.graphics.Color;
@@ -10,11 +12,11 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.Pin;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.snippets.Renderer;
 import net.mograsim.logic.model.snippets.SnippetDefinintion;
 import net.mograsim.logic.model.snippets.SubmodelComponentSnippetSuppliers;
-import net.mograsim.preferences.Preferences;
 
 /**
  * Renders a text (<code>"centerText"</code>) with a given font height (<code>"centerTextHeight"</code>) in the center of the component and
@@ -44,7 +46,7 @@ public class SimpleRectangularLikeSymbolRenderer implements Renderer
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
                double posX = component.getPosX();
                double posY = component.getPosY();
@@ -54,7 +56,7 @@ public class SimpleRectangularLikeSymbolRenderer implements Renderer
                Font oldFont = gc.getFont();
                gc.setFont(new Font(oldFont.getName(), centerTextHeight, oldFont.getStyle()));
                Point textExtent = gc.textExtent(centerText);
-               Color textColor = Preferences.current().getColor("net.mograsim.logic.model.color.text");
+               Color textColor = renderPrefs.getColor(TEXT_COLOR);
                if (textColor != null)
                        gc.setForeground(textColor);
                gc.drawText(centerText, posX + (width - textExtent.x) / 2, posY + (height - textExtent.y) / 2, true);
index 58a86ea..581286f 100644 (file)
@@ -3,8 +3,8 @@ package net.mograsim.logic.model.util;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.ModelWire;
-import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.ModelWireCrossPoint;
+import net.mograsim.logic.model.model.wires.Pin;
 
 public class ModellingTool
 {
diff --git a/plugins/net.mograsim.machine/.settings/org.eclipse.core.runtime.prefs b/plugins/net.mograsim.machine/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
index 72fe437..9b820eb 100644 (file)
@@ -4,6 +4,7 @@ import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.snippets.Renderer;
 import net.mograsim.logic.model.snippets.outlinerenderers.DefaultOutlineRenderer;
 import net.mograsim.logic.model.snippets.symbolrenderers.SimpleRectangularLikeSymbolRenderer;
@@ -34,9 +35,9 @@ public abstract class ModelMemory extends ModelComponent
        }
 
        @Override
-       public void render(GeneralGC gc, Rectangle visibleRegion)
+       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
        {
-               symbolRenderer.render(gc, visibleRegion);
-               outlineRenderer.render(gc, visibleRegion);
+               symbolRenderer.render(gc, renderPrefs, visibleRegion);
+               outlineRenderer.render(gc, renderPrefs, visibleRegion);
        }
 }
\ No newline at end of file
diff --git a/plugins/net.mograsim.plugin.branding/.settings/org.eclipse.core.runtime.prefs b/plugins/net.mograsim.plugin.branding/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/net.mograsim.plugin.core.nl_de/.settings/org.eclipse.core.runtime.prefs b/plugins/net.mograsim.plugin.core.nl_de/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/net.mograsim.plugin.core/.settings/org.eclipse.core.runtime.prefs b/plugins/net.mograsim.plugin.core/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
index a5add49..c735a0a 100644 (file)
@@ -11,6 +11,8 @@ Export-Package: net.mograsim.plugin;uses:="org.eclipse.ui.themes,org.eclipse.swt
  net.mograsim.plugin.launch,
  net.mograsim.plugin.nature,
  net.mograsim.plugin.nature.properties,
+ net.mograsim.plugin.perspectives,
+ net.mograsim.plugin.preferences,
  net.mograsim.plugin.tables,
  net.mograsim.plugin.tables.memory,
  net.mograsim.plugin.tables.mi,
diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/EclipsePreferences.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/EclipsePreferences.java
deleted file mode 100644 (file)
index 445cf20..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-package net.mograsim.plugin;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ColorRegistry;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.statushandlers.StatusManager;
-import org.eclipse.ui.themes.ITheme;
-
-import net.mograsim.preferences.ColorDefinition;
-import net.mograsim.preferences.DefaultPreferences;
-import net.mograsim.preferences.Preferences;
-
-public class EclipsePreferences extends Preferences
-{
-       private final ITheme theme;
-       private final IPreferenceStore prefs;
-       private final Preferences defaultPrefs;
-
-       public EclipsePreferences(ITheme theme, IPreferenceStore prefs)
-       {
-               this.theme = theme;
-               this.prefs = prefs;
-               this.defaultPrefs = new DefaultPreferences();
-       }
-
-       @Override
-       public boolean getBoolean(String name)
-       {
-               prefs.setDefault(name, defaultPrefs.getBoolean(name));
-               return prefs.getBoolean(name);
-       }
-
-       @Override
-       public int getInt(String name)
-       {
-               prefs.setDefault(name, defaultPrefs.getInt(name));
-               return prefs.getInt(name);
-       }
-
-       @Override
-       public double getDouble(String name)
-       {
-               prefs.setDefault(name, defaultPrefs.getDouble(name));
-               return prefs.getDouble(name);
-       }
-
-       @Override
-       public ColorDefinition getColorDefinition(String name)
-       {
-               RGB rgb = getColorRegistry().getRGB(name);
-               if (rgb == null)
-               {
-                       StatusManager.getManager().handle(new Status(IStatus.ERROR, MograsimActivator.PLUGIN_ID, "No color for name " + name));
-                       return null;
-               }
-               return new ColorDefinition(rgb.red, rgb.green, rgb.blue);
-       }
-
-       @Override
-       public Color getColor(String name)
-       {
-               return getColorRegistry().get(name);
-       }
-
-       private ColorRegistry getColorRegistry()
-       {
-               return theme.getColorRegistry();
-       }
-}
\ No newline at end of file
index 765a63a..64586b0 100644 (file)
@@ -1,9 +1,15 @@
 package net.mograsim.plugin;
 
+import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.themes.ITheme;
 
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.machine.MachineRegistry;
+import net.mograsim.plugin.preferences.EclipsePluginPreferences;
+import net.mograsim.plugin.preferences.EclipseRenderPreferences;
+import net.mograsim.plugin.preferences.PluginPreferences;
 import net.mograsim.preferences.Preferences;
 
 public final class MograsimActivator extends AbstractUIPlugin
@@ -12,20 +18,36 @@ public final class MograsimActivator extends AbstractUIPlugin
 
        private static MograsimActivator instance;
 
+       public static MograsimActivator instance()
+       {
+               if (instance == null)
+                       throw new IllegalStateException("MograsimActivator not yet created!");
+               return instance;
+       }
+
+       private final RenderPreferences renderPrefs;
+       private final PluginPreferences pluginPrefs;
+
        public MograsimActivator()
        {
                if (instance != null)
                        throw new IllegalStateException("MograsimActivator already created!");
                instance = this;
+
                MachineRegistry.initialize();
-               Preferences.setPreferences(new EclipsePreferences(PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(),
-                               MograsimActivator.instance().getPreferenceStore()));
+               ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
+               IPreferenceStore preferenceStore = getPreferenceStore();
+               renderPrefs = new EclipseRenderPreferences(currentTheme, preferenceStore);
+               pluginPrefs = new EclipsePluginPreferences(currentTheme, preferenceStore);
        }
 
-       public static MograsimActivator instance()
+       public RenderPreferences getRenderPrefs()
        {
-               if (instance == null)
-                       throw new IllegalStateException("MograsimActivator not yet created!");
-               return instance;
+               return renderPrefs;
+       }
+
+       public Preferences getPluginPrefs()
+       {
+               return pluginPrefs;
        }
 }
\ No newline at end of file
index 746433b..03a0e34 100644 (file)
@@ -17,24 +17,20 @@ import net.mograsim.logic.model.model.wires.ModelWire;
 import net.mograsim.logic.model.model.wires.ModelWireCrossPoint;
 import net.mograsim.logic.model.modeladapter.CoreModelParameters;
 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
-import net.mograsim.preferences.Preferences;
+import net.mograsim.logic.model.preferences.RenderPreferences;
+import net.mograsim.plugin.preferences.EclipseRenderPreferences;
 
 public class SimulationPreview implements IThemePreview
 {
        private LogicUICanvas ui;
        private LogicExecuter exec;
-       private Preferences oldPreferences;
-       private Preferences currentThemePreferences;
 
        @Override
        @SuppressWarnings("unused")
        public void createControl(Composite parent, ITheme currentTheme)
        {
-               oldPreferences = Preferences.current();
-
-               currentThemePreferences = new EclipsePreferences(currentTheme, MograsimActivator.instance().getPreferenceStore());
-               // TODO this will change the global preferences; so if another LogicUICanvas redraws, it will use the "new" colors too.
-               Preferences.setPreferences(currentThemePreferences);
+               RenderPreferences currentThemeRenderPrefs = new EclipseRenderPreferences(currentTheme,
+                               MograsimActivator.instance().getPreferenceStore());
 
                LogicModelModifiable model = new LogicModelModifiable();
                CoreModelParameters params = new CoreModelParameters();
@@ -86,7 +82,7 @@ public class SimulationPreview implements IThemePreview
 
                rIn.clicked(0, 0);
 
-               ui = new LogicUICanvas(parent, SWT.NONE, model);
+               ui = new LogicUICanvas(parent, SWT.NONE, model, currentThemeRenderPrefs);
 
                ui.zoom(3.5, 10, 10);
                exec.startLiveExecution();
@@ -98,7 +94,5 @@ public class SimulationPreview implements IThemePreview
        public void dispose()
        {
                exec.stopLiveExecution();
-               if (Preferences.current() == currentThemePreferences)
-                       Preferences.setPreferences(oldPreferences);
        }
 }
index 88c6ba7..f8d2265 100644 (file)
@@ -18,7 +18,7 @@ import org.eclipse.debug.core.model.IValue;
 import org.eclipse.swt.SWT;
 
 import net.mograsim.logic.core.types.BitVector;
-import net.mograsim.logic.core.types.BitVectorFormatter;
+import net.mograsim.logic.model.BitVectorFormatter;
 import net.mograsim.machine.Machine;
 import net.mograsim.machine.registers.Register;
 import net.mograsim.plugin.MograsimActivator;
index 5d4cf5d..16c6db0 100644 (file)
@@ -1,5 +1,7 @@
 package net.mograsim.plugin.launch;
 
+import static net.mograsim.plugin.preferences.PluginPreferences.MAX_MEMORY_CHANGE_INTERVAL;
+
 import java.math.BigInteger;
 import java.util.HashSet;
 import java.util.Set;
@@ -21,7 +23,6 @@ import net.mograsim.machine.MainMemory;
 import net.mograsim.machine.MainMemoryDefinition;
 import net.mograsim.machine.Memory.MemoryCellModifiedListener;
 import net.mograsim.plugin.MograsimActivator;
-import net.mograsim.preferences.Preferences;
 
 public class MainMemoryBlockExtension extends PlatformObject implements IMemoryBlockExtension
 {
@@ -80,7 +81,8 @@ public class MainMemoryBlockExtension extends PlatformObject implements IMemoryB
                this.memListener = a -> queueFireContentChangeEvent();
                this.memListenerRegistered = new AtomicBoolean();
 
-               this.maxContentChangeInterval = Preferences.current().getInt("net.mograsim.plugin.core.maxmemchangeinterval");
+               // TODO add a listener
+               this.maxContentChangeInterval = MograsimActivator.instance().getPluginPrefs().getInt(MAX_MEMORY_CHANGE_INTERVAL);
                this.contentChangeLock = new Object();
                this.nextContentChangeAllowedMillis = System.currentTimeMillis() - maxContentChangeInterval - 1;
        }
diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/DefaultPluginPreferences.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/DefaultPluginPreferences.java
new file mode 100755 (executable)
index 0000000..e3dcc72
--- /dev/null
@@ -0,0 +1,53 @@
+package net.mograsim.plugin.preferences;
+
+import net.mograsim.preferences.ColorDefinition;
+import net.mograsim.preferences.DefaultPreferences;
+
+public class DefaultPluginPreferences extends DefaultPreferences implements PluginPreferences
+{
+       @Override
+       public boolean getBoolean(String name)
+       {
+               switch (name)
+               {
+               case MPM_EDITOR_BITS_AS_COLUMN_NAME:
+                       return false;
+               default:
+                       throw new IllegalArgumentException("Unknown boolean preference name: " + name);
+               }
+       }
+
+       @Override
+       public int getInt(String name)
+       {
+               switch (name)
+               {
+               case SIMULATION_SPEED_PRECISION:
+                       return 6;
+               case MAX_MEMORY_CHANGE_INTERVAL:
+                       return 1000;
+               default:
+                       throw new IllegalArgumentException("Unknown int preference name: " + name);
+               }
+       }
+
+       @Override
+       public double getDouble(String name)
+       {
+               switch (name)
+               {
+               default:
+                       throw new IllegalArgumentException("Unknown double preference name: " + name);
+               }
+       }
+
+       @Override
+       public ColorDefinition getColorDefinition(String name)
+       {
+               switch (name)
+               {
+               default:
+                       throw new IllegalArgumentException("Unknown color preference name: " + name);
+               }
+       }
+}
\ No newline at end of file
diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/EclipsePluginPreferences.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/EclipsePluginPreferences.java
new file mode 100755 (executable)
index 0000000..193471d
--- /dev/null
@@ -0,0 +1,12 @@
+package net.mograsim.plugin.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.ui.themes.ITheme;
+
+public class EclipsePluginPreferences extends EclipsePreferences implements PluginPreferences
+{
+       public EclipsePluginPreferences(ITheme theme, IPreferenceStore prefs)
+       {
+               super(theme, prefs, new DefaultPluginPreferences());
+       }
+}
diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/EclipsePreferences.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/EclipsePreferences.java
new file mode 100755 (executable)
index 0000000..c57c443
--- /dev/null
@@ -0,0 +1,189 @@
+package net.mograsim.plugin.preferences;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Consumer;
+import java.util.function.Function;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.ui.statushandlers.StatusManager;
+import org.eclipse.ui.themes.ITheme;
+
+import net.mograsim.plugin.MograsimActivator;
+import net.mograsim.preferences.ColorDefinition;
+import net.mograsim.preferences.Preferences;
+
+public class EclipsePreferences implements Preferences
+{
+       private final ITheme theme;
+       private final IPreferenceStore prefs;
+       private final Preferences defaultPrefs;
+
+       private final ListenerManager<Boolean> booleanListeners;
+       private final ListenerManager<Integer> intListeners;
+       private final ListenerManager<Double> doubleListeners;
+       private final ListenerManager<ColorDefinition> colorDefinitionListeners;
+
+       protected EclipsePreferences(ITheme theme, IPreferenceStore prefs, Preferences defaultPrefs)
+       {
+               this.theme = theme;
+               this.prefs = prefs;
+               this.defaultPrefs = defaultPrefs;
+
+               this.booleanListeners = new ListenerManager<>(this::getBoolean);
+               this.intListeners = new ListenerManager<>(this::getInt);
+               this.doubleListeners = new ListenerManager<>(this::getDouble);
+               this.colorDefinitionListeners = new ListenerManager<>(this::getColorDefinition);
+       }
+
+       @Override
+       public boolean getBoolean(String name)
+       {
+               prefs.setDefault(name, defaultPrefs.getBoolean(name));
+               return prefs.getBoolean(name);
+       }
+
+       @Override
+       public int getInt(String name)
+       {
+               prefs.setDefault(name, defaultPrefs.getInt(name));
+               return prefs.getInt(name);
+       }
+
+       @Override
+       public double getDouble(String name)
+       {
+               prefs.setDefault(name, defaultPrefs.getDouble(name));
+               return prefs.getDouble(name);
+       }
+
+       @Override
+       public ColorDefinition getColorDefinition(String name)
+       {
+               RGB rgb = getColorRegistry().getRGB(name);
+               if (rgb == null)
+               {
+                       StatusManager.getManager().handle(new Status(IStatus.ERROR, MograsimActivator.PLUGIN_ID, "No color for name " + name));
+                       return null;
+               }
+               return new ColorDefinition(rgb.red, rgb.green, rgb.blue);
+       }
+
+       @Override
+       public Color getColor(String name)
+       {
+               return getColorRegistry().get(name);
+       }
+
+       private ColorRegistry getColorRegistry()
+       {
+               return theme.getColorRegistry();
+       }
+
+       @Override
+       public void addBooleanListener(String name, Consumer<Boolean> listener)
+       {
+               booleanListeners.addListener(name, listener);
+       }
+
+       @Override
+       public void removeBooleanListener(String name, Consumer<Boolean> listener)
+       {
+               booleanListeners.removeListener(name, listener);
+       }
+
+       @Override
+       public void addIntListener(String name, Consumer<Integer> listener)
+       {
+               intListeners.addListener(name, listener);
+       }
+
+       @Override
+       public void removeIntListener(String name, Consumer<Integer> listener)
+       {
+               intListeners.removeListener(name, listener);
+       }
+
+       @Override
+       public void addDoubleListener(String name, Consumer<Double> listener)
+       {
+               doubleListeners.addListener(name, listener);
+       }
+
+       @Override
+       public void removeDoubleListener(String name, Consumer<Double> listener)
+       {
+               doubleListeners.removeListener(name, listener);
+       }
+
+       @Override
+       public void addColorDefinitionListener(String name, Consumer<ColorDefinition> listener)
+       {
+               colorDefinitionListeners.addListener(name, listener);
+       }
+
+       @Override
+       public void removeColorDefinitionListener(String name, Consumer<ColorDefinition> listener)
+       {
+               colorDefinitionListeners.removeListener(name, listener);
+       }
+
+       private class ListenerManager<P>
+       {
+               private final Map<String, Set<Consumer<P>>> listenersPerName;
+               private final IPropertyChangeListener eclipseListener;
+
+               public ListenerManager(Function<String, P> preferenceGetter)
+               {
+                       this.listenersPerName = new HashMap<>();
+                       this.eclipseListener = e ->
+                       {
+                               String name = e.getProperty();
+                               synchronized (listenersPerName)
+                               {
+                                       Set<Consumer<P>> listenersThisName = listenersPerName.get(name);
+                                       if (listenersThisName != null)
+                                       {
+                                               P p = preferenceGetter.apply(name);
+                                               listenersThisName.forEach(l -> l.accept(p));
+                                       }
+                               }
+                       };
+               }
+
+               public void addListener(String name, Consumer<P> listener)
+               {
+                       synchronized (listenersPerName)
+                       {
+                               boolean wasEmpty = listenersPerName.isEmpty();
+                               listenersPerName.computeIfAbsent(name, n -> new HashSet<>()).add(listener);
+                               if (wasEmpty)
+                                       prefs.addPropertyChangeListener(eclipseListener);
+                       }
+               }
+
+               public void removeListener(String name, Consumer<P> listener)
+               {
+                       synchronized (listenersPerName)
+                       {
+                               Set<Consumer<P>> listenersThisName = listenersPerName.get(name);
+                               if (listenersThisName != null)
+                               {
+                                       listenersThisName.remove(listener);
+                                       if (listenersThisName.isEmpty())
+                                               listenersPerName.remove(name);
+                               }
+                               if (listenersPerName.isEmpty())
+                                       prefs.addPropertyChangeListener(eclipseListener);
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/EclipseRenderPreferences.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/EclipseRenderPreferences.java
new file mode 100755 (executable)
index 0000000..f976ccc
--- /dev/null
@@ -0,0 +1,15 @@
+package net.mograsim.plugin.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.ui.themes.ITheme;
+
+import net.mograsim.logic.model.preferences.DefaultRenderPreferences;
+import net.mograsim.logic.model.preferences.RenderPreferences;
+
+public class EclipseRenderPreferences extends EclipsePreferences implements RenderPreferences
+{
+       public EclipseRenderPreferences(ITheme theme, IPreferenceStore prefs)
+       {
+               super(theme, prefs, new DefaultRenderPreferences());
+       }
+}
diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/PluginPreferences.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/preferences/PluginPreferences.java
new file mode 100755 (executable)
index 0000000..3378e66
--- /dev/null
@@ -0,0 +1,13 @@
+package net.mograsim.plugin.preferences;
+
+import net.mograsim.preferences.Preferences;
+
+public interface PluginPreferences extends Preferences
+{
+       public static final String PREFIX = "net.mograsim.plugin.core.";
+
+       public static final String MAX_MEMORY_CHANGE_INTERVAL = "net.mograsim.plugin.core.maxmemchangeinterval";
+       public static final String SIMULATION_SPEED_PRECISION = "net.mograsim.plugin.core.simspeedprecision";
+       public static final String MPM_EDITOR_BITS_AS_COLUMN_NAME = "net.mograsim.plugin.core.editors.mpm.bitsascolumnname";
+
+}
index 81e0f16..25c0f71 100644 (file)
@@ -1,5 +1,7 @@
 package net.mograsim.plugin.tables.mi;
 
+import static net.mograsim.plugin.preferences.PluginPreferences.MPM_EDITOR_BITS_AS_COLUMN_NAME;
+
 import java.util.Arrays;
 
 import org.eclipse.jface.viewers.ColumnLabelProvider;
@@ -25,10 +27,10 @@ import net.mograsim.machine.mi.MicroInstructionDefinition;
 import net.mograsim.machine.mi.MicroInstructionMemory;
 import net.mograsim.machine.mi.parameters.MnemonicFamily;
 import net.mograsim.machine.mi.parameters.ParameterClassification;
+import net.mograsim.plugin.MograsimActivator;
 import net.mograsim.plugin.tables.AddressLabelProvider;
 import net.mograsim.plugin.tables.DisplaySettings;
 import net.mograsim.plugin.tables.LazyTableViewer;
-import net.mograsim.preferences.Preferences;
 
 public class InstructionTable
 {
@@ -134,7 +136,8 @@ public class InstructionTable
 
                        String columnTitle;
                        String bitString = startBit == endBit ? Integer.toString(startBit) : startBit + "..." + endBit;
-                       if (Preferences.current().getBoolean("net.mograsim.plugin.core.editors.mpm.bitsascolumnname"))
+                       // TODO add a listener
+                       if (MograsimActivator.instance().getPluginPrefs().getBoolean(MPM_EDITOR_BITS_AS_COLUMN_NAME))
                                columnTitle = bitString;
                        else
                                columnTitle = miDef.getParameterTitle(i).orElse(bitString);
index f81fb4b..210e9de 100644 (file)
@@ -1,5 +1,9 @@
 package net.mograsim.plugin.views;
 
+import static net.mograsim.logic.model.preferences.RenderPreferences.DRAG_BUTTON;
+import static net.mograsim.logic.model.preferences.RenderPreferences.ZOOM_BUTTON;
+import static net.mograsim.plugin.preferences.PluginPreferences.SIMULATION_SPEED_PRECISION;
+
 import java.util.HashSet;
 import java.util.Optional;
 import java.util.Set;
@@ -26,16 +30,17 @@ import net.haspamelodica.swt.helper.zoomablecanvas.helper.ZoomableCanvasUserInpu
 import net.mograsim.logic.core.LogicObserver;
 import net.mograsim.logic.core.components.CoreClock;
 import net.mograsim.logic.model.LogicUICanvas;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.machine.Machine;
 import net.mograsim.machine.Memory.MemoryCellModifiedListener;
 import net.mograsim.machine.mi.AssignableMicroInstructionMemory;
+import net.mograsim.plugin.MograsimActivator;
 import net.mograsim.plugin.launch.MachineDebugContextListener;
 import net.mograsim.plugin.launch.MachineDebugTarget;
 import net.mograsim.plugin.tables.DisplaySettings;
 import net.mograsim.plugin.tables.mi.ActiveInstructionPreviewContentProvider;
 import net.mograsim.plugin.tables.mi.InstructionTable;
 import net.mograsim.plugin.util.OverlappingFillLayout;
-import net.mograsim.preferences.Preferences;
 
 public class SimulationView extends ViewPart
 {
@@ -153,7 +158,8 @@ public class SimulationView extends ViewPart
 
                simSpeedInput = new DoubleInput(c, SWT.NONE);
                controlsToDisableWhenNoMachinePresent.add(simSpeedInput);
-               simSpeedInput.setPrecision(Preferences.current().getInt("net.mograsim.plugin.core.simspeedprecision"));
+               // TODO add a listener
+               simSpeedInput.setPrecision(MograsimActivator.instance().getPluginPrefs().getInt(SIMULATION_SPEED_PRECISION));
                simSpeedInput.addChangeListener(speed ->
                {
                        if (speed != 0)
@@ -220,11 +226,14 @@ public class SimulationView extends ViewPart
 
                        Machine machine = debugTarget.getMachine();
 
-                       canvas = new LogicUICanvas(canvasParent, SWT.NONE, machine.getModel());
+                       RenderPreferences renderPrefs = MograsimActivator.instance().getRenderPrefs();
+                       canvas = new LogicUICanvas(canvasParent, SWT.NONE, machine.getModel(), renderPrefs);
                        canvas.addListener(SWT.MouseDown, e -> canvas.setFocus());
                        ZoomableCanvasUserInput userInput = new ZoomableCanvasUserInput(canvas);
-                       userInput.buttonDrag = Preferences.current().getInt("net.mograsim.logic.model.button.drag");
-                       userInput.buttonZoom = Preferences.current().getInt("net.mograsim.logic.model.button.zoom");
+                       // TODO add a listener
+                       userInput.buttonDrag = renderPrefs.getInt(DRAG_BUTTON);
+                       // TODO add a listener
+                       userInput.buttonZoom = renderPrefs.getInt(ZOOM_BUTTON);
                        userInput.enableUserInput();
                        if (zoom > 0)
                        {
diff --git a/plugins/net.mograsim.plugin.docs/.settings/org.eclipse.core.runtime.prefs b/plugins/net.mograsim.plugin.docs/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/net.mograsim.preferences/.settings/org.eclipse.core.runtime.prefs b/plugins/net.mograsim.preferences/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
index 1f6820d..d51acab 100644 (file)
@@ -1,90 +1,19 @@
 package net.mograsim.preferences;
 
-import net.mograsim.preferences.ColorDefinition.BuiltInColor;
+import java.util.function.Consumer;
 
-public class DefaultPreferences extends Preferences
+public abstract class DefaultPreferences implements Preferences
 {
-       @Override
-       public boolean getBoolean(String name)
-       {
-               switch (name)
-               {
-               case "net.mograsim.logic.model.improvetext":
-                       return true;
-               case "net.mograsim.logic.model.debug.openhlsshell":
-                       return false;
-               case "net.mograsim.plugin.core.editors.mpm.bitsascolumnname":
-                       return false;
-               default:
-                       throw new IllegalArgumentException("Unknown boolean preference name: " + name);
-               }
-       }
+       // Adding / removing listeners. All are no-ops, since DefaultPreferences are immutable.
 
-       @Override
-       public int getInt(String name)
-       {
-               switch (name)
-               {
-               case "net.mograsim.logic.model.debug.hlsshelldepth":
-                       return 0;
-               case "net.mograsim.logic.model.button.action":
-                       return 3;
-               case "net.mograsim.logic.model.button.drag":
-                       return 1;
-               case "net.mograsim.logic.model.button.zoom":
-                       return 2;
-               case "net.mograsim.plugin.core.simspeedprecision":
-                       return 6;
-               case "net.mograsim.plugin.core.maxmemchangeinterval":
-                       return 1000;
-               default:
-                       throw new IllegalArgumentException("Unknown int preference name: " + name);
-               }
-       }
-
-       @Override
-       public double getDouble(String name)
-       {
-               switch (name)
-               {
-               case "net.mograsim.logic.model.linewidth.default":
-                       return 0.5;
-               case "net.mograsim.logic.model.linewidth.wire.singlebit":
-                       return 0.5;
-               case "net.mograsim.logic.model.linewidth.wire.multibit":
-                       return 0.85;
-               case "net.mograsim.logic.model.submodel.zoomalpha0":
-                       return 0.8;
-               case "net.mograsim.logic.model.submodel.zoomalpha1":
-                       return 0.9;
-               default:
-                       throw new IllegalArgumentException("Unknown double preference name: " + name);
-               }
-       }
-
-       @Override
-       public ColorDefinition getColorDefinition(String name)
-       {
-               switch (name)
-               {
-               case "net.mograsim.logic.model.color.bit.one":
-                       return new ColorDefinition(BuiltInColor.COLOR_GREEN);
-               case "net.mograsim.logic.model.color.bit.u":
-                       return new ColorDefinition(BuiltInColor.COLOR_CYAN);
-               case "net.mograsim.logic.model.color.bit.x":
-                       return new ColorDefinition(BuiltInColor.COLOR_RED);
-               case "net.mograsim.logic.model.color.bit.z":
-                       return new ColorDefinition(BuiltInColor.COLOR_YELLOW);
-               case "net.mograsim.logic.model.color.bit.zero":
-                       return new ColorDefinition(BuiltInColor.COLOR_GRAY);
-               case "net.mograsim.logic.model.color.background":
-                       return new ColorDefinition(BuiltInColor.COLOR_WHITE);
-               case "net.mograsim.logic.model.color.foreground":
-                       return new ColorDefinition(BuiltInColor.COLOR_BLACK);
-               case "net.mograsim.logic.model.color.text":
-                       return new ColorDefinition(BuiltInColor.COLOR_BLACK);
-               default:
-                       throw new IllegalArgumentException("Unknown color preference name: " + name);
-               }
-       }
+       //@formatter:off
+       @Override public void addBooleanListener(String name, Consumer<Boolean> listener) {/**/}
+       @Override public void removeBooleanListener(String name, Consumer<Boolean> listener) {/**/}
+       @Override public void addIntListener(String name, Consumer<Integer> listener) {/**/}
+       @Override public void removeIntListener(String name, Consumer<Integer> listener) {/**/}
+       @Override public void addDoubleListener(String name, Consumer<Double> listener) {/**/}
+       @Override public void removeDoubleListener(String name, Consumer<Double> listener) {/**/}
+       @Override public void addColorDefinitionListener(String name, Consumer<ColorDefinition> listener) {/**/}
+       @Override public void removeColorDefinitionListener(String name, Consumer<ColorDefinition> listener) {/**/}
+       //@formatter:on
 }
\ No newline at end of file
index f249856..f19ae65 100644 (file)
@@ -1,34 +1,36 @@
 package net.mograsim.preferences;
 
-import java.util.Objects;
+import java.util.function.Consumer;
 
 import org.eclipse.swt.graphics.Color;
 
-public abstract class Preferences
+public interface Preferences
 {
-       private static Preferences currentPreferences;
+       public boolean getBoolean(String name);
 
-       public static void setPreferences(Preferences preferences)
-       {
-               currentPreferences = Objects.requireNonNull(preferences);
-       }
+       public void addBooleanListener(String name, Consumer<Boolean> listener);
 
-       public static Preferences current()
-       {
-               if (currentPreferences == null)
-                       currentPreferences = new DefaultPreferences();
-               return currentPreferences;
-       }
+       public void removeBooleanListener(String name, Consumer<Boolean> listener);
+
+       public int getInt(String name);
+
+       public void addIntListener(String name, Consumer<Integer> listener);
+
+       public void removeIntListener(String name, Consumer<Integer> listener);
+
+       public double getDouble(String name);
+
+       public void addDoubleListener(String name, Consumer<Double> listener);
 
-       public abstract boolean getBoolean(String name);
+       public void removeDoubleListener(String name, Consumer<Double> listener);
 
-       public abstract int getInt(String name);
+       public ColorDefinition getColorDefinition(String name);
 
-       public abstract double getDouble(String name);
+       public void addColorDefinitionListener(String name, Consumer<ColorDefinition> listener);
 
-       public abstract ColorDefinition getColorDefinition(String name);
+       public void removeColorDefinitionListener(String name, Consumer<ColorDefinition> listener);
 
-       public Color getColor(String name)
+       public default Color getColor(String name)
        {
                return ColorManager.current().toColor(getColorDefinition(name));
        }
diff --git a/products/net.mograsim.product/.settings/org.eclipse.core.runtime.prefs b/products/net.mograsim.product/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/releng/net.mograsim.configuration/.settings/org.eclipse.core.runtime.prefs b/releng/net.mograsim.configuration/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/releng/net.mograsim.plugin.updatesite/.settings/org.eclipse.core.runtime.prefs b/releng/net.mograsim.plugin.updatesite/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/releng/net.mograsim.target/.settings/org.eclipse.core.runtime.prefs b/releng/net.mograsim.target/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/tests/net.mograsim.logic.core.tests/.settings/org.eclipse.core.runtime.prefs b/tests/net.mograsim.logic.core.tests/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
index d9b9068..6630a96 100644 (file)
@@ -1,8 +1,22 @@
 package net.mograsim.logic.core.types;
 
-import static net.mograsim.logic.core.types.BitVector.*;
-import static net.mograsim.logic.core.types.Bit.*;
-import static org.junit.jupiter.api.Assertions.*;
+import static net.mograsim.logic.core.types.Bit.ONE;
+import static net.mograsim.logic.core.types.Bit.U;
+import static net.mograsim.logic.core.types.Bit.X;
+import static net.mograsim.logic.core.types.Bit.Z;
+import static net.mograsim.logic.core.types.Bit.ZERO;
+import static net.mograsim.logic.core.types.BitVector.SINGLE_0;
+import static net.mograsim.logic.core.types.BitVector.SINGLE_1;
+import static net.mograsim.logic.core.types.BitVector.SINGLE_U;
+import static net.mograsim.logic.core.types.BitVector.SINGLE_X;
+import static net.mograsim.logic.core.types.BitVector.SINGLE_Z;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.math.BigInteger;
 import java.util.Iterator;
diff --git a/tests/net.mograsim.logic.model.am2900.tests/.settings/org.eclipse.core.runtime.prefs b/tests/net.mograsim.logic.model.am2900.tests/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
index 622aa69..080e6f3 100644 (file)
@@ -24,6 +24,7 @@ import net.mograsim.logic.model.am2900.machine.Am2900MicroInstructionDefinition;
 import net.mograsim.logic.model.am2900.machine.Am2900MicroInstructionMemoryDefinition;
 import net.mograsim.logic.model.am2900.machine.StrictAm2900MachineDefinition;
 import net.mograsim.logic.model.am2900.machine.registers.am2901.NumberedRegister;
+import net.mograsim.logic.model.preferences.DefaultRenderPreferences;
 import net.mograsim.machine.MainMemory;
 import net.mograsim.machine.mi.MicroInstruction;
 import net.mograsim.machine.mi.MicroInstructionDefinition;
@@ -99,7 +100,7 @@ public class TestGCD
 
        private void startGUI()
        {
-               new Thread(() -> new LogicUIStandaloneGUI(mach.getModel()).run(), "GUI thread").start();
+               new Thread(() -> new LogicUIStandaloneGUI(mach.getModel(), new DefaultRenderPreferences()).run(), "GUI thread").start();
        }
 
        @Test
index 0d55c75..3637fd7 100644 (file)
@@ -1,11 +1,23 @@
 package net.mograsim.logic.model.am2900.am2901;
 
-import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Dest.*;
-import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Func.*;
-import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Src.*;
-import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Register.*;
-import static net.mograsim.logic.model.am2900.util.TestUtil.*;
-import static org.junit.jupiter.api.Assertions.*;
+import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Dest.NOP;
+import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Dest.QREG;
+import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Dest.RAMF;
+import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Func.ADD;
+import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Func.AND;
+import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Func.EXOR;
+import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Func.OR;
+import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Func.SUBR;
+import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Src.AB;
+import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Src.DA;
+import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Am2901_Src.DZ;
+import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Register.Q;
+import static net.mograsim.logic.model.am2900.am2901.TestableAm2901.Register.r0;
+import static net.mograsim.logic.model.am2900.util.TestUtil.signed4ToSigned32;
+import static net.mograsim.logic.model.am2900.util.TestUtil.to1bitBin;
+import static net.mograsim.logic.model.am2900.util.TestUtil.to4bitBin;
+import static org.junit.jupiter.api.Assertions.assertAll;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.awt.Point;
 import java.util.stream.IntStream;
@@ -13,8 +25,8 @@ import java.util.stream.Stream;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Order;
 import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
+import org.junit.jupiter.api.Order;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.TestMethodOrder;
 import org.junit.jupiter.api.extension.RegisterExtension;
index 414054e..857b727 100644 (file)
@@ -16,9 +16,9 @@ import net.mograsim.logic.model.model.components.atomic.ModelBitDisplay;
 import net.mograsim.logic.model.model.components.atomic.ModelManualSwitch;
 import net.mograsim.logic.model.model.components.atomic.ModelNotGate;
 import net.mograsim.logic.model.model.components.atomic.ModelTextComponent;
+import net.mograsim.logic.model.model.wires.ModelWireCrossPoint;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
-import net.mograsim.logic.model.model.wires.ModelWireCrossPoint;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
 import net.mograsim.logic.model.util.ModellingTool;
 
index 332f4f6..05e5cd0 100644 (file)
@@ -4,11 +4,11 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
 import org.junit.jupiter.api.Order;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.TestMethodOrder;
 import org.junit.jupiter.api.extension.RegisterExtension;
-import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.EnumSource;
 
index e46561d..1f52750 100644 (file)
@@ -10,6 +10,7 @@ import net.mograsim.logic.model.am2900.Am2900Loader;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.atomic.ModelManualSwitch;
 import net.mograsim.logic.model.model.components.submodels.SubmodelComponent;
+import net.mograsim.logic.model.preferences.RenderPreferences;
 import net.mograsim.logic.model.serializing.DeserializedSubmodelComponent;
 import net.mograsim.logic.model.serializing.IdentifyParams;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
@@ -44,7 +45,7 @@ public class Am2904Testbench
                        }
 
                        @Override
-                       public void render(GeneralGC gc, Rectangle visibleRegion)
+                       public void render(GeneralGC gc, RenderPreferences renderPrefs, Rectangle visibleRegion)
                        {
                                // do nothing
                        }
index 2596647..0e38b78 100644 (file)
@@ -1,15 +1,15 @@
 package net.mograsim.logic.model.am2900.am2910;
 
-import static net.mograsim.logic.model.am2900.am2910.TestableAm2910.Am2910_Inst.*;
-import static net.mograsim.logic.core.types.Bit.*;
+import static net.mograsim.logic.core.types.Bit.U;
+import static net.mograsim.logic.model.am2900.am2910.TestableAm2910.Am2910_Inst.JZ;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
 import org.junit.jupiter.api.Order;
 import org.junit.jupiter.api.TestMethodOrder;
 import org.junit.jupiter.api.extension.RegisterExtension;
-import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.EnumSource;
 
index c085c52..f9af150 100644 (file)
@@ -6,8 +6,8 @@ import net.mograsim.logic.core.types.BitVector;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.atomic.ModelBitDisplay;
 import net.mograsim.logic.model.model.components.atomic.ModelManualSwitch;
-import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.ModelWireCrossPoint;
+import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.util.ModellingTool;
 
 public class SwitchWithDisplay
index 51833be..54321cb 100644 (file)
@@ -29,6 +29,7 @@ import net.mograsim.logic.model.model.wires.ModelWire;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.modeladapter.CoreModelParameters;
 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
+import net.mograsim.logic.model.preferences.DefaultRenderPreferences;
 import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
 import net.mograsim.logic.model.util.ModellingTool;
 
@@ -261,7 +262,7 @@ public class TestEnvironmentHelper
        {
                try
                {
-                       new LogicUIStandaloneGUI(logicModel).run();
+                       new LogicUIStandaloneGUI(logicModel, new DefaultRenderPreferences()).run();
                        logicModel.setRedrawHandler(null);
                }
                catch (Exception e)
diff --git a/tests/net.mograsim.machine.tests/.settings/org.eclipse.core.runtime.prefs b/tests/net.mograsim.machine.tests/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..5a0ad22
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n