Merge branch 'development' of https://gitlab.lrz.de/lrr-tum/students/eragp-misim...
authorFabian Stemmler <stemmler@in.tum.de>
Wed, 11 Sep 2019 15:11:45 +0000 (17:11 +0200)
committerFabian Stemmler <stemmler@in.tum.de>
Wed, 11 Sep 2019 15:11:45 +0000 (17:11 +0200)
22 files changed:
net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/Am2900.json
net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2901/Am2901.json
net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2904/Am2904.json
net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2904/Am2904MSR.json
net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2904/Am2904TestLogic.json
net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2904/Am2904muSR.json
net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/am2910/Am2910.json
net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff12_we.json
net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff16_invwe.json
net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff16_we.json [new file with mode: 0644]
net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/mux1_12.json
net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/mux1_16.json
net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelinc.java [new file with mode: 0644]
net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelinc12.java [deleted file]
net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/am2910/ModelAm2910RegCntr.java
net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/standardComponentIDMapping.json
net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ReserializeJSONs.java [new file with mode: 0644]
net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ReserializeJSONsSettingUsages.java [deleted file]
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/ModelComponent.java
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/ModelMerger.java
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/ModelSplitter.java
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/submodels/SubmodelComponent.java

index 7afc8a7..dbca8f2 100644 (file)
         }
       },
       {
-        "id": "Merger",
-        "name": "Merger#0",
+        "id": "NandGate",
+        "name": "NandGate#0",
         "pos": {
-          "x": 235.0,
-          "y": 56.0
+          "x": 255.0,
+          "y": 495.0
         },
-        "params": 8
+        "params": 1
       },
       {
-        "id": "Merger",
-        "name": "Merger#1",
+        "id": "NandGate",
+        "name": "NandGate#1",
         "pos": {
-          "x": 235.0,
-          "y": 136.0
+          "x": 270.0,
+          "y": 550.0
         },
-        "params": 4
+        "params": 1
       },
       {
-        "id": "Merger",
-        "name": "Merger#2",
+        "id": "Splitter",
+        "name": "Splitter#0",
         "pos": {
-          "x": 235.0,
-          "y": 176.0
+          "x": 215.0,
+          "y": 56.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 16,
+          "orientation": "RIGHT"
+        }
       },
       {
-        "id": "Merger",
-        "name": "Merger#3",
+        "id": "Splitter",
+        "name": "Splitter#1",
         "pos": {
-          "x": 360.0,
-          "y": 20.0
+          "x": 305.0,
+          "y": 30.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
-        "id": "Merger",
-        "name": "Merger#4",
+        "id": "Splitter",
+        "name": "Splitter#10",
         "pos": {
-          "x": 360.0,
-          "y": 125.0
+          "x": 600.0,
+          "y": 395.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
-        "id": "NandGate",
-        "name": "NandGate#0",
+        "id": "Splitter",
+        "name": "Splitter#11",
         "pos": {
-          "x": 255.0,
-          "y": 495.0
+          "x": 235.0,
+          "y": 56.0
         },
-        "params": 1
+        "params": {
+          "logicWidth": 8,
+          "orientation": "LEFT"
+        }
       },
       {
-        "id": "NandGate",
-        "name": "NandGate#1",
+        "id": "Splitter",
+        "name": "Splitter#12",
         "pos": {
-          "x": 270.0,
-          "y": 550.0
+          "x": 235.0,
+          "y": 136.0
         },
-        "params": 1
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT"
+        }
       },
       {
         "id": "Splitter",
-        "name": "Splitter#0",
+        "name": "Splitter#13",
         "pos": {
-          "x": 215.0,
-          "y": 56.0
+          "x": 235.0,
+          "y": 176.0
         },
-        "params": 16
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT"
+        }
       },
       {
         "id": "Splitter",
-        "name": "Splitter#1",
+        "name": "Splitter#14",
         "pos": {
-          "x": 305.0,
-          "y": 30.0
+          "x": 360.0,
+          "y": 20.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT"
+        }
       },
       {
         "id": "Splitter",
-        "name": "Splitter#10",
+        "name": "Splitter#15",
         "pos": {
-          "x": 600.0,
-          "y": 395.0
+          "x": 360.0,
+          "y": 125.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT"
+        }
       },
       {
         "id": "Splitter",
           "x": 305.0,
           "y": 135.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 405.0,
           "y": 395.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 405.0,
           "y": 435.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 470.0,
           "y": 395.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 470.0,
           "y": 435.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 535.0,
           "y": 435.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 535.0,
           "y": 395.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 600.0,
           "y": 435.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#14",
         "pos": {
           "x": 354.0,
-          "y": 504.0
+          "y": 509.0
         },
-        "params": 12
+        "params": 16
       },
       {
         "id": "WireCrossPoint",
           "y": 526.0
         }
       },
-      {
-        "id": "dff12_we",
-        "name": "dff12_we#0",
-        "pos": {
-          "x": 290.0,
-          "y": 485.0
-        }
-      },
       {
         "id": "dff16_invwe",
         "name": "dff16_invwe#0",
         }
       },
       {
-        "id": "inc12",
-        "name": "inc12#0",
+        "id": "dff16_we",
+        "name": "dff16_we#0",
+        "pos": {
+          "x": 290.0,
+          "y": 485.0
+        }
+      },
+      {
+        "id": "inc",
+        "name": "inc#0",
         "pos": {
           "x": 245.0,
           "y": 525.0
-        }
+        },
+        "params": 16
       },
       {
-        "id": "mux1_12",
-        "name": "mux1_12#0",
+        "id": "mux1_16",
+        "name": "mux1_16#0",
         "pos": {
           "x": 170.0,
           "y": 495.0
       },
       {
         "pin1": {
-          "compName": "Merger#3",
-          "pinName": "O"
+          "compName": "Splitter#14",
+          "pinName": "I"
         },
         "pin2": {
           "compName": "WireCrossPoint#10",
           "pinName": ""
         },
         "pin2": {
-          "compName": "Merger#4",
-          "pinName": "O"
+          "compName": "Splitter#15",
+          "pinName": "I"
         },
         "name": "unnamedWire#114",
         "path": []
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "dff12_we#0",
+          "compName": "dff16_we#0",
           "pinName": "WE"
         },
         "name": "unnamedWire#127",
       },
       {
         "pin1": {
-          "compName": "inc12#0",
+          "compName": "inc#0",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "dff12_we#0",
+          "compName": "dff16_we#0",
           "pinName": "D"
         },
         "name": "unnamedWire#128",
       },
       {
         "pin1": {
-          "compName": "inc12#0",
+          "compName": "inc#0",
           "pinName": "A"
         },
         "pin2": {
-          "compName": "mux1_12#0",
+          "compName": "mux1_16#0",
           "pinName": "Y"
         },
         "name": "unnamedWire#129",
       },
       {
         "pin1": {
-          "compName": "inc12#0",
+          "compName": "inc#0",
           "pinName": "CI"
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "mux1_12#0",
+          "compName": "mux1_16#0",
           "pinName": "I1"
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "mux1_12#0",
+          "compName": "mux1_16#0",
           "pinName": "S"
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#14",
-          "pinName": ""
-        },
-        "pin2": {
-          "compName": "WireCrossPoint#14",
-          "pinName": ""
-        },
-        "name": "unnamedWire#137",
-        "path": []
-      },
-      {
-        "pin1": {
-          "compName": "dff12_we#0",
+          "compName": "dff16_we#0",
           "pinName": "Q"
         },
         "pin2": {
           "compName": "WireCrossPoint#14",
           "pinName": ""
         },
-        "name": "unnamedWire#138",
+        "name": "unnamedWire#137",
         "path": []
       },
       {
           "pinName": "O15"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I7"
+          "compName": "Splitter#11",
+          "pinName": "O7"
         },
         "name": "unnamedWire#46",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I6"
+          "compName": "Splitter#11",
+          "pinName": "O6"
         },
         "pin2": {
           "compName": "Splitter#0",
           "pinName": "O13"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I5"
+          "compName": "Splitter#11",
+          "pinName": "O5"
         },
         "name": "unnamedWire#48",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I4"
+          "compName": "Splitter#11",
+          "pinName": "O4"
         },
         "pin2": {
           "compName": "Splitter#0",
           "pinName": "O11"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I3"
+          "compName": "Splitter#11",
+          "pinName": "O3"
         },
         "name": "unnamedWire#50",
         "path": []
           "pinName": "O10"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I2"
+          "compName": "Splitter#11",
+          "pinName": "O2"
         },
         "name": "unnamedWire#51",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I1"
+          "compName": "Splitter#11",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "Splitter#0",
           "pinName": "O8"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I0"
+          "compName": "Splitter#11",
+          "pinName": "O0"
         },
         "name": "unnamedWire#53",
         "path": []
           "pinName": ""
         },
         "pin2": {
-          "compName": "Merger#1",
-          "pinName": "I3"
+          "compName": "Splitter#12",
+          "pinName": "O3"
         },
         "name": "unnamedWire#55",
         "path": [
           "pinName": ""
         },
         "pin2": {
-          "compName": "Merger#2",
-          "pinName": "I3"
+          "compName": "Splitter#13",
+          "pinName": "O3"
         },
         "name": "unnamedWire#56",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#2",
-          "pinName": "I2"
+          "compName": "Splitter#13",
+          "pinName": "O2"
         },
         "pin2": {
           "compName": "Splitter#0",
           "pinName": "O1"
         },
         "pin2": {
-          "compName": "Merger#2",
-          "pinName": "I1"
+          "compName": "Splitter#13",
+          "pinName": "O1"
         },
         "name": "unnamedWire#58",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#2",
-          "pinName": "I0"
+          "compName": "Splitter#13",
+          "pinName": "O0"
         },
         "pin2": {
           "compName": "Splitter#0",
       },
       {
         "pin1": {
-          "compName": "Merger#1",
-          "pinName": "I0"
+          "compName": "Splitter#12",
+          "pinName": "O0"
         },
         "pin2": {
           "compName": "Splitter#0",
           "pinName": "O5"
         },
         "pin2": {
-          "compName": "Merger#1",
-          "pinName": "I1"
+          "compName": "Splitter#12",
+          "pinName": "O1"
         },
         "name": "unnamedWire#61",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#1",
-          "pinName": "I2"
+          "compName": "Splitter#12",
+          "pinName": "O2"
         },
         "pin2": {
           "compName": "Splitter#0",
       },
       {
         "pin1": {
-          "compName": "Merger#2",
-          "pinName": "O"
+          "compName": "Splitter#13",
+          "pinName": "I"
         },
         "pin2": {
           "compName": "Splitter#2",
       },
       {
         "pin1": {
-          "compName": "Merger#1",
-          "pinName": "O"
+          "compName": "Splitter#12",
+          "pinName": "I"
         },
         "pin2": {
           "compName": "Splitter#1",
           "pinName": "Y1"
         },
         "pin2": {
-          "compName": "Merger#3",
-          "pinName": "I3"
+          "compName": "Splitter#14",
+          "pinName": "O3"
         },
         "name": "unnamedWire#73",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#3",
-          "pinName": "I2"
+          "compName": "Splitter#14",
+          "pinName": "O2"
         },
         "pin2": {
           "compName": "mux1_4#0",
           "pinName": "Y3"
         },
         "pin2": {
-          "compName": "Merger#3",
-          "pinName": "I1"
+          "compName": "Splitter#14",
+          "pinName": "O1"
         },
         "name": "unnamedWire#75",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#3",
-          "pinName": "I0"
+          "compName": "Splitter#14",
+          "pinName": "O0"
         },
         "pin2": {
           "compName": "mux1_4#0",
           "pinName": "Y1"
         },
         "pin2": {
-          "compName": "Merger#4",
-          "pinName": "I3"
+          "compName": "Splitter#15",
+          "pinName": "O3"
         },
         "name": "unnamedWire#77",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#4",
-          "pinName": "I2"
+          "compName": "Splitter#15",
+          "pinName": "O2"
         },
         "pin2": {
           "compName": "mux1_4#1",
           "pinName": "Y3"
         },
         "pin2": {
-          "compName": "Merger#4",
-          "pinName": "I1"
+          "compName": "Splitter#15",
+          "pinName": "O1"
         },
         "name": "unnamedWire#79",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#4",
