From: Daniel Kirschten Date: Mon, 4 May 2020 21:26:27 +0000 (+0200) Subject: Created a gate-based implementation of ram5_12 X-Git-Url: https://mograsim.net/gitweb/?p=Mograsim.git;a=commitdiff_plain;h=b68a864134f57856066d810dd3fa19fe83b2b22d Created a gate-based implementation of ram5_12 --- diff --git a/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/and51.json b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/and51.json new file mode 100644 index 00000000..18806d6a --- /dev/null +++ b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/and51.json @@ -0,0 +1,438 @@ +{ + "width": 15.0, + "height": 60.0, + "interfacePins": [ + { + "location": { + "x": 0.0, + "y": 5.0 + }, + "name": "A1", + "logicWidth": 1, + "usage": "INPUT" + }, + { + "location": { + "x": 0.0, + "y": 15.0 + }, + "name": "A2", + "logicWidth": 1, + "usage": "INPUT" + }, + { + "location": { + "x": 0.0, + "y": 25.0 + }, + "name": "A3", + "logicWidth": 1, + "usage": "INPUT" + }, + { + "location": { + "x": 0.0, + "y": 35.0 + }, + "name": "A4", + "logicWidth": 1, + "usage": "INPUT" + }, + { + "location": { + "x": 0.0, + "y": 45.0 + }, + "name": "A5", + "logicWidth": 1, + "usage": "INPUT" + }, + { + "location": { + "x": 0.0, + "y": 55.0 + }, + "name": "B", + "logicWidth": 1, + "usage": "INPUT" + }, + { + "location": { + "x": 15.0, + "y": 5.0 + }, + "name": "Y1", + "logicWidth": 1, + "usage": "OUTPUT" + }, + { + "location": { + "x": 15.0, + "y": 15.0 + }, + "name": "Y2", + "logicWidth": 1, + "usage": "OUTPUT" + }, + { + "location": { + "x": 15.0, + "y": 25.0 + }, + "name": "Y3", + "logicWidth": 1, + "usage": "OUTPUT" + }, + { + "location": { + "x": 15.0, + "y": 35.0 + }, + "name": "Y4", + "logicWidth": 1, + "usage": "OUTPUT" + }, + { + "location": { + "x": 15.0, + "y": 45.0 + }, + "name": "Y5", + "logicWidth": 1, + "usage": "OUTPUT" + } + ], + "innerScale": 0.4, + "submodel": { + "components": [ + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#0", + "pos": { + "x": 4.0, + "y": 46.5 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#1", + "pos": { + "x": 4.0, + "y": 71.5 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#2", + "pos": { + "x": 4.0, + "y": 96.5 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#3", + "pos": { + "x": 4.0, + "y": 121.5 + }, + "params": 1 + }, + { + "id": "and", + "name": "and#0", + "pos": { + "x": 7.5, + "y": 7.5 + } + }, + { + "id": "and", + "name": "and#1", + "pos": { + "x": 7.5, + "y": 32.5 + } + }, + { + "id": "and", + "name": "and#2", + "pos": { + "x": 7.5, + "y": 57.5 + } + }, + { + "id": "and", + "name": "and#3", + "pos": { + "x": 7.5, + "y": 82.5 + } + }, + { + "id": "and", + "name": "and#4", + "pos": { + "x": 7.5, + "y": 107.5 + } + } + ], + "wires": [ + { + "pin1": { + "compName": "_submodelinterface", + "pinName": "A1" + }, + "pin2": { + "compName": "and#0", + "pinName": "A" + }, + "name": "unnamedWire#0", + "path": [] + }, + { + "pin1": { + "compName": "_submodelinterface", + "pinName": "A2" + }, + "pin2": { + "compName": "and#1", + "pinName": "A" + }, + "name": "unnamedWire#1", + "path": [] + }, + { + "pin1": { + "compName": "_submodelinterface", + "pinName": "A3" + }, + "pin2": { + "compName": "and#2", + "pinName": "A" + }, + "name": "unnamedWire#2", + "path": [] + }, + { + "pin1": { + "compName": "_submodelinterface", + "pinName": "A4" + }, + "pin2": { + "compName": "and#3", + "pinName": "A" + }, + "name": "unnamedWire#3", + "path": [] + }, + { + "pin1": { + "compName": "_submodelinterface", + "pinName": "B" + }, + "pin2": { + "compName": "WireCrossPoint#3", + "pinName": "" + }, + "name": "unnamedWire#4", + "path": [ + { + "x": 5.0, + "y": 137.5 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#2", + "pinName": "" + }, + "pin2": { + "compName": "and#3", + "pinName": "B" + }, + "name": "unnamedWire#5", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#2", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#1", + "pinName": "" + }, + "name": "unnamedWire#6", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#1", + "pinName": "" + }, + "pin2": { + "compName": "and#2", + "pinName": "B" + }, + "name": "unnamedWire#7", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#1", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#0", + "pinName": "" + }, + "name": "unnamedWire#8", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#0", + "pinName": "" + }, + "pin2": { + "compName": "and#1", + "pinName": "B" + }, + "name": "unnamedWire#9", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#0", + "pinName": "" + }, + "pin2": { + "compName": "and#0", + "pinName": "B" + }, + "name": "unnamedWire#10", + "path": [ + { + "x": 5.0, + "y": 22.5 + } + ] + }, + { + "pin1": { + "compName": "and#0", + "pinName": "Y" + }, + "pin2": { + "compName": "_submodelinterface", + "pinName": "Y1" + }, + "name": "unnamedWire#11", + "path": [] + }, + { + "pin1": { + "compName": "and#1", + "pinName": "Y" + }, + "pin2": { + "compName": "_submodelinterface", + "pinName": "Y2" + }, + "name": "unnamedWire#12", + "path": [] + }, + { + "pin1": { + "compName": "and#2", + "pinName": "Y" + }, + "pin2": { + "compName": "_submodelinterface", + "pinName": "Y3" + }, + "name": "unnamedWire#13", + "path": [] + }, + { + "pin1": { + "compName": "and#3", + "pinName": "Y" + }, + "pin2": { + "compName": "_submodelinterface", + "pinName": "Y4" + }, + "name": "unnamedWire#14", + "path": [] + }, + { + "pin1": { + "compName": "_submodelinterface", + "pinName": "A5" + }, + "pin2": { + "compName": "and#4", + "pinName": "A" + }, + "name": "unnamedWire#15", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#3", + "pinName": "" + }, + "pin2": { + "compName": "and#4", + "pinName": "B" + }, + "name": "unnamedWire#16", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#3", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#2", + "pinName": "" + }, + "name": "unnamedWire#17", + "path": [] + }, + { + "pin1": { + "compName": "and#4", + "pinName": "Y" + }, + "pin2": { + "compName": "_submodelinterface", + "pinName": "Y5" + }, + "name": "unnamedWire#18", + "path": [] + } + ], + "version": "0.1.1" + }, + "symbolRendererSnippetID": "simpleRectangularLike", + "symbolRendererParams": { + "centerText": "and51", + "centerTextHeight": 5.0, + "horizontalComponentCenter": 17.5, + "pinLabelHeight": 3.5, + "pinLabelMargin": 0.5 + }, + "outlineRendererSnippetID": "default", + "highLevelStateHandlerSnippetID": "default", + "version": "0.1.5" +} \ No newline at end of file diff --git a/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff12_we.json b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff12_we.json new file mode 100644 index 00000000..0ec19753 --- /dev/null +++ b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff12_we.json @@ -0,0 +1,1313 @@ +{ + "width": 55.0, + "height": 45.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": 12, + "usage": "INPUT" + }, + { + "location": { + "x": 55.0, + "y": 20.0 + }, + "name": "Q", + "logicWidth": 12, + "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": 70.0, + "y": 45.0 + }, + "params": { + "logicWidth": 12, + "orientation": "RIGHT" + } + }, + { + "id": "Splitter", + "name": "Splitter#1", + "pos": { + "x": 255.0, + "y": 45.0 + }, + "params": { + "logicWidth": 12, + "orientation": "LEFT" + } + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#0", + "pos": { + "x": 124.0, + "y": 24.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#1", + "pos": { + "x": 124.0, + "y": 54.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#2", + "pos": { + "x": 124.0, + "y": 114.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#3", + "pos": { + "x": 124.0, + "y": 144.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#4", + "pos": { + "x": 124.0, + "y": 84.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#5", + "pos": { + "x": 269.0, + "y": 99.0 + }, + "params": 12 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#6", + "pos": { + "x": 179.0, + "y": 74.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#7", + "pos": { + "x": 179.0, + "y": 164.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#8", + "pos": { + "x": 179.0, + "y": 44.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#9", + "pos": { + "x": 179.0, + "y": 104.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#10", + "pos": { + "x": 179.0, + "y": 134.0 + }, + "params": 1 + }, + { + "id": "dff", + "name": "dff#0", + "pos": { + "x": 185.0, + "y": 30.0 + } + }, + { + "id": "dff", + "name": "dff#1", + "pos": { + "x": 185.0, + "y": 60.0 + } + }, + { + "id": "dff", + "name": "dff#2", + "pos": { + "x": 130.0, + "y": 10.0 + } + }, + { + "id": "dff", + "name": "dff#3", + "pos": { + "x": 130.0, + "y": 40.0 + } + }, + { + "id": "dff", + "name": "dff#4", + "pos": { + "x": 130.0, + "y": 70.0 + } + }, + { + "id": "dff", + "name": "dff#5", + "pos": { + "x": 185.0, + "y": 150.0 + } + }, + { + "id": "dff", + "name": "dff#6", + "pos": { + "x": 185.0, + "y": 180.0 + } + }, + { + "id": "dff", + "name": "dff#7", + "pos": { + "x": 130.0, + "y": 160.0 + } + }, + { + "id": "dff", + "name": "dff#8", + "pos": { + "x": 130.0, + "y": 130.0 + } + }, + { + "id": "dff", + "name": "dff#9", + "pos": { + "x": 185.0, + "y": 90.0 + } + }, + { + "id": "dff", + "name": "dff#10", + "pos": { + "x": 185.0, + "y": 120.0 + } + }, + { + "id": "dff", + "name": "dff#11", + "pos": { + "x": 130.0, + "y": 100.0 + } + }, + { + "id": "mux1_12", + "name": "mux1_12#0", + "pos": { + "x": 15.0, + "y": 70.0 + } + } + ], + "wires": [ + { + "pin1": { + "compName": "WireCrossPoint#0", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#8", + "pinName": "" + }, + "name": "unnamedWire#0", + "path": [ + { + "x": 125.0, + "y": 5.0 + }, + { + "x": 180.0, + "y": 5.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#0", + "pinName": "" + }, + "pin2": { + "compName": "_submodelinterface", + "pinName": "C" + }, + "name": "unnamedWire#1", + "path": [] + }, + { + "pin1": { + "compName": "mux1_12#0", + "pinName": "Y" + }, + "pin2": { + "compName": "Splitter#0", + "pinName": "I" + }, + "name": "unnamedWire#2", + "path": [] + }, + { + "pin1": { + "compName": "mux1_12#0", + "pinName": "I0" + }, + "pin2": { + "compName": "WireCrossPoint#5", + "pinName": "" + }, + "name": "unnamedWire#3", + "path": [ + { + "x": 10.0, + "y": 90.0 + }, + { + "x": 10.0, + "y": 205.0 + }, + { + "x": 270.0, + "y": 205.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#0", + "pinName": "O11" + }, + "pin2": { + "compName": "dff#2", + "pinName": "D" + }, + "name": "unnamedWire#4", + "path": [ + { + "x": 85.0, + "y": 45.0 + }, + { + "x": 85.0, + "y": 15.0 + } + ] + }, + { + "pin1": { + "compName": "dff#0", + "pinName": "D" + }, + "pin2": { + "compName": "Splitter#0", + "pinName": "O10" + }, + "name": "unnamedWire#5", + "path": [ + { + "x": 90.0, + "y": 35.0 + }, + { + "x": 90.0, + "y": 55.0 + } + ] + }, + { + "pin1": { + "compName": "dff#3", + "pinName": "D" + }, + "pin2": { + "compName": "Splitter#0", + "pinName": "O9" + }, + "name": "unnamedWire#6", + "path": [ + { + "x": 95.0, + "y": 45.0 + }, + { + "x": 95.0, + "y": 65.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#0", + "pinName": "O8" + }, + "pin2": { + "compName": "dff#1", + "pinName": "D" + }, + "name": "unnamedWire#7", + "path": [ + { + "x": 100.0, + "y": 75.0 + }, + { + "x": 100.0, + "y": 65.0 + } + ] + }, + { + "pin1": { + "compName": "dff#4", + "pinName": "D" + }, + "pin2": { + "compName": "Splitter#0", + "pinName": "O7" + }, + "name": "unnamedWire#8", + "path": [ + { + "x": 105.0, + "y": 75.0 + }, + { + "x": 105.0, + "y": 85.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#0", + "pinName": "O6" + }, + "pin2": { + "compName": "dff#9", + "pinName": "D" + }, + "name": "unnamedWire#9", + "path": [] + }, + { + "pin1": { + "compName": "dff#11", + "pinName": "D" + }, + "pin2": { + "compName": "Splitter#0", + "pinName": "O5" + }, + "name": "unnamedWire#10", + "path": [] + }, + { + "pin1": { + "compName": "Splitter#0", + "pinName": "O4" + }, + "pin2": { + "compName": "dff#10", + "pinName": "D" + }, + "name": "unnamedWire#11", + "path": [ + { + "x": 115.0, + "y": 115.0 + }, + { + "x": 115.0, + "y": 125.0 + } + ] + }, + { + "pin1": { + "compName": "dff#8", + "pinName": "D" + }, + "pin2": { + "compName": "Splitter#0", + "pinName": "O3" + }, + "name": "unnamedWire#12", + "path": [ + { + "x": 110.0, + "y": 135.0 + }, + { + "x": 110.0, + "y": 125.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#0", + "pinName": "O2" + }, + "pin2": { + "compName": "dff#5", + "pinName": "D" + }, + "name": "unnamedWire#13", + "path": [ + { + "x": 105.0, + "y": 135.0 + }, + { + "x": 105.0, + "y": 155.0 + } + ] + }, + { + "pin1": { + "compName": "dff#7", + "pinName": "D" + }, + "pin2": { + "compName": "Splitter#0", + "pinName": "O1" + }, + "name": "unnamedWire#14", + "path": [ + { + "x": 100.0, + "y": 165.0 + }, + { + "x": 100.0, + "y": 145.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#0", + "pinName": "O0" + }, + "pin2": { + "compName": "dff#6", + "pinName": "D" + }, + "name": "unnamedWire#15", + "path": [ + { + "x": 95.0, + "y": 155.0 + }, + { + "x": 95.0, + "y": 185.0 + } + ] + }, + { + "pin1": { + "compName": "_submodelinterface", + "pinName": "WE" + }, + "pin2": { + "compName": "mux1_12#0", + "pinName": "S" + }, + "name": "unnamedWire#16", + "path": [ + { + "x": 5.0, + "y": 100.0 + }, + { + "x": 5.0, + "y": 75.0 + } + ] + }, + { + "pin1": { + "compName": "_submodelinterface", + "pinName": "D" + }, + "pin2": { + "compName": "mux1_12#0", + "pinName": "I1" + }, + "name": "unnamedWire#17", + "path": [ + { + "x": 5.0, + "y": 175.0 + }, + { + "x": 5.0, + "y": 130.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#0", + "pinName": "" + }, + "pin2": { + "compName": "dff#2", + "pinName": "C" + }, + "name": "unnamedWire#18", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#0", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#1", + "pinName": "" + }, + "name": "unnamedWire#19", + "path": [] + }, + { + "pin1": { + "compName": "dff#3", + "pinName": "C" + }, + "pin2": { + "compName": "WireCrossPoint#1", + "pinName": "" + }, + "name": "unnamedWire#20", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#1", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#4", + "pinName": "" + }, + "name": "unnamedWire#21", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#4", + "pinName": "" + }, + "pin2": { + "compName": "dff#4", + "pinName": "C" + }, + "name": "unnamedWire#22", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#4", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#2", + "pinName": "" + }, + "name": "unnamedWire#23", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#2", + "pinName": "" + }, + "pin2": { + "compName": "dff#11", + "pinName": "C" + }, + "name": "unnamedWire#24", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#2", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#3", + "pinName": "" + }, + "name": "unnamedWire#25", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#3", + "pinName": "" + }, + "pin2": { + "compName": "dff#8", + "pinName": "C" + }, + "name": "unnamedWire#26", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#3", + "pinName": "" + }, + "pin2": { + "compName": "dff#7", + "pinName": "C" + }, + "name": "unnamedWire#27", + "path": [ + { + "x": 125.0, + "y": 175.0 + } + ] + }, + { + "pin1": { + "compName": "dff#6", + "pinName": "C" + }, + "pin2": { + "compName": "WireCrossPoint#7", + "pinName": "" + }, + "name": "unnamedWire#28", + "path": [ + { + "x": 180.0, + "y": 195.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#7", + "pinName": "" + }, + "pin2": { + "compName": "dff#5", + "pinName": "C" + }, + "name": "unnamedWire#29", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#7", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#10", + "pinName": "" + }, + "name": "unnamedWire#30", + "path": [] + }, + { + "pin1": { + "compName": "dff#10", + "pinName": "C" + }, + "pin2": { + "compName": "WireCrossPoint#10", + "pinName": "" + }, + "name": "unnamedWire#31", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#9", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#10", + "pinName": "" + }, + "name": "unnamedWire#32", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#9", + "pinName": "" + }, + "pin2": { + "compName": "dff#9", + "pinName": "C" + }, + "name": "unnamedWire#33", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#9", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#6", + "pinName": "" + }, + "name": "unnamedWire#34", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#6", + "pinName": "" + }, + "pin2": { + "compName": "dff#1", + "pinName": "C" + }, + "name": "unnamedWire#35", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#8", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#6", + "pinName": "" + }, + "name": "unnamedWire#36", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#8", + "pinName": "" + }, + "pin2": { + "compName": "dff#0", + "pinName": "C" + }, + "name": "unnamedWire#37", + "path": [] + }, + { + "pin1": { + "compName": "Splitter#1", + "pinName": "O11" + }, + "pin2": { + "compName": "dff#2", + "pinName": "Q" + }, + "name": "unnamedWire#38", + "path": [ + { + "x": 250.0, + "y": 45.0 + }, + { + "x": 250.0, + "y": 25.0 + }, + { + "x": 170.0, + "y": 25.0 + }, + { + "x": 170.0, + "y": 15.0 + } + ] + }, + { + "pin1": { + "compName": "dff#0", + "pinName": "Q" + }, + "pin2": { + "compName": "Splitter#1", + "pinName": "O10" + }, + "name": "unnamedWire#39", + "path": [ + { + "x": 240.0, + "y": 35.0 + }, + { + "x": 240.0, + "y": 55.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#1", + "pinName": "O9" + }, + "pin2": { + "compName": "dff#3", + "pinName": "Q" + }, + "name": "unnamedWire#40", + "path": [ + { + "x": 235.0, + "y": 65.0 + }, + { + "x": 235.0, + "y": 55.0 + }, + { + "x": 170.0, + "y": 55.0 + }, + { + "x": 170.0, + "y": 45.0 + } + ] + }, + { + "pin1": { + "compName": "dff#1", + "pinName": "Q" + }, + "pin2": { + "compName": "Splitter#1", + "pinName": "O8" + }, + "name": "unnamedWire#41", + "path": [ + { + "x": 230.0, + "y": 65.0 + }, + { + "x": 230.0, + "y": 75.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#1", + "pinName": "O7" + }, + "pin2": { + "compName": "dff#4", + "pinName": "Q" + }, + "name": "unnamedWire#42", + "path": [ + { + "x": 170.0, + "y": 85.0 + }, + { + "x": 170.0, + "y": 75.0 + } + ] + }, + { + "pin1": { + "compName": "dff#9", + "pinName": "Q" + }, + "pin2": { + "compName": "Splitter#1", + "pinName": "O6" + }, + "name": "unnamedWire#43", + "path": [] + }, + { + "pin1": { + "compName": "Splitter#1", + "pinName": "O5" + }, + "pin2": { + "compName": "dff#11", + "pinName": "Q" + }, + "name": "unnamedWire#44", + "path": [ + { + "x": 225.0, + "y": 105.0 + }, + { + "x": 225.0, + "y": 115.0 + }, + { + "x": 170.0, + "y": 115.0 + }, + { + "x": 170.0, + "y": 105.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#1", + "pinName": "O4" + }, + "pin2": { + "compName": "dff#10", + "pinName": "Q" + }, + "name": "unnamedWire#45", + "path": [ + { + "x": 230.0, + "y": 115.0 + }, + { + "x": 230.0, + "y": 125.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#1", + "pinName": "O3" + }, + "pin2": { + "compName": "dff#8", + "pinName": "Q" + }, + "name": "unnamedWire#46", + "path": [ + { + "x": 235.0, + "y": 125.0 + }, + { + "x": 235.0, + "y": 145.0 + }, + { + "x": 170.0, + "y": 145.0 + }, + { + "x": 170.0, + "y": 135.0 + } + ] + }, + { + "pin1": { + "compName": "dff#5", + "pinName": "Q" + }, + "pin2": { + "compName": "Splitter#1", + "pinName": "O2" + }, + "name": "unnamedWire#47", + "path": [ + { + "x": 240.0, + "y": 155.0 + }, + { + "x": 240.0, + "y": 135.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#1", + "pinName": "O1" + }, + "pin2": { + "compName": "dff#7", + "pinName": "Q" + }, + "name": "unnamedWire#48", + "path": [ + { + "x": 245.0, + "y": 145.0 + }, + { + "x": 245.0, + "y": 175.0 + }, + { + "x": 170.0, + "y": 175.0 + }, + { + "x": 170.0, + "y": 165.0 + } + ] + }, + { + "pin1": { + "compName": "dff#6", + "pinName": "Q" + }, + "pin2": { + "compName": "Splitter#1", + "pinName": "O0" + }, + "name": "unnamedWire#49", + "path": [ + { + "x": 250.0, + "y": 185.0 + }, + { + "x": 250.0, + "y": 155.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#1", + "pinName": "I" + }, + "pin2": { + "compName": "WireCrossPoint#5", + "pinName": "" + }, + "name": "unnamedWire#50", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#5", + "pinName": "" + }, + "pin2": { + "compName": "_submodelinterface", + "pinName": "Q" + }, + "name": "unnamedWire#51", + "path": [] + } + ], + "version": "0.1.1" + }, + "symbolRendererSnippetID": "simpleRectangularLike", + "symbolRendererParams": { + "centerText": "D flip flop\n12 bit", + "centerTextHeight": 5.0, + "horizontalComponentCenter": 30.0, + "pinLabelHeight": 3.5, + "pinLabelMargin": 0.5 + }, + "outlineRendererSnippetID": "default", + "highLevelStateHandlerSnippetID": "standard", + "highLevelStateHandlerParams": { + "subcomponentHighLevelStates": {}, + "atomicHighLevelStates": { + "q": { + "id": "bitVectorSplitting", + "params": { + "vectorPartTargets": [ + "q12", + "q11", + "q10", + "q9", + "q8", + "q7", + "q6", + "q5", + "q4", + "q3", + "q2", + "q1" + ], + "vectorPartLengthes": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ] + } + }, + "q1": { + "id": "delegating", + "params": { + "delegateTarget": "dff#6", + "subStateID": "q" + } + }, + "q2": { + "id": "delegating", + "params": { + "delegateTarget": "dff#7", + "subStateID": "q" + } + }, + "q3": { + "id": "delegating", + "params": { + "delegateTarget": "dff#5", + "subStateID": "q" + } + }, + "q4": { + "id": "delegating", + "params": { + "delegateTarget": "dff#8", + "subStateID": "q" + } + }, + "q5": { + "id": "delegating", + "params": { + "delegateTarget": "dff#10", + "subStateID": "q" + } + }, + "q6": { + "id": "delegating", + "params": { + "delegateTarget": "dff#11", + "subStateID": "q" + } + }, + "q7": { + "id": "delegating", + "params": { + "delegateTarget": "dff#9", + "subStateID": "q" + } + }, + "q8": { + "id": "delegating", + "params": { + "delegateTarget": "dff#4", + "subStateID": "q" + } + }, + "q9": { + "id": "delegating", + "params": { + "delegateTarget": "dff#1", + "subStateID": "q" + } + }, + "q10": { + "id": "delegating", + "params": { + "delegateTarget": "dff#3", + "subStateID": "q" + } + }, + "q11": { + "id": "delegating", + "params": { + "delegateTarget": "dff#0", + "subStateID": "q" + } + }, + "q12": { + "id": "delegating", + "params": { + "delegateTarget": "dff#2", + "subStateID": "q" + } + } + } + }, + "version": "0.1.5" +} \ No newline at end of file diff --git a/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/ram5_12.json b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/ram5_12.json new file mode 100644 index 00000000..c3ac86f2 --- /dev/null +++ b/plugins/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/ram5_12.json @@ -0,0 +1,1212 @@ +{ + "width": 40.0, + "height": 40.0, + "interfacePins": [ + { + "location": { + "x": 10.0, + "y": 0.0 + }, + "name": "A", + "logicWidth": 3, + "usage": "INPUT" + }, + { + "location": { + "x": 30.0, + "y": 0.0 + }, + "name": "B", + "logicWidth": 3, + "usage": "INPUT" + }, + { + "location": { + "x": 0.0, + "y": 15.0 + }, + "name": "C", + "logicWidth": 1, + "usage": "INPUT" + }, + { + "location": { + "x": 20.0, + "y": 40.0 + }, + "name": "D", + "logicWidth": 12, + "usage": "INPUT" + }, + { + "location": { + "x": 0.0, + "y": 5.0 + }, + "name": "WE", + "logicWidth": 1, + "usage": "INPUT" + }, + { + "location": { + "x": 0.0, + "y": 30.0 + }, + "name": "Y", + "logicWidth": 12, + "usage": "OUTPUT" + } + ], + "innerScale": 0.1, + "submodel": { + "components": [ + { + "id": "NandGate", + "name": "NandGate#0", + "pos": { + "x": 125.0, + "y": 20.0 + }, + "params": 1 + }, + { + "id": "Splitter", + "name": "Splitter#0", + "pos": { + "x": 195.0, + "y": 100.0 + }, + "params": { + "logicWidth": 3, + "orientation": "DOWN" + } + }, + { + "id": "Splitter", + "name": "Splitter#1", + "pos": { + "x": 15.0, + "y": 25.0 + }, + "params": { + "logicWidth": 3, + "orientation": "RIGHT" + } + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#0", + "pos": { + "x": 164.0, + "y": 134.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#1", + "pos": { + "x": 94.0, + "y": 354.0 + }, + "params": 12 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#2", + "pos": { + "x": 89.0, + "y": 174.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#3", + "pos": { + "x": 89.0, + "y": 224.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#4", + "pos": { + "x": 89.0, + "y": 274.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#5", + "pos": { + "x": 89.0, + "y": 149.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#6", + "pos": { + "x": 94.0, + "y": 304.0 + }, + "params": 12 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#7", + "pos": { + "x": 94.0, + "y": 254.0 + }, + "params": 12 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#8", + "pos": { + "x": 94.0, + "y": 204.0 + }, + "params": 12 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#9", + "pos": { + "x": 29.0, + "y": 24.0 + }, + "params": 1 + }, + { + "id": "WireCrossPoint", + "name": "WireCrossPoint#10", + "pos": { + "x": 119.0, + "y": 24.0 + }, + "params": 1 + }, + { + "id": "and51", + "name": "and51#0", + "pos": { + "x": 75.0, + "y": 30.0 + } + }, + { + "id": "and", + "name": "and#0", + "pos": { + "x": 155.0, + "y": 30.0 + } + }, + { + "id": "demux2", + "name": "demux2#0", + "pos": { + "x": 35.0, + "y": 30.0 + } + }, + { + "id": "dff12_we", + "name": "dff12_we#0", + "pos": { + "x": 100.0, + "y": 170.0 + } + }, + { + "id": "dff12_we", + "name": "dff12_we#1", + "pos": { + "x": 100.0, + "y": 220.0 + } + }, + { + "id": "dff12_we", + "name": "dff12_we#2", + "pos": { + "x": 100.0, + "y": 120.0 + } + }, + { + "id": "dff12_we", + "name": "dff12_we#3", + "pos": { + "x": 100.0, + "y": 270.0 + } + }, + { + "id": "dff12_we", + "name": "dff12_we#4", + "pos": { + "x": 100.0, + "y": 320.0 + } + }, + { + "id": "mux1_12", + "name": "mux1_12#0", + "pos": { + "x": 170.0, + "y": 130.0 + } + }, + { + "id": "mux1_12", + "name": "mux1_12#1", + "pos": { + "x": 170.0, + "y": 230.0 + } + }, + { + "id": "mux1_12", + "name": "mux1_12#2", + "pos": { + "x": 235.0, + "y": 200.0 + } + }, + { + "id": "mux1_12", + "name": "mux1_12#3", + "pos": { + "x": 300.0, + "y": 280.0 + } + } + ], + "wires": [ + { + "pin1": { + "compName": "dff12_we#2", + "pinName": "Q" + }, + "pin2": { + "compName": "mux1_12#0", + "pinName": "I0" + }, + "name": "unnamedWire#0", + "path": [ + { + "x": 160.0, + "y": 140.0 + }, + { + "x": 160.0, + "y": 150.0 + } + ] + }, + { + "pin1": { + "compName": "dff12_we#0", + "pinName": "Q" + }, + "pin2": { + "compName": "mux1_12#0", + "pinName": "I1" + }, + "name": "unnamedWire#1", + "path": [] + }, + { + "pin1": { + "compName": "dff12_we#1", + "pinName": "Q" + }, + "pin2": { + "compName": "mux1_12#1", + "pinName": "I0" + }, + "name": "unnamedWire#2", + "path": [ + { + "x": 160.0, + "y": 240.0 + }, + { + "x": 160.0, + "y": 250.0 + } + ] + }, + { + "pin1": { + "compName": "dff12_we#3", + "pinName": "Q" + }, + "pin2": { + "compName": "mux1_12#1", + "pinName": "I1" + }, + "name": "unnamedWire#3", + "path": [] + }, + { + "pin1": { + "compName": "dff12_we#4", + "pinName": "Q" + }, + "pin2": { + "compName": "mux1_12#3", + "pinName": "I1" + }, + "name": "unnamedWire#4", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#0", + "pinName": "" + }, + "pin2": { + "compName": "mux1_12#1", + "pinName": "S" + }, + "name": "unnamedWire#5", + "path": [ + { + "x": 165.0, + "y": 235.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#0", + "pinName": "" + }, + "pin2": { + "compName": "mux1_12#0", + "pinName": "S" + }, + "name": "unnamedWire#6", + "path": [] + }, + { + "pin1": { + "compName": "mux1_12#2", + "pinName": "Y" + }, + "pin2": { + "compName": "mux1_12#3", + "pinName": "I0" + }, + "name": "unnamedWire#7", + "path": [ + { + "x": 290.0, + "y": 230.0 + }, + { + "x": 290.0, + "y": 300.0 + } + ] + }, + { + "pin1": { + "compName": "mux1_12#3", + "pinName": "Y" + }, + "pin2": { + "compName": "_submodelinterface", + "pinName": "Y" + }, + "name": "unnamedWire#8", + "path": [ + { + "x": 355.0, + "y": 310.0 + }, + { + "x": 355.0, + "y": 375.0 + }, + { + "x": 40.0, + "y": 375.0 + }, + { + "x": 40.0, + "y": 300.0 + } + ] + }, + { + "pin1": { + "compName": "_submodelinterface", + "pinName": "A" + }, + "pin2": { + "compName": "Splitter#0", + "pinName": "I" + }, + "name": "unnamedWire#9", + "path": [ + { + "x": 100.0, + "y": 15.0 + }, + { + "x": 205.0, + "y": 15.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#0", + "pinName": "" + }, + "pin2": { + "compName": "Splitter#0", + "pinName": "O1" + }, + "name": "unnamedWire#10", + "path": [ + { + "x": 165.0, + "y": 120.0 + }, + { + "x": 205.0, + "y": 120.0 + } + ] + }, + { + "pin1": { + "compName": "mux1_12#2", + "pinName": "I1" + }, + "pin2": { + "compName": "mux1_12#1", + "pinName": "Y" + }, + "name": "unnamedWire#11", + "path": [] + }, + { + "pin1": { + "compName": "Splitter#0", + "pinName": "O0" + }, + "pin2": { + "compName": "mux1_12#2", + "pinName": "S" + }, + "name": "unnamedWire#12", + "path": [ + { + "x": 215.0, + "y": 120.0 + }, + { + "x": 230.0, + "y": 120.0 + }, + { + "x": 230.0, + "y": 205.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#0", + "pinName": "O2" + }, + "pin2": { + "compName": "mux1_12#3", + "pinName": "S" + }, + "name": "unnamedWire#13", + "path": [ + { + "x": 195.0, + "y": 115.0 + }, + { + "x": 295.0, + "y": 115.0 + }, + { + "x": 295.0, + "y": 285.0 + } + ] + }, + { + "pin1": { + "compName": "demux2#0", + "pinName": "Y00" + }, + "pin2": { + "compName": "and51#0", + "pinName": "A1" + }, + "name": "unnamedWire#14", + "path": [] + }, + { + "pin1": { + "compName": "dff12_we#4", + "pinName": "C" + }, + "pin2": { + "compName": "WireCrossPoint#4", + "pinName": "" + }, + "name": "unnamedWire#15", + "path": [ + { + "x": 90.0, + "y": 325.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#4", + "pinName": "" + }, + "pin2": { + "compName": "dff12_we#3", + "pinName": "C" + }, + "name": "unnamedWire#16", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#4", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#3", + "pinName": "" + }, + "name": "unnamedWire#17", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#3", + "pinName": "" + }, + "pin2": { + "compName": "dff12_we#1", + "pinName": "C" + }, + "name": "unnamedWire#18", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#2", + "pinName": "" + }, + "pin2": { + "compName": "dff12_we#0", + "pinName": "C" + }, + "name": "unnamedWire#19", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#2", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#3", + "pinName": "" + }, + "name": "unnamedWire#20", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#5", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#2", + "pinName": "" + }, + "name": "unnamedWire#21", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#5", + "pinName": "" + }, + "pin2": { + "compName": "dff12_we#2", + "pinName": "C" + }, + "name": "unnamedWire#22", + "path": [ + { + "x": 90.0, + "y": 125.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#5", + "pinName": "" + }, + "pin2": { + "compName": "_submodelinterface", + "pinName": "C" + }, + "name": "unnamedWire#23", + "path": [] + }, + { + "pin1": { + "compName": "and51#0", + "pinName": "A2" + }, + "pin2": { + "compName": "demux2#0", + "pinName": "Y01" + }, + "name": "unnamedWire#24", + "path": [] + }, + { + "pin1": { + "compName": "demux2#0", + "pinName": "Y10" + }, + "pin2": { + "compName": "and51#0", + "pinName": "A3" + }, + "name": "unnamedWire#25", + "path": [] + }, + { + "pin1": { + "compName": "and51#0", + "pinName": "A4" + }, + "pin2": { + "compName": "demux2#0", + "pinName": "Y11" + }, + "name": "unnamedWire#26", + "path": [] + }, + { + "pin1": { + "compName": "_submodelinterface", + "pinName": "B" + }, + "pin2": { + "compName": "Splitter#1", + "pinName": "I" + }, + "name": "unnamedWire#27", + "path": [ + { + "x": 300.0, + "y": 10.0 + }, + { + "x": 10.0, + "y": 10.0 + }, + { + "x": 10.0, + "y": 35.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#1", + "pinName": "O1" + }, + "pin2": { + "compName": "demux2#0", + "pinName": "S0" + }, + "name": "unnamedWire#28", + "path": [] + }, + { + "pin1": { + "compName": "Splitter#1", + "pinName": "O0" + }, + "pin2": { + "compName": "demux2#0", + "pinName": "S1" + }, + "name": "unnamedWire#29", + "path": [] + }, + { + "pin1": { + "compName": "and51#0", + "pinName": "B" + }, + "pin2": { + "compName": "_submodelinterface", + "pinName": "WE" + }, + "name": "unnamedWire#30", + "path": [ + { + "x": 20.0, + "y": 85.0 + }, + { + "x": 20.0, + "y": 50.0 + } + ] + }, + { + "pin1": { + "compName": "and51#0", + "pinName": "Y1" + }, + "pin2": { + "compName": "and#0", + "pinName": "B" + }, + "name": "unnamedWire#31", + "path": [ + { + "x": 115.0, + "y": 35.0 + }, + { + "x": 115.0, + "y": 45.0 + } + ] + }, + { + "pin1": { + "compName": "and51#0", + "pinName": "Y2" + }, + "pin2": { + "compName": "dff12_we#0", + "pinName": "WE" + }, + "name": "unnamedWire#32", + "path": [ + { + "x": 110.0, + "y": 45.0 + }, + { + "x": 110.0, + "y": 110.0 + }, + { + "x": 80.0, + "y": 110.0 + }, + { + "x": 80.0, + "y": 190.0 + } + ] + }, + { + "pin1": { + "compName": "dff12_we#1", + "pinName": "WE" + }, + "pin2": { + "compName": "and51#0", + "pinName": "Y3" + }, + "name": "unnamedWire#33", + "path": [ + { + "x": 75.0, + "y": 240.0 + }, + { + "x": 75.0, + "y": 105.0 + }, + { + "x": 105.0, + "y": 105.0 + }, + { + "x": 105.0, + "y": 55.0 + } + ] + }, + { + "pin1": { + "compName": "and51#0", + "pinName": "Y4" + }, + "pin2": { + "compName": "dff12_we#3", + "pinName": "WE" + }, + "name": "unnamedWire#34", + "path": [ + { + "x": 100.0, + "y": 65.0 + }, + { + "x": 100.0, + "y": 100.0 + }, + { + "x": 70.0, + "y": 100.0 + }, + { + "x": 70.0, + "y": 290.0 + } + ] + }, + { + "pin1": { + "compName": "dff12_we#4", + "pinName": "WE" + }, + "pin2": { + "compName": "and51#0", + "pinName": "Y5" + }, + "name": "unnamedWire#35", + "path": [ + { + "x": 65.0, + "y": 340.0 + }, + { + "x": 65.0, + "y": 95.0 + }, + { + "x": 95.0, + "y": 95.0 + }, + { + "x": 95.0, + "y": 75.0 + } + ] + }, + { + "pin1": { + "compName": "_submodelinterface", + "pinName": "D" + }, + "pin2": { + "compName": "WireCrossPoint#1", + "pinName": "" + }, + "name": "unnamedWire#36", + "path": [ + { + "x": 200.0, + "y": 370.0 + }, + { + "x": 95.0, + "y": 370.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#1", + "pinName": "" + }, + "pin2": { + "compName": "dff12_we#4", + "pinName": "D" + }, + "name": "unnamedWire#37", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#1", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#6", + "pinName": "" + }, + "name": "unnamedWire#38", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#6", + "pinName": "" + }, + "pin2": { + "compName": "dff12_we#3", + "pinName": "D" + }, + "name": "unnamedWire#39", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#6", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#7", + "pinName": "" + }, + "name": "unnamedWire#40", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#7", + "pinName": "" + }, + "pin2": { + "compName": "dff12_we#1", + "pinName": "D" + }, + "name": "unnamedWire#41", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#7", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#8", + "pinName": "" + }, + "name": "unnamedWire#42", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#8", + "pinName": "" + }, + "pin2": { + "compName": "dff12_we#0", + "pinName": "D" + }, + "name": "unnamedWire#43", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#8", + "pinName": "" + }, + "pin2": { + "compName": "dff12_we#2", + "pinName": "D" + }, + "name": "unnamedWire#44", + "path": [ + { + "x": 95.0, + "y": 155.0 + } + ] + }, + { + "pin1": { + "compName": "Splitter#1", + "pinName": "O2" + }, + "pin2": { + "compName": "WireCrossPoint#9", + "pinName": "" + }, + "name": "unnamedWire#45", + "path": [] + }, + { + "pin1": { + "compName": "mux1_12#0", + "pinName": "Y" + }, + "pin2": { + "compName": "mux1_12#2", + "pinName": "I0" + }, + "name": "unnamedWire#46", + "path": [ + { + "x": 225.0, + "y": 160.0 + }, + { + "x": 225.0, + "y": 220.0 + } + ] + }, + { + "pin1": { + "compName": "and#0", + "pinName": "Y" + }, + "pin2": { + "compName": "dff12_we#2", + "pinName": "WE" + }, + "name": "unnamedWire#47", + "path": [ + { + "x": 185.0, + "y": 35.0 + }, + { + "x": 185.0, + "y": 55.0 + }, + { + "x": 115.0, + "y": 55.0 + }, + { + "x": 115.0, + "y": 115.0 + }, + { + "x": 85.0, + "y": 115.0 + }, + { + "x": 85.0, + "y": 140.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#9", + "pinName": "" + }, + "pin2": { + "compName": "and51#0", + "pinName": "A5" + }, + "name": "unnamedWire#48", + "path": [ + { + "x": 30.0, + "y": 75.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#10", + "pinName": "" + }, + "pin2": { + "compName": "NandGate#0", + "pinName": "A" + }, + "name": "unnamedWire#49", + "path": [] + }, + { + "pin1": { + "compName": "WireCrossPoint#10", + "pinName": "" + }, + "pin2": { + "compName": "NandGate#0", + "pinName": "B" + }, + "name": "unnamedWire#50", + "path": [ + { + "x": 120.0, + "y": 35.0 + } + ] + }, + { + "pin1": { + "compName": "WireCrossPoint#10", + "pinName": "" + }, + "pin2": { + "compName": "WireCrossPoint#9", + "pinName": "" + }, + "name": "unnamedWire#51", + "path": [] + }, + { + "pin1": { + "compName": "NandGate#0", + "pinName": "Y" + }, + "pin2": { + "compName": "and#0", + "pinName": "A" + }, + "name": "unnamedWire#52", + "path": [ + { + "x": 150.0, + "y": 30.0 + }, + { + "x": 150.0, + "y": 35.0 + } + ] + } + ], + "version": "0.1.1" + }, + "symbolRendererSnippetID": "simpleRectangularLike", + "symbolRendererParams": { + "centerText": "RAM\n5 x 12 Bit", + "centerTextHeight": 5.0, + "horizontalComponentCenter": 20.0, + "pinLabelHeight": 3.5, + "pinLabelMargin": 0.5 + }, + "outlineRendererSnippetID": "default", + "highLevelStateHandlerSnippetID": "default", + "version": "0.1.5" +} \ No newline at end of file diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelram5_12.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelram5_12.java deleted file mode 100644 index 36562414..00000000 --- a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/Modelram5_12.java +++ /dev/null @@ -1,131 +0,0 @@ -package net.mograsim.logic.model.am2900.components; - -import static net.mograsim.logic.core.types.Bit.ONE; -import static net.mograsim.logic.core.types.Bit.U; -import static net.mograsim.logic.core.types.Bit.X; -import static net.mograsim.logic.core.types.Bit.Z; -import static net.mograsim.logic.core.types.Bit.ZERO; - -import java.util.Arrays; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import net.mograsim.logic.core.types.Bit; -import net.mograsim.logic.core.types.BitVector; -import net.mograsim.logic.core.wires.CoreWire.ReadEnd; -import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd; -import net.mograsim.logic.model.model.LogicModelModifiable; -import net.mograsim.logic.model.model.components.atomic.SimpleRectangularHardcodedModelComponent; -import net.mograsim.logic.model.model.wires.Pin; -import net.mograsim.logic.model.model.wires.PinUsage; -import net.mograsim.logic.model.serializing.IndirectModelComponentCreator; -import net.mograsim.logic.model.snippets.symbolrenderers.PinNamesSymbolRenderer.PinNamesParams.Position; - -public class Modelram5_12 extends SimpleRectangularHardcodedModelComponent -{ - public Modelram5_12(LogicModelModifiable model, String name) - { - super(model, "ram5_12", name, "RAM\n5 x 12 Bit", false); - setSize(40, 40); - addPin(new Pin(model, this, "A", 3, PinUsage.INPUT, 10, 0), Position.BOTTOM); - addPin(new Pin(model, this, "B", 3, PinUsage.INPUT, 30, 0), Position.BOTTOM); - addPin(new Pin(model, this, "WE", 1, PinUsage.INPUT, 0, 5), Position.RIGHT); - addPin(new Pin(model, this, "C", 1, PinUsage.INPUT, 0, 15), Position.RIGHT); - addPin(new Pin(model, this, "Y", 12, PinUsage.OUTPUT, 0, 30), Position.RIGHT); - addPin(new Pin(model, this, "D", 12, PinUsage.INPUT, 20, 40), Position.TOP); - - init(); - } - - @Override - public Object recalculate(Object lastState, Map readEnds, Map readWriteEnds) - { - BitVector[] memC = castAndInitState(lastState); - - BitVector CVal = readEnds.get("C").getValues(); - BitVector oldC = memC[5]; - // TODO is the timing right? - if (oldC.getLSBit(0) == ZERO && CVal.getLSBit(0) == ONE && readEnds.get("WE").getValue() == ONE) - { - int BInt = getAsInt(readEnds.get("B").getValues()); - if (BInt == -1 || BInt > 4) - Arrays.fill(memC, BitVector.of(X, 12)); - else if (BInt == -2) - Arrays.fill(memC, BitVector.of(U, 12)); - else - memC[BInt] = readEnds.get("D").getValues(); - } - int AInt = getAsInt(readEnds.get("A").getValues()); - BitVector YVal = AInt == -1 || AInt > 4 ? BitVector.of(X, 12) : AInt == -2 ? BitVector.of(U, 12) : memC[AInt]; - readWriteEnds.get("Y").feedSignals(YVal); - memC[5] = CVal; - return memC; - } - - /** - * -1 means X, -2 means U - */ - private static int getAsInt(BitVector vect) - { - Bit[] bits = vect.getBits(); - for (int i = 0; i < 3; i++) - if (bits[i] == X) - return -1; - for (int i = 0; i < 3; i++) - if (bits[i] == U) - return -2; - for (int i = 0; i < 3; i++) - if (bits[i] == Z) - return -1; - return (bits[0] == ONE ? 4 : 0) + (bits[1] == ONE ? 2 : 0) + (bits[2] == ONE ? 1 : 0); - } - - Pattern stateIDPattern = Pattern.compile("c(0[10][10]|100).q"); - - @Override - protected Object getHighLevelState(Object state, String stateID) - { - BitVector[] memC = castAndInitState(state); - - Matcher m = stateIDPattern.matcher(stateID); - if (m.matches()) - return memC[Integer.parseInt(m.group(1), 2)]; - return super.getHighLevelState(memC, stateID); - } - - @Override - protected Object setHighLevelState(Object lastState, String stateID, Object newHighLevelState) - { - BitVector[] memC = castAndInitState(lastState); - - Matcher m = stateIDPattern.matcher(stateID); - if (m.matches()) - { - int addr = Integer.parseInt(m.group(1), 2); - BitVector newHighLevelStateCasted = (BitVector) newHighLevelState; - if (newHighLevelStateCasted.length() != 12) - throw new IllegalArgumentException("Expected BitVector of length 12, not " + newHighLevelStateCasted.length()); - memC[addr] = newHighLevelStateCasted; - return memC; - } - return super.setHighLevelState(memC, stateID, newHighLevelState); - } - - private static BitVector[] castAndInitState(Object state) - { - BitVector[] memC = (BitVector[]) state; - if (memC == null) - { - memC = new BitVector[6]; - Arrays.fill(memC, 0, 5, BitVector.of(U, 12)); - memC[5] = BitVector.of(U); - } - return memC; - } - - static - { - IndirectModelComponentCreator.setComponentSupplier(Modelram5_12.class.getCanonicalName(), (m, p, n) -> new Modelram5_12(m, n)); - } -} \ No newline at end of file diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/standardComponentIDMapping.json b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/standardComponentIDMapping.json index a3c0728f..273a74e7 100644 --- a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/standardComponentIDMapping.json +++ b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/standardComponentIDMapping.json @@ -1,7 +1,6 @@ { "Am2900MainMemory": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.ModelAm2900MainMemory", "Am2900MicroInstructionMemory": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.ModelAm2900MicroInstructionMemory", - "ram5_12": "resloader:Am2900Loader:class:net.mograsim.logic.model.am2900.components.Modelram5_12", "Am2900": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/Am2900.json", "Am2900MemoryController": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/Am2900MemoryController.json", @@ -25,6 +24,7 @@ "_rsLatch": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/_rsLatch.json", "and": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/and.json", "and41": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/and41.json", + "and51": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/and51.json", "andor414": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/andor414.json", "dec12": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dec12.json", "demux2": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/demux2.json", @@ -32,6 +32,7 @@ "dff4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff4.json", "dff4_finewe": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff4_finewe.json", "dff12": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff12.json", + "dff12_we": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff12_we.json", "dff16": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff16.json", "dff16_invwe": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dff16_invwe.json", "dlatch": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/dlatch.json", @@ -60,6 +61,7 @@ "or_4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/or_4.json", "ram2": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/ram2.json", "ram4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/ram4.json", + "ram5_12": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/ram5_12.json", "sel1": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/sel1.json", "sel2_4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/sel2_4.json", "sel3_4": "resloader:Am2900Loader:jsonres:net/mograsim/logic/model/am2900/components/sel3_4.json", diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ModelComponentTestbench.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ModelComponentTestbench.java index 658f056b..0dbbbdde 100644 --- a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ModelComponentTestbench.java +++ b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/ModelComponentTestbench.java @@ -28,7 +28,7 @@ public class ModelComponentTestbench { Am2900Loader.setup(); // ModelComponent comp = new StrictAm2900MachineDefinition().createNew(model).getAm2900(); - ModelComponent comp = IndirectModelComponentCreator.createComponent(model, "Am2904"); + ModelComponent comp = IndirectModelComponentCreator.createComponent(model, "ram5_12"); List inputPinNames = new ArrayList<>(); List outputPinNames = new ArrayList<>();