Implemented set/getHighLevelState for most components
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / am2901 / GUIAm2901.java
1 package net.mograsim.logic.ui.model.components.mi.nandbased.am2901;
2
3 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
4 import net.mograsim.logic.ui.model.ViewModelModifiable;
5 import net.mograsim.logic.ui.model.components.GUINandGate;
6 import net.mograsim.logic.ui.model.components.SimpleRectangularSubmodelComponent;
7 import net.mograsim.logic.ui.model.components.mi.nandbased.GUIand;
8 import net.mograsim.logic.ui.model.components.mi.nandbased.GUIdlatch4;
9 import net.mograsim.logic.ui.model.components.mi.nandbased.GUImux1_4;
10 import net.mograsim.logic.ui.model.components.mi.nandbased.GUIor4;
11 import net.mograsim.logic.ui.model.components.mi.nandbased.GUIram4;
12 import net.mograsim.logic.ui.model.components.mi.nandbased.GUIsel3_4;
13 import net.mograsim.logic.ui.model.wires.GUIWire;
14 import net.mograsim.logic.ui.model.wires.Pin;
15 import net.mograsim.logic.ui.model.wires.WireCrossPoint;
16
17 public class GUIAm2901 extends SimpleRectangularSubmodelComponent
18 {
19         private GUIram4 ram;
20         private GUIAm2901QReg qreg;
21
22         public GUIAm2901(ViewModelModifiable model)
23         {
24                 super(model, 1, "GUIAm2901");
25                 setSubmodelScale(.1);
26                 setInputPins("I8", "I7", "I6", "I5", "I4", "I3", "I2", "I1", "I0", "C", "Cn", "D1", "D2", "D3", "D4", "A0", "A1", "A2", "A3", "B0",
27                                 "B1", "B2", "B3", "IRAMn", "IRAMn+3", "IQn", "IQn+3");
28                 setOutputPins("Y1", "Y2", "Y3", "Y4", "F=0", "Cn+4", "OVR", "F3", "ORAMn", "ORAMn+3", "OQn", "OQn+3");
29                 initSubmodelComponents();
30         }
31
32         @SuppressWarnings("unused") // for GUIWires being created
33         private void initSubmodelComponents()
34         {
35                 Pin I8 = getSubmodelPin("I8");
36                 Pin I7 = getSubmodelPin("I7");
37                 Pin I6 = getSubmodelPin("I6");
38                 Pin I5 = getSubmodelPin("I5");
39                 Pin I4 = getSubmodelPin("I4");
40                 Pin I3 = getSubmodelPin("I3");
41                 Pin I2 = getSubmodelPin("I2");
42                 Pin I1 = getSubmodelPin("I1");
43                 Pin I0 = getSubmodelPin("I0");
44                 Pin C = getSubmodelPin("C");
45                 Pin Cn = getSubmodelPin("Cn");
46                 Pin D1 = getSubmodelPin("D1");
47                 Pin D2 = getSubmodelPin("D2");
48                 Pin D3 = getSubmodelPin("D3");
49                 Pin D4 = getSubmodelPin("D4");
50                 Pin A0 = getSubmodelPin("A0");
51                 Pin A1 = getSubmodelPin("A1");
52                 Pin A2 = getSubmodelPin("A2");
53                 Pin A3 = getSubmodelPin("A3");
54                 Pin B0 = getSubmodelPin("B0");
55                 Pin B1 = getSubmodelPin("B1");
56                 Pin B2 = getSubmodelPin("B2");
57                 Pin B3 = getSubmodelPin("B3");
58                 Pin IRAMn = getSubmodelPin("IRAMn");
59                 Pin IRAMnplus3 = getSubmodelPin("IRAMn+3");
60                 Pin IQn = getSubmodelPin("IQn");
61                 Pin IQnplus3 = getSubmodelPin("IQn+3");
62                 Pin Y1 = getSubmodelPin("Y1");
63                 Pin Y2 = getSubmodelPin("Y2");
64                 Pin Y3 = getSubmodelPin("Y3");
65                 Pin Y4 = getSubmodelPin("Y4");
66                 Pin Feq0 = getSubmodelPin("F=0");
67                 Pin Cnplus4 = getSubmodelPin("Cn+4");
68                 Pin OVR = getSubmodelPin("OVR");
69                 Pin F3 = getSubmodelPin("F3");
70                 Pin ORAMn = getSubmodelPin("ORAMn");
71                 Pin ORAMnplus3 = getSubmodelPin("ORAMn+3");
72                 Pin OQn = getSubmodelPin("OQn");
73                 Pin OQnplus3 = getSubmodelPin("OQn+3");
74
75                 GUIAm2901DestDecode destDecode = new GUIAm2901DestDecode(submodelModifiable);
76                 GUImux1_4 Ymux = new GUImux1_4(submodelModifiable);
77                 GUIand ramweAnd = new GUIand(submodelModifiable);
78                 GUINandGate notC = new GUINandGate(submodelModifiable, 1);
79                 GUIAm2901ALUInclSourceDecodeInclFunctionDecode alu = new GUIAm2901ALUInclSourceDecodeInclFunctionDecode(submodelModifiable);
80                 GUIor4 Fneq0 = new GUIor4(submodelModifiable);
81                 GUINandGate notFneq0 = new GUINandGate(submodelModifiable, 1);
82                 ram = new GUIram4(submodelModifiable);
83                 GUIdlatch4 QAlatch = new GUIdlatch4(submodelModifiable);
84                 GUIdlatch4 QBlatch = new GUIdlatch4(submodelModifiable);
85                 GUIsel3_4 ramDsel = new GUIsel3_4(submodelModifiable);
86                 GUIsel3_4 qregDsel = new GUIsel3_4(submodelModifiable);
87                 qreg = new GUIAm2901QReg(submodelModifiable);
88
89                 WireCrossPoint cpC1 = new WireCrossPoint(submodelModifiable, 1);
90                 WireCrossPoint cpC2 = new WireCrossPoint(submodelModifiable, 1);
91                 WireCrossPoint cpC3 = new WireCrossPoint(submodelModifiable, 1);
92                 WireCrossPoint cpC4 = new WireCrossPoint(submodelModifiable, 1);
93                 WireCrossPoint cpLSH = new WireCrossPoint(submodelModifiable, 1);
94                 WireCrossPoint cpNSH = new WireCrossPoint(submodelModifiable, 1);
95                 WireCrossPoint cpRSH = new WireCrossPoint(submodelModifiable, 1);
96                 WireCrossPoint cpQA1 = new WireCrossPoint(submodelModifiable, 1);
97                 WireCrossPoint cpQA2 = new WireCrossPoint(submodelModifiable, 1);
98                 WireCrossPoint cpQA3 = new WireCrossPoint(submodelModifiable, 1);
99                 WireCrossPoint cpQA4 = new WireCrossPoint(submodelModifiable, 1);
100                 WireCrossPoint cpQ1 = new WireCrossPoint(submodelModifiable, 1);
101                 WireCrossPoint cpQ2 = new WireCrossPoint(submodelModifiable, 1);
102                 WireCrossPoint cpQ3 = new WireCrossPoint(submodelModifiable, 1);
103                 WireCrossPoint cpQ4 = new WireCrossPoint(submodelModifiable, 1);
104                 WireCrossPoint cpOQn = new WireCrossPoint(submodelModifiable, 1);
105                 WireCrossPoint cpOQnplus3 = new WireCrossPoint(submodelModifiable, 1);
106                 WireCrossPoint cpQ2Rsh = new WireCrossPoint(submodelModifiable, 1);
107                 WireCrossPoint cpQ3Rsh = new WireCrossPoint(submodelModifiable, 1);
108                 WireCrossPoint cpORAMn = new WireCrossPoint(submodelModifiable, 1);
109                 WireCrossPoint cpORAMnplus3 = new WireCrossPoint(submodelModifiable, 1);
110                 WireCrossPoint cpF3 = new WireCrossPoint(submodelModifiable, 1);
111                 WireCrossPoint cpF11 = new WireCrossPoint(submodelModifiable, 1);
112                 WireCrossPoint cpF21 = new WireCrossPoint(submodelModifiable, 1);
113                 WireCrossPoint cpF31 = new WireCrossPoint(submodelModifiable, 1);
114                 WireCrossPoint cpF41 = new WireCrossPoint(submodelModifiable, 1);
115                 WireCrossPoint cpF12 = new WireCrossPoint(submodelModifiable, 1);
116                 WireCrossPoint cpF22 = new WireCrossPoint(submodelModifiable, 1);
117                 WireCrossPoint cpF32 = new WireCrossPoint(submodelModifiable, 1);
118                 WireCrossPoint cpF42 = new WireCrossPoint(submodelModifiable, 1);
119                 WireCrossPoint cpF1Lsh = new WireCrossPoint(submodelModifiable, 1);
120                 WireCrossPoint cpF2Lsh = new WireCrossPoint(submodelModifiable, 1);
121                 WireCrossPoint cpF3Lsh = new WireCrossPoint(submodelModifiable, 1);
122                 WireCrossPoint cpF2Rsh = new WireCrossPoint(submodelModifiable, 1);
123                 WireCrossPoint cpF3Rsh = new WireCrossPoint(submodelModifiable, 1);
124                 WireCrossPoint cpF4Rsh = new WireCrossPoint(submodelModifiable, 1);
125                 WireCrossPoint cpF13 = new WireCrossPoint(submodelModifiable, 1);
126                 WireCrossPoint cpF23 = new WireCrossPoint(submodelModifiable, 1);
127                 WireCrossPoint cpF33 = new WireCrossPoint(submodelModifiable, 1);
128                 WireCrossPoint cpF43 = new WireCrossPoint(submodelModifiable, 1);
129                 WireCrossPoint cpFneq0 = new WireCrossPoint(submodelModifiable, 1);
130
131                 destDecode.moveTo(15, 45);
132                 Ymux.moveTo(275, 135);
133                 ramweAnd.moveTo(190, 65);
134                 notC.moveTo(160, 75);
135                 alu.moveTo(240, 2110);
136                 Fneq0.moveTo(275, 445);
137                 notFneq0.moveTo(320, 440);
138                 ram.moveTo(95, 2220);
139                 QAlatch.moveTo(160, 2220);
140                 QBlatch.moveTo(160, 2275);
141                 ramDsel.moveTo(45, 2310);
142                 qregDsel.moveTo(45, 2510);
143                 qreg.moveTo(90, 2490);
144                 cpC1.moveCenterTo(155, 950);
145                 cpC2.moveCenterTo(155, 90);
146                 cpC3.moveCenterTo(155, 2265);
147                 cpC4.moveCenterTo(155, 2320);
148                 cpLSH.moveCenterTo(40, 2315);
149                 cpNSH.moveCenterTo(35, 2325);
150                 cpRSH.moveCenterTo(30, 2335);
151                 cpQA1.moveCenterTo(220, 2225);
152                 cpQA2.moveCenterTo(225, 2235);
153                 cpQA3.moveCenterTo(230, 2245);
154                 cpQA4.moveCenterTo(235, 2255);
155                 cpQ1.moveCenterTo(130, 2495);
156                 cpQ2.moveCenterTo(135, 2505);
157                 cpQ3.moveCenterTo(140, 2515);
158                 cpQ4.moveCenterTo(145, 2525);
159                 cpOQn.moveCenterTo(220, 2495);
160                 cpOQnplus3.moveCenterTo(235, 2525);
161                 cpQ2Rsh.moveCenterTo(35, 2625);
162                 cpQ3Rsh.moveCenterTo(40, 2635);
163                 cpORAMn.moveCenterTo(280, 2115);
164                 cpORAMnplus3.moveCenterTo(295, 2145);
165                 cpF3.moveCenterTo(330, 950);
166                 cpF11.moveCenterTo(255, 2090);
167                 cpF21.moveCenterTo(260, 2095);
168                 cpF31.moveCenterTo(265, 2100);
169                 cpF41.moveCenterTo(270, 2105);
170                 cpF12.moveCenterTo(255, 450);
171                 cpF22.moveCenterTo(260, 460);
172                 cpF32.moveCenterTo(265, 470);
173                 cpF42.moveCenterTo(270, 480);
174                 cpF1Lsh.moveCenterTo(10, 2355);
175                 cpF2Lsh.moveCenterTo(15, 2365);
176                 cpF3Lsh.moveCenterTo(20, 2375);
177                 cpF2Rsh.moveCenterTo(15, 2395);
178                 cpF3Rsh.moveCenterTo(20, 2405);
179                 cpF4Rsh.moveCenterTo(25, 2415);
180                 cpF13.moveCenterTo(10, 2385);
181                 cpF23.moveCenterTo(15, 2425);
182                 cpF33.moveCenterTo(20, 2435);
183                 cpF43.moveCenterTo(25, 2445);
184                 cpFneq0.moveCenterTo(315, 450);
185
186                 new GUIWire(submodelModifiable, I8, destDecode.getPin("I8"), new Point[0]);
187                 new GUIWire(submodelModifiable, I7, destDecode.getPin("I7"), new Point(5, 150), new Point(5, 60));
188                 new GUIWire(submodelModifiable, I6, destDecode.getPin("I6"), new Point(10, 250), new Point(10, 70));
189                 new GUIWire(submodelModifiable, I5, alu.getPin("I5"), new Point(130, 350), new Point(130, 2115));
190                 new GUIWire(submodelModifiable, I4, alu.getPin("I4"), new Point(125, 450), new Point(125, 2125));
191                 new GUIWire(submodelModifiable, I3, alu.getPin("I3"), new Point(120, 550), new Point(120, 2135));
192                 new GUIWire(submodelModifiable, I2, alu.getPin("I2"), new Point(115, 650), new Point(115, 2145));
193                 new GUIWire(submodelModifiable, I1, alu.getPin("I1"), new Point(110, 750), new Point(110, 2155));
194                 new GUIWire(submodelModifiable, I0, alu.getPin("I0"), new Point(105, 850), new Point(105, 2165));
195                 new GUIWire(submodelModifiable, C, cpC1, new Point[0]);
196                 new GUIWire(submodelModifiable, cpC1, cpC2, new Point[0]);
197                 new GUIWire(submodelModifiable, cpC2, notC.getPin("A"), new Point(155, 80));
198                 new GUIWire(submodelModifiable, cpC2, notC.getPin("B"), new Point[0]);
199                 new GUIWire(submodelModifiable, cpC1, cpC3, new Point[0]);
200                 new GUIWire(submodelModifiable, cpC3, QAlatch.getPin("C"), new Point[0]);
201                 new GUIWire(submodelModifiable, cpC3, cpC4, new Point[0]);
202                 new GUIWire(submodelModifiable, cpC4, QBlatch.getPin("C"), new Point[0]);
203                 new GUIWire(submodelModifiable, cpC4, qreg.getPin("C"), new Point(155, 2485), new Point(80, 2485), new Point(80, 2495));
204                 new GUIWire(submodelModifiable, destDecode.getPin("LSH"), cpLSH, new Point(55, 90), new Point(55, 125), new Point(40, 125));
205                 new GUIWire(submodelModifiable, destDecode.getPin("NSH"), cpNSH, new Point(60, 50), new Point(60, 120), new Point(35, 120));
206                 new GUIWire(submodelModifiable, destDecode.getPin("RSH"), cpRSH, new Point(65, 60), new Point(65, 115), new Point(30, 115));
207                 new GUIWire(submodelModifiable, cpLSH, ramDsel.getPin("SA"), new Point[0]);
208                 new GUIWire(submodelModifiable, cpNSH, ramDsel.getPin("SB"), new Point[0]);
209                 new GUIWire(submodelModifiable, cpRSH, ramDsel.getPin("SC"), new Point[0]);
210                 new GUIWire(submodelModifiable, cpLSH, qregDsel.getPin("SA"), new Point(40, 2515));
211                 new GUIWire(submodelModifiable, cpNSH, qregDsel.getPin("SB"), new Point(35, 2525));
212                 new GUIWire(submodelModifiable, cpRSH, qregDsel.getPin("SC"), new Point(30, 2535));
213                 new GUIWire(submodelModifiable, A0, ram.getPin("A0"), new Point(80, 1550), new Point(80, 2225));
214                 new GUIWire(submodelModifiable, A1, ram.getPin("A1"), new Point(75, 1650), new Point(75, 2235));
215                 new GUIWire(submodelModifiable, A2, ram.getPin("A2"), new Point(70, 1750), new Point(70, 2245));
216                 new GUIWire(submodelModifiable, A3, ram.getPin("A3"), new Point(65, 1850), new Point(65, 2255));
217                 new GUIWire(submodelModifiable, B0, ram.getPin("B0"), new Point(60, 1950), new Point(60, 2265));
218                 new GUIWire(submodelModifiable, B1, ram.getPin("B1"), new Point(55, 2050), new Point(55, 2275));
219                 new GUIWire(submodelModifiable, B2, ram.getPin("B2"), new Point(50, 2150), new Point(50, 2285));
220                 new GUIWire(submodelModifiable, B3, ram.getPin("B3"), new Point(45, 2250), new Point(45, 2295));
221                 new GUIWire(submodelModifiable, ram.getPin("QA1"), QAlatch.getPin("D1"), new Point[0]);
222                 new GUIWire(submodelModifiable, ram.getPin("QA2"), QAlatch.getPin("D2"), new Point[0]);
223                 new GUIWire(submodelModifiable, ram.getPin("QA3"), QAlatch.getPin("D3"), new Point[0]);
224                 new GUIWire(submodelModifiable, ram.getPin("QA4"), QAlatch.getPin("D4"), new Point[0]);
225                 new GUIWire(submodelModifiable, ram.getPin("QB1"), QBlatch.getPin("D1"), new Point(150, 2265), new Point(150, 2280));
226                 new GUIWire(submodelModifiable, ram.getPin("QB2"), QBlatch.getPin("D2"), new Point(145, 2275), new Point(145, 2290));
227                 new GUIWire(submodelModifiable, ram.getPin("QB3"), QBlatch.getPin("D3"), new Point(140, 2285), new Point(140, 2300));
228                 new GUIWire(submodelModifiable, ram.getPin("QB4"), QBlatch.getPin("D4"), new Point(135, 2295), new Point(135, 2310));
229                 new GUIWire(submodelModifiable, Cn, alu.getPin("Cn"), new Point(100, 1050), new Point(100, 2175));
230                 new GUIWire(submodelModifiable, D1, alu.getPin("D1"), new Point(180, 1150), new Point(180, 2185));
231                 new GUIWire(submodelModifiable, D2, alu.getPin("D2"), new Point(175, 1250), new Point(175, 2195));
232                 new GUIWire(submodelModifiable, D3, alu.getPin("D3"), new Point(170, 1350), new Point(170, 2205));
233                 new GUIWire(submodelModifiable, D4, alu.getPin("D4"), new Point(165, 1450), new Point(165, 2215));
234                 new GUIWire(submodelModifiable, QAlatch.getPin("Q1"), cpQA1, new Point[0]);
235                 new GUIWire(submodelModifiable, QAlatch.getPin("Q2"), cpQA2, new Point[0]);
236                 new GUIWire(submodelModifiable, QAlatch.getPin("Q3"), cpQA3, new Point[0]);
237                 new GUIWire(submodelModifiable, QAlatch.getPin("Q4"), cpQA4, new Point[0]);
238                 new GUIWire(submodelModifiable, cpQA1, Ymux.getPin("I0_1"), new Point(220, 150));
239                 new GUIWire(submodelModifiable, cpQA2, Ymux.getPin("I0_2"), new Point(225, 160));
240                 new GUIWire(submodelModifiable, cpQA3, Ymux.getPin("I0_3"), new Point(230, 170));
241                 new GUIWire(submodelModifiable, cpQA4, Ymux.getPin("I0_4"), new Point(235, 180));
242                 new GUIWire(submodelModifiable, cpQA1, alu.getPin("A1"), new Point[0]);
243                 new GUIWire(submodelModifiable, cpQA2, alu.getPin("A2"), new Point[0]);
244                 new GUIWire(submodelModifiable, cpQA3, alu.getPin("A3"), new Point[0]);
245                 new GUIWire(submodelModifiable, cpQA4, alu.getPin("A4"), new Point[0]);
246                 new GUIWire(submodelModifiable, QBlatch.getPin("Q1"), alu.getPin("B1"), new Point(200, 2280), new Point(200, 2265));
247                 new GUIWire(submodelModifiable, QBlatch.getPin("Q2"), alu.getPin("B2"), new Point(205, 2290), new Point(205, 2275));
248                 new GUIWire(submodelModifiable, QBlatch.getPin("Q3"), alu.getPin("B3"), new Point(210, 2300), new Point(210, 2285));
249                 new GUIWire(submodelModifiable, QBlatch.getPin("Q4"), alu.getPin("B4"), new Point(215, 2310), new Point(215, 2295));
250                 new GUIWire(submodelModifiable, qreg.getPin("Q1"), cpQ1, new Point[0]);
251                 new GUIWire(submodelModifiable, qreg.getPin("Q2"), cpQ2, new Point[0]);
252                 new GUIWire(submodelModifiable, qreg.getPin("Q3"), cpQ3, new Point[0]);
253                 new GUIWire(submodelModifiable, qreg.getPin("Q4"), cpQ4, new Point[0]);
254                 new GUIWire(submodelModifiable, cpQ1, cpOQn, new Point[0]);
255                 new GUIWire(submodelModifiable, cpOQn, OQn, new Point(335, 2495), new Point(335, 1050));
256                 new GUIWire(submodelModifiable, cpQ4, cpOQnplus3, new Point[0]);
257                 new GUIWire(submodelModifiable, cpOQnplus3, OQnplus3, new Point(340, 2525), new Point(340, 1150));
258                 new GUIWire(submodelModifiable, cpQ2, cpQ2Rsh, new Point(135, 2670), new Point(30, 2670), new Point(30, 2635), new Point(35, 2635));
259                 new GUIWire(submodelModifiable, cpQ3, cpQ3Rsh, new Point(140, 2675), new Point(35, 2675), new Point(35, 2640), new Point(40, 2640));
260                 new GUIWire(submodelModifiable, cpQ2Rsh, qregDsel.getPin("C1"), new Point[0]);
261                 new GUIWire(submodelModifiable, cpQ3Rsh, qregDsel.getPin("C2"), new Point[0]);
262                 new GUIWire(submodelModifiable, cpQ4, qregDsel.getPin("C3"), new Point(145, 2680), new Point(40, 2680), new Point(40, 2645));
263                 new GUIWire(submodelModifiable, IQnplus3, qregDsel.getPin("C4"), new Point(5, 2650), new Point(5, 2655));
264                 new GUIWire(submodelModifiable, IQn, qregDsel.getPin("A1"), new Point(5, 2550), new Point(5, 2545));
265                 new GUIWire(submodelModifiable, cpQ1, qregDsel.getPin("A2"), new Point(130, 2665), new Point(25, 2665), new Point(25, 2630),
266                                 new Point(30, 2630), new Point(30, 2555));
267                 new GUIWire(submodelModifiable, cpOQn, alu.getPin("Q1"), new Point(220, 2305));
268                 new GUIWire(submodelModifiable, cpQ2, alu.getPin("Q2"), new Point(225, 2505), new Point(225, 2315));
269                 new GUIWire(submodelModifiable, cpQ3, alu.getPin("Q3"), new Point(230, 2515), new Point(230, 2325));
270                 new GUIWire(submodelModifiable, cpOQnplus3, alu.getPin("Q4"), new Point(235, 2335));
271                 new GUIWire(submodelModifiable, cpQ2Rsh, qregDsel.getPin("A3"), new Point(35, 2565));
272                 new GUIWire(submodelModifiable, cpQ3Rsh, qregDsel.getPin("A4"), new Point(40, 2575));
273                 new GUIWire(submodelModifiable, qregDsel.getPin("Y1"), qreg.getPin("D1"), new Point[0]);
274                 new GUIWire(submodelModifiable, qregDsel.getPin("Y2"), qreg.getPin("D2"), new Point[0]);
275                 new GUIWire(submodelModifiable, qregDsel.getPin("Y3"), qreg.getPin("D3"), new Point[0]);
276                 new GUIWire(submodelModifiable, qregDsel.getPin("Y4"), qreg.getPin("D4"), new Point[0]);
277                 new GUIWire(submodelModifiable, alu.getPin("Cn+4"), Cnplus4, new Point(315, 2155), new Point(315, 550));
278                 new GUIWire(submodelModifiable, alu.getPin("OVR"), OVR, new Point(320, 2165), new Point(320, 650));
279                 new GUIWire(submodelModifiable, alu.getPin("F1"), cpORAMn, new Point[0]);
280                 new GUIWire(submodelModifiable, alu.getPin("F4"), cpORAMnplus3, new Point[0]);
281                 new GUIWire(submodelModifiable, cpORAMn, ORAMn, new Point(325, 2115), new Point(325, 850));
282                 new GUIWire(submodelModifiable, cpORAMnplus3, cpF3, new Point(330, 2145));
283                 new GUIWire(submodelModifiable, cpF3, ORAMnplus3, new Point[0]);
284                 new GUIWire(submodelModifiable, cpF3, F3, new Point(330, 750));
285                 new GUIWire(submodelModifiable, cpORAMn, cpF11, new Point(280, 2090));
286                 new GUIWire(submodelModifiable, alu.getPin("F2"), cpF21, new Point(285, 2125), new Point(285, 2095));
287                 new GUIWire(submodelModifiable, alu.getPin("F3"), cpF31, new Point(290, 2135), new Point(290, 2100));
288                 new GUIWire(submodelModifiable, cpORAMnplus3, cpF41, new Point(295, 2105));
289                 new GUIWire(submodelModifiable, cpF11, cpF12, new Point[0]);
290                 new GUIWire(submodelModifiable, cpF21, cpF22, new Point[0]);
291                 new GUIWire(submodelModifiable, cpF31, cpF32, new Point[0]);
292                 new GUIWire(submodelModifiable, cpF41, cpF42, new Point[0]);
293                 new GUIWire(submodelModifiable, cpF12, Fneq0.getPin("A1"), new Point[0]);
294                 new GUIWire(submodelModifiable, cpF22, Fneq0.getPin("A2"), new Point[0]);
295                 new GUIWire(submodelModifiable, cpF32, Fneq0.getPin("A3"), new Point[0]);
296                 new GUIWire(submodelModifiable, cpF42, Fneq0.getPin("A4"), new Point[0]);
297                 new GUIWire(submodelModifiable, cpF12, Ymux.getPin("I1_1"), new Point(255, 190));
298                 new GUIWire(submodelModifiable, cpF22, Ymux.getPin("I1_2"), new Point(260, 200));
299                 new GUIWire(submodelModifiable, cpF32, Ymux.getPin("I1_3"), new Point(265, 210));
300                 new GUIWire(submodelModifiable, cpF42, Ymux.getPin("I1_4"), new Point(270, 220));
301                 new GUIWire(submodelModifiable, cpF11, cpF1Lsh, new Point(10, 2090));
302                 new GUIWire(submodelModifiable, cpF21, cpF2Lsh, new Point(15, 2095));
303                 new GUIWire(submodelModifiable, cpF31, cpF3Lsh, new Point(20, 2100));
304                 new GUIWire(submodelModifiable, IRAMn, ramDsel.getPin("A1"), new Point(5, 2350), new Point(5, 2345));
305                 new GUIWire(submodelModifiable, cpF1Lsh, ramDsel.getPin("A2"), new Point[0]);
306                 new GUIWire(submodelModifiable, cpF2Lsh, ramDsel.getPin("A3"), new Point[0]);
307                 new GUIWire(submodelModifiable, cpF3Lsh, ramDsel.getPin("A4"), new Point[0]);
308                 new GUIWire(submodelModifiable, cpF2Lsh, cpF2Rsh, new Point[0]);
309                 new GUIWire(submodelModifiable, cpF3Lsh, cpF3Rsh, new Point[0]);
310                 new GUIWire(submodelModifiable, cpF41, cpF4Rsh, new Point(25, 2105));
311                 new GUIWire(submodelModifiable, cpF1Lsh, cpF13, new Point[0]);
312                 new GUIWire(submodelModifiable, cpF13, ramDsel.getPin("B1"), new Point[0]);
313                 new GUIWire(submodelModifiable, cpF2Rsh, ramDsel.getPin("B2"), new Point[0]);
314                 new GUIWire(submodelModifiable, cpF3Rsh, ramDsel.getPin("B3"), new Point[0]);
315                 new GUIWire(submodelModifiable, cpF4Rsh, ramDsel.getPin("B4"), new Point[0]);
316                 new GUIWire(submodelModifiable, cpF2Rsh, cpF23, new Point[0]);
317                 new GUIWire(submodelModifiable, cpF3Rsh, cpF33, new Point[0]);
318                 new GUIWire(submodelModifiable, cpF4Rsh, cpF43, new Point[0]);
319                 new GUIWire(submodelModifiable, cpF23, ramDsel.getPin("C1"), new Point[0]);
320                 new GUIWire(submodelModifiable, cpF33, ramDsel.getPin("C2"), new Point[0]);
321                 new GUIWire(submodelModifiable, cpF43, ramDsel.getPin("C3"), new Point[0]);
322                 new GUIWire(submodelModifiable, IRAMnplus3, ramDsel.getPin("C4"), new Point(5, 2450), new Point(5, 2455));
323                 new GUIWire(submodelModifiable, cpF13, qregDsel.getPin("B1"), new Point(10, 2585));
324                 new GUIWire(submodelModifiable, cpF23, qregDsel.getPin("B2"), new Point(15, 2595));
325                 new GUIWire(submodelModifiable, cpF33, qregDsel.getPin("B3"), new Point(20, 2605));
326                 new GUIWire(submodelModifiable, cpF43, qregDsel.getPin("B4"), new Point(25, 2615));
327                 new GUIWire(submodelModifiable, ramDsel.getPin("Y1"), ram.getPin("D1"), new Point[0]);
328                 new GUIWire(submodelModifiable, ramDsel.getPin("Y2"), ram.getPin("D2"), new Point[0]);
329                 new GUIWire(submodelModifiable, ramDsel.getPin("Y3"), ram.getPin("D3"), new Point[0]);
330                 new GUIWire(submodelModifiable, ramDsel.getPin("Y4"), ram.getPin("D4"), new Point[0]);
331                 new GUIWire(submodelModifiable, destDecode.getPin("RAMWE"), ramweAnd.getPin("A"), new Point[0]);
332                 new GUIWire(submodelModifiable, notC.getPin("Y"), ramweAnd.getPin("B"));
333                 new GUIWire(submodelModifiable, ramweAnd.getPin("Y"), ram.getPin("WE"), new Point(230, 70), new Point(230, 105), new Point(90, 105),
334                                 new Point(90, 2305));
335                 new GUIWire(submodelModifiable, destDecode.getPin("QWE"), qreg.getPin("WE"), new Point(85, 100), new Point(85, 2505));
336                 new GUIWire(submodelModifiable, destDecode.getPin("YF"), Ymux.getPin("S0"), new Point(70, 80), new Point(70, 140));
337                 new GUIWire(submodelModifiable, Ymux.getPin("Y1"), Y1, new Point(335, 140), new Point(335, 50));
338                 new GUIWire(submodelModifiable, Ymux.getPin("Y2"), Y2, new Point[0]);
339                 new GUIWire(submodelModifiable, Ymux.getPin("Y3"), Y3, new Point(335, 160), new Point(335, 250));
340                 new GUIWire(submodelModifiable, Ymux.getPin("Y4"), Y4, new Point(325, 170), new Point(325, 350));
341                 new GUIWire(submodelModifiable, Fneq0.getPin("Y"), cpFneq0, new Point[0]);
342                 new GUIWire(submodelModifiable, cpFneq0, notFneq0.getPin("A"), new Point(315, 445));
343                 new GUIWire(submodelModifiable, cpFneq0, notFneq0.getPin("B"), new Point(315, 455));
344                 new GUIWire(submodelModifiable, notFneq0.getPin("Y"), Feq0, new Point[0]);
345         }
346
347         @Override
348         public void setHighLevelState(String stateID, Object newState)
349         {
350                 switch (stateID)
351                 {
352                 default:
353                         int indexOfDot = stateID.indexOf('.');
354                         if (indexOfDot != -1)
355                         {
356                                 switch (stateID.substring(0, indexOfDot))
357                                 {
358                                 case "regs":
359                                         ram.setHighLevelState(stateID.substring(indexOfDot + 1), newState);
360                                         break;
361                                 case "qreg":
362                                         qreg.setHighLevelState(stateID.substring(indexOfDot + 1), newState);
363                                         break;
364                                 default:
365                                         super.setHighLevelState(stateID, newState);
366                                         break;
367                                 }
368                         } else
369                                 super.setHighLevelState(stateID, newState);
370                 }
371         }
372
373         @Override
374         public Object getHighLevelState(String stateID)
375         {
376                 switch (stateID)
377                 {
378                 default:
379                         int indexOfDot = stateID.indexOf('.');
380                         if (indexOfDot != -1)
381                         {
382                                 switch (stateID.substring(0, indexOfDot))
383                                 {
384                                 case "regs":
385                                         return ram.getHighLevelState(stateID.substring(indexOfDot + 1));
386                                 case "qreg":
387                                         return qreg.getHighLevelState(stateID.substring(indexOfDot + 1));
388                                 default:
389                                         return super.getHighLevelState(stateID);
390                                 }
391                         }
392                         return super.getHighLevelState(stateID);
393                 }
394         }
395 }