-          "pinName": "I0"
+          "compName": "Splitter#15",
+          "pinName": "O0"
         },
         "pin2": {
           "compName": "mux1_4#1",
index 6f0ac00..de38b1a 100644 (file)
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#10",
-        "pos": {
-          "x": 334.0,
-          "y": 394.0
-        },
-        "params": 1
-      },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#11",
         "pos": {
           "x": 229.0,
           "y": 909.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#12",
+        "name": "WireCrossPoint#11",
         "pos": {
           "x": 234.0,
           "y": 919.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#13",
+        "name": "WireCrossPoint#12",
         "pos": {
           "x": 239.0,
           "y": 929.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#14",
+        "name": "WireCrossPoint#13",
         "pos": {
           "x": 244.0,
           "y": 939.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#15",
+        "name": "WireCrossPoint#14",
         "pos": {
           "x": 319.0,
           "y": 909.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#16",
+        "name": "WireCrossPoint#15",
         "pos": {
           "x": 334.0,
           "y": 939.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#17",
+        "name": "WireCrossPoint#16",
         "pos": {
           "x": 134.0,
           "y": 1039.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#18",
+        "name": "WireCrossPoint#17",
         "pos": {
           "x": 139.0,
           "y": 1049.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#19",
+        "name": "WireCrossPoint#18",
         "pos": {
           "x": 379.0,
           "y": 529.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#20",
+        "name": "WireCrossPoint#19",
         "pos": {
           "x": 394.0,
           "y": 544.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#21",
+        "name": "WireCrossPoint#2",
+        "pos": {
+          "x": 254.0,
+          "y": 749.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#20",
         "pos": {
           "x": 434.0,
           "y": 734.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#22",
+        "name": "WireCrossPoint#21",
         "pos": {
           "x": 354.0,
           "y": 504.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#23",
+        "name": "WireCrossPoint#22",
         "pos": {
           "x": 359.0,
           "y": 509.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#24",
+        "name": "WireCrossPoint#23",
         "pos": {
           "x": 364.0,
           "y": 514.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#25",
+        "name": "WireCrossPoint#24",
         "pos": {
           "x": 369.0,
           "y": 519.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#26",
+        "name": "WireCrossPoint#25",
         "pos": {
           "x": 354.0,
           "y": 449.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#27",
+        "name": "WireCrossPoint#26",
         "pos": {
           "x": 359.0,
           "y": 459.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#28",
+        "name": "WireCrossPoint#27",
         "pos": {
           "x": 364.0,
           "y": 469.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#29",
+        "name": "WireCrossPoint#28",
         "pos": {
           "x": 369.0,
           "y": 479.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#3",
+        "name": "WireCrossPoint#29",
         "pos": {
-          "x": 254.0,
-          "y": 749.0
+          "x": 104.0,
+          "y": 769.0
         },
         "params": 1
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#30",
+        "name": "WireCrossPoint#3",
         "pos": {
-          "x": 104.0,
-          "y": 769.0
+          "x": 134.0,
+          "y": 729.0
         },
         "params": 1
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#31",
+        "name": "WireCrossPoint#30",
         "pos": {
           "x": 109.0,
           "y": 779.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#32",
+        "name": "WireCrossPoint#31",
         "pos": {
           "x": 114.0,
           "y": 789.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#33",
+        "name": "WireCrossPoint#32",
         "pos": {
           "x": 109.0,
           "y": 809.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#34",
+        "name": "WireCrossPoint#33",
         "pos": {
           "x": 114.0,
           "y": 819.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#35",
+        "name": "WireCrossPoint#34",
         "pos": {
           "x": 119.0,
           "y": 829.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#36",
+        "name": "WireCrossPoint#35",
         "pos": {
           "x": 104.0,
           "y": 799.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#37",
+        "name": "WireCrossPoint#36",
         "pos": {
           "x": 109.0,
           "y": 839.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#38",
+        "name": "WireCrossPoint#37",
         "pos": {
           "x": 114.0,
           "y": 849.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#39",
+        "name": "WireCrossPoint#38",
         "pos": {
           "x": 119.0,
           "y": 859.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#4",
+        "name": "WireCrossPoint#39",
         "pos": {
-          "x": 134.0,
-          "y": 729.0
+          "x": 414.0,
+          "y": 449.0
         },
         "params": 1
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#40",
+        "name": "WireCrossPoint#4",
         "pos": {
-          "x": 414.0,
-          "y": 449.0
+          "x": 129.0,
+          "y": 739.0
         },
         "params": 1
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#41",
+        "name": "WireCrossPoint#40",
         "pos": {
           "x": 99.0,
           "y": 964.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#42",
+        "name": "WireCrossPoint#41",
         "pos": {
           "x": 99.0,
           "y": 764.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#44",
+        "name": "WireCrossPoint#42",
         "pos": {
           "x": 124.0,
           "y": 889.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#45",
+        "name": "WireCrossPoint#43",
         "pos": {
           "x": 364.0,
           "y": 889.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#46",
+        "name": "WireCrossPoint#44",
         "pos": {
           "x": 134.0,
           "y": 894.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#47",
+        "name": "WireCrossPoint#45",
         "pos": {
           "x": 409.0,
           "y": 894.0
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#48",
+        "name": "WireCrossPoint#46",
         "pos": {
           "x": 424.0,
           "y": 1079.0
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#5",
         "pos": {
-          "x": 129.0,
-          "y": 739.0
+          "x": 124.0,
+          "y": 749.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#6",
         "pos": {
-          "x": 124.0,
-          "y": 749.0
+          "x": 349.0,
+          "y": 364.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#7",
         "pos": {
-          "x": 349.0,
-          "y": 364.0
+          "x": 344.0,
+          "y": 374.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#8",
         "pos": {
-          "x": 344.0,
-          "y": 374.0
+          "x": 339.0,
+          "y": 384.0
         },
         "params": 1
       },
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#9",
         "pos": {
-          "x": 339.0,
-          "y": 384.0
+          "x": 334.0,
+          "y": 394.0
         },
         "params": 1
       },
           "pinName": "F3"
         },
         "pin2": {
-          "compName": "WireCrossPoint#24",
+          "compName": "WireCrossPoint#23",
           "pinName": ""
         },
         "name": "unnamedWire#100",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#20",
+          "compName": "WireCrossPoint#19",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#25",
+          "compName": "WireCrossPoint#24",
           "pinName": ""
         },
         "name": "unnamedWire#101",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#22",
+          "compName": "WireCrossPoint#21",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#26",
+          "compName": "WireCrossPoint#25",
           "pinName": ""
         },
         "name": "unnamedWire#102",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#23",
+          "compName": "WireCrossPoint#22",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#27",
+          "compName": "WireCrossPoint#26",
           "pinName": ""
         },
         "name": "unnamedWire#103",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#24",
+          "compName": "WireCrossPoint#23",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#28",
+          "compName": "WireCrossPoint#27",
           "pinName": ""
         },
         "name": "unnamedWire#104",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#25",
+          "compName": "WireCrossPoint#24",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#29",
+          "compName": "WireCrossPoint#28",
           "pinName": ""
         },
         "name": "unnamedWire#105",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#26",
+          "compName": "WireCrossPoint#25",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#27",
+          "compName": "WireCrossPoint#26",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#28",
+          "compName": "WireCrossPoint#27",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#29",
+          "compName": "WireCrossPoint#28",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#26",
+          "compName": "WireCrossPoint#25",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#27",
+          "compName": "WireCrossPoint#26",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#28",
+          "compName": "WireCrossPoint#27",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#29",
+          "compName": "WireCrossPoint#28",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#22",
+          "compName": "WireCrossPoint#21",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#30",
+          "compName": "WireCrossPoint#29",
           "pinName": ""
         },
         "name": "unnamedWire#114",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#23",
+          "compName": "WireCrossPoint#22",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#31",
+          "compName": "WireCrossPoint#30",
           "pinName": ""
         },
         "name": "unnamedWire#115",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#24",
+          "compName": "WireCrossPoint#23",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#32",
+          "compName": "WireCrossPoint#31",
           "pinName": ""
         },
         "name": "unnamedWire#116",
           "pinName": "A1"
         },
         "pin2": {
-          "compName": "WireCrossPoint#41",
+          "compName": "WireCrossPoint#40",
           "pinName": ""
         },
         "name": "unnamedWire#117",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#30",
+          "compName": "WireCrossPoint#29",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#31",
+          "compName": "WireCrossPoint#30",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#32",
+          "compName": "WireCrossPoint#31",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#31",
+          "compName": "WireCrossPoint#30",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#33",
+          "compName": "WireCrossPoint#32",
           "pinName": ""
         },
         "name": "unnamedWire#121",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#32",
+          "compName": "WireCrossPoint#31",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#34",
+          "compName": "WireCrossPoint#33",
           "pinName": ""
         },
         "name": "unnamedWire#122",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#25",
+          "compName": "WireCrossPoint#24",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#35",
+          "compName": "WireCrossPoint#34",
           "pinName": ""
         },
         "name": "unnamedWire#123",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#30",
+          "compName": "WireCrossPoint#29",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#36",
+          "compName": "WireCrossPoint#35",
           "pinName": ""
         },
         "name": "unnamedWire#124",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#36",
+          "compName": "WireCrossPoint#35",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#33",
+          "compName": "WireCrossPoint#32",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#34",
+          "compName": "WireCrossPoint#33",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#35",
+          "compName": "WireCrossPoint#34",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#33",
+          "compName": "WireCrossPoint#32",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#37",
+          "compName": "WireCrossPoint#36",
           "pinName": ""
         },
         "name": "unnamedWire#129",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#3",
+          "compName": "WireCrossPoint#2",
           "pinName": ""
         },
         "name": "unnamedWire#13",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#34",
+          "compName": "WireCrossPoint#33",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#38",
+          "compName": "WireCrossPoint#37",
           "pinName": ""
         },
         "name": "unnamedWire#130",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#35",
+          "compName": "WireCrossPoint#34",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#39",
+          "compName": "WireCrossPoint#38",
           "pinName": ""
         },
         "name": "unnamedWire#131",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#37",
+          "compName": "WireCrossPoint#36",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#38",
+          "compName": "WireCrossPoint#37",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#39",
+          "compName": "WireCrossPoint#38",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#16",
+          "compName": "WireCrossPoint#15",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#36",
+          "compName": "WireCrossPoint#35",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#37",
+          "compName": "WireCrossPoint#36",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#38",
+          "compName": "WireCrossPoint#37",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#39",
+          "compName": "WireCrossPoint#38",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#3",
+          "compName": "WireCrossPoint#2",
           "pinName": ""
         },
         "pin2": {
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "WireCrossPoint#40",
+          "compName": "WireCrossPoint#39",
           "pinName": ""
         },
         "name": "unnamedWire#153",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#40",
+          "compName": "WireCrossPoint#39",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#40",
+          "compName": "WireCrossPoint#39",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#41",
+          "compName": "WireCrossPoint#40",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#19",
+          "compName": "WireCrossPoint#18",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#3",
+          "compName": "WireCrossPoint#2",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#42",
+          "compName": "WireCrossPoint#41",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#42",
+          "compName": "WireCrossPoint#41",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#20",
+          "compName": "WireCrossPoint#19",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#44",
+          "compName": "WireCrossPoint#42",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#6",
+          "compName": "WireCrossPoint#5",
           "pinName": ""
         },
         "name": "unnamedWire#164",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#45",
+          "compName": "WireCrossPoint#43",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#45",
+          "compName": "WireCrossPoint#43",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#45",
+          "compName": "WireCrossPoint#43",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#44",
+          "compName": "WireCrossPoint#42",
           "pinName": ""
         },
         "name": "unnamedWire#167",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#46",
+          "compName": "WireCrossPoint#44",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#4",
+          "compName": "WireCrossPoint#3",
           "pinName": ""
         },
         "name": "unnamedWire#168",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#46",
+          "compName": "WireCrossPoint#44",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#47",
+          "compName": "WireCrossPoint#45",
           "pinName": ""
         },
         "name": "unnamedWire#169",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#3",
+          "compName": "WireCrossPoint#2",
           "pinName": ""
         },
         "pin2": {
           "pinName": "EN"
         },
         "pin2": {
-          "compName": "WireCrossPoint#47",
+          "compName": "WireCrossPoint#45",
           "pinName": ""
         },
         "name": "unnamedWire#170",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#20",
+          "compName": "WireCrossPoint#19",
           "pinName": ""
         },
         "pin2": {
           "pinName": "C4"
         },
         "pin2": {
-          "compName": "WireCrossPoint#48",
+          "compName": "WireCrossPoint#46",
           "pinName": ""
         },
         "name": "unnamedWire#172",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#48",
+          "compName": "WireCrossPoint#46",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#48",
+          "compName": "WireCrossPoint#46",
           "pinName": ""
         },
         "pin2": {
           "pinName": "LSH"
         },
         "pin2": {
-          "compName": "WireCrossPoint#4",
+          "compName": "WireCrossPoint#3",
           "pinName": ""
         },
         "name": "unnamedWire#18",
           "pinName": "NSH"
         },
         "pin2": {
-          "compName": "WireCrossPoint#5",
+          "compName": "WireCrossPoint#4",
           "pinName": ""
         },
         "name": "unnamedWire#19",
           "pinName": "RSH"
         },
         "pin2": {
-          "compName": "WireCrossPoint#6",
+          "compName": "WireCrossPoint#5",
           "pinName": ""
         },
         "name": "unnamedWire#20",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#4",
+          "compName": "WireCrossPoint#3",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#5",
+          "compName": "WireCrossPoint#4",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#6",
+          "compName": "WireCrossPoint#5",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#46",
+          "compName": "WireCrossPoint#44",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#5",
+          "compName": "WireCrossPoint#4",
           "pinName": ""
         },
         "pin2": {
           "pinName": "SC"
         },
         "pin2": {
-          "compName": "WireCrossPoint#44",
+          "compName": "WireCrossPoint#42",
           "pinName": ""
         },
         "name": "unnamedWire#26",
           "pinName": "Q1"
         },
         "pin2": {
-          "compName": "WireCrossPoint#7",
+          "compName": "WireCrossPoint#6",
           "pinName": ""
         },
         "name": "unnamedWire#48",
           "pinName": "Q2"
         },
         "pin2": {
-          "compName": "WireCrossPoint#8",
+          "compName": "WireCrossPoint#7",
           "pinName": ""
         },
         "name": "unnamedWire#49",
           "pinName": "Q3"
         },
         "pin2": {
-          "compName": "WireCrossPoint#9",
+          "compName": "WireCrossPoint#8",
           "pinName": ""
         },
         "name": "unnamedWire#50",
           "pinName": "Q4"
         },
         "pin2": {
-          "compName": "WireCrossPoint#10",
+          "compName": "WireCrossPoint#9",
           "pinName": ""
         },
         "name": "unnamedWire#51",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#7",
+          "compName": "WireCrossPoint#6",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#8",
+          "compName": "WireCrossPoint#7",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#9",
+          "compName": "WireCrossPoint#8",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#10",
+          "compName": "WireCrossPoint#9",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#7",
+          "compName": "WireCrossPoint#6",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#8",
+          "compName": "WireCrossPoint#7",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#9",
+          "compName": "WireCrossPoint#8",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#10",
+          "compName": "WireCrossPoint#9",
           "pinName": ""
         },
         "pin2": {
           "pinName": "Q1"
         },
         "pin2": {
-          "compName": "WireCrossPoint#11",
+          "compName": "WireCrossPoint#10",
           "pinName": ""
         },
         "name": "unnamedWire#64",
           "pinName": "Q2"
         },
         "pin2": {
-          "compName": "WireCrossPoint#12",
+          "compName": "WireCrossPoint#11",
           "pinName": ""
         },
         "name": "unnamedWire#65",
           "pinName": "Q3"
         },
         "pin2": {
-          "compName": "WireCrossPoint#13",
+          "compName": "WireCrossPoint#12",
           "pinName": ""
         },
         "name": "unnamedWire#66",
           "pinName": "Q4"
         },
         "pin2": {
-          "compName": "WireCrossPoint#14",
+          "compName": "WireCrossPoint#13",
           "pinName": ""
         },
         "name": "unnamedWire#67",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#11",
