From: Fabian Stemmler Date: Mon, 17 Jun 2019 15:52:22 +0000 (+0200) Subject: Providing json examples X-Git-Url: https://mograsim.net/gitweb/?a=commitdiff_plain;h=5bbe52e7d69c17c18c5b22d5e9fce19a29e35515;p=Mograsim.git Providing json examples The format is basically finished, only the InnerComponentParams might still changed. --- diff --git a/net.mograsim.logic.ui/FullAdder.json b/net.mograsim.logic.ui/FullAdder.json new file mode 100644 index 00000000..4740f057 --- /dev/null +++ b/net.mograsim.logic.ui/FullAdder.json @@ -0,0 +1,180 @@ +{ + "type": "SimpleRectangularSubmodelComponent", + "width": 35.0, + "height": 30.0, + "interfacePins": [ + { + "location": { + "x": 0.0, + "y": 5.0 + }, + "logicWidth": 1 + }, + { + "location": { + "x": 0.0, + "y": 15.0 + }, + "logicWidth": 1 + }, + { + "location": { + "x": 0.0, + "y": 25.0 + }, + "logicWidth": 1 + }, + { + "location": { + "x": 35.0, + "y": 5.0 + }, + "logicWidth": 1 + }, + { + "location": { + "x": 35.0, + "y": 15.0 + }, + "logicWidth": 1 + } + ], + "composition": { + "innerScale": 0.4, + "subComps": [ + { + "pos": { + "x": 5.0, + "y": 40.0 + }, + "type": "class:net.mograsim.logic.ui.model.components.mi.nandbased.GUIhalfadder", + "logicWidth": 1 + }, + { + "pos": { + "x": 45.0, + "y": 7.5 + }, + "type": "class:net.mograsim.logic.ui.model.components.mi.nandbased.GUIhalfadder", + "logicWidth": 1 + }, + { + "pos": { + "x": 57.5, + "y": 40.0 + }, + "type": "class:net.mograsim.logic.ui.model.components.GUINandGate", + "logicWidth": 1 + } + ], + "innerWires": [ + { + "pin1": { + "compId": 0, + "pinIndex": 0 + }, + "pin2": { + "compId": 2, + "pinIndex": 0 + }, + "path": [] + }, + { + "pin1": { + "compId": 0, + "pinIndex": 1 + }, + "pin2": { + "compId": 1, + "pinIndex": 0 + } + }, + { + "pin1": { + "compId": 0, + "pinIndex": 2 + }, + "pin2": { + "compId": 1, + "pinIndex": 1 + } + }, + { + "pin1": { + "compId": 1, + "pinIndex": 2 + }, + "pin2": { + "compId": 2, + "pinIndex": 1 + } + }, + { + "pin1": { + "compId": 1, + "pinIndex": 3 + }, + "pin2": { + "compId": 3, + "pinIndex": 2 + }, + "path": [] + }, + { + "pin1": { + "compId": 2, + "pinIndex": 2 + }, + "pin2": { + "compId": 0, + "pinIndex": 3 + }, + "path": [] + }, + { + "pin1": { + "compId": 2, + "pinIndex": 3 + }, + "pin2": { + "compId": 3, + "pinIndex": 1 + }, + "path": [ + { + "x": 82.5, + "y": 22.5 + }, + { + "x": 82.5, + "y": 35.0 + }, + { + "x": 52.5, + "y": 35.0 + }, + { + "x": 52.5, + "y": 45.0 + } + ] + }, + { + "pin1": { + "compId": 3, + "pinIndex": 0 + }, + "pin2": { + "compId": 0, + "pinIndex": 4 + } + } + ] + }, + "specialized": { + "input_count": 3, + "label": "GUIfulladder", + "logic_width": 1, + "output_count": 2 + } +} \ No newline at end of file diff --git a/net.mograsim.logic.ui/HalfAdder.json b/net.mograsim.logic.ui/HalfAdder.json new file mode 100644 index 00000000..99fd0f4b --- /dev/null +++ b/net.mograsim.logic.ui/HalfAdder.json @@ -0,0 +1,304 @@ +{ + "type": "SimpleRectangularSubmodelComponent", + "width": 35.0, + "height": 20.0, + "interfacePins": [ + { + "location": { + "x": 0.0, + "y": 5.0 + }, + "logicWidth": 1 + }, + { + "location": { + "x": 0.0, + "y": 15.0 + }, + "logicWidth": 1 + }, + { + "location": { + "x": 35.0, + "y": 5.0 + }, + "logicWidth": 1 + }, + { + "location": { + "x": 35.0, + "y": 15.0 + }, + "logicWidth": 1 + } + ], + "composition": { + "innerScale": 0.4, + "subComps": [ + { + "pos": { + "x": 10.0, + "y": 15.0 + }, + "type": "class:net.mograsim.logic.ui.model.components.GUINandGate", + "logicWidth": 1 + }, + { + "pos": { + "x": 40.0, + "y": 2.5 + }, + "type": "class:net.mograsim.logic.ui.model.components.GUINandGate", + "logicWidth": 1 + }, + { + "pos": { + "x": 40.0, + "y": 27.5 + }, + "type": "class:net.mograsim.logic.ui.model.components.GUINandGate", + "logicWidth": 1 + }, + { + "pos": { + "x": 65.0, + "y": 2.5 + }, + "type": "class:net.mograsim.logic.ui.model.components.GUINandGate", + "logicWidth": 1 + }, + { + "pos": { + "x": 4.0, + "y": 11.5 + }, + "type": "class:net.mograsim.logic.ui.model.wires.WireCrossPoint", + "logicWidth": 1 + }, + { + "pos": { + "x": 4.0, + "y": 36.5 + }, + "type": "class:net.mograsim.logic.ui.model.wires.WireCrossPoint", + "logicWidth": 1 + }, + { + "pos": { + "x": 34.0, + "y": 24.0 + }, + "type": "class:net.mograsim.logic.ui.model.wires.WireCrossPoint", + "logicWidth": 1 + } + ], + "innerWires": [ + { + "pin1": { + "compId": 0, + "pinIndex": 0 + }, + "pin2": { + "compId": 5, + "pinIndex": 0 + }, + "path": [] + }, + { + "pin1": { + "compId": 5, + "pinIndex": 0 + }, + "pin2": { + "compId": 2, + "pinIndex": 1 + }, + "path": [ + { + "x": 5.0, + "y": 7.5 + } + ] + }, + { + "pin1": { + "compId": 5, + "pinIndex": 0 + }, + "pin2": { + "compId": 1, + "pinIndex": 1 + }, + "path": [ + { + "x": 5.0, + "y": 20.0 + } + ] + }, + { + "pin1": { + "compId": 0, + "pinIndex": 1 + }, + "pin2": { + "compId": 6, + "pinIndex": 0 + }, + "path": [] + }, + { + "pin1": { + "compId": 6, + "pinIndex": 0 + }, + "pin2": { + "compId": 3, + "pinIndex": 2 + }, + "path": [ + { + "x": 5.0, + "y": 42.5 + } + ] + }, + { + "pin1": { + "compId": 6, + "pinIndex": 0 + }, + "pin2": { + "compId": 1, + "pinIndex": 2 + }, + "path": [ + { + "x": 5.0, + "y": 30.0 + } + ] + }, + { + "pin1": { + "compId": 1, + "pinIndex": 0 + }, + "pin2": { + "compId": 7, + "pinIndex": 0 + }, + "path": [] + }, + { + "pin1": { + "compId": 7, + "pinIndex": 0 + }, + "pin2": { + "compId": 0, + "pinIndex": 3 + }, + "path": [ + { + "x": 80.0, + "y": 25.0 + }, + { + "x": 80.0, + "y": 37.5 + } + ] + }, + { + "pin1": { + "compId": 7, + "pinIndex": 0 + }, + "pin2": { + "compId": 2, + "pinIndex": 2 + }, + "path": [ + { + "x": 35.0, + "y": 17.5 + } + ] + }, + { + "pin1": { + "compId": 7, + "pinIndex": 0 + }, + "pin2": { + "compId": 3, + "pinIndex": 1 + }, + "path": [ + { + "x": 35.0, + "y": 32.5 + } + ] + }, + { + "pin1": { + "compId": 2, + "pinIndex": 0 + }, + "pin2": { + "compId": 4, + "pinIndex": 1 + }, + "path": [ + { + "x": 62.5, + "y": 12.5 + }, + { + "x": 62.5, + "y": 7.5 + } + ] + }, + { + "pin1": { + "compId": 3, + "pinIndex": 0 + }, + "pin2": { + "compId": 4, + "pinIndex": 2 + }, + "path": [ + { + "x": 62.5, + "y": 37.5 + }, + { + "x": 62.5, + "y": 17.5 + } + ] + }, + { + "pin1": { + "compId": 4, + "pinIndex": 0 + }, + "pin2": { + "compId": 0, + "pinIndex": 2 + }, + "path": [] + } + ] + }, + "specialized": { + "input_count": 2, + "label": "GUIhalfadder", + "logic_width": 1, + "output_count": 2 + } +} \ No newline at end of file diff --git a/net.mograsim.logic.ui/Test.json b/net.mograsim.logic.ui/Test.json new file mode 100644 index 00000000..4e376db1 --- /dev/null +++ b/net.mograsim.logic.ui/Test.json @@ -0,0 +1,34 @@ +{ + "type": "SimpleRectangularSubmodelComponent", + "width": 35.0, + "height": 10.0, + "interfacePins": [ + { + "location": { + "x": 0.0, + "y": 5.0 + }, + "logicWidth": 1 + } + ], + "composition": { + "innerScale": 0.4, + "subComps": [ + { + "pos": { + "x": 0.0, + "y": 0.0 + }, + "type": "file:HalfAdder.json", + "logicWidth": 1 + } + ], + "innerWires": [] + }, + "specialized": { + "input_count": 1, + "label": "Test", + "logic_width": 1, + "output_count": 0 + } +} \ No newline at end of file