+          "compName": "WireCrossPoint#10",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#15",
+          "compName": "WireCrossPoint#14",
           "pinName": ""
         },
         "name": "unnamedWire#68",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#15",
+          "compName": "WireCrossPoint#14",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#14",
+          "compName": "WireCrossPoint#13",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#16",
+          "compName": "WireCrossPoint#15",
           "pinName": ""
         },
         "name": "unnamedWire#70",
           "pinName": "Qn"
         },
         "pin2": {
-          "compName": "WireCrossPoint#41",
+          "compName": "WireCrossPoint#40",
           "pinName": ""
         },
         "name": "unnamedWire#71",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#12",
+          "compName": "WireCrossPoint#11",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#17",
+          "compName": "WireCrossPoint#16",
           "pinName": ""
         },
         "name": "unnamedWire#72",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#13",
+          "compName": "WireCrossPoint#12",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#18",
+          "compName": "WireCrossPoint#17",
           "pinName": ""
         },
         "name": "unnamedWire#73",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#17",
+          "compName": "WireCrossPoint#16",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#18",
+          "compName": "WireCrossPoint#17",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#14",
+          "compName": "WireCrossPoint#13",
           "pinName": ""
         },
         "pin2": {
           "pinName": "RAMn"
         },
         "pin2": {
-          "compName": "WireCrossPoint#42",
+          "compName": "WireCrossPoint#41",
           "pinName": ""
         },
         "name": "unnamedWire#78",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#11",
+          "compName": "WireCrossPoint#10",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#15",
+          "compName": "WireCrossPoint#14",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#12",
+          "compName": "WireCrossPoint#11",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#13",
+          "compName": "WireCrossPoint#12",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#16",
+          "compName": "WireCrossPoint#15",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#17",
+          "compName": "WireCrossPoint#16",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#18",
+          "compName": "WireCrossPoint#17",
           "pinName": ""
         },
         "pin2": {
           "pinName": "F1"
         },
         "pin2": {
-          "compName": "WireCrossPoint#19",
+          "compName": "WireCrossPoint#18",
           "pinName": ""
         },
         "name": "unnamedWire#92",
           "pinName": "F4"
         },
         "pin2": {
-          "compName": "WireCrossPoint#20",
+          "compName": "WireCrossPoint#19",
           "pinName": ""
         },
         "name": "unnamedWire#93",
           "pinName": "OUT"
         },
         "pin2": {
-          "compName": "WireCrossPoint#21",
+          "compName": "WireCrossPoint#20",
           "pinName": ""
         },
         "name": "unnamedWire#94",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#47",
+          "compName": "WireCrossPoint#45",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#21",
+          "compName": "WireCrossPoint#20",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#21",
+          "compName": "WireCrossPoint#20",
           "pinName": ""
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#19",
+          "compName": "WireCrossPoint#18",
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#22",
+          "compName": "WireCrossPoint#21",
           "pinName": ""
         },
         "name": "unnamedWire#98",
           "pinName": "F2"
         },
         "pin2": {
-          "compName": "WireCrossPoint#23",
+          "compName": "WireCrossPoint#22",
           "pinName": ""
         },
         "name": "unnamedWire#99",
index 836fe5c..769a0a4 100644 (file)
           "y": 95.0
         }
       },
-      {
-        "id": "Merger",
-        "name": "Merger#0",
-        "pos": {
-          "x": 20.0,
-          "y": 235.0
-        },
-        "params": 6
-      },
-      {
-        "id": "Merger",
-        "name": "Merger#1",
-        "pos": {
-          "x": 20.0,
-          "y": 185.0
-        },
-        "params": 5
-      },
-      {
-        "id": "Merger",
-        "name": "Merger#2",
-        "pos": {
-          "x": 15.0,
-          "y": 65.0
-        },
-        "params": 4
-      },
-      {
-        "id": "Merger",
-        "name": "Merger#3",
-        "pos": {
-          "x": 520.0,
-          "y": 90.0
-        },
-        "params": 4
-      },
-      {
-        "id": "Merger",
-        "name": "Merger#4",
-        "pos": {
-          "x": 20.0,
-          "y": 165.0
-        },
-        "params": 2
-      },
       {
         "id": "NandGate",
         "name": "NandGate#0",
           "x": 5.0,
           "y": 165.0
         },
-        "params": 13
+        "params": {
+          "logicWidth": 13,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 575.0,
           "y": 40.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 445.0,
           "y": 300.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 455.0,
           "y": 635.0
         },
-        "params": 3
+        "params": {
+          "logicWidth": 3,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 455.0,
           "y": 710.0
         },
-        "params": 3
+        "params": {
+          "logicWidth": 3,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 135.0,
           "y": 645.0
         },
-        "params": 3
+        "params": {
+          "logicWidth": 3,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 310.0,
           "y": 645.0
         },
-        "params": 3
+        "params": {
+          "logicWidth": 3,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 430.0,
           "y": 535.0
         },
-        "params": 2
+        "params": {
+          "logicWidth": 2,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#16",
+        "pos": {
+          "x": 20.0,
+          "y": 235.0
+        },
+        "params": {
+          "logicWidth": 6,
+          "orientation": "LEFT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#17",
+        "pos": {
+          "x": 20.0,
+          "y": 185.0
+        },
+        "params": {
+          "logicWidth": 5,
+          "orientation": "LEFT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#18",
+        "pos": {
+          "x": 15.0,
+          "y": 65.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#19",
+        "pos": {
+          "x": 520.0,
+          "y": 90.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT"
+        }
       },
       {
         "id": "Splitter",
           "x": 440.0,
           "y": 90.0
         },
-        "params": 2
+        "params": {
+          "logicWidth": 2,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#20",
+        "pos": {
+          "x": 20.0,
+          "y": 165.0
+        },
+        "params": {
+          "logicWidth": 2,
+          "orientation": "LEFT"
+        }
       },
       {
         "id": "Splitter",
           "x": 465.0,
           "y": 100.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 425.0,
           "y": 150.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 425.0,
           "y": 190.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 320.0,
           "y": 310.0
         },
-        "params": 3
+        "params": {
+          "logicWidth": 3,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 445.0,
           "y": 340.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 445.0,
           "y": 380.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 255.0,
           "y": 430.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "TriStateBuffer",
           "pinName": "O6"
         },
         "pin2": {
-          "compName": "Merger#1",
-          "pinName": "I0"
+          "compName": "Splitter#17",
+          "pinName": "O0"
         },
         "name": "unnamedWire#10",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#1",
-          "pinName": "I1"
+          "compName": "Splitter#17",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "Splitter#0",
           "pinName": "O8"
         },
         "pin2": {
-          "compName": "Merger#1",
-          "pinName": "I2"
+          "compName": "Splitter#17",
+          "pinName": "O2"
         },
         "name": "unnamedWire#12",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#1",
-          "pinName": "I3"
+          "compName": "Splitter#17",
+          "pinName": "O3"
         },
         "pin2": {
           "compName": "Splitter#0",
           "pinName": "O11"
         },
         "pin2": {
-          "compName": "Merger#4",
-          "pinName": "I0"
+          "compName": "Splitter#20",
+          "pinName": "O0"
         },
         "name": "unnamedWire#139",
         "path": []
           "pinName": "O10"
         },
         "pin2": {
-          "compName": "Merger#1",
-          "pinName": "I4"
+          "compName": "Splitter#17",
+          "pinName": "O4"
         },
         "name": "unnamedWire#14",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#4",
-          "pinName": "I1"
+          "compName": "Splitter#20",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "Splitter#0",
       },
       {
         "pin1": {
-          "compName": "Merger#4",
-          "pinName": "O"
+          "compName": "Splitter#20",
+          "pinName": "I"
         },
         "pin2": {
           "compName": "Am2904RegCTInstrDecode#0",
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "O"
+          "compName": "Splitter#16",
+          "pinName": "I"
         },
         "pin2": {
           "compName": "Am2904RegCTInstrDecode#0",
           "pinName": "I"
         },
         "pin2": {
-          "compName": "Merger#1",
-          "pinName": "O"
+          "compName": "Splitter#17",
+          "pinName": "I"
         },
         "name": "unnamedWire#16",
         "path": [
           "pinName": "IOVR"
         },
         "pin2": {
-          "compName": "Merger#2",
-          "pinName": "I0"
+          "compName": "Splitter#18",
+          "pinName": "O0"
         },
         "name": "unnamedWire#17",
         "path": [
           "pinName": "IN"
         },
         "pin2": {
-          "compName": "Merger#2",
-          "pinName": "I1"
+          "compName": "Splitter#18",
+          "pinName": "O1"
         },
         "name": "unnamedWire#18",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#2",
-          "pinName": "I2"
+          "compName": "Splitter#18",
+          "pinName": "O2"
         },
         "pin2": {
           "compName": "_submodelinterface",
           "pinName": "IZ"
         },
         "pin2": {
-          "compName": "Merger#2",
-          "pinName": "I3"
+          "compName": "Splitter#18",
+          "pinName": "O3"
         },
         "name": "unnamedWire#20",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#2",
-          "pinName": "O"
+          "compName": "Splitter#18",
+          "pinName": "I"
         },
         "pin2": {
           "compName": "WireCrossPoint#1",
           "pinName": "O0"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I0"
+          "compName": "Splitter#16",
+          "pinName": "O0"
         },
         "name": "unnamedWire#4",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I1"
+          "compName": "Splitter#16",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "Splitter#0",
           "pinName": "O2"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I2"
+          "compName": "Splitter#16",
+          "pinName": "O2"
         },
         "name": "unnamedWire#6",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I3"
+          "compName": "Splitter#16",
+          "pinName": "O3"
         },
         "pin2": {
           "compName": "Splitter#0",
           "pinName": "O4"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I4"
+          "compName": "Splitter#16",
+          "pinName": "O4"
         },
         "name": "unnamedWire#8",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#3",
-          "pinName": "I0"
+          "compName": "Splitter#19",
+          "pinName": "O0"
         },
         "pin2": {
           "compName": "mux1_4#0",
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I5"
+          "compName": "Splitter#16",
+          "pinName": "O5"
         },
         "pin2": {
           "compName": "Splitter#0",
           "pinName": "Y3"
         },
         "pin2": {
-          "compName": "Merger#3",
-          "pinName": "I1"
+          "compName": "Splitter#19",
+          "pinName": "O1"
         },
         "name": "unnamedWire#90",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#3",
-          "pinName": "I2"
+          "compName": "Splitter#19",
+          "pinName": "O2"
         },
         "pin2": {
           "compName": "mux1_4#0",
           "pinName": "Y1"
         },
         "pin2": {
-          "compName": "Merger#3",
-          "pinName": "I3"
+          "compName": "Splitter#19",
+          "pinName": "O3"
         },
         "name": "unnamedWire#92",
         "path": []
           "pinName": ""
         },
         "pin2": {
-          "compName": "Merger#3",
-          "pinName": "O"
+          "compName": "Splitter#19",
+          "pinName": "I"
         },
         "name": "unnamedWire#93",
         "path": []
index a5b084d..927d41f 100644 (file)
   "innerScale": 0.2,
   "submodel": {
     "components": [
-      {
-        "id": "Merger",
-        "name": "Merger#0",
-        "pos": {
-          "x": 385.0,
-          "y": 85.0
-        },
-        "params": 4
-      },
       {
         "id": "NandGate",
         "name": "NandGate#0",
           "x": 5.0,
           "y": 35.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 5.0,
           "y": 135.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 45.0,
           "y": 340.0
         },
-        "params": 3
+        "params": {
+          "logicWidth": 3,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 5.0,
           "y": 235.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#4",
+        "pos": {
+          "x": 385.0,
+          "y": 85.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT"
+        }
       },
       {
         "id": "WireCrossPoint",
           "pinName": ""
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I2"
+          "compName": "Splitter#4",
+          "pinName": "O2"
         },
         "name": "unnamedWire#27",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I3"
+          "compName": "Splitter#4",
+          "pinName": "O3"
         },
         "pin2": {
           "compName": "WireCrossPoint#1",
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "O"
+          "compName": "Splitter#4",
+          "pinName": "I"
         },
         "pin2": {
           "compName": "_submodelinterface",
           "pinName": ""
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I0"
+          "compName": "Splitter#4",
+          "pinName": "O0"
         },
         "name": "unnamedWire#7",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I1"
+          "compName": "Splitter#4",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "WireCrossPoint#3",
index ab44304..2c007e5 100644 (file)
           "x": 5.0,
           "y": 110.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "WireCrossPoint",
index 7faf69d..3b859b2 100644 (file)
   "innerScale": 0.2,
   "submodel": {
     "components": [
-      {
-        "id": "Merger",
-        "name": "Merger#0",
-        "pos": {
-          "x": 230.0,
-          "y": 30.0
-        },
-        "params": 4
-      },
       {
         "id": "NandGate",
         "name": "NandGate#0",
           "x": 5.0,
           "y": 135.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 5.0,
           "y": 185.0
         },
-        "params": 4
+        "params": {
+          "logicWidth": 4,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 5.0,
           "y": 95.0
         },
-        "params": 2
+        "params": {
+          "logicWidth": 2,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#3",
+        "pos": {
+          "x": 230.0,
+          "y": 30.0
+        },
+        "params": {
+          "logicWidth": 4,
+          "orientation": "LEFT"
+        }
       },
       {
         "id": "WireCrossPoint",
           "pinName": "Q1"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I3"
+          "compName": "Splitter#3",
+          "pinName": "O3"
         },
         "name": "unnamedWire#0",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I2"
+          "compName": "Splitter#3",
+          "pinName": "O2"
         },
         "pin2": {
           "compName": "dff4_finewe#0",
           "pinName": ""
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I0"
+          "compName": "Splitter#3",
+          "pinName": "O0"
         },
         "name": "unnamedWire#11",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I1"
+          "compName": "Splitter#3",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "dff4_finewe#0",
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "O"
+          "compName": "Splitter#3",
+          "pinName": "I"
         },
         "pin2": {
           "compName": "_submodelinterface",
index 55256c7..9163fc3 100644 (file)
         },
         "params": 1
       },
-      {
-        "id": "WireCrossPoint",
-        "name": "WireCrossPoint#10",
-        "pos": {
-          "x": 199.0,
-          "y": 209.0
-        },
-        "params": 1
-      },
       {
         "id": "WireCrossPoint",
         "name": "WireCrossPoint#2",
       },
       {
         "id": "WireCrossPoint",
-        "name": "WireCrossPoint#9",
+        "name": "WireCrossPoint#8",
         "pos": {
           "x": 234.0,
           "y": 69.0
         },
         "params": 1
       },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#9",
+        "pos": {
+          "x": 199.0,
+          "y": 209.0
+        },
+        "params": 1
+      },
       {
         "id": "dff12",
         "name": "dff12#0",
         }
       },
       {
-        "id": "inc12",
-        "name": "inc12#0",
+        "id": "inc",
+        "name": "inc#0",
         "pos": {
           "x": 240.0,
           "y": 140.0
-        }
+        },
+        "params": 12
       },
       {
         "id": "nor12",
           "pinName": ""
         },
         "pin2": {
-          "compName": "inc12#0",
+          "compName": "inc#0",
           "pinName": "A"
         },
         "name": "unnamedWire#18",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#9",
+          "compName": "WireCrossPoint#8",
           "pinName": ""
         },
         "pin2": {
           "pinName": ""
         },
         "pin2": {
-          "compName": "WireCrossPoint#9",
+          "compName": "WireCrossPoint#8",
           "pinName": ""
         },
         "name": "unnamedWire#36",
       },
       {
         "pin1": {
-          "compName": "inc12#0",
+          "compName": "inc#0",
           "pinName": "Y"
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "inc12#0",
+          "compName": "inc#0",
           "pinName": "CI"
         },
         "pin2": {
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#9",
+          "compName": "WireCrossPoint#8",
           "pinName": ""
         },
         "pin2": {
           "pinName": "_OE"
         },
         "pin2": {
-          "compName": "WireCrossPoint#10",
+          "compName": "WireCrossPoint#9",
           "pinName": ""
         },
         "name": "unnamedWire#53",
       },
       {
         "pin1": {
-          "compName": "WireCrossPoint#10",
+          "compName": "WireCrossPoint#9",
           "pinName": ""
         },
         "pin2": {
           "pinName": "A"
         },
         "pin2": {
-          "compName": "WireCrossPoint#10",
+          "compName": "WireCrossPoint#9",
           "pinName": ""
         },
         "name": "unnamedWire#57",
index 20f0664..1f15137 100644 (file)
   "submodel": {
     "components": [
       {
-        "id": "Merger",
-        "name": "Merger#0",
+        "id": "Splitter",
+        "name": "Splitter#0",
         "pos": {
-          "x": 250.0,
-          "y": 45.0
+          "x": 70.0,
+          "y": 65.0
         },
-        "params": 12
+        "params": {
+          "logicWidth": 12,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
-        "name": "Splitter#0",
+        "name": "Splitter#1",
         "pos": {
-          "x": 70.0,
-          "y": 65.0
+          "x": 250.0,
+          "y": 45.0
         },
-        "params": 12
+        "params": {
+          "logicWidth": 12,
+          "orientation": "LEFT"
+        }
       },
       {
         "id": "TextComponent",
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I11"
+          "compName": "Splitter#1",
+          "pinName": "O11"
         },
         "pin2": {
           "compName": "dff#2",
           "pinName": "Q"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I10"
+          "compName": "Splitter#1",
+          "pinName": "O10"
         },
         "name": "unnamedWire#54",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I9"
+          "compName": "Splitter#1",
+          "pinName": "O9"
         },
         "pin2": {
           "compName": "dff#3",
           "pinName": "Q"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I8"
+          "compName": "Splitter#1",
+          "pinName": "O8"
         },
         "name": "unnamedWire#56",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I7"
+          "compName": "Splitter#1",
+          "pinName": "O7"
         },
         "pin2": {
           "compName": "dff#4",
           "pinName": "Q"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I6"
+          "compName": "Splitter#1",
+          "pinName": "O6"
         },
         "name": "unnamedWire#58",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I5"
+          "compName": "Splitter#1",
+          "pinName": "O5"
         },
         "pin2": {
           "compName": "dff#11",
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I4"
+          "compName": "Splitter#1",
+          "pinName": "O4"
         },
         "pin2": {
           "compName": "dff#10",
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I3"
+          "compName": "Splitter#1",
+          "pinName": "O3"
         },
         "pin2": {
           "compName": "dff#8",
           "pinName": "Q"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I2"
+          "compName": "Splitter#1",
+          "pinName": "O2"
         },
         "name": "unnamedWire#62",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I1"
+          "compName": "Splitter#1",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "dff#7",
           "pinName": "Q"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I0"
+          "compName": "Splitter#1",
+          "pinName": "O0"
         },
         "name": "unnamedWire#64",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "O"
+          "compName": "Splitter#1",
+          "pinName": "I"
         },
         "pin2": {
           "compName": "WireCrossPoint#5",
index 11bc97c..e6cda44 100644 (file)
   "submodel": {
     "components": [
       {
-        "id": "Merger",
-        "name": "Merger#0",
+        "id": "Splitter",
+        "name": "Splitter#0",
         "pos": {
-          "x": 275.0,
-          "y": 50.0
+          "x": 75.0,
+          "y": 70.0
         },
-        "params": 16
+        "params": {
+          "logicWidth": 16,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
-        "name": "Splitter#0",
+        "name": "Splitter#1",
         "pos": {
-          "x": 75.0,
-          "y": 70.0
+          "x": 275.0,
+          "y": 50.0
         },
-        "params": 16
+        "params": {
+          "logicWidth": 16,
+          "orientation": "LEFT"
+        }
       },
       {
         "id": "WireCrossPoint",
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I15"
+          "compName": "Splitter#1",
+          "pinName": "O15"
         },
         "pin2": {
           "compName": "dff#0",
           "pinName": "Q"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I14"
+          "compName": "Splitter#1",
+          "pinName": "O14"
         },
         "name": "unnamedWire#50",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I13"
+          "compName": "Splitter#1",
+          "pinName": "O13"
         },
         "pin2": {
           "compName": "dff#3",
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I12"
+          "compName": "Splitter#1",
+          "pinName": "O12"
         },
         "pin2": {
           "compName": "dff#2",
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I11"
+          "compName": "Splitter#1",
+          "pinName": "O11"
         },
         "pin2": {
           "compName": "dff#6",
           "pinName": "Q"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I10"
+          "compName": "Splitter#1",
+          "pinName": "O10"
         },
         "name": "unnamedWire#54",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I9"
+          "compName": "Splitter#1",
+          "pinName": "O9"
         },
         "pin2": {
           "compName": "dff#7",
           "pinName": "Q"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I8"
+          "compName": "Splitter#1",
+          "pinName": "O8"
         },
         "name": "unnamedWire#56",
         "path": []
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I7"
+          "compName": "Splitter#1",
+          "pinName": "O7"
         },
         "pin2": {
           "compName": "dff#8",
           "pinName": "Q"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I6"
+          "compName": "Splitter#1",
+          "pinName": "O6"
         },
         "name": "unnamedWire#58",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I5"
+          "compName": "Splitter#1",
+          "pinName": "O5"
         },
         "pin2": {
           "compName": "dff#15",
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I4"
+          "compName": "Splitter#1",
+          "pinName": "O4"
         },
         "pin2": {
           "compName": "dff#14",
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I3"
+          "compName": "Splitter#1",
+          "pinName": "O3"
         },
         "pin2": {
           "compName": "dff#12",
           "pinName": "Q"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I2"
+          "compName": "Splitter#1",
+          "pinName": "O2"
         },
         "name": "unnamedWire#62",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I1"
+          "compName": "Splitter#1",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "dff#11",
           "pinName": "Q"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I0"
+          "compName": "Splitter#1",
+          "pinName": "O0"
         },
         "name": "unnamedWire#64",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "O"
+          "compName": "Splitter#1",
+          "pinName": "I"
         },
         "pin2": {
           "compName": "WireCrossPoint#7",
diff --git a/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff16_we.json b/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff16_we.json
new file mode 100644 (file)
index 0000000..3fc94f9
--- /dev/null
@@ -0,0 +1,1474 @@
+{
+  "width": 60.0,
+  "height": 60.0,
+  "interfacePins": [
+    {
+      "location": {
+        "x": 0.0,
+        "y": 5.0
+      },
+      "name": "C",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 35.0
+      },
+      "name": "D",
+      "logicWidth": 16,
+      "usage": "INPUT"
+    },
+    {
+      "location": {
+        "x": 60.0,
+        "y": 25.0
+      },
+      "name": "Q",
+      "logicWidth": 16,
+      "usage": "TRISTATE"
+    },
+    {
+      "location": {
+        "x": 0.0,
+        "y": 20.0
+      },
+      "name": "WE",
+      "logicWidth": 1,
+      "usage": "INPUT"
+    }
+  ],
+  "innerScale": 0.2,
+  "submodel": {
+    "components": [
+      {
+        "id": "Splitter",
+        "name": "Splitter#0",
+        "pos": {
+          "x": 75.0,
+          "y": 70.0
+        },
+        "params": {
+          "logicWidth": 16,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#1",
+        "pos": {
+          "x": 275.0,
+          "y": 50.0
+        },
+        "params": {
+          "logicWidth": 16,
+          "orientation": "LEFT"
+        }
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#0",
+        "pos": {
+          "x": 134.0,
+          "y": 19.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#1",
+        "pos": {
+          "x": 134.0,
+          "y": 49.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#10",
+        "pos": {
+          "x": 184.0,
+          "y": 119.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#11",
+        "pos": {
+          "x": 184.0,
+          "y": 209.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#12",
+        "pos": {
+          "x": 184.0,
+          "y": 89.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#13",
+        "pos": {
+          "x": 184.0,
+          "y": 149.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#14",
+        "pos": {
+          "x": 184.0,
+          "y": 179.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#2",
+        "pos": {
+          "x": 134.0,
+          "y": 79.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#3",
+        "pos": {
+          "x": 134.0,
+          "y": 109.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#4",
+        "pos": {
+          "x": 134.0,
+          "y": 169.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#5",
+        "pos": {
+          "x": 134.0,
+          "y": 199.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#6",
+        "pos": {
+          "x": 134.0,
+          "y": 139.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#7",
+        "pos": {
+          "x": 289.0,
+          "y": 124.0
+        },
+        "params": 16
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#8",
+        "pos": {
+          "x": 184.0,
+          "y": 59.0
+        },
+        "params": 1
+      },
+      {
+        "id": "WireCrossPoint",
+        "name": "WireCrossPoint#9",
+        "pos": {
+          "x": 184.0,
+          "y": 29.0
+        },
+        "params": 1
+      },
+      {
+        "id": "dff",
+        "name": "dff#0",
+        "pos": {
+          "x": 140.0,
+          "y": 15.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#1",
+        "pos": {
+          "x": 190.0,
+          "y": 25.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#10",
+        "pos": {
+          "x": 190.0,
+          "y": 235.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#11",
+        "pos": {
+          "x": 140.0,
+          "y": 225.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#12",
+        "pos": {
+          "x": 140.0,
+          "y": 195.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#13",
+        "pos": {
+          "x": 190.0,
+          "y": 145.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#14",
+        "pos": {
+          "x": 190.0,
+          "y": 175.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#15",
+        "pos": {
+          "x": 140.0,
+          "y": 165.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#2",
+        "pos": {
+          "x": 190.0,
+          "y": 55.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#3",
+        "pos": {
+          "x": 140.0,
+          "y": 45.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#4",
+        "pos": {
+          "x": 190.0,
+          "y": 85.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#5",
+        "pos": {
+          "x": 190.0,
+          "y": 115.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#6",
+        "pos": {
+          "x": 140.0,
+          "y": 75.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#7",
+        "pos": {
+          "x": 140.0,
+          "y": 105.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#8",
+        "pos": {
+          "x": 140.0,
+          "y": 135.0
+        }
+      },
+      {
+        "id": "dff",
+        "name": "dff#9",
+        "pos": {
+          "x": 190.0,
+          "y": 205.0
+        }
+      },
+      {
+        "id": "mux1_16",
+        "name": "mux1_16#0",
+        "pos": {
+          "x": 15.0,
+          "y": 95.0
+        }
+      }
+    ],
+    "wires": [
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O15"
+        },
+        "pin2": {
+          "compName": "dff#0",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#0",
+        "path": [
+          {
+            "x": 90.0,
+            "y": 70.0
+          },
+          {
+            "x": 90.0,
+            "y": 30.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#1",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O14"
+        },
+        "name": "unnamedWire#1",
+        "path": [
+          {
+            "x": 95.0,
+            "y": 40.0
+          },
+          {
+            "x": 95.0,
+            "y": 80.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#15",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O5"
+        },
+        "name": "unnamedWire#10",
+        "path": [
+          {
+            "x": 120.0,
+            "y": 180.0
+          },
+          {
+            "x": 120.0,
+            "y": 170.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O4"
+        },
+        "pin2": {
+          "compName": "dff#14",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#11",
+        "path": [
+          {
+            "x": 115.0,
+            "y": 180.0
+          },
+          {
+            "x": 115.0,
+            "y": 190.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#12",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#12",
+        "path": [
+          {
+            "x": 110.0,
+            "y": 210.0
+          },
+          {
+            "x": 110.0,
+            "y": 190.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "dff#9",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#13",
+        "path": [
+          {
+            "x": 105.0,
+            "y": 200.0
+          },
+          {
+            "x": 105.0,
+            "y": 220.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#11",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#14",
+        "path": [
+          {
+            "x": 100.0,
+            "y": 240.0
+          },
+          {
+            "x": 100.0,
+            "y": 210.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "dff#10",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#15",
+        "path": [
+          {
+            "x": 95.0,
+            "y": 220.0
+          },
+          {
+            "x": 95.0,
+            "y": 250.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "mux1_16#0",
+          "pinName": "Y"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#16",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#0",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#17",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "name": "unnamedWire#18",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#3",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#19",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O13"
+        },
+        "pin2": {
+          "compName": "dff#3",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#2",
+        "path": [
+          {
+            "x": 100.0,
+            "y": 90.0
+          },
+          {
+            "x": 100.0,
+            "y": 60.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#1",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "name": "unnamedWire#20",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#6",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#21",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#2",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "name": "unnamedWire#22",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "dff#7",
+          "pinName": "C"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "name": "unnamedWire#23",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#3",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#6",
+          "pinName": ""
+        },
+        "name": "unnamedWire#24",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#6",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#8",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#25",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#6",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "name": "unnamedWire#26",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#15",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#27",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#4",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#5",
+          "pinName": ""
+        },
+        "name": "unnamedWire#28",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#5",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#12",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#29",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "dff#2",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O12"
+        },
+        "name": "unnamedWire#3",
+        "path": [
+          {
+            "x": 105.0,
+            "y": 70.0
+          },
+          {
+            "x": 105.0,
+            "y": 100.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#5",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#11",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#30",
+        "path": [
+          {
+            "x": 135.0,
+            "y": 230.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#10",
+          "pinName": "C"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#11",
+          "pinName": ""
+        },
+        "name": "unnamedWire#31",
+        "path": [
+          {
+            "x": 185.0,
+            "y": 240.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#11",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#9",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#32",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#11",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#14",
+          "pinName": ""
+        },
+        "name": "unnamedWire#33",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "dff#14",
+          "pinName": "C"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#14",
+          "pinName": ""
+        },
+        "name": "unnamedWire#34",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#13",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#14",
+          "pinName": ""
+        },
+        "name": "unnamedWire#35",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#13",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#13",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#36",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#13",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#10",
+          "pinName": ""
+        },
+        "name": "unnamedWire#37",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#10",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#5",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#38",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#12",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#10",
+          "pinName": ""
+        },
+        "name": "unnamedWire#39",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O11"
+        },
+        "pin2": {
+          "compName": "dff#6",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#4",
+        "path": [
+          {
+            "x": 110.0,
+            "y": 110.0
+          },
+          {
+            "x": 110.0,
+            "y": 90.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#12",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#4",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#40",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#12",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#8",
+          "pinName": ""
+        },
+        "name": "unnamedWire#41",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#8",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#2",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#42",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#8",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#9",
+          "pinName": ""
+        },
+        "name": "unnamedWire#43",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#9",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "dff#1",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#44",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#9",
+          "pinName": ""
+        },
+        "name": "unnamedWire#45",
+        "path": [
+          {
+            "x": 135.0,
+            "y": 10.0
+          },
+          {
+            "x": 185.0,
+            "y": 10.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "WE"
+        },
+        "pin2": {
+          "compName": "mux1_16#0",
+          "pinName": "S"
+        },
+        "name": "unnamedWire#47",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "C"
+        },
+        "name": "unnamedWire#48",
+        "path": [
+          {
+            "x": 35.0,
+            "y": 20.0
+          },
+          {
+            "x": 35.0,
+            "y": 25.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O15"
+        },
+        "pin2": {
+          "compName": "dff#0",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#49",
+        "path": [
+          {
+            "x": 265.0,
+            "y": 50.0
+          },
+          {
+            "x": 265.0,
+            "y": 20.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#4",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O10"
+        },
+        "name": "unnamedWire#5",
+        "path": [
+          {
+            "x": 115.0,
+            "y": 100.0
+          },
+          {
+            "x": 115.0,
+            "y": 120.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#1",
+          "pinName": "Q"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O14"
+        },
+        "name": "unnamedWire#50",
+        "path": [
+          {
+            "x": 260.0,
+            "y": 30.0
+          },
+          {
+            "x": 260.0,
+            "y": 60.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O13"
+        },
+        "pin2": {
+          "compName": "dff#3",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#51",
+        "path": [
+          {
+            "x": 255.0,
+            "y": 70.0
+          },
+          {
+            "x": 255.0,
+            "y": 50.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O12"
+        },
+        "pin2": {
+          "compName": "dff#2",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#52",
+        "path": [
+          {
+            "x": 250.0,
+            "y": 80.0
+          },
+          {
+            "x": 250.0,
+            "y": 60.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O11"
+        },
+        "pin2": {
+          "compName": "dff#6",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#53",
+        "path": [
+          {
+            "x": 245.0,
+            "y": 90.0
+          },
+          {
+            "x": 245.0,
+            "y": 80.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#4",
+          "pinName": "Q"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O10"
+        },
+        "name": "unnamedWire#54",
+        "path": [
+          {
+            "x": 240.0,
+            "y": 90.0
+          },
+          {
+            "x": 240.0,
+            "y": 100.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O9"
+        },
+        "pin2": {
+          "compName": "dff#7",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#55",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "dff#5",
+          "pinName": "Q"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O8"
+        },
+        "name": "unnamedWire#56",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O7"
+        },
+        "pin2": {
+          "compName": "dff#8",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#57",
+        "path": [
+          {
+            "x": 235.0,
+            "y": 130.0
+          },
+          {
+            "x": 235.0,
+            "y": 140.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#13",
+          "pinName": "Q"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O6"
+        },
+        "name": "unnamedWire#58",
+        "path": [
+          {
+            "x": 240.0,
+            "y": 150.0
+          },
+          {
+            "x": 240.0,
+            "y": 140.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O5"
+        },
+        "pin2": {
+          "compName": "dff#15",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#59",
+        "path": [
+          {
+            "x": 245.0,
+            "y": 150.0
+          },
+          {
+            "x": 245.0,
+            "y": 170.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#7",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O9"
+        },
+        "name": "unnamedWire#6",
+        "path": [
+          {
+            "x": 120.0,
+            "y": 120.0
+          },
+          {
+            "x": 120.0,
+            "y": 130.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O4"
+        },
+        "pin2": {
+          "compName": "dff#14",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#60",
+        "path": [
+          {
+            "x": 250.0,
+            "y": 160.0
+          },
+          {
+            "x": 250.0,
+            "y": 180.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O3"
+        },
+        "pin2": {
+          "compName": "dff#12",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#61",
+        "path": [
+          {
+            "x": 255.0,
+            "y": 170.0
+          },
+          {
+            "x": 255.0,
+            "y": 200.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#9",
+          "pinName": "Q"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O2"
+        },
+        "name": "unnamedWire#62",
+        "path": [
+          {
+            "x": 260.0,
+            "y": 210.0
+          },
+          {
+            "x": 260.0,
+            "y": 180.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "O1"
+        },
+        "pin2": {
+          "compName": "dff#11",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#63",
+        "path": [
+          {
+            "x": 265.0,
+            "y": 190.0
+          },
+          {
+            "x": 265.0,
+            "y": 230.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#10",
+          "pinName": "Q"
+        },
+        "pin2": {
+          "compName": "Splitter#1",
+          "pinName": "O0"
+        },
+        "name": "unnamedWire#64",
+        "path": [
+          {
+            "x": 270.0,
+            "y": 240.0
+          },
+          {
+            "x": 270.0,
+            "y": 200.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#1",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "WireCrossPoint#7",
+          "pinName": ""
+        },
+        "name": "unnamedWire#65",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#7",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "_submodelinterface",
+          "pinName": "Q"
+        },
+        "name": "unnamedWire#66",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "WireCrossPoint#7",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "mux1_16#0",
+          "pinName": "I0"
+        },
+        "name": "unnamedWire#67",
+        "path": [
+          {
+            "x": 290.0,
+            "y": 275.0
+          },
+          {
+            "x": 10.0,
+            "y": 275.0
+          },
+          {
+            "x": 10.0,
+            "y": 120.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "mux1_16#0",
+          "pinName": "I1"
+        },
+        "name": "unnamedWire#68",
+        "path": [
+          {
+            "x": 5.0,
+            "y": 175.0
+          },
+          {
+            "x": 5.0,
+            "y": 185.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O8"
+        },
+        "pin2": {
+          "compName": "dff#5",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#7",
+        "path": [
+          {
+            "x": 125.0,
+            "y": 140.0
+          },
+          {
+            "x": 125.0,
+            "y": 130.0
+          }
+        ]
+      },
+      {
+        "pin1": {
+          "compName": "dff#8",
+          "pinName": "D"
+        },
+        "pin2": {
+          "compName": "Splitter#0",
+          "pinName": "O7"
+        },
+        "name": "unnamedWire#8",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "Splitter#0",
+          "pinName": "O6"
+        },
+        "pin2": {
+          "compName": "dff#13",
+          "pinName": "D"
+        },
+        "name": "unnamedWire#9",
+        "path": []
+      }
+    ],
+    "version": "0.1.1"
+  },
+  "symbolRendererSnippetID": "simpleRectangularLike",
+  "symbolRendererParams": {
+    "centerText": "D flip flop\n16 bit",
+    "centerTextHeight": 5.0,
+    "horizontalComponentCenter": 30.0,
+    "pinLabelHeight": 3.5,
+    "pinLabelMargin": 0.5
+  },
+  "outlineRendererSnippetID": "default",
+  "highLevelStateHandlerSnippetID": "default",
+  "version": "0.1.5"
+}
\ No newline at end of file
index faeaeb5..9f1da98 100644 (file)
   "innerScale": 0.2,
   "submodel": {
     "components": [
-      {
-        "id": "Merger",
-        "name": "Merger#0",
-        "pos": {
-          "x": 235.0,
-          "y": 95.0
-        },
-        "params": 12
-      },
       {
         "id": "NandGate",
         "name": "NandGate#0",
           "x": 5.0,
           "y": 45.0
         },
-        "params": 12
+        "params": {
+          "logicWidth": 12,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 5.0,
           "y": 245.0
         },
-        "params": 12
+        "params": {
+          "logicWidth": 12,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#2",
+        "pos": {
+          "x": 235.0,
+          "y": 95.0
+        },
+        "params": {
+          "logicWidth": 12,
+          "orientation": "LEFT"
+        }
       },
       {
         "id": "WireCrossPoint",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I11"
+          "compName": "Splitter#2",
+          "pinName": "O11"
         },
         "name": "unnamedWire#103",
         "path": [
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I10"
+          "compName": "Splitter#2",
+          "pinName": "O10"
         },
         "name": "unnamedWire#104",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I9"
+          "compName": "Splitter#2",
+          "pinName": "O9"
         },
         "pin2": {
           "compName": "sel1#1",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I8"
+          "compName": "Splitter#2",
+          "pinName": "O8"
         },
         "name": "unnamedWire#106",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I7"
+          "compName": "Splitter#2",
+          "pinName": "O7"
         },
         "pin2": {
           "compName": "sel1#6",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I6"
+          "compName": "Splitter#2",
+          "pinName": "O6"
         },
         "name": "unnamedWire#108",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I5"
+          "compName": "Splitter#2",
+          "pinName": "O5"
         },
         "pin2": {
           "compName": "sel1#7",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I4"
+          "compName": "Splitter#2",
+          "pinName": "O4"
         },
         "name": "unnamedWire#110",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I3"
+          "compName": "Splitter#2",
+          "pinName": "O3"
         },
         "pin2": {
           "compName": "sel1#10",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I2"
+          "compName": "Splitter#2",
+          "pinName": "O2"
         },
         "name": "unnamedWire#112",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I1"
+          "compName": "Splitter#2",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "sel1#4",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I0"
+          "compName": "Splitter#2",
+          "pinName": "O0"
         },
         "name": "unnamedWire#114",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "O"
+          "compName": "Splitter#2",
+          "pinName": "I"
         },
         "pin2": {
           "compName": "_submodelinterface",
index c282fa5..e29bbbf 100644 (file)
   "innerScale": 0.2,
   "submodel": {
     "components": [
-      {
-        "id": "Merger",
-        "name": "Merger#0",
-        "pos": {
-          "x": 260.0,
-          "y": 175.0
-        },
-        "params": 16
-      },
       {
         "id": "NandGate",
         "name": "NandGate#0",
           "x": 5.0,
           "y": 50.0
         },
-        "params": 16
+        "params": {
+          "logicWidth": 16,
+          "orientation": "RIGHT"
+        }
       },
       {
         "id": "Splitter",
           "x": 5.0,
           "y": 375.0
         },
-        "params": 16
+        "params": {
+          "logicWidth": 16,
+          "orientation": "RIGHT"
+        }
+      },
+      {
+        "id": "Splitter",
+        "name": "Splitter#2",
+        "pos": {
+          "x": 260.0,
+          "y": 175.0
+        },
+        "params": {
+          "logicWidth": 16,
+          "orientation": "LEFT"
+        }
       },
       {
         "id": "WireCrossPoint",
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I14"
+          "compName": "Splitter#2",
+          "pinName": "O14"
         },
         "pin2": {
           "compName": "sel1#1",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I13"
+          "compName": "Splitter#2",
+          "pinName": "O13"
         },
         "name": "unnamedWire#101",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I12"
+          "compName": "Splitter#2",
+          "pinName": "O12"
         },
         "pin2": {
           "compName": "sel1#3",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I11"
+          "compName": "Splitter#2",
+          "pinName": "O11"
         },
         "name": "unnamedWire#103",
         "path": [
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I10"
+          "compName": "Splitter#2",
+          "pinName": "O10"
         },
         "name": "unnamedWire#104",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I9"
+          "compName": "Splitter#2",
+          "pinName": "O9"
         },
         "pin2": {
           "compName": "sel1#5",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I8"
+          "compName": "Splitter#2",
+          "pinName": "O8"
         },
         "name": "unnamedWire#106",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I7"
+          "compName": "Splitter#2",
+          "pinName": "O7"
         },
         "pin2": {
           "compName": "sel1#10",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I6"
+          "compName": "Splitter#2",
+          "pinName": "O6"
         },
         "name": "unnamedWire#108",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I5"
+          "compName": "Splitter#2",
+          "pinName": "O5"
         },
         "pin2": {
           "compName": "sel1#11",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I4"
+          "compName": "Splitter#2",
+          "pinName": "O4"
         },
         "name": "unnamedWire#110",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I3"
+          "compName": "Splitter#2",
+          "pinName": "O3"
         },
         "pin2": {
           "compName": "sel1#14",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I2"
+          "compName": "Splitter#2",
+          "pinName": "O2"
         },
         "name": "unnamedWire#112",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "I1"
+          "compName": "Splitter#2",
+          "pinName": "O1"
         },
         "pin2": {
           "compName": "sel1#8",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I0"
+          "compName": "Splitter#2",
+          "pinName": "O0"
         },
         "name": "unnamedWire#114",
         "path": [
       },
       {
         "pin1": {
-          "compName": "Merger#0",
-          "pinName": "O"
+          "compName": "Splitter#2",
+          "pinName": "I"
         },
         "pin2": {
           "compName": "_submodelinterface",
           "pinName": "Y"
         },
         "pin2": {
-          "compName": "Merger#0",
-          "pinName": "I15"
+          "compName": "Splitter#2",
+          "pinName": "O15"
         },
         "name": "unnamedWire#99",
         "path": [
diff --git a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelinc.java b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelinc.java
new file mode 100644 (file)
index 0000000..981c848
--- /dev/null
@@ -0,0 +1,78 @@
+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/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelinc12.java b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelinc12.java
deleted file mode 100644 (file)
index 05d2eee..0000000
+++ /dev/null
@@ -1,67 +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.IndirectModelComponentCreator;
-import net.mograsim.logic.model.snippets.symbolrenderers.PinNamesSymbolRenderer.PinNamesParams.Position;
-
-public class Modelinc12 extends SimpleRectangularHardcodedModelComponent
-{
-       public Modelinc12(LogicModelModifiable model, String name)
-       {
-               super(model, "inc12", name, "Incrementer", false);
-               setSize(40, 20);
-               addPin(new Pin(model, this, "A", 12, 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", 12, 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[12];
-               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 = 11; i >= 0; i--)
-                       {
-                               Bit a = ABits[i];
-                               YBits[i] = a.xor(carry);
-                               carry = a.and(carry);
-                       }
-               }
-               readWriteEnds.get("Y").feedSignals(YBits);
-               return null;
-       }
-
-       static
-       {
-               IndirectModelComponentCreator.setComponentSupplier(Modelinc12.class.getCanonicalName(), (m, p, n) -> new Modelinc12(m, n));
-       }
-}
\ No newline at end of file
index 05ebf45..0c101bb 100644 (file)
@@ -62,7 +62,7 @@ public class ModelAm2910RegCntr extends SimpleRectangularHardcodedModelComponent
                        else if (WE.getValue() == ONE)
                        {
                                Bit carry = Bit.ZERO;
-                               // TODO extract to helper. This code almost also exists in Modelinc12.
+                               // TODO extract to helper. This code almost also exists in Modelinc.
                                for (int i = 11; i >= 0; i--)
                                {
                                        Bit a = QC[i];
index 6ab00c4..4ecaf4a 100644 (file)
@@ -7,7 +7,7 @@ mograsim version: 0.1.3
   "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",
-  "inc12": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.Modelinc12",
+  "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",
@@ -32,6 +32,7 @@ mograsim version: 0.1.3
   "demux2": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/demux2.json",
   "dff": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff.json",
   "dff12_we": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff12_we.json",
+  "dff16_we": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff16_we.json",
   "dff16_invwe": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff16_invwe.json",
   "dff4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff4.json",
   "dff4_invwe": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff4_invwe.json",
diff --git a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ReserializeJSONs.java b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ReserializeJSONs.java
new file mode 100644 (file)
index 0000000..c9486cc
--- /dev/null
@@ -0,0 +1,284 @@
+package net.mograsim.logic.model.examples;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.Scanner;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
+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.components.submodels.SubmodelInterface;
+import net.mograsim.logic.model.model.wires.ModelWire;
+import net.mograsim.logic.model.model.wires.ModelWireCrossPoint;
+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.serializing.DeserializedSubmodelComponent;
+import net.mograsim.logic.model.serializing.IdentifyParams;
+import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
+import net.mograsim.logic.model.serializing.SubmodelComponentSerializer;
+import net.mograsim.logic.model.snippets.highlevelstatehandlers.DefaultHighLevelStateHandler;
+
+public class ReserializeJSONs
+{
+       public static double GRIDSIZE = 2.5;
+       public static boolean changePinUsages = false;
+       public static boolean changeComponentNames = false;
+       public static boolean snapWCPs = true;
+       public static boolean warnNonSnappedPoints = true;
+
+       public static void main(String[] args) throws IOException
+       {
+               Am2900Loader.setup();
+               try (Scanner sysin = new Scanner(System.in))
+               {
+                       System.out.print("Directory to search for JSONs in / JSON file to reserialize >");
+                       Path root = Paths.get(sysin.nextLine());
+                       if (!Files.exists(root))
+                               throw new IllegalArgumentException("Path doesn't exist");
+                       if (Files.isRegularFile(root))
+                               reserializeJSON(root, sysin);
+                       else
+                       {
+                               System.out.print("Recursive? >");
+                               boolean recursive = Boolean.valueOf(sysin.nextLine());
+                               try (Stream<Path> jsons = recursive ? Files.walk(root) : Files.list(root))
+                               {
+                                       jsons.filter(Files::isRegularFile).filter(p -> p.getFileName().toString().endsWith(".json"))
+                                                       .forEach(j -> reserializeJSON(j, sysin));
+                               }
+                       }
+               }
+       }
+
+       public static void reserializeJSON(Path componentPath, Scanner sysin)
+       {
+               try
+               {
+                       DeserializedSubmodelComponent comp = (DeserializedSubmodelComponent) IndirectModelComponentCreator
+                                       .createComponent(new LogicModelModifiable(), "jsonfile:" + componentPath.toString());
+                       System.out.println("Reserializing " + componentPath);
+                       if (changePinUsages)
+                               comp.getSupermodelPins().entrySet().stream().sorted(Comparator.comparing(Entry::getKey)).map(Entry::getValue).forEach(pin ->
+                               {
+                                       PinUsage usage = null;
+                                       while (usage == null)
+                                               try
+                                               {
+                                                       System.out.print("  Usage for interface pin " + pin.name + " (empty: " + pin.usage + ") >");
+                                                       String usageStr = sysin.nextLine().toUpperCase();
+                                                       usage = usageStr.equals("") ? pin.usage
+                                                                       : usageStr.equals("I") ? PinUsage.INPUT
+                                                                                       : usageStr.equals("O") ? PinUsage.OUTPUT
+                                                                                                       : usageStr.equals("T") ? PinUsage.TRISTATE : PinUsage.valueOf(usageStr);
+                                               }
+                                               catch (@SuppressWarnings("unused") IllegalArgumentException e)
+                                               {
+                                                       System.err.println("  Illegal usage");
+                                               }
+                                       setInterfacePinUsage(comp, pin, usage);
+                               });
+                       LogicModelModifiable submodelModifiable = comp.getSubmodelModifiable();
+                       Map<String, String> componentNameRemapping = new HashMap<>();
+                       if (changeComponentNames)
+                       {
+                               componentNameRemapping.put(SubmodelComponent.SUBMODEL_INTERFACE_NAME, SubmodelComponent.SUBMODEL_INTERFACE_NAME);
+                               LogicModelModifiable tempModel = new LogicModelModifiable();
+                               IdentifyParams iP = new IdentifyParams();
+                               submodelModifiable.getComponentsByName().entrySet().stream()
+                                               .filter(e -> !e.getKey().equals(SubmodelComponent.SUBMODEL_INTERFACE_NAME))
+                                               .sorted(Comparator.comparing(Entry::getKey, ReserializeJSONs::compareStringsWithIntegers)).forEach(e ->
+                                               {
+                                                       String oldName = e.getKey();
+                                                       ModelComponent subcomp = e.getValue();
+                                                       String defaultName = tempModel.getDefaultComponentName(subcomp);
+                                                       String newName = null;
+                                                       while (newName == null)
+                                                       {
+                                                               System.out.print("  New name for component " + oldName + " of type " + subcomp.getIDForSerializing(iP)
+                                                                               + " (empty: " + defaultName + ") >");
+                                                               newName = sysin.nextLine();
+                                                               if (newName.equals(""))
+                                                                       newName = defaultName;
+                                                               if (tempModel.getComponentsByName().containsKey(newName))
+                                                               {
+                                                                       System.err.println("  There already is a component with that name");
+                                                                       newName = null;
+                                                               }
+                                                       }
+                                                       componentNameRemapping.put(oldName, newName);
+                                                       IndirectModelComponentCreator.createComponent(tempModel, subcomp.getIDForSerializing(iP),
+                                                                       subcomp.getParamsForSerializingJSON(iP), newName).moveTo(subcomp.getPosX(), subcomp.getPosY());
+                                               });
+                               SubmodelInterface tempSubmodelInterface = new SubmodelInterface(tempModel);
+                               for (Pin p : submodelModifiable.getComponentsByName().get(SubmodelComponent.SUBMODEL_INTERFACE_NAME).getPins().values())
+                                       tempSubmodelInterface
+                                                       .addPin(new Pin(tempModel, tempSubmodelInterface, p.name, p.logicWidth, p.usage, p.getRelX(), p.getRelY()));
+                               for (ModelWire w : submodelModifiable.getWiresByName().values())
+                                       createWire(componentNameRemapping::get, tempModel, w);
+
+                               Optional<ModelComponent> o;
+                               while ((o = submodelModifiable.getComponentsByName().values().stream()
+                                               .filter(c -> !c.getName().equals(SubmodelComponent.SUBMODEL_INTERFACE_NAME)).findAny()).isPresent())
+                                       submodelModifiable.destroyComponent(o.get());
+
+                               tempModel.getComponentsByName().values().stream()
+                                               .filter(c -> !c.getName().equals(SubmodelComponent.SUBMODEL_INTERFACE_NAME))
+                                               .forEach(c -> IndirectModelComponentCreator.createComponent(submodelModifiable, c.getIDForSerializing(iP),
+                                                               c.getParamsForSerializingJSON(iP), c.getName()).moveTo(c.getPosX(), c.getPosY()));
+                               for (ModelWire w : tempModel.getWiresByName().values())
+                                       createWire(Function.identity(), submodelModifiable, w);
+                       }
+                       if (snapWCPs)
+                               submodelModifiable.getComponentsByName().values().stream().filter(c -> c instanceof ModelWireCrossPoint).forEach(c ->
+                               {
+                                       double x = c.getPosX();
+                                       double y = c.getPosY();
+                                       c.moveTo(x % GRIDSIZE == 0 ? x - 1 : x, y % GRIDSIZE == 0 ? y - 1 : y);
+                               });
+                       if (warnNonSnappedPoints)
+                       {
+                               if (comp.getWidth() % GRIDSIZE != 0 || comp.getHeight() % GRIDSIZE != 0)
+                                       System.out.println("  Size is not snapped to grid: " + comp.getWidth() + "," + comp.getHeight());
+                               submodelModifiable.getComponentsByName().values().forEach(c ->
+                               {
+                                       double x = c.getPosX();
+                                       double y = c.getPosY();
+                                       if (c instanceof ModelWireCrossPoint)
+                                       {
+                                               x++;
+                                               y++;
+                                       }
+                                       if (x % GRIDSIZE != 0 || y % GRIDSIZE != 0)
+                                               System.out.println("  Component " + c.getName() + " (type " + c.getIDForSerializing(new IdentifyParams())
+                                                               + ") is not snapped to grid: " + x + "," + y);
+                               });
+                               submodelModifiable.getWiresByName().values().stream().forEach(w ->
+                               {
+                                       Point[] p = w.getPath();
+                                       if (p != null)
+                                               for (int i = 0; i < p.length; i++)
+                                                       if (p[i].x % GRIDSIZE != 0 || p[i].y % GRIDSIZE != 0)
+                                                               System.out.println(
+                                                                               "  Wire " + w.name + " path point #" + i + " is not snapped to grid: " + p[i].x + "," + p[i].y);
+                               });
+                               comp.getPins().values().forEach(p ->
+                               {
+                                       if (p.getRelX() % GRIDSIZE != 0 || p.getRelY() % GRIDSIZE != 0)
+                                               System.out.println("  Interface point " + p.name + " is not snapped to grid: " + p.getRelX() + "," + p.getRelY());
+                               });
+                       }
+                       SubmodelComponentSerializer.serialize(comp, componentPath.toString());
+                       if (changeComponentNames && (comp.getHighLevelStateHandler() == null
+                                       || !(comp.getHighLevelStateHandler() instanceof DefaultHighLevelStateHandler)))
+                       {
+                               System.out.println("  A non-default HighLevelStateHandler was detected. Check for changes there manually.");
+                               System.out.print("  Empty line to continue to next component, old component name to get new component name >");
+                               for (String line = sysin.nextLine(); !line.equals(""); line = sysin.nextLine())
+                                       System.out.println("  " + line + "->" + componentNameRemapping.get(line) + " >");
+                       }
+               }
+               catch (Exception e)
+               {
+                       System.err.println("An error occurred visiting " + componentPath + ":");
+                       e.printStackTrace();
+               }
+       }
+
+       private static ModelWire createWire(Function<String, String> componentNameRemapping, LogicModelModifiable tempModelForDefaultNames,
+                       ModelWire w)
+       {
+               return new ModelWire(tempModelForDefaultNames, w.name,
+                               getRemappedPin(componentNameRemapping, tempModelForDefaultNames, w.getPin1()),
+                               getRemappedPin(componentNameRemapping, tempModelForDefaultNames, w.getPin2()), w.getPath());
+       }
+
+       private static Pin getRemappedPin(Function<String, String> componentNameRemapping, LogicModelModifiable tempModelForDefaultNames,
+                       Pin pin)
+       {
+               return tempModelForDefaultNames.getComponentsByName().get(componentNameRemapping.apply(pin.component.getName())).getPin(pin.name);
+       }
+
+       private static int compareStringsWithIntegers(String a, String b)
+       {
+               int aLoc = 0;
+               int bLoc = 0;
+               for (;;)
+               {
+                       if (aLoc == a.length())
+                       {
+                               if (bLoc == b.length())
+                                       return 0;
+                               return -1;
+                       }
+                       if (bLoc == b.length())
+                               return 1;
+                       int aInt = 0;
+                       int aIntLen = 0;
+                       char nextCharA;
+                       for (;;)
+                       {
+                               nextCharA = a.charAt(aLoc++);
+                               if (nextCharA < '0' || nextCharA > '9')
+                                       break;
+                               aIntLen++;
+                               aInt = aInt * 10 + nextCharA - '0';
+                               if (aLoc == a.length())
+                                       break;
+                       }
+                       int bInt = 0;
+                       int bIntLen = 0;
+                       char nextCharB;
+                       for (;;)
+                       {
+                               nextCharB = b.charAt(bLoc++);
+                               if (nextCharB < '0' || nextCharB > '9')
+                                       break;
+                               bIntLen++;
+                               bInt = bInt * 10 + nextCharB - '0';
+                               if (bLoc == b.length())
+                                       break;
+                       }
+                       if (aIntLen != 0)
+                       {
+                               if (bIntLen == 0)
+                                       return -1;
+                               int comp = Integer.compare(aInt, bInt);
+                               if (comp != 0)
+                                       return comp;
+                       } else
+                       {
+                               if (bIntLen != 0)
+                                       return 1;
+                               int comp = Character.compare(nextCharA, nextCharB);
+                               if (comp != 0)
+                                       return comp;
+                       }
+               }
+       }
+
+       private static void setInterfacePinUsage(DeserializedSubmodelComponent comp, Pin interfacePin, PinUsage usage)
+       {
+               Set<ModelWire> wiresConnectedToPin = comp.submodel.getWiresByName().values().stream()
+                               .filter(w -> w.getPin1() == interfacePin || w.getPin2() == interfacePin).collect(Collectors.toSet());
+               LogicModelModifiable submodelModifiable = comp.getSubmodelModifiable();
+               wiresConnectedToPin.forEach(submodelModifiable::destroyWire);
+               comp.removeSubmodelInterface(interfacePin.name);
+               comp.addSubmodelInterface(new MovablePin(submodelModifiable, comp, interfacePin.name, interfacePin.logicWidth, usage,
+                               interfacePin.getRelX(), interfacePin.getRelY()));
+               wiresConnectedToPin.forEach(w -> new ModelWire(submodelModifiable, w.getPin1(), w.getPin2()));
+       }
+}
\ No newline at end of file
diff --git a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ReserializeJSONsSettingUsages.java b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ReserializeJSONsSettingUsages.java
deleted file mode 100644 (file)
index 0788589..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-package net.mograsim.logic.model.examples;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Optional;
-import java.util.Scanner;
-import java.util.Set;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
-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.components.submodels.SubmodelInterface;
-import net.mograsim.logic.model.model.wires.ModelWire;
-import net.mograsim.logic.model.model.wires.ModelWireCrossPoint;
-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.serializing.DeserializedSubmodelComponent;
-import net.mograsim.logic.model.serializing.IdentifyParams;
-import net.mograsim.logic.model.serializing.IndirectModelComponentCreator;
-import net.mograsim.logic.model.serializing.SubmodelComponentSerializer;
-import net.mograsim.logic.model.snippets.highlevelstatehandlers.DefaultHighLevelStateHandler;
-
-public class ReserializeJSONsSettingUsages
-{
-       public static double GRIDSIZE = 2.5;
-       public static boolean changePinUsages = false;
-       public static boolean changeComponentNames = false;
-       public static boolean snapWCPs = true;
-       public static boolean warnNonSnappedPoints = true;
-
-       public static void main(String[] args) throws IOException
-       {
-               Am2900Loader.setup();
-               try (Scanner sysin = new Scanner(System.in))
-               {
-                       System.out.print("Directory to search for JSONs in / JSON file to reserialize >");
-                       Path root = Paths.get(sysin.nextLine());
-                       if (!Files.exists(root))
-                               throw new IllegalArgumentException("Path doesn't exist");
-                       if (Files.isRegularFile(root))
-                               reserializeJSON(root, sysin);
-                       else
-                       {
-                               System.out.print("Recursive? >");
-                               boolean recursive = Boolean.valueOf(sysin.nextLine());
-                               try (Stream<Path> jsons = recursive ? Files.walk(root) : Files.list(root))
-                               {
-                                       jsons.filter(Files::isRegularFile).filter(p -> p.getFileName().toString().endsWith(".json"))
-                                                       .forEach(j -> reserializeJSON(j, sysin));
-                               }
-                       }
-               }
-       }
-
-       public static void reserializeJSON(Path componentPath, Scanner sysin)
-       {
-               try
-               {
-                       DeserializedSubmodelComponent comp = (DeserializedSubmodelComponent) IndirectModelComponentCreator
-                                       .createComponent(new LogicModelModifiable(), "jsonfile:" + componentPath.toString());
-                       System.out.println("Reserializing " + componentPath);
-                       if (changePinUsages)
-                               comp.getSupermodelPins().entrySet().stream().sorted(Comparator.comparing(Entry::getKey)).map(Entry::getValue).forEach(pin ->
-                               {
-                                       PinUsage usage = null;
-                                       while (usage == null)
-                                               try
-                                               {
-                                                       System.out.print("  Usage for interface pin " + pin.name + " (empty: " + pin.usage + ") >");
-                                                       String usageStr = sysin.nextLine().toUpperCase();
-                                                       usage = usageStr.equals("") ? pin.usage
-                                                                       : usageStr.equals("I") ? PinUsage.INPUT
-                                                                                       : usageStr.equals("O") ? PinUsage.OUTPUT
-                                                                                                       : usageStr.equals("T") ? PinUsage.TRISTATE : PinUsage.valueOf(usageStr);
-                                               }
-                                               catch (@SuppressWarnings("unused") IllegalArgumentException e)
-                                               {
-                                                       System.err.println("  Illegal usage");
-                                               }
-                                       setInterfacePinUsage(comp, pin, usage);
-                               });
-                       LogicModelModifiable submodelModifiable = comp.getSubmodelModifiable();
-                       Map<String, String> componentNameRemapping = new HashMap<>();
-                       if (changeComponentNames)
-                       {
-                               componentNameRemapping.put(SubmodelComponent.SUBMODEL_INTERFACE_NAME, SubmodelComponent.SUBMODEL_INTERFACE_NAME);
-                               LogicModelModifiable tempModel = new LogicModelModifiable();
-                               IdentifyParams iP = new IdentifyParams();
-                               submodelModifiable.getComponentsByName().entrySet().stream()
-                                               .filter(e -> !e.getKey().equals(SubmodelComponent.SUBMODEL_INTERFACE_NAME))
-                                               .sorted(Comparator.comparing(Entry::getKey, ReserializeJSONsSettingUsages::compareStringsWithIntegers)).forEach(e ->
-                                               {
-                                                       String oldName = e.getKey();
-                                                       ModelComponent subcomp = e.getValue();
-                                                       String defaultName = tempModel.getDefaultComponentName(subcomp);
-                                                       String newName = null;
-                                                       while (newName == null)
-                                                       {
-                                                               System.out.print("  New name for component " + oldName + " of type " + subcomp.getIDForSerializing(iP)
-                                                                               + " (empty: " + defaultName + ") >");
-                                                               newName = sysin.nextLine();
-                                                               if (newName.equals(""))
-                                                                       newName = defaultName;
-                                                               if (tempModel.getComponentsByName().containsKey(newName))
-                                                               {
-                                                                       System.err.println("  There already is a component with that name");
-                                                                       newName = null;
-                                                               }
-                                                       }
-                                                       componentNameRemapping.put(oldName, newName);
-                                                       IndirectModelComponentCreator.createComponent(tempModel, subcomp.getIDForSerializing(iP),
-                                                                       subcomp.getParamsForSerializingJSON(iP), newName).moveTo(subcomp.getPosX(), subcomp.getPosY());
-                                               });
-                               SubmodelInterface tempSubmodelInterface = new SubmodelInterface(tempModel);
-                               for (Pin p : submodelModifiable.getComponentsByName().get(SubmodelComponent.SUBMODEL_INTERFACE_NAME).getPins().values())
-                                       tempSubmodelInterface
-                                                       .addPin(new Pin(tempModel, tempSubmodelInterface, p.name, p.logicWidth, p.usage, p.getRelX(), p.getRelY()));
-                               for (ModelWire w : submodelModifiable.getWiresByName().values())
-                                       createWire(componentNameRemapping::get, tempModel, w);
-
-                               Optional<ModelComponent> o;
-                               while ((o = submodelModifiable.getComponentsByName().values().stream()
-                                               .filter(c -> !c.getName().equals(SubmodelComponent.SUBMODEL_INTERFACE_NAME)).findAny()).isPresent())
-                                       submodelModifiable.destroyComponent(o.get());
-
-                               tempModel.getComponentsByName().values().stream()
-                                               .filter(c -> !c.getName().equals(SubmodelComponent.SUBMODEL_INTERFACE_NAME))
-                                               .forEach(c -> IndirectModelComponentCreator.createComponent(submodelModifiable, c.getIDForSerializing(iP),
-                                                               c.getParamsForSerializingJSON(iP), c.getName()).moveTo(c.getPosX(), c.getPosY()));
-                               for (ModelWire w : tempModel.getWiresByName().values())
-                                       createWire(Function.identity(), submodelModifiable, w);
-                       }
-                       if (snapWCPs)
-                               submodelModifiable.getComponentsByName().values().stream().filter(c -> c instanceof ModelWireCrossPoint).forEach(c ->
-                               {
-                                       double x = c.getPosX();
-                                       double y = c.getPosY();
-                                       c.moveTo(x % GRIDSIZE == 0 ? x - 1 : x, y % GRIDSIZE == 0 ? y - 1 : y);
-                               });
-                       if (warnNonSnappedPoints)
-                       {
-                               submodelModifiable.getComponentsByName().values().forEach(c ->
-                               {
-                                       double x = c.getPosX();
-                                       double y = c.getPosY();
-                                       if (c instanceof ModelWireCrossPoint)
-                                       {
-                                               x++;
-                                               y++;
-                                       }
-                                       if (x % GRIDSIZE != 0 || y % GRIDSIZE != 0)
-                                               System.out.println("  Component " + c.getName() + " (type " + c.getIDForSerializing(new IdentifyParams())
-                                                               + ") is not snapped to grid: " + x + "," + y);
-                               });
-                               submodelModifiable.getWiresByName().values().stream().forEach(w ->
-                               {
-                                       Point[] p = w.getPath();
-                                       if (p != null)
-                                               for (int i = 0; i < p.length; i++)
-                                                       if (p[i].x % GRIDSIZE != 0 || p[i].y % GRIDSIZE != 0)
-                                                               System.out.println(
-                                                                               "  Wire " + w.name + " path point #" + i + " is not snapped to grid: " + p[i].x + "," + p[i].y);
-                               });
-                               comp.getPins().values().forEach(p ->
-                               {
-                                       if (p.getRelX() % GRIDSIZE != 0 || p.getRelY() % GRIDSIZE != 0)
-                                               System.out.println("  Interface point " + p.name + " is not snapped to grid: " + p.getRelX() + "," + p.getRelY());
-                               });
-                       }
-                       SubmodelComponentSerializer.serialize(comp, componentPath.toString());
-                       if (changeComponentNames && (comp.getHighLevelStateHandler() == null
-                                       || !(comp.getHighLevelStateHandler() instanceof DefaultHighLevelStateHandler)))
-                       {
-                               System.out.println("  A non-default HighLevelStateHandler was detected. Check for changes there manually.");
-                               System.out.print("  Empty line to continue to next component, old component name to get new component name >");
-                               for (String line = sysin.nextLine(); !line.equals(""); line = sysin.nextLine())
-                                       System.out.println("  " + line + "->" + componentNameRemapping.get(line) + " >");
-                       }
-               }
-               catch (Exception e)
-               {
-                       System.err.println("An error occurred visiting " + componentPath + ":");
-                       e.printStackTrace();
-               }
-       }
-
-       private static ModelWire createWire(Function<String, String> componentNameRemapping, LogicModelModifiable tempModelForDefaultNames,
-                       ModelWire w)
-       {
-               return new ModelWire(tempModelForDefaultNames, w.name,
-                               getRemappedPin(componentNameRemapping, tempModelForDefaultNames, w.getPin1()),
-                               getRemappedPin(componentNameRemapping, tempModelForDefaultNames, w.getPin2()), w.getPath());
-       }
-
-       private static Pin getRemappedPin(Function<String, String> componentNameRemapping, LogicModelModifiable tempModelForDefaultNames,
-                       Pin pin)
-       {
-               return tempModelForDefaultNames.getComponentsByName().get(componentNameRemapping.apply(pin.component.getName())).getPin(pin.name);
-       }
-
-       private static int compareStringsWithIntegers(String a, String b)
-       {
-               int aLoc = 0;
-               int bLoc = 0;
-               for (;;)
-               {
-                       if (aLoc == a.length())
-                       {
-                               if (bLoc == b.length())
-                                       return 0;
-                               return -1;
-                       }
-                       if (bLoc == b.length())
-                               return 1;
-                       int aInt = 0;
-                       int aIntLen = 0;
-                       char nextCharA;
-                       for (;;)
-                       {
-                               nextCharA = a.charAt(aLoc++);
-                               if (nextCharA < '0' || nextCharA > '9')
-                                       break;
-                               aIntLen++;
-                               aInt = aInt * 10 + nextCharA - '0';
-                               if (aLoc == a.length())
-                                       break;
-                       }
-                       int bInt = 0;
-                       int bIntLen = 0;
-                       char nextCharB;
-                       for (;;)
-                       {
-                               nextCharB = b.charAt(bLoc++);
-                               if (nextCharB < '0' || nextCharB > '9')
-                                       break;
-                               bIntLen++;
-                               bInt = bInt * 10 + nextCharB - '0';
-                               if (bLoc == b.length())
-                                       break;
-                       }
-                       if (aIntLen != 0)
-                       {
-                               if (bIntLen == 0)
-                                       return -1;
-                               int comp = Integer.compare(aInt, bInt);
-                               if (comp != 0)
-                                       return comp;
-                       } else
-                       {
-                               if (bIntLen != 0)
-                                       return 1;
-                               int comp = Character.compare(nextCharA, nextCharB);
-                               if (comp != 0)
-                                       return comp;
-                       }
-               }
-       }
-
-       private static void setInterfacePinUsage(DeserializedSubmodelComponent comp, Pin interfacePin, PinUsage usage)
-       {
-               Set<ModelWire> wiresConnectedToPin = comp.submodel.getWiresByName().values().stream()
-                               .filter(w -> w.getPin1() == interfacePin || w.getPin2() == interfacePin).collect(Collectors.toSet());
-               LogicModelModifiable submodelModifiable = comp.getSubmodelModifiable();
-               wiresConnectedToPin.forEach(submodelModifiable::destroyWire);
-               comp.removeSubmodelInterface(interfacePin.name);
-               comp.addSubmodelInterface(new MovablePin(submodelModifiable, comp, interfacePin.name, interfacePin.logicWidth, usage,
-                               interfacePin.getRelX(), interfacePin.getRelY()));
-               wiresConnectedToPin.forEach(w -> new ModelWire(submodelModifiable, w.getPin1(), w.getPin2()));
-       }
-}
\ No newline at end of file
index 9171ee8..d543c54 100644 (file)
@@ -168,17 +168,30 @@ public abstract class ModelComponent implements JSONSerializable
         * Returns the pin with the given name of this component.
         * 
         * @throws IllegalArgumentException if there is no pin with the given name
+        * @see #getPinOrNull(String)
         * 
         * @author Daniel Kirschten
         */
        public Pin getPin(String name)
        {
-               Pin pin = pinsByName.get(name);
+               Pin pin = getPinOrNull(name);
                if (pin == null)
                        throw new IllegalArgumentException("No pin with the name " + name);
                return pin;
        }
 
+       /**
+        * Returns the pin with the given name of this component, or <code>null</code> if there is no such pin.
+        * 
+        * @see #getPin(String)
+        * 
+        * @author Daniel Kirschten
+        */
+       public Pin getPinOrNull(String name)
+       {
+               return pinsByName.get(name);
+       }
+
        // high-level access
 
        /**
index 7152392..6efc9ad 100644 (file)
@@ -8,6 +8,8 @@ import net.mograsim.logic.core.types.BitVectorFormatter;
 import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
+import net.mograsim.logic.model.model.components.Orientation;
+import net.mograsim.logic.model.model.components.atomic.ModelSplitter.SplitterParams;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
@@ -18,6 +20,7 @@ import net.mograsim.preferences.ColorDefinition;
 import net.mograsim.preferences.ColorManager;
 import net.mograsim.preferences.Preferences;
 
+//TODO delete this legacy class
 public class ModelMerger extends ModelComponent
 {
        private static final double width = 10;
@@ -41,8 +44,8 @@ public class ModelMerger extends ModelComponent
                setSize(width, (logicWidth - 1) * heightPerPin);
                double inputHeight = (logicWidth - 1) * heightPerPin;
                for (int i = 0; i < logicWidth; i++, inputHeight -= 10)
-                       addPin(new Pin(model, this, "I" + i, 1, PinUsage.TRISTATE, 0, inputHeight));
-               addPin(this.outputPin = new Pin(model, this, "O", logicWidth, PinUsage.TRISTATE, width, (logicWidth - 1) * heightPerPin / 2));
+                       addPin(new Pin(model, this, "O" + i, 1, PinUsage.TRISTATE, 0, inputHeight));
+               addPin(this.outputPin = new Pin(model, this, "I", logicWidth, PinUsage.TRISTATE, width, (logicWidth - 1) * heightPerPin / 2));
                inputEnds = new ReadEnd[logicWidth];
 
                init();
@@ -81,16 +84,26 @@ public class ModelMerger extends ModelComponent
                gc.setLineCap(oldLineCap);
        }
 
+       @Override
+       public Pin getPin(String name)
+       {
+               Pin pin = getPinOrNull(name);
+               return pin == null ? getPin(name.replace('O', 'i').replace('I', 'O').replace('i', 'I')) : pin;
+       }
+
        @Override
        public String getIDForSerializing(IdentifyParams idParams)
        {
-               return "Merger";
+               return "Splitter";
        }
 
        @Override
-       public Integer getParamsForSerializing(IdentifyParams idParams)
+       public SplitterParams getParamsForSerializing(IdentifyParams idParams)
        {
-               return logicWidth;
+               SplitterParams splitterParams = new SplitterParams();
+               splitterParams.logicWidth = logicWidth;
+               splitterParams.orientation = Orientation.LEFT;
+               return splitterParams;
        }
 
        public void setCoreModelBinding(ReadEnd[] inputEnds, ReadEnd outputEnd)
index 708a4ad..962f2ac 100644 (file)
@@ -8,12 +8,15 @@ import net.mograsim.logic.core.types.BitVectorFormatter;
 import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
 import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
+import net.mograsim.logic.model.model.components.Orientation;
+import net.mograsim.logic.model.model.components.OrientationCalculator;
 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.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;
@@ -23,26 +26,31 @@ public class ModelSplitter extends ModelComponent
        private static final double width = 10;
        private static final double heightPerPin = 10;
 
+       private final double heightWithoutOC;
        public final int logicWidth;
+       private final OrientationCalculator oc;
        private final Pin inputPin;
 
        private ReadEnd inputEnd;
        private final ReadEnd[] outputEnds;
 
-       public ModelSplitter(LogicModelModifiable model, int logicWidth)
+       public ModelSplitter(LogicModelModifiable model, SplitterParams params)
        {
-               this(model, logicWidth, null);
+               this(model, params, null);
        }
 
-       public ModelSplitter(LogicModelModifiable model, int logicWidth, String name)
+       public ModelSplitter(LogicModelModifiable model, SplitterParams params, String name)
        {
                super(model, name, false);
-               this.logicWidth = logicWidth;
-               setSize(width, (logicWidth - 1) * heightPerPin);
-               addPin(this.inputPin = new Pin(model, this, "I", logicWidth, PinUsage.TRISTATE, 0, (logicWidth - 1) * heightPerPin / 2));
+               this.logicWidth = params.logicWidth;
+               this.oc = new OrientationCalculator(toggleLeftDownAlt(params.orientation), width,
+                               this.heightWithoutOC = (logicWidth - 1) * heightPerPin);
+               setSize(oc.width(), oc.height());
+               double inLineY = (logicWidth - 1) * heightPerPin / 2;
+               addPin(this.inputPin = new Pin(model, this, "I", logicWidth, PinUsage.TRISTATE, oc.newX(0, inLineY), oc.newY(0, inLineY)));
                double outputHeight = (logicWidth - 1) * heightPerPin;
                for (int i = 0; i < logicWidth; i++, outputHeight -= 10)
-                       addPin(new Pin(model, this, "O" + i, 1, PinUsage.TRISTATE, width, outputHeight));
+                       addPin(new Pin(model, this, "O" + i, 1, PinUsage.TRISTATE, oc.newX(width, outputHeight), oc.newY(width, outputHeight)));
                outputEnds = new ReadEnd[logicWidth];
 
                init();
@@ -59,16 +67,18 @@ public class ModelSplitter extends ModelComponent
                        gc.setForeground(ColorManager.current().toColor(c));
                gc.setLineWidth(
                                Preferences.current().getDouble("net.mograsim.logic.model.linewidth.wire." + (logicWidth == 1 ? "singlebit" : "multibit")));
-               double inLineY = posY + (logicWidth - 1) * heightPerPin / 2;
-               gc.drawLine(posX, inLineY, posX + width / 2, inLineY);
+               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"));
-               double outputHeight = posY;
+               double outputHeight = 0;
                for (int i = 0; i < logicWidth; i++, outputHeight += 10)
                {
                        c = BitVectorFormatter.formatAsColor(outputEnds[i]);
                        if (c != null)
                                gc.setForeground(ColorManager.current().toColor(c));
-                       gc.drawLine(posX + width / 2, outputHeight, posX + width, outputHeight);
+                       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"));
                int oldLineCap = gc.getLineCap();
@@ -76,7 +86,8 @@ public class ModelSplitter extends ModelComponent
                // TODO find better "replacement" for JOIN_BEVEL
                // TODO it looks weird that the vertical line is thinner than the single multibit wire.
                gc.setLineCap(lineJoin == SWT.JOIN_MITER ? SWT.CAP_SQUARE : lineJoin == SWT.JOIN_ROUND ? SWT.CAP_ROUND : SWT.CAP_SQUARE);
-               gc.drawLine(posX + width / 2, posY, posX + width / 2, posY + heightPerPin * (logicWidth - 1));
+               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.setLineCap(oldLineCap);
        }
@@ -88,9 +99,12 @@ public class ModelSplitter extends ModelComponent
        }
 
        @Override
-       public Integer getParamsForSerializing(IdentifyParams idParams)
+       public SplitterParams getParamsForSerializing(IdentifyParams idParams)
        {
-               return logicWidth;
+               SplitterParams splitterParams = new SplitterParams();
+               splitterParams.logicWidth = logicWidth;
+               splitterParams.orientation = toggleLeftDownAlt(oc.getOrientation());
+               return splitterParams;
        }
 
        public void setCoreModelBinding(ReadEnd inputEnd, ReadEnd[] outputEnds)
@@ -104,10 +118,48 @@ public class ModelSplitter extends ModelComponent
                return inputPin;
        }
 
+       /**
+        * Used to leave bit order intuitive (MSB left or on top)
+        */
+       private static Orientation toggleLeftDownAlt(Orientation orientation)
+       {
+               // TODO if we upgrade to Java 12, replace with switch-expression
+               switch (orientation)
+               {
+               case LEFT:
+                       return Orientation.LEFT_ALT;
+               case LEFT_ALT:
+                       return Orientation.LEFT;
+               case DOWN:
+                       return Orientation.DOWN_ALT;
+               case DOWN_ALT:
+                       return Orientation.DOWN;
+               default:
+                       return orientation;
+               }
+       }
+
+       public static class SplitterParams
+       {
+               public int logicWidth;
+               public Orientation orientation;
+       }
+
        static
        {
                LogicCoreAdapter.addComponentAdapter(new SplitterAdapter());
-               IndirectModelComponentCreator.setComponentSupplier(ModelSplitter.class.getCanonicalName(),
-                               (m, p, n) -> new ModelSplitter(m, p.getAsInt(), n));
+               IndirectModelComponentCreator.setComponentSupplier(ModelSplitter.class.getCanonicalName(), (m, p, n) ->
+               {
+                       // TODO remove legacy params parsing
+                       SplitterParams params;
+                       if (p.isJsonPrimitive())
+                       {
+                               params = new SplitterParams();
+                               params.logicWidth = p.getAsInt();
+                               params.orientation = Orientation.RIGHT;
+                       } else
+                               params = JsonHandler.fromJsonTree(p, SplitterParams.class);
+                       return new ModelSplitter(m, params, n);
+               });
        }
 }
\ No newline at end of file
index 5aa5e38..9388e2f 100644 (file)
@@ -167,7 +167,7 @@ public abstract class SubmodelComponent extends ModelComponent
                default:
                        throw new IllegalArgumentException("Unknown enum constant: " + supermodelPin.usage);
                }
-               MovablePin submodelPin = new MovablePin(model, submodelInterface, name, supermodelPin.logicWidth, submodelPinUsage,
+               MovablePin submodelPin = new MovablePin(submodelModifiable, submodelInterface, name, supermodelPin.logicWidth, submodelPinUsage,
                                supermodelPin.getRelX() / submodelScale, supermodelPin.getRelY() / submodelScale);
 
                submodelPin.addPinMovedListener(p ->