From 3d3ddab5bdcc836ea3d686e84f04ccf2958df44d Mon Sep 17 00:00:00 2001 From: Alejandro Calderon Mateos Date: Tue, 27 Jun 2023 19:49:01 +0200 Subject: [PATCH] 2.3.0: minor updates --- examples/hardware/ep/images/controlunit.svg | 101 +- examples/hardware/ep/images/processor.svg | 18 +- examples/hardware/poc/images/controlunit.svg | 2774 +++++++++++++++-- examples/hardware/poc/images/processor.svg | 813 +++-- sim_hw/sim_hw_ep/sim_hw_cpu.js | 18 +- sim_hw/sim_hw_poc/sim_hw_cpu.js | 8 +- ws_dist/examples/hardware/ep/hw_def.json | 2 +- .../hardware/ep/images/controlunit.svg | 101 +- .../examples/hardware/ep/images/processor.svg | 18 +- ws_dist/examples/hardware/poc/hw_def.json | 2 +- .../hardware/poc/images/controlunit.svg | 2774 +++++++++++++++-- .../hardware/poc/images/processor.svg | 813 +++-- ws_dist/min.sim_all.js | 2 +- ws_dist/min.wepsim_node.js | 2 +- ws_dist/min.wepsim_web.js | 2 +- 15 files changed, 6214 insertions(+), 1234 deletions(-) diff --git a/examples/hardware/ep/images/controlunit.svg b/examples/hardware/ep/images/controlunit.svg index a80819f70..6700b9c5a 100644 --- a/examples/hardware/ep/images/controlunit.svg +++ b/examples/hardware/ep/images/controlunit.svg @@ -305,42 +305,42 @@ d="m 377.47518,105.46009 h 34.61328 v -1.6042 h -34.61328 z m 30.56474,4.1044 7.3658,-4.9184 -7.3658,-4.918502 z" stroke="#000000" stroke-width="0.30" - style="stroke-width:0.025;stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + stroke-width="0.05" + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> SelCop + stroke-width="1.0px" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;">SelCop - - + style="stroke-dasharray:none" /> + stroke-width="0.03" + style="stroke-dasharray:none;image-rendering:optimizeSpeed" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + stroke-width="0.35" + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + + - + MUX @@ -179,7 +179,7 @@ 4 - + SELEC @@ -297,7 +297,7 @@ SR - + 2 @@ -514,16 +514,16 @@ Control Bus - - HPC + + HPC - 2 + 2 - T12 + T12 - - MH + + MH diff --git a/examples/hardware/poc/images/controlunit.svg b/examples/hardware/poc/images/controlunit.svg index eec78e93e..b21033efd 100644 --- a/examples/hardware/poc/images/controlunit.svg +++ b/examples/hardware/poc/images/controlunit.svg @@ -1,305 +1,2477 @@ - - - - - image/svg+xml - - - - - - - - - Control Memory - MUX C - - - 80 - - - - SR - - - - - - - - - + + + + + + + image/svg+xml + + + + + + + + Control Memory + MUX C + + + 80 + + + + SR + + + + + + + + + - - - 0 - A0 - MUX A - µInstruction - MADDR - µAddr - - +1 - - - - - - - - - - - 4 - - 12 - - 0 - (fetch) - - - - 0 - - - - - - - SelA - SelB - SelC - - - - - - - - - - - - - - - - - - - - 49 - - MUX - - MRA - Rest of CPU - control - signals - - - - MUX - - MRB - - - MUX - - MRC - - - - - - - - - - 6 - - - - - - 6 - - - - 6 - - - MUX - - - - SelCop - - - - - MC - - - IR3 -- IR0 - 4 - 6 - 6 - 6 - 0 - 1 - RB - RC - RA - Cop - 0 - 1 - 0 - 1 - A1 - MUX B - - 0 - 1 - - 00 - 01 - 10 - 11 - - - - - - - - - A0 - B - C - µAddress - - - - - - - - - - C - V - N - I - U - - 31 - 30 - 29 - 1 - MRdy - IORdy - INT - 7 - 6 - 5 - 4 - 3 - 2 - 1 - 0 - 8 - - - - - - - - - - - - - - - - - - - - - - + + + 0 + A0 + MUX A + µInstruction + MADDR + µAddr + + +1 + + + + + + + + + + + 4 + + 12 + + 0 + (fetch) + + + + 0 + + + + + + + SelA + SelB + SelC + + + + + + + + + + + + + + + + + + + + 49 + + MUX + + MRA + Rest of CPU + control + signals + + + + MUX + + MRB + + + MUX + + MRC + + + + + + + + + + 6 + + + + + + 6 + + + + 6 + + + MUX + + + + SelCop + + + + + MC + + + IR3 -- IR0 + 4 + 6 + 6 + 6 + 0 + 1 + RB + RC + RA + Cop + 0 + 1 + 0 + 1 + A1 + MUX B + + 0 + 1 + + 00 + 01 + 10 + 11 + + + + + + + + + A0 + B + C + µAddress + + + + + + + + + + C + V + N + I + U + + 31 + 30 + 29 + 1 + MRdy + IORdy + INT + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 0 + 8 + + + + + + + + + + + + + + + + + + + + + + - - - ... - - MC - - CLK - - ExCode - - 4 - - - - T11 - - - Z - 28 - 9 - - 10 - - - - co2µaddr - - CO - IR - - - - 6 - - - 4 - - - - InEx - - - - - Sel RA - Sel RB - Sel RC - 0 - 1 - - - - - - CLK - - - - - - - - ... - - - ... - COP - - + + + ... + + MC + + CLK + + ExCode + + 4 + + + + T11 + + + Z + 28 + 9 + + 10 + + + + co2µaddr + + CO + IR + + + + 6 + + + 4 + + + + InEx + + + + + Sel RA + Sel RB + Sel RC + 0 + 1 + + + + + + CLK + + + + + + + + ... + + + ... + COP + diff --git a/examples/hardware/poc/images/processor.svg b/examples/hardware/poc/images/processor.svg index 40ec52d43..2a9938f30 100644 --- a/examples/hardware/poc/images/processor.svg +++ b/examples/hardware/poc/images/processor.svg @@ -85,37 +85,47 @@ visibility="hidden" style="visibility:hidden" /> Memory Address Bus ALU @@ -190,7 +211,9 @@ font-size="16.938px" xml:space="preserve" transform="scale(1.054676,0.94815848)" - style="font-size:16.9384px;line-height:125%;font-family:Arial;text-decoration:underline;text-decoration-line:underline;fill:#000000;stroke-width:1.00002" + stroke-width="1.0px" + fill="#000000" + style="font-size:16.9384px;line-height:125%;font-family:Arial;text-decoration:underline;text-decoration-line:underline;" id="text3029">Register File MAR IR +0 1 MUX MBR C0 C1 Ta Td T1 RA RB RC LC T9 T10 B PC C2 Control Unit @@ -657,23 +776,28 @@ d="m 229.02272,135.6238 c 0,-1.3566 1.1435,-2.4694 2.5579,-2.4694 1.4146,0 2.5578,1.1128 2.5578,2.4694 0,1.3671 -1.1434,2.4799 -2.5578,2.4799 -1.4145,0 -2.5579,-1.1128 -2.5579,-2.4799" id="path3185" /> MUX 0 1 MUX A @@ -751,41 +887,49 @@ d="m 287.44688,446.75834 c 0,-1.3566 1.1316,-2.4799 2.5461,-2.4799 1.4145,0 2.5696,1.1234 2.5696,2.4799 0,1.3777 -1.1552,2.4798 -2.5696,2.4798 -1.4145,0 -2.5461,-1.1023 -2.5461,-2.4798" id="path3163" /> 4 SELEC Control Signals C3 T2 T3 T6 MA MB M1 5 Internal Bus 6 6 6 Processor A31 - A0 @@ -1175,12 +1384,14 @@ d="m 638.39432,167.5938 c 0,-1.3566 1.1787,-2.4587 2.5932,-2.4587 1.3673,0 2.5461,1.1023 2.5461,2.4587 0,1.3989 -1.1788,2.5011 -2.5461,2.5011 -1.4144,0 -2.5932,-1.1023 -2.5932,-2.5011" id="path3517" /> @@ -1190,12 +1401,14 @@ d="m 229.53172,135.9438 c 0,-1.3566 1.1434,-2.4694 2.5578,-2.4694 1.4028,0 2.546,1.1128 2.546,2.4694 0,1.3671 -1.1433,2.4798 -2.546,2.4798 -1.4145,0 -2.5578,-1.1128 -2.5578,-2.4798" id="path3537" /> @@ -1205,17 +1418,20 @@ d="m 285.89072,151.8838 c 0,-1.3671 1.1434,-2.4798 2.5578,-2.4798 1.4028,0 2.5461,1.1128 2.5461,2.4798 0,1.3671 -1.1434,2.4694 -2.5461,2.4694 -1.4144,0 -2.5578,-1.1023 -2.5578,-2.4694" id="path3543" /> @@ -1225,7 +1441,8 @@ d="m 206.82856,167.48208 c 0,-1.3777 1.1552,-2.4799 2.5698,-2.4799 1.3908,0 2.5461,1.1023 2.5461,2.4799 0,1.3566 -1.1552,2.4587 -2.5461,2.4587 -1.4144,0 -2.5698,-1.1023 -2.5698,-2.4587" id="path3569" /> @@ -1235,7 +1452,8 @@ d="m 183.99404,167.36658 c 0,-1.3777 1.1316,-2.4799 2.5461,-2.4799 1.4145,0 2.546,1.1023 2.546,2.4799 0,1.3566 -1.1316,2.4587 -2.546,2.4587 -1.4145,0 -2.5461,-1.1023 -2.5461,-2.4587" id="path3573" /> @@ -1246,12 +1464,15 @@ id="path3589" sodipodi:nodetypes="ccccccccccc" /> SE C7 Offset 5 KBSR Keyboard DSR + style="fill-rule:evenodd;" /> 0 MRdy ADDR DATA R 0 1 ADDR IOW ADDR DATA D0 C V Z Data Bus V7 - IODR IORdy ADDR DATA IOR IOW INT INTA >>0;if(value!=0){vec.CPU[\"R\"+i]={type:\"register\",default_value:0,id:\"R\"+i,op:\"=\",value:\"0x\"+value.toString(16)}}}for(i=0;i>>0;if(value!=0){vec.CPU[internal_reg[i]]={type:\"register\",default_value:0,id:internal_reg[i],op:\"=\",value:\"0x\"+value.toString(16)}}}return vec})/","read_state":"/Function(function(vec,check){if(typeof vec.CPU==\"undefined\"){vec.CPU={}}var key=check[\"id\"].toUpperCase().trim();var val=parseInt(check[\"value\"]).toString(16);if(\"REGISTER\"==check[\"type\"].toUpperCase().trim()){vec.CPU[key]={type:\"register\",default_value:0,id:key,op:check[\"condition\"],value:\"0x\"+val};return true}return false})/","get_state":"/Function(function(reg){var value=0;var r_reg=reg.toUpperCase().trim();if(typeof sim.ep.states[\"REG_\"+r_reg]!=\"undefined\"){value=get_value(sim.ep.states[\"REG_\"+r_reg])>>>0;return\"0x\"+value.toString(16)}r_reg=r_reg.replace(\"R\",\"\");var index=parseInt(r_reg);if(typeof sim.ep.states.BR[index]!=\"undefined\"){value=get_value(sim.ep.states.BR[index])>>>0;return\"0x\"+value.toString(16)}return null})/","get_value":"/Function(function(elto){if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index))return get_value(simhw_sim_state(elto))>>>0;return get_value(simhw_sim_states().BR[index])>>>0})/","set_value":"/Function(function(elto,value){var pc_name=simhw_sim_ctrlStates_get().pc.state;if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index)){set_value(simhw_sim_state(elto),value);if(pc_name===elto){show_asmdbg_pc()}return value}return set_value(simhw_sim_states().BR[index],value)})/"},"MEMORY":{"name":"MEMORY","version":"1","abilities":["MEMORY"],"details_name":["MEMORY","MEMORY_CONFIG"],"details_fire":[["svg_p:text3001"],[]],"write_state":"/Function(function(vec){if(typeof vec.MEMORY==\"undefined\")vec.MEMORY={};var key=0;var value=0;for(var index in sim.ep.internal_states.MP){value=main_memory_getvalue(sim.ep.internal_states.MP,index);value=parseInt(value);if(value!=0){key=parseInt(index).toString(16);vec.MEMORY[\"0x\"+key]={type:\"memory\",default_value:0,id:\"0x\"+key,op:\"=\",value:\"0x\"+value.toString(16)}}}return vec})/","read_state":"/Function(function(vec,check){if(typeof vec.MEMORY==\"undefined\")vec.MEMORY={};var key=parseInt(check.id).toString(16);var val=parseInt(check.value).toString(16);if(\"MEMORY\"==check.type.toUpperCase().trim()){vec.MEMORY[\"0x\"+key]={type:\"memory\",default_value:0,id:\"0x\"+key,op:check.condition,value:\"0x\"+val};return true}return false})/","get_state":"/Function(function(pos){var index=parseInt(pos);var value=main_memory_getvalue(sim.ep.internal_states.MP,elto);if(typeof value===\"undefined\"){return null}return\"0x\"+parseInt(value).toString(16)})/","get_value":"/Function(function(elto){var value=main_memory_getvalue(sim.ep.internal_states.MP,elto);show_main_memory(sim.ep.internal_states.MP,elto,false,false);return value>>>0})/","set_value":"/Function(function(elto,value){var origin=\"\";var r_value=main_memory_get_program_counter();if(r_value!=null){origin=\"PC=0x\"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.ep.internal_states.MP,elto,melto);show_main_memory(sim.ep.internal_states.MP,elto,typeof valref===\"undefined\",true);return value})/"},"IO":{"name":"IO","version":"1","abilities":["IO_TIMER"],"details_name":["IO_STATS","IO_CONFIG"],"details_fire":[["svg_p:text3775"],[]],"write_state":"/Function(function(vec){return vec})/","read_state":"/Function(function(o,check){return false})/","get_state":"/Function(function(reg){return null})/","get_value":"/Function(function(elto){var associated_state=simhw_internalState_get(\"io_hash\",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_signal(\"IOR\"),1);compute_behavior(\"FIRE IOR\");value=get_value(simhw_sim_state(\"BUS_DB\"));return value})/","set_value":"/Function(function(elto,value){var associated_state=simhw_internalState_get(\"io_hash\",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_state(\"BUS_DB\"),value);set_value(simhw_sim_signal(\"IOW\"),1);compute_behavior(\"FIRE IOW\");return value})/"},"KBD":{"name":"KBD","version":"1","abilities":["KEYBOARD"],"details_name":["KEYBOARD"],"details_fire":[["svg_p:text3829"]],"write_state":"/Function(function(vec){return vec})/","read_state":"/Function(function(o,check){return false})/","get_state":"/Function(function(reg){return null})/","get_value":"/Function(function(elto){return sim.ep.internal_states.keyboard_content})/","set_value":"/Function(function(elto,value){sim.ep.internal_states.keyboard_content=value;return value})/"},"SCREEN":{"name":"SCREEN","version":"1","abilities":["SCREEN"],"details_name":["SCREEN"],"details_fire":[["svg_p:text3845"]],"write_state":"/Function(function(vec){if(typeof vec.SCREEN==\"undefined\"){vec.SCREEN={}}var sim_screen=sim.ep.internal_states.screen_content;var sim_lines=sim_screen.trim().split(\"\\n\");for(var i=0;i>>0;set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_signal(\"IOR\"),1);compute_behavior(\"FIRE IOR\");value=get_value(simhw_sim_state(\"BUS_DB\"));return value})/","set_value":"/Function(function(elto,value){var associated_state=simhw_internalState_get(\"io_hash\",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_state(\"BUS_DB\"),value);set_value(simhw_sim_signal(\"IOW\"),1);compute_behavior(\"FIRE IOW\");return value})/"},"LEDM":{"name":"LEDM","version":"1","abilities":["LEDMATRIX"],"details_name":["LEDMATRIX"],"details_fire":[[]],"write_state":"/Function(function(vec){return vec})/","read_state":"/Function(function(o,check){return false})/","get_state":"/Function(function(reg){return null})/","get_value":"/Function(function(elto){var associated_state=simhw_internalState_get(\"io_hash\",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_signal(\"IOR\"),1);compute_behavior(\"FIRE IOR\");value=get_value(simhw_sim_state(\"BUS_DB\"));return value})/","set_value":"/Function(function(elto,value){var associated_state=simhw_internalState_get(\"io_hash\",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_state(\"BUS_DB\"),value);set_value(simhw_sim_signal(\"IOW\"),1);compute_behavior(\"FIRE IOW\");return value})/"}},"states":{"BR":[{"name":"R0","verbal":"Register 0","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R1","verbal":"Register 1","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R2","verbal":"Register 2","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R3","verbal":"Register 3","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R4","verbal":"Register 4","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R5","verbal":"Register 5","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R6","verbal":"Register 6","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R7","verbal":"Register 7","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R8","verbal":"Register 8","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R9","verbal":"Register 9","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R10","verbal":"Register 10","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R11","verbal":"Register 11","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R12","verbal":"Register 12","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R13","verbal":"Register 13","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R14","verbal":"Register 14","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R15","verbal":"Register 15","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R16","verbal":"Register 16","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R17","verbal":"Register 17","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R18","verbal":"Register 18","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R19","verbal":"Register 19","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R20","verbal":"Register 20","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R21","verbal":"Register 21","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R22","verbal":"Register 22","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R23","verbal":"Register 23","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R24","verbal":"Register 24","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R25","verbal":"Register 25","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R26","verbal":"Register 26","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R27","verbal":"Register 27","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R28","verbal":"Register 28","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R29","verbal":"Register 29","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R30","verbal":"Register 30","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R31","verbal":"Register 31","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]}],"REG_PC":{"name":"PC","verbal":"Program Counter Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_MAR":{"name":"MAR","verbal":"Memory Address Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_MBR":{"name":"MBR","verbal":"Memory Data Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_IR":{"name":"IR","verbal":"Instruction Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_RT1":{"name":"RT1","verbal":"Temporal 1 Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_RT2":{"name":"RT2","verbal":"Temporal 2 Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_RT3":{"name":"RT3","verbal":"Temporal 3 Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_SR":{"name":"SR","verbal":"State Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_IB":{"name":"I_BUS","verbal":"Internal Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_AB":{"name":"A_BUS","verbal":"Address Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_CB":{"name":"C_BUS","verbal":"Control Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_DB":{"name":"D_BUS","verbal":"Data Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"C2_T2":{"name":"C2_T2","verbal":"Output of PC","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"RA_T9":{"name":"RA_T9","verbal":"Input of T9 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"RB_T10":{"name":"RB_T10","verbal":"Input of T10 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"HPC_T12":{"name":"HPC_T12","verbal":"Input of T12 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"SELEC_T3":{"name":"SELEC_T3","verbal":"Input of T3 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"SELP_M7":{"name":"SELP_M7","verbal":"Output of MUX SelP","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"ALU_C6":{"name":"ALU_C6","verbal":"Input of Temporal 3 Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"MA_ALU":{"name":"MA_ALU","verbal":"Input ALU via MA","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"MB_ALU":{"name":"MB_ALU","verbal":"Input ALU via MB","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"FLAG_C":{"name":"FLAG_C","verbal":"Carry Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_V":{"name":"FLAG_V","verbal":"Overflow Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_N":{"name":"FLAG_N","verbal":"Negative Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_Z":{"name":"FLAG_Z","verbal":"Zero Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_I":{"name":"FLAG_I","verbal":"Interruption Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_U":{"name":"FLAG_U","verbal":"User Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"REG_MICROADDR":{"name":"µADDR","verbal":"Microaddress Register","visible":true,"nbits":"12","value":0,"default_value":0,"draw_data":["svg_cu:text4667"]},"REG_MICROINS":{"name":"µINS","verbal":"Microinstruction Register","visible":true,"nbits":"77","value":{},"default_value":{},"draw_data":[]},"FETCH":{"name":"FETCH","verbal":"Input Fetch","visible":false,"nbits":"12","value":0,"default_value":0,"draw_data":[]},"ROM_MUXA":{"name":"ROM_MUXA","verbal":"Input ROM","visible":false,"nbits":"12","value":0,"default_value":0,"draw_data":[]},"SUM_ONE":{"name":"SUM_ONE","verbal":"Input next microinstruction","visible":false,"nbits":"12","value":1,"default_value":1,"draw_data":[]},"MUXA_MICROADDR":{"name":"MUXA_MICROADDR","verbal":"Input microaddress","visible":false,"nbits":"12","value":0,"default_value":0,"draw_data":[]},"MUXC_MUXB":{"name":"MUXC_MUXB","verbal":"Output of MUX C","visible":false,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"INEX":{"name":"INEX","verbal":"Illegal Instruction Exception","visible":false,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"BS_M1":{"name":"BS_M1","verbal":"from Memory","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BS_TD":{"name":"BS_TD","verbal":"Memory","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"INTV":{"name":"INTV","verbal":"Interruption Vector","visible":false,"nbits":"8","value":0,"default_value":0,"draw_data":[]},"M2_C2":{"name":"M2_C2","verbal":"Input of Program Counter","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"M1_C1":{"name":"M1_C1","verbal":"Input of Memory Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"M7_C7":{"name":"M7_C7","verbal":"Input of State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"VAL_ZERO":{"name":"VAL_ZERO","verbal":"Wired Zero","visible":false,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"VAL_ONE":{"name":"VAL_ONE","verbal":"Wired One","visible":false,"nbits":"32","value":1,"default_value":1,"draw_data":[]},"VAL_FOUR":{"name":"VAL_FOUR","verbal":"Wired Four","visible":false,"nbits":"32","value":4,"default_value":4,"draw_data":[]},"REG_IR_DECO":{"name":"IR_DECO","verbal":"Instruction Decoded","visible":true,"nbits":"0","value":0,"default_value":0,"draw_data":[]},"DECO_INS":{"name":"DECO_INS","verbal":"Instruction decoded in binary","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"CLK":{"name":"CLK","verbal":"Clock","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"ACC_TIME":{"name":"ACC_TIME","verbal":"Accumulated CPU time","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"TTCPU":{"name":"TTCPU","verbal":"Several Tristates to the internal data bus in CPU activated","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"ACC_PWR":{"name":"ACC_PWR","verbal":"Accumulated Energy Consumption","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"IOSR":{"name":"IOSR","verbal":"IO State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"IOCR":{"name":"IOCR","verbal":"IO Control Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"IODR":{"name":"IODR","verbal":"IO Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"KBDR":{"name":"KBDR","verbal":"Keyboard Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"KBSR":{"name":"KBSR","verbal":"Keyboard Status Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"DDR":{"name":"DDR","verbal":"Display Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"DSR":{"name":"DSR","verbal":"Display State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"L3DSR":{"name":"L3DSR","verbal":"L3D State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"L3DCR":{"name":"L3DCR","verbal":"L3D Control Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"L3DDR":{"name":"L3DDR","verbal":"L3D Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"LEDMSR":{"name":"LEDMSR","verbal":"LEDM State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"LEDMCR":{"name":"LEDMCR","verbal":"LEDM Control Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"LEDMDR":{"name":"LEDMDR","verbal":"LEDM Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]}},"signals":{"C":{"name":"C","visible":true,"type":"L","value":0,"default_value":0,"nbits":"4","behavior":["MV MUXC_MUXB VAL_ZERO; FIRE B","MBIT MUXC_MUXB INT 0 1; FIRE B","MBIT MUXC_MUXB IORDY 0 1; FIRE B","MBIT MUXC_MUXB MRDY 0 1; FIRE B","MBIT MUXC_MUXB REG_SR 0 1; FIRE B","MBIT MUXC_MUXB REG_SR 1 1; FIRE B","MBIT MUXC_MUXB REG_SR 28 1; FIRE B","MBIT MUXC_MUXB REG_SR 29 1; FIRE B","MBIT MUXC_MUXB REG_SR 30 1; FIRE B","MBIT MUXC_MUXB REG_SR 31 1; FIRE B","MV MUXC_MUXB INEX; FIRE B"],"fire_name":["svg_cu:text3410"],"draw_data":[["svg_cu:path3108"],["svg_cu:path3062"],["svg_cu:path3060"],["svg_cu:path3136"],["svg_cu:path3482"],["svg_cu:path3480"],["svg_cu:path3488"],["svg_cu:path3486"],["svg_cu:path3484"],["svg_cu:path3484-9"],["svg_cu:path3108-3","svg_cu:path3260-3-8-6","svg_cu:path3260-3-8","svg_cu:path3260-3"]],"draw_name":[["svg_cu:path3496","svg_cu:path3414","svg_cu:path3194-08"]]},"B":{"name":"B","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV A1 MUXC_MUXB; FIRE A1","NOT_ES A1 MUXC_MUXB; FIRE A1"],"depends_on":["CLK"],"fire_name":["svg_cu:text3408"],"draw_data":[["svg_cu:path3100-8-7","svg_cu:path3108-1"],["svg_cu:path3392","svg_cu:path3372","svg_cu:path3390","svg_cu:path3384","svg_cu:path3100-8-7"]],"draw_name":[[],["svg_cu:path3194-0","svg_cu:path3138-8","svg_cu:path3498-6"]]},"A0":{"name":"A0","visible":false,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["SBIT_SIGNAL A0A1 0 1; FIRE A0A1","SBIT_SIGNAL A0A1 1 1; FIRE A0A1"],"depends_on":["CLK"],"fire_name":["svg_cu:text3406"],"draw_data":[["svg_cu:path3096"],["svg_cu:path3096"]],"draw_name":[[],["svg_cu:path3138-8-1","svg_cu:path3098-2","svg_cu:path3124-2-5"]]},"A1":{"name":"A1","visible":false,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["SBIT_SIGNAL A0A1 0 0; FIRE A0A1","SBIT_SIGNAL A0A1 1 0; FIRE A0A1"],"depends_on":["CLK"],"fire_name":[],"draw_data":[["svg_cu:path3094"],["svg_cu:path3094"]],"draw_name":[[]]},"A0A1":{"name":"A0A1","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["PLUS1 MUXA_MICROADDR REG_MICROADDR","CP_FIELD MUXA_MICROADDR REG_MICROINS/MADDR","MV MUXA_MICROADDR ROM_MUXA","MV MUXA_MICROADDR FETCH"],"depends_on":["CLK"],"fire_name":[],"draw_data":[["svg_cu:path3102","svg_cu:path3100","svg_cu:path3098","svg_cu:path3100-9","svg_cu:path3088"],["svg_cu:path3104","svg_cu:path3134","svg_cu:path3500","svg_cu:path3416"],["svg_cu:path3504","svg_cu:path3100-8","svg_cu:path3234-9"],["svg_cu:path3124"]],"draw_name":[[]]},"C0":{"name":"C0","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_MAR BUS_IB"],"fire_name":["svg_p:text3077"],"draw_data":[["svg_p:path3081"]],"draw_name":[["svg_p:path3075"]]},"C1":{"name":"C1","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_MBR M1_C1"],"fire_name":["svg_p:text3079"],"draw_data":[["svg_p:path3055"]],"draw_name":[["svg_p:path3073"]]},"C2":{"name":"C2","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_PC M2_C2; UPDATEDPC"],"fire_name":["svg_p:text3179"],"draw_data":[["svg_p:path3485"]],"draw_name":[["svg_p:path3177"]]},"C3":{"name":"C3","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_IR BUS_IB; DECO; FIRE_IFSET C 10"],"fire_name":["svg_p:text3439"],"draw_data":[["svg_p:path3339"]],"draw_name":[["svg_p:path3337"]]},"C4":{"name":"C4","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_RT1 BUS_IB"],"fire_name":["svg_p:text3441"],"draw_data":[["svg_p:path3263"]],"draw_name":[["svg_p:path3255"]]},"C5":{"name":"C5","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_RT2 BUS_IB"],"fire_name":["svg_p:text3443"],"draw_data":[["svg_p:path3277"]],"draw_name":[["svg_p:path3269"]]},"C6":{"name":"C6","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_RT3 ALU_C6"],"fire_name":["svg_p:text3445"],"draw_data":[["svg_p:path3325","svg_p:path3323","svg_p:path3321","svg_p:path3261-8","svg_p:path3317-9","svg_p:path3901-6-9"]],"draw_name":[["svg_p:path3245"]]},"C7":{"name":"C7","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_SR M7_C7"],"fire_name":["svg_p:text3655"],"draw_data":[["svg_p:path3651-9"]],"draw_name":[["svg_p:path3681"]]},"TA":{"name":"TA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV BUS_AB REG_MAR; MOVE_BITSE A1A0 0 2 BUS_AB 0; FIRE_IFCHANGED A1A0 A1A0"],"fire_name":["svg_p:text3091"],"draw_data":[["svg_p:path3083","svg_p:path3089","svg_p:path3597","svg_p:path3513","svg_p:path3601","svg_p:path3601-2","svg_p:path3187","svg_p:path3087","svg_p:path2995","svg_p:path3535"]],"draw_name":[["svg_p:path3085"]]},"TD":{"name":"TD","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; CHECK_RTD","MV BUS_DB BS_TD; MOVE_BITSE A1A0 0 2 BUS_AB 0; FIRE_IFCHANGED A1A0 A1A0; CHECK_RTD"],"fire_name":["svg_p:text3103"],"draw_data":[["svg_p:path3093","svg_p:path3101","svg_p:path3587","svg_p:path3515","svg_p:path3071","svg_p:path3419","svg_p:path3099","svg_p:path3097","svg_p:path3559-5","svg_p:path3419-1-0","svg_p:path3583","svg_p:path3419-1","svg_p:path3491","svg_p:path3641","svg_p:path3541"]],"draw_name":[["svg_p:path3095"]]},"T1":{"name":"T1","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 0","MV BUS_IB REG_MBR; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 0"],"fire_name":["svg_p:text3105"],"draw_data":[["svg_p:path3065","svg_p:path3071","svg_p:path3049","svg_p:path3063-9","svg_p:path3071","svg_p:path3071","svg_p:path3069"]],"draw_name":[["svg_p:path3067"]]},"T2":{"name":"T2","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 1","MV BUS_IB REG_PC; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 1"],"fire_name":["svg_p:text3449"],"draw_data":[["svg_p:path3195","svg_p:path3199","svg_p:path3201","svg_p:path3049"]],"draw_name":[["svg_p:path3329"]]},"T3":{"name":"T3","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 2","MV BUS_IB SELEC_T3; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 2"],"fire_name":["svg_p:text3451"],"draw_data":[["svg_p:path3347","svg_p:path3349","svg_p:path3931","svg_p:path3345","svg_p:path3049"]],"draw_name":[["svg_p:path3351"]]},"T4":{"name":"T4","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 3","MV BUS_IB REG_RT1; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 3"],"fire_name":["svg_p:text3453"],"draw_data":[["svg_p:path3257","svg_p:path3261","svg_p:path3259","svg_p:path3049"]],"draw_name":[["svg_p:path3305"]]},"T5":{"name":"T5","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 4","MV BUS_IB REG_RT2; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 4"],"fire_name":["svg_p:text3455"],"draw_data":[["svg_p:path3271","svg_p:path3275","svg_p:path3273","svg_p:path3049"]],"draw_name":[["svg_p:path3307"]]},"T6":{"name":"T6","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 5","MV BUS_IB ALU_C6; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 5"],"fire_name":["svg_p:text3457"],"draw_data":[["svg_p:path3315","svg_p:path3589","svg_p:path3317","svg_p:path3163-2","svg_p:path3049","svg_p:path3321","svg_p:path3261-8","svg_p:path3317-9","svg_p:path3901-6-9"]],"draw_name":[["svg_p:path3319"]]},"T7":{"name":"T7","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 6","MV BUS_IB REG_RT3; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 6"],"fire_name":["svg_p:text3459"],"draw_data":[["svg_p:path3309","svg_p:path3327","svg_p:path3311","svg_p:path3049"]],"draw_name":[["svg_p:path3313"]]},"T8":{"name":"T8","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 7","MV BUS_IB REG_SR; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 7"],"fire_name":["svg_p:text3657"],"draw_data":[["svg_p:path3645","svg_p:path3651","svg_p:path3647","svg_p:path3049"]],"draw_name":[["svg_p:path3649"]]},"T9":{"name":"T9","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 8","MV BUS_IB RA_T9; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 8"],"fire_name":["svg_p:text3147"],"draw_data":[["svg_p:path3131","svg_p:path3143","svg_p:path3139","svg_p:path3049","svg_p:path3143-9"]],"draw_name":[["svg_p:path3133"]]},"T10":{"name":"T10","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 9","MV BUS_IB RB_T10; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 9"],"fire_name":["svg_p:text3149"],"draw_data":[["svg_p:path3135","svg_p:path3145","svg_p:path3141","svg_p:path3049","svg_p:path3145-5"]],"draw_name":[["svg_p:path3137"]]},"T11":{"name":"T11","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 10","CP_FIELD BUS_IB REG_MICROINS/EXCODE; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 10"],"fire_name":["svg_p:text3147-5","svg_cu:tspan4426"],"draw_data":[["svg_p:path3131-3","svg_p:path3145","svg_p:path3081-3","svg_p:path3139-7","svg_p:path3049","svg_cu:path3081-3","svg_cu:path3139-7"]],"draw_name":[["svg_p:path3133-6","svg_cu:path3133-6"]]},"T12":{"name":"T12","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 11","MV BUS_IB HPC_T12; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 11"],"fire_name":["svg_p:text3147-5-0-1-1"],"draw_data":[["svg_p:path3131-3-8-4-31","svg_p:path3139-7-1-4-3","svg_p:path3049","svg_p:path3081-3-8-5-3"]],"draw_name":[["svg_p:path3133-6-9-7-5"]]},"M1":{"name":"M1","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV M1_C1 BUS_IB","MV M1_C1 BS_M1"],"depends_on":["C1"],"fire_name":["svg_p:text3469"],"draw_data":[["svg_p:path3063","svg_p:path3061","svg_p:path3059"],["svg_p:path3057","svg_p:path3641","svg_p:path3419","svg_p:path3583"]],"draw_name":[[],["svg_p:path3447"]]},"M2":{"name":"M2","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV M2_C2 BUS_IB","PLUS4 M2_C2 REG_PC"],"depends_on":["C2"],"fire_name":["svg_p:text3471"],"draw_data":[["svg_p:path3217","svg_p:path3215","svg_p:path3213","svg_p:path3213-9"],["svg_p:path3211","svg_p:path3209","svg_p:path3193","svg_p:path3207","svg_p:path3197","svg_p:path3201"]],"draw_name":[[],["svg_p:path3467","svg_p:path3467"]]},"M7":{"name":"M7","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV M7_C7 BUS_IB","MV M7_C7 SELP_M7"],"depends_on":["C7"],"fire_name":["svg_p:text3673"],"draw_data":[["svg_p:path3691","svg_p:path3693","svg_p:path3659"],["svg_p:path3695"]],"draw_name":[[],["svg_p:path3667"]]},"MA":{"name":"MA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV MA_ALU RA_T9; FIRE COP","MV MA_ALU REG_RT1; FIRE COP"],"depends_on":["SELA","SELB"],"fire_name":["svg_p:text3463"],"draw_data":[["svg_p:path3249","svg_p:path3161","svg_p:path3165"],["svg_p:path3279"]],"draw_name":[[],["svg_p:path3423"]]},"MB":{"name":"MB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["MV MB_ALU RB_T10; FIRE COP","MV MB_ALU REG_RT2; FIRE COP","MV MB_ALU VAL_FOUR; FIRE COP","MV MB_ALU VAL_ONE; FIRE COP"],"depends_on":["SELA","SELB"],"fire_name":["svg_p:text3465"],"draw_data":[["svg_p:path3281","svg_p:path3171","svg_p:path3169"],["svg_p:path3283"],["svg_p:path3295","svg_p:path3293"],["svg_p:path3297","svg_p:path3299"]],"draw_name":[[],["svg_p:path3425","svg_p:path3427"]]},"MH":{"name":"MH","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["MV HPC_T12 CLK","MV HPC_T12 ACC_TIME","MV HPC_T12 ACC_PWR","NOP"],"fire_name":["svg_p:text3147-5-0-1-8-4"],"draw_data":[[],["svg_p:path3081-3-8-5-3"]],"draw_name":[[],["svg_p:path3306-8-7-6"]]},"COP":{"name":"COP","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","forbidden":true,"behavior":["NOP_ALU; UPDATE_NZVC","AND ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","OR ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","NOT ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","XOR ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SRL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SRA ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","RR ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","RL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","ADD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SUB ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MUL ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","DIV ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MOD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","LUI ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FADD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FSUB ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FMUL ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FDIV ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FCVT ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FCLASS ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","ADDU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SUBU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MULU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","DIVU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU"],"depends_on":["SELCOP"],"fire_name":["svg_p:text3303"],"draw_data":[["svg_p:path3237","svg_p:path3239","svg_p:path3261-8","svg_p:path3321","svg_p:path3901-6","svg_p:path3317-9"]],"draw_name":[["svg_p:path3009","svg_p:path3301"]]},"SELP":{"name":"SELP","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["NOP","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_U 0; FIRE M7","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_I 1; FIRE M7","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_C 31; UPDATE_FLAG SELP_M7 FLAG_V 30; UPDATE_FLAG SELP_M7 FLAG_N 29; UPDATE_FLAG SELP_M7 FLAG_Z 28; FIRE M7"],"fire_name":["svg_p:text3703"],"draw_data":[[],["svg_p:path3643"],["svg_p:path3705"],["svg_p:path3675","svg_p:path3331"]],"draw_name":[[],["svg_p:path3697"]]},"SELA":{"name":"SELA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["FIRE MR_RA"],"depends_on":["RA"],"fire_name":["svg_cu:text3164"],"draw_data":[[]],"draw_name":[[]]},"SELB":{"name":"SELB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["FIRE MR_RB"],"depends_on":["RB"],"fire_name":["svg_cu:text3168"],"draw_data":[[]],"draw_name":[[]]},"SELC":{"name":"SELC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["FIRE MR_RC"],"depends_on":["RC"],"fire_name":["svg_cu:text3172"],"draw_data":[[]],"draw_name":[[]]},"SELCOP":{"name":"SELCOP","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["FIRE MC"],"depends_on":["COP"],"fire_name":["svg_cu:text3312"],"draw_data":[[]],"draw_name":[[]]},"EXCODE":{"name":"EXCODE","visible":true,"type":"L","value":0,"default_value":0,"nbits":"4","behavior":["FIRE T11"],"fire_name":["svg_cu:text3312-6"],"draw_data":[[]],"draw_name":[]},"RA":{"name":"RA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","forbidden":true,"behavior":["GET RA_T9 BR RA; FIRE_IFSET T9 1; FIRE_IFSET MA 0"],"depends_on":["SELA"],"fire_name":["svg_p:text3107"],"draw_data":[[]],"draw_name":[["svg_p:path3109"]]},"RB":{"name":"RB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","forbidden":true,"behavior":["GET RB_T10 BR RB; FIRE_IFSET T10 1; FIRE_IFSET MB 0"],"depends_on":["SELB"],"fire_name":["svg_p:text3123"],"draw_data":[[]],"draw_name":[["svg_p:path3113"]]},"RC":{"name":"RC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","forbidden":true,"behavior":["FIRE LC"],"depends_on":["SELC"],"fire_name":["svg_p:text3125"],"draw_data":[[]],"draw_name":[["svg_p:path3117"]]},"LC":{"name":"LC","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","SET BR RC BUS_IB"],"fire_name":["svg_p:text3127"],"draw_data":[["svg_p:path3153","svg_p:path3151","svg_p:path3129"]],"draw_name":[["svg_p:path3121"]]},"SE":{"name":"SE","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3; MOVE_BITS SBWA 4 1 SE; FIRE_IFCHANGED SBWA SE","MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3; MOVE_BITS SBWA 4 1 SE; FIRE_IFCHANGED SBWA SE"],"depends_on":["T3"],"fire_name":["svg_p:text3593","svg_p:text3431"],"draw_data":[[]],"draw_name":[["svg_p:path3591","svg_p:path3447-7-7"]]},"SIZE":{"name":"SIZE","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3"],"depends_on":["T3"],"fire_name":["svg_p:text3363"],"draw_data":[[]],"draw_name":[["svg_p:path3355"]]},"OFFSET":{"name":"OFFSET","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3"],"depends_on":["T3"],"fire_name":["svg_p:text3707"],"draw_data":[[]],"draw_name":[["svg_p:path3359"]]},"MC":{"name":"MC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT COP REG_IR 0 5; FIRE COP;","CP_FIELD COP REG_MICROINS/SELCOP; FIRE COP;"],"depends_on":["SELCOP"],"fire_name":["svg_cu:text3322","svg_cu:text3172-1-5"],"draw_data":[["svg_cu:path3320","svg_cu:path3142"],["svg_cu:path3318","svg_cu:path3502-6"]],"draw_name":[[],["svg_cu:path3306"]]},"MR":{"name":"MR","verbal":["Copy from IR[SelA], from IR[SelB], and from IR[SelB] into RA, RB, and RC. ","Copy SelA, SelB, and SelB into RA, RB, and RC. "],"visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV MR_RA MR; FIRE MR_RA; MV MR_RB MR; FIRE MR_RB; MV MR_RC MR; FIRE MR_RC;","MV MR_RA MR; FIRE MR_RA; MV MR_RB MR; FIRE MR_RB; MV MR_RC MR; FIRE MR_RC;"],"depends_on":["SELA","SELB","SELC"],"fire_name":["svg_cu:text3222","svg_cu:text3242","svg_cu:text3254","svg_cu:text3172-1"],"draw_data":[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3260","svg_cu:path3196","svg_cu:path3278","svg_cu:path3292","svg_cu:path3142","svg_cu:path3258-4","svg_cu:path3390-7","svg_cu:path3258","svg_cu:path3280"],["svg_cu:path3270","svg_cu:path3282","svg_cu:path3300","svg_cu:path3258","svg_cu:path3260","svg_cu:path3258-4","svg_cu:path3278","svg_cu:path3196","svg_cu:path3294","svg_cu:path3292","svg_cu:path3288","svg_cu:path3280","svg_cu:path3258","svg_cu:path3258-4","svg_cu:path3390-7"]],"draw_name":[[],["svg_cu:path3220","svg_cu:path3240","svg_cu:path3252"]]},"MR_RA":{"name":"MR_RA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT_SN RA REG_IR REG_MICROINS/SELA 5; FIRE RA;","CP_FIELD RA REG_MICROINS/SELA; FIRE RA;"],"fire_name":[],"draw_data":[[]],"draw_name":[[]]},"MR_RB":{"name":"MR_RB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT_SN RB REG_IR REG_MICROINS/SELB 5; FIRE RB;","CP_FIELD RB REG_MICROINS/SELB; FIRE RB;"],"fire_name":[],"draw_data":[[]],"draw_name":[[]]},"MR_RC":{"name":"MR_RC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT_SN RC REG_IR REG_MICROINS/SELC 5; FIRE RC;","CP_FIELD RC REG_MICROINS/SELC; FIRE RC;"],"fire_name":[],"draw_data":[[]],"draw_name":[[]]},"BW":{"name":"BW","verbal":["Select one byte (based on A1A0) from Word. ","Select two bytes (one Half Word based on A1A0) from Word. ","","Select the full Word. "],"visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW"],"fire_name":["svg_p:text3433"],"draw_data":[["svg_p:path3061-2-6","svg_p:path3101-8","svg_p:path3535-8"]],"draw_name":[[],[]]},"A1A0":{"name":"A1A0","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA"],"fire_name":["svg_p:text3603"],"draw_data":[[],[]],"draw_name":[[],[]]},"BWA":{"name":"BWA","visible":false,"type":"L","value":0,"default_value":0,"nbits":"4","behavior":["BSEL BS_TD 0 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 8 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 24 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W"],"fire_name":["svg_p:text3533-5"],"draw_data":[[],[]],"draw_name":[[],[]]},"SBWA":{"name":"SBWA","visible":false,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["BSEL BS_M1 0 8 BUS_DB 0; FIRE M1","BSEL BS_M1 0 8 BUS_DB 8; FIRE M1","BSEL BS_M1 0 8 BUS_DB 16; FIRE M1","BSEL BS_M1 0 8 BUS_DB 24; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","BSEL BS_M1 0 8 BUS_DB 0; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 8; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 16; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 24; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1"],"fire_name":[],"draw_data":[[],[]],"draw_name":[[],[]]},"IOR":{"name":"IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MOVE_BITS KBD_IOR 0 1 IOR; MOVE_BITS SCR_IOR 0 1 IOR; MOVE_BITS L3D_IOR 0 1 IOR; MOVE_BITS L3D_IOR 0 1 IOR; FIRE KBD_IOR; FIRE SCR_IOR; FIRE L3D_IOR; FIRE LEDM_IOR"],"fire_name":["svg_p:text3715"],"draw_data":[[],["svg_p:path3733","svg_p:path3491","svg_p:text3715"]],"draw_name":[[],[]]},"IOW":{"name":"IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MOVE_BITS SCR_IOW 0 1 IOW; FIRE SCR_IOW; MOVE_BITS IO_IOW 0 1 IOW; FIRE IO_IOW; MOVE_BITS L3D_IOW 0 1 IOW; FIRE L3D_IOW; MOVE_BITS LEDM_IOW 0 1 IOW; FIRE LEDM_IOW"],"fire_name":["svg_p:text3717"],"draw_data":[[],["svg_p:path3735","svg_p:path3491","svg_p:text3717"]],"draw_name":[[],[]]},"I":{"name":"I","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV FLAG_I VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_I VAL_ONE; FIRE_IFSET SELP 2"],"fire_name":[],"draw_data":[[],[]],"draw_name":[[],[]]},"U":{"name":"U","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV FLAG_U VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_U VAL_ONE; FIRE_IFSET SELP 2"],"fire_name":[],"draw_data":[[],[]],"draw_name":[[],[]]},"TEST_C":{"name":"TEST_C","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_C VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_C VAL_ONE; FIRE_IFSET SELP 3"],"depends_on":["SELCOP","COP"],"fire_name":["svg_p:text3701-3"],"draw_data":[["svg_p:text3701-3"]],"draw_name":[[]]},"TEST_V":{"name":"TEST_V","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_V VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_V VAL_ONE; FIRE_IFSET SELP 3"],"depends_on":["SELCOP","COP"],"fire_name":["svg_p:text3701-3-1"],"draw_data":[["svg_p:text3701-3-1"]],"draw_name":[[]]},"TEST_N":{"name":"TEST_N","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_N VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_N VAL_ONE; FIRE_IFSET SELP 3"],"depends_on":["SELCOP","COP"],"fire_name":["svg_p:text3701-3-2"],"draw_data":[["svg_p:text3701-3-2"]],"draw_name":[[]]},"TEST_Z":{"name":"TEST_Z","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_Z VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_Z VAL_ONE; FIRE_IFSET SELP 3"],"depends_on":["SELCOP","COP"],"fire_name":["svg_p:text3701-3-5"],"draw_data":[["svg_p:text3701-3-5"]],"draw_name":[[]]},"TEST_I":{"name":"TEST_I","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV FLAG_I VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_I VAL_ONE; FIRE_IFSET SELP 2"],"depends_on":["CLK"],"fire_name":["svg_p:text3669"],"draw_data":[["svg_p:text3669"]],"draw_name":[[]]},"TEST_U":{"name":"TEST_U","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV FLAG_U VAL_ZERO; FIRE_IFSET SELP 1","MV FLAG_U VAL_ONE; FIRE_IFSET SELP 1"],"depends_on":["CLK"],"fire_name":["svg_p:text3669-1"],"draw_data":[["svg_p:text3669-1"]],"draw_name":[[]]},"TEST_INTV":{"name":"TEST_INTV","visible":true,"type":"L","value":0,"default_value":0,"nbits":"8","forbidden":true,"behavior":["MBIT INTV TEST_INTV 0 32"],"depends_on":["INT"],"fire_name":["svg_p:tspan4225"],"draw_data":[["svg_p:path3749"]],"draw_name":[[]]},"MRDY":{"name":"MRDY","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","depends_on":["CLK"],"behavior":["FIRE_IFCHANGED MRDY C","FIRE_IFCHANGED MRDY C"],"fire_name":["svg_p:tspan3916","svg_p:text3909"],"draw_data":[[],["svg_p:path3895","svg_p:path3541"]],"draw_name":[[],[]]},"R":{"name":"R","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; CHECK_RTD","MEM_READ BUS_AB BUS_DB BWA MRDY CLK; FIRE MRDY; CHECK_RTD"],"fire_name":["svg_p:text3533-5-2","svg_p:text3713"],"draw_data":[[],["svg_p:path3557","svg_p:path3571"]],"draw_name":[[],[]]},"W":{"name":"W","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MEM_WRITE BUS_AB BUS_DB BWA MRDY CLK; FIRE MRDY"],"fire_name":["svg_p:text3533-5-08","svg_p:text3527","svg_p:text3431-7"],"draw_data":[[],["svg_p:path3559","svg_p:path3575","svg_p:path3447-7"]],"draw_name":[[],[]]},"INT":{"name":"INT","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","depends_on":["CLK"],"behavior":["FIRE C","FIRE C"],"fire_name":["svg_p:tspan4199"],"draw_data":[[],["svg_p:path3809"]],"draw_name":[[],[]]},"IORDY":{"name":"IORDY","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","depends_on":["CLK"],"behavior":["FIRE_IFCHANGED IORDY C","FIRE_IFCHANGED IORDY C"],"fire_name":["svg_p:tspan4089","svg_p:path3793","svg_p:text3911"],"draw_data":[[],["svg_p:path3897"]],"draw_name":[[],[]]},"IO_IOR":{"name":"IO_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","IO_IOR BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE SBWA"],"fire_name":["svg_p:tspan4173"],"draw_data":[[],["svg_p:path3795","svg_p:path3733"]],"draw_name":[[],[]]},"IO_IOW":{"name":"IO_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","IO_IOW BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE SBWA"],"fire_name":["svg_p:text3785-0-6-0-5-5"],"draw_data":[[],["svg_p:path3805","svg_p:path3733"]],"draw_name":[[],[]]},"IO_IE":{"name":"IO_IE","visible":true,"type":"L","value":1,"default_value":1,"nbits":"1","behavior":["NOP","IO_CHK_I CLK INT INTV; FIRE C"],"fire_name":[],"draw_data":[[],[]],"draw_name":[[],[]]},"INTA":{"name":"INTA","visible":true,"type":"L","value":1,"default_value":0,"nbits":"1","behavior":["NOP","INTA CLK INT INTA BUS_DB INTV; FIRE BW; FIRE C"],"fire_name":["svg_p:text3785-0-6-0-5-5-1-1"],"draw_data":[[],["svg_p:path3807","svg_p:path3737"]],"draw_name":[[],[]]},"KBD_IOR":{"name":"KBD_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","KBD_IOR BUS_AB BUS_DB KBDR KBSR CLK; FIRE SBWA"],"fire_name":["svg_p:tspan4057"],"draw_data":[[],["svg_p:path3863","svg_p:path3847"]],"draw_name":[[],[]]},"SCR_IOR":{"name":"SCR_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","SCR_IOR BUS_AB BUS_DB DDR DSR CLK"],"fire_name":["svg_p:tspan4004"],"draw_data":[[],["svg_p:path3871","svg_p:path3857"]],"draw_name":[[],[]]},"SCR_IOW":{"name":"SCR_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","SCR_IOW BUS_AB BUS_DB DDR DSR CLK"],"fire_name":["svg_p:tspan4006"],"draw_data":[[],["svg_p:path3873","svg_p:path3857"]],"draw_name":[[],[]]},"L3D_IOR":{"name":"L3D_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","L3D_IOR BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE SBWA"],"fire_name":["svg_p:tspan4173"],"draw_data":[[],["svg_p:path3795","svg_p:path3733"]],"draw_name":[[],[]]},"L3D_IOW":{"name":"L3D_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","L3D_IOW BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE SBWA; L3D_SYNC"],"fire_name":["svg_p:text3785-0-6-0-5-5"],"draw_data":[[],["svg_p:path3805","svg_p:path3733"]],"draw_name":[[],[]]},"LEDM_IOR":{"name":"LEDM_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LEDM_IOR BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE SBWA"],"fire_name":["svg_p:tspan4173"],"draw_data":[[],["svg_p:path3795","svg_p:path3733"]],"draw_name":[[],[]]},"LEDM_IOW":{"name":"LEDM_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LEDM_IOW BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE SBWA; LEDM_SYNC"],"fire_name":["svg_p:text3785-0-6-0-5-5"],"draw_data":[[],["svg_p:path3805","svg_p:path3733"]],"draw_name":[[],[]]}},"behaviors":{"PRINT_S":{"nparameters":2,"types":["S"],"operation":"/Function(function(s_expr){console.log(s_expr[1]+\": 0x\"+sim.ep.signals[s_expr[1]].value.toString(16))})/","verbal":"/Function(function(s_expr){return\"Print value of signal \"+s_expr[1]+\": 0x\"+sim.ep.signals[s_expr[1]].value.toString(16)+\". \"})/"},"PRINT_E":{"nparameters":2,"types":["E"],"operation":"/Function(function(s_expr){console.log(s_expr[1]+\": 0x\"+sim.ep.states[s_expr[1]].value.toString(16))})/","verbal":"/Function(function(s_expr){return\"Print value of state \"+s_expr[1]+\": 0x\"+sim.ep.states[s_expr[1]].value.toString(16)+\". \"})/"},"NOP":{"nparameters":1,"operation":"/Function(function(s_expr){})/","verbal":"/Function(function(s_expr){return\"\"})/"},"NOP_ALU":{"nparameters":1,"operation":"/Function(function(s_expr){sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0})/","verbal":"/Function(function(s_expr){return\"\"})/"},"MV":{"nparameters":3,"types":["X","X"],"operation":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)})/","verbal":"/Function(function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+show_verbal(s_expr[2])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(newval)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" (\"+show_value(newval)+\"). \"})/"},"LOAD":{"nparameters":3,"types":["X","X"],"operation":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)})/","verbal":"/Function(function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Load from \"+show_verbal(s_expr[2])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(newval)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" (\"+show_value(newval)+\"). \"})/"},"CP_FIELD":{"nparameters":3,"types":["X","X"],"operation":"/Function(function(s_expr){r=s_expr[2].split(\"/\");sim_elto_org=get_reference(r[0]);newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval!=\"undefined\"){sim_elto_dst=get_reference(s_expr[1]);set_value(sim_elto_dst,newval)}})/","verbal":"/Function(function(s_expr){var newval=0;var r=s_expr[2].split(\"/\");var sim_elto_org=get_reference(r[0]);var sim_elto_dst=get_reference(r[1]);if(typeof sim_elto_dst==\"undefined\")sim_elto_dst={};if(typeof sim_elto_org.value[r[1]]!=\"undefined\")newval=sim_elto_org.value[r[1]];else if(typeof sim_elto_dst.default_value!=\"undefined\")newval=sim_elto_dst.default_value;else newval=\"<undefined>\";var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from Field \"+r[1]+\" of \"+show_verbal(r[0])+\" to \"+show_verbal(s_expr[1])+\" value \"+newval+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(r[0])+\".\"+r[1]+\" (\"+newval+\"). \"})/"},"NOT_ES":{"nparameters":3,"types":["S","E"],"operation":"/Function(function(s_expr){set_value(sim.ep.signals[s_expr[1]],Math.abs(get_value(sim.ep.states[s_expr[2]])-1))})/","verbal":"/Function(function(s_expr){var value=Math.abs(get_value(sim.ep.states[s_expr[2]])-1);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Set \"+show_verbal(s_expr[1])+\" with value \"+show_value(value)+\" (Logical NOT of \"+s_expr[2]+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_value(value)+\" (Logical NOT \"+s_expr[2]+\"). \"})/"},"GET":{"nparameters":4,"types":["E","E","S"],"operation":"/Function(function(s_expr){set_value(sim.ep.states[s_expr[1]],get_value(sim.ep.states[s_expr[2]][sim.ep.signals[s_expr[3]].value]))})/","verbal":"/Function(function(s_expr){var value=get_value(sim.ep.states[s_expr[2]][sim.ep.signals[s_expr[3]].value]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Set \"+show_verbal(s_expr[1])+\" with value \"+show_value(value)+\" (Register File \"+s_expr[3]+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_value(value)+\" (Register File \"+s_expr[3]+\"). \"})/"},"SET":{"nparameters":4,"types":["E","S","E"],"operation":"/Function(function(s_expr){set_value(sim.ep.states[s_expr[1]][sim.ep.signals[s_expr[2]].value],get_value(sim.ep.states[s_expr[3]]))})/","verbal":"/Function(function(s_expr){var value=get_value(sim.ep.states[s_expr[3]]);var o_ref=sim.ep.states[s_expr[1]][sim.ep.signals[s_expr[2]].value];var o_verbal=o_ref.name;if(typeof o_ref.verbal!=\"undefined\")o_verbal=o_ref.verbal;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy to \"+o_verbal+\" the value \"+show_value(value)+\". \"}return o_verbal+\" = \"+show_value(value)+\". \"})/"},"AND":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])&get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])&get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU AND with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (AND). \"})/"},"OR":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])|get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])|get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU OR with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (OR). \"})/"},"NOT":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=~get_value(sim.ep.states[s_expr[2]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=~get_value(sim.ep.states[s_expr[2]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU NOT with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (NOT). \"})/"},"XOR":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])^get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])^get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU XOR with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (XOR). \"})/"},"SRL":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Shift Right Logical with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SRL). \"})/"},"SRA":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Shift Right Arithmetic with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SRA). \"})/"},"SL":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=result>>>31})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Shift Left with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SL). \"})/"},"RR":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1|(get_value(sim.ep.states[s_expr[2]])&1)<<31;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1|(get_value(sim.ep.states[s_expr[2]])&1)<<31;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Right Rotation with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (RR). \"})/"},"RL":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1|(get_value(sim.ep.states[s_expr[2]])&2147483648)>>>31;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1|(get_value(sim.ep.states[s_expr[2]])&2147483648)>>>31;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Left Rotation with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (LR). \"})/"},"ADD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a+b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a+b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU ADD with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (ADD). \"})/"},"SUB":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a-b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a-b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU SUB with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SUB). \"})/"},"MUL":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a*b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a*b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU MUL with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (MUL). \"})/"},"DIV":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){return\"ALU DIV zero by zero (oops!). \"}var result=Math.floor(a/b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU DIV with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (DIV). \"})/"},"MOD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=a%b;set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){return\"ALU MOD zero by zero (oops!). \"}var result=a%b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU MOD with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (MOD). \"})/"},"LUI":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<16;set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<16;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Load Upper Immediate with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (LUI). \"})/"},"ADDU":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a+b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a+b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU ADDU with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (ADDU). \"})/"},"SUBU":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a-b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a-b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU SUBU with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SUBU). \"})/"},"MULU":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a*b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a*b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU MULU with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (MULU). \"})/"},"DIVU":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;if(0==b){return\"ALU DIVU zero by zero (oops!). \"}var result=Math.floor(a/b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU DIVU with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (DIVU). \"})/"},"FADD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)+hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)+hex2float(b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU FADD with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (FADD). \"})/"},"FSUB":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU FSUB with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (FSUB). \"})/"},"FMUL":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)*hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)*hex2float(b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU FMUL with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (FMUL). \"})/"},"FDIV":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)/hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU FDIV with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (FDIV). \"})/"},"FCVT":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]]);var result=a;switch(b){case 1:result=hex2float(result);result=Math.trunc(result);break;case 2:result=hex2float(result);result=Math.round(result);break;case 4:result=result.toFixed(5);result=parseFloat(result);result=float2decimal(result);break;default:break}set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]]);var result=a;switch(b){case 1:result=hex2float(result);result=Math.trunc(result);break;case 2:result=hex2float(result);result=Math.round(result);break;case 4:result=result.toFixed(5);result=parseFloat(result);result=float2decimal(result);break;default:break}var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU FCVT with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (FCVT). \"})/"},"FCLASS":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var result=float_class(a);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])>>>0;var result=float_class(a);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU FCLASS with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (FCLASS). \"})/"},"PLUS1":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+1;set_value(sim.ep.states[s_expr[1]],result>>>0)})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy to \"+show_verbal(s_expr[1])+\" \"+show_verbal(s_expr[2])+\" plus one with result \"+show_value(result)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" + 1\"+\" (\"+show_value(result)+\"). \"})/"},"PLUS4":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+4;set_value(sim.ep.states[s_expr[1]],result>>>0)})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+4;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy to \"+show_verbal(s_expr[1])+\" \"+show_verbal(s_expr[2])+\" plus four with result \"+show_value(result)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" + 4\"+\" (\"+show_value(result)+\"). \"})/"},"SET_TT":{"nparameters":3,"types":["E","I"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a|m;set_value(sim.ep.states[s_expr[1]],r);update_cpu_bus_fire(r,b)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"RST_TT":{"nparameters":3,"types":["E","I"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a&~m;set_value(sim.ep.states[s_expr[1]],r);update_cpu_bus_fire(r,b)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"CHECK_RTD":{"nparameters":1,"operation":"/Function(function(s_expr){var number_active_tri=parseInt(simhw_sim_signal(\"TD\").value)+parseInt(simhw_sim_signal(\"R\").value);update_system_bus_fire(number_active_tri)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"MBIT":{"nparameters":5,"types":["X","X","I","I"],"operation":"/Function(function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);set_value(sim_elto_dst,parseInt(n2,2))})/","verbal":"/Function(function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=parseInt(n2,2);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+show_verbal(s_expr[2])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(n3)+\" (copied \"+size+\" bits from bit \"+offset+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" (\"+show_value(n3)+\", \"+size+\" bits from bit \"+offset+\"). \"})/"},"MBIT_SN":{"nparameters":5,"types":["S","E","E","I"],"operation":"/Function(function(s_expr){var base=0;var r=s_expr[3].split(\"/\");if(1==r.length)base=get_value(sim.ep.states[s_expr[3]]);else if(typeof sim.ep.states[r[0]].value[r[1]]!=\"undefined\")base=sim.ep.states[r[0]].value[r[1]];else if(typeof sim.ep.signals[r[1]].default_value!=\"undefined\")base=sim.ep.signals[r[1]].default_value;else if(typeof sim.ep.states[r[1]].default_value!=\"undefined\")base=sim.ep.states[r[1]].default_value;else ws_alert(\"WARN: undefined state/field pair -> \"+r[0]+\"/\"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.ep.states[s_expr[2]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){var base=0;var r=s_expr[3].split(\"/\");if(1==r.length)base=get_value(sim.ep.states[s_expr[3]]);else if(typeof sim.ep.states[r[0]].value[r[1]]!=\"undefined\")base=sim.ep.states[r[0]].value[r[1]];else if(typeof sim.ep.signals[r[1]].default_value!=\"undefined\")base=sim.ep.signals[r[1]].default_value;else if(typeof sim.ep.states[r[1]].default_value!=\"undefined\")base=sim.ep.states[r[1]].default_value;else ws_alert(\"WARN: undefined state/field pair -> \"+r[0]+\"/\"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.ep.states[s_expr[2]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);var from_elto=\"\";if(1==r.length)from_elto=show_verbal(s_expr[3]);else from_elto=show_verbal(s_expr[2])+\"[\"+r[1]+\"] \";var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+from_elto+\"into \"+show_verbal(s_expr[1])+\" \"+\"value \"+parseInt(n3,2)+\". \"}return show_verbal(s_expr[1])+\" = \"+from_elto+\" (\"+parseInt(n3,2)+\"). \"})/"},"SBIT_SIGNAL":{"nparameters":4,"types":["X","I","I"],"operation":"/Function(function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)})/","verbal":"/Function(function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)})/"},"UPDATE_FLAG":{"nparameters":4,"types":["X","X","I"],"operation":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value&~(1<>>0)})/","verbal":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Update \"+show_verbal(s_expr[2])+\" to value \"+sim_elto_org.value+\". \"}return show_verbal(s_expr[1])+\".\"+show_verbal(s_expr[3])+\" = \"+sim_elto_org.value+\". \"})/"},"MBITS":{"nparameters":8,"types":["E","I","E","S","S","I","S"],"operation":"/Function(function(s_expr){var offset=parseInt(sim.ep.signals[s_expr[4]].value);var size=parseInt(sim.ep.signals[s_expr[5]].value);var n1=get_value(sim.ep.states[s_expr[3]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;if(\"1\"==sim.ep.signals[s_expr[7]].value&&\"1\"==n2.substr(0,1)){n3=\"11111111111111111111111111111111\".substring(0,32-n2.length)+n2}set_value(sim.ep.states[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){var offset=parseInt(sim.ep.signals[s_expr[4]].value);var size=parseInt(sim.ep.signals[s_expr[5]].value);var n1=get_value(sim.ep.states[s_expr[3]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;if(\"1\"==sim.ep.signals[s_expr[7]].value&&\"1\"==n2.substr(0,1)){n3=\"11111111111111111111111111111111\".substring(0,32-n2.length)+n2}n1=parseInt(n3,2);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\" Copy from \"+show_verbal(s_expr[3])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(n1)+\" (copied \"+size+\" bits from bit \"+offset+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[3])+\" (\"+show_value(n1)+\", \"+size+\" bits from bit \"+offset+\"). \"})/"},"BSEL":{"nparameters":6,"types":["E","I","I","E","I"],"operation":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var n4=\"00000000000000000000000000000000\".substr(0,posd);n3=n3+n4;set_value(sim.ep.states[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var len=parseInt(s_expr[3]);var poso=parseInt(s_expr[5]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var n4=\"00000000000000000000000000000000\".substr(0,posd);n3=n3+n4;var n5=parseInt(n3,2);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+show_verbal(s_expr[4])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(n5)+\" (copied \"+len+\" bits, from bit \"+poso+\" of \"+s_expr[4]+\" to bit \"+posd+\" of \"+s_expr[1]+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[4])+\" (\"+show_value(n5)+\", \"+len+\" bits, from bit \"+poso+\" of \"+s_expr[4]+\" to bit \"+posd+\" of \"+s_expr[1]+\"). \"})/"},"EXT_SIG":{"nparameters":3,"types":["E","I"],"operation":"/Function(function(s_expr){var n1=get_value(sim.ep.states[s_expr[1]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if(\"1\"==n2[31-s_expr[2]]){n4=\"11111111111111111111111111111111\".substring(0,32-n3.length)+n4}set_value(sim.ep.states[s_expr[1]],parseInt(n4,2))})/","verbal":"/Function(function(s_expr){var n1=get_value(sim.ep.states[s_expr[1]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if(\"1\"==n2[31-s_expr[2]]){n4=\"11111111111111111111111111111111\".substring(0,32-n3.length)+n4}var n5=parseInt(n4,2);return\"Sign Extension with value \"+show_value(n5)+\". \"})/"},"MOVE_BITS":{"nparameters":5,"types":["S","I","I","S"],"operation":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var poso=0;var len=parseInt(s_expr[3]);var n1=sim.ep.signals[s_expr[4]].value.toString(2);n1=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.ep.signals[s_expr[1]].value.toString(2);n2=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){return\"\"})/"},"MOVE_BITSE":{"nparameters":6,"types":["S","I","I","E","I"],"operation":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);n1=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.ep.signals[s_expr[1]].value.toString(2);n2=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){return\"\"})/"},"DECO":{"nparameters":1,"operation":"/Function(function(s_expr){sim.ep.states[\"INEX\"].value=0;var oi=decode_instruction(sim.ep.internal_states.FIRMWARE,sim.ep.ctrl_states.ir,get_value(sim.ep.states[\"REG_IR\"]));if(null==oi.oinstruction){ws_alert(\"ERROR: undefined instruction code in IR (\"+\"co:\"+oi.op_code.toString(2)+\", \"+\"cop:\"+oi.cop_code.toString(2)+\")\");sim.ep.states[\"ROM_MUXA\"].value=0;sim.ep.states[\"INEX\"].value=1;return-1}var rom_addr=oi.op_code<<6;if(typeof oi.oinstruction.cop!=\"undefined\"){rom_addr=rom_addr+oi.cop_code}if(typeof sim.ep.internal_states[\"ROM\"][rom_addr]==\"undefined\"){ws_alert(\"ERROR: undefined rom address \"+rom_addr+\" in firmware\");sim.ep.states[\"ROM_MUXA\"].value=0;return-1}sim.ep.states[\"ROM_MUXA\"].value=sim.ep.internal_states[\"ROM\"][rom_addr];var val=get_value(sim.ep.states[\"DECO_INS\"]);set_value(sim.ep.states[\"DECO_INS\"],val+1);var pc=get_value(sim.ep.states[\"REG_PC\"])-4;var decins=get_deco_from_pc(pc);set_value(sim.ep.states[\"REG_IR_DECO\"],decins);show_dbg_ir(get_value(sim.ep.states[\"REG_IR_DECO\"]))})/","verbal":"/Function(function(s_expr){return\"Decode instruction. \"})/"},"FIRE":{"nparameters":2,"types":["S"],"operation":"/Function(function(s_expr){if(sim.ep.internal_states.fire_stack.indexOf(s_expr[1])!=-1){return}sim.ep.internal_states.fire_stack.push(s_expr[1]);update_draw(sim.ep.signals[s_expr[1]],sim.ep.signals[s_expr[1]].value);if(\"L\"==sim.ep.signals[s_expr[1]].type){update_state(s_expr[1])}sim.ep.internal_states.fire_stack.pop(s_expr[1])})/","verbal":"/Function(function(s_expr){return\"\"})/"},"FIRE_IFSET":{"nparameters":3,"types":["S","I"],"operation":"/Function(function(s_expr){if(get_value(sim.ep.signals[s_expr[1]])!=parseInt(s_expr[2])){return}sim.ep.behaviors[\"FIRE\"].operation(s_expr)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"FIRE_IFCHANGED":{"nparameters":3,"types":["S","X"],"operation":"/Function(function(s_expr){sim_elto=get_reference(s_expr[2]);if(sim_elto.changed==false){return}sim.ep.behaviors[\"FIRE\"].operation(s_expr)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"RESET_CHANGED":{"nparameters":2,"types":["X"],"operation":"/Function(function(s_expr){sim_elto=get_reference(s_expr[1]);sim_elto.changed=false})/","verbal":"/Function(function(s_expr){return\"\"})/"},"CLOCK":{"nparameters":1,"operation":"/Function(function(s_expr){var new_maddr=null;var mcelto=null;var t0=performance.now();var val=get_value(sim.ep.states[\"CLK\"]);set_value(sim.ep.states[\"CLK\"],val+1);set_value(sim.ep.states[\"TTCPU\"],0);new_maddr=get_value(sim.ep.states[\"REG_MICROADDR\"]);mcelto=sim.ep.internal_states[\"MC\"][new_maddr];if(typeof mcelto!==\"undefined\"&&false==mcelto.is_native){for(var i=0;i0){remain=sim.ep.events.mem[clk-1]-1}var first_time=typeof sim.ep.events.mem[clk]==\"undefined\";sim.ep.events.mem[clk]=remain;if(remain>0){return}address=address&4294967292;var value=main_memory_getvalue(sim.ep.internal_states.MP,address);var full_redraw=false;if(typeof value===\"undefined\"){value=0;full_redraw=true}dbvalue=main_memory_fusionvalues(dbvalue,value,bw);sim.ep.states[s_expr[2]].value=dbvalue>>>0;sim.ep.signals[s_expr[4]].value=1;show_main_memory(sim.ep.internal_states.MP,address,full_redraw,false);if(first_time&&sim.ep.internal_states.CM.length>0){cache_memory_access(sim.ep.internal_states.CM[0],address,\"read\",clk)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);var bw_type=\"word\";if(0==(bw&12))bw_type=\"byte\";else if(1==(bw&12))bw_type=\"half\";var value=main_memory_getvalue(sim.ep.internal_states.MP,address);if(typeof value===\"undefined\")value=0;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){verbal=\"Try to read a \"+bw_type+\" from memory \"+\"at address 0x\"+address.toString(16)+\" with value 0x\"+value.toString(16)+\". \"}verbal=\"Memory output = 0x\"+value.toString(16)+\" (Read a \"+bw_type+\" from 0x\"+address.toString(16)+\"). \";return verbal})/"},"MEM_WRITE":{"nparameters":6,"types":["E","E","S","S","E"],"operation":"/Function(function(s_expr){var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);sim.ep.signals[s_expr[4]].value=0;var remain=get_value(sim.ep.internal_states.MP_wc);if(typeof sim.ep.events.mem[clk-1]!=\"undefined\"&&sim.ep.events.mem[clk-1]>0){remain=sim.ep.events.mem[clk-1]-1}var first_time=typeof sim.ep.events.mem[clk]==\"undefined\";sim.ep.events.mem[clk]=remain;if(remain>0){return}address=address&4294967292;var value=main_memory_getvalue(sim.ep.internal_states.MP,address);var full_redraw=false;if(typeof value===\"undefined\"){value=0;full_redraw=true}value=main_memory_fusionvalues(value,dbvalue,bw);var origin=\"\";var r_value=main_memory_get_program_counter();if(r_value!=null){origin=\"PC=0x\"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.ep.internal_states.MP,address,melto);sim.ep.signals[s_expr[4]].value=1;show_main_memory(sim.ep.internal_states.MP,address,full_redraw,true);if(first_time&&sim.ep.internal_states.CM.length>0){cache_memory_access(sim.ep.internal_states.CM[0],address,\"write\",clk)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);var bw_type=\"word\";if(0==(bw&12))bw_type=\"byte\";else if(1==(bw&12))bw_type=\"half\";var value=main_memory_getvalue(sim.ep.internal_states.MP,address);if(typeof value===\"undefined\")value=0;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){verbal=\"Try to write a \"+bw_type+\" to memory \"+\"at address 0x\"+address.toString(16)+\" with value \"+value.toString(16)+\". \"}verbal=\"Memory[0x\"+address.toString(16)+\"] = \"+\"0x\"+value.toString(16)+\" (Write a \"+bw_type+\" to 0x\"+address.toString(16)+\"). \";return verbal})/"},"MEMORY_RESET":{"nparameters":1,"operation":"/Function(function(s_expr){sim.ep.events.mem={}})/","verbal":"/Function(function(s_expr){return\"Reset main memory (all values will be zeroes). \"})/"},"IO_IOR":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==IOSR_ID)set_value(sim.ep.states[s_expr[2]],iosr);if(bus_ab==IOCR_ID)set_value(sim.ep.states[s_expr[2]],iocr);if(bus_ab==IODR_ID)set_value(sim.ep.states[s_expr[2]],iodr)})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==IOSR_ID)verbal=\"I/O device read at IOSR of value \"+iosr+\". \";if(bus_ab==IOCR_ID)verbal=\"I/O device read at IOCR of value \"+iocr+\". \";if(bus_ab==IODR_ID)verbal=\"I/O device read at IODR of value \"+iodr+\". \";return verbal})/"},"IO_IOW":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab!=IOSR_ID&&bus_ab!=IOCR_ID&&bus_ab!=IODR_ID){return}if(bus_ab==IOSR_ID)set_value(sim.ep.states[s_expr[3]],bus_db);if(bus_ab==IOCR_ID)set_value(sim.ep.states[s_expr[4]],bus_db);if(bus_ab==IODR_ID)set_value(sim.ep.states[s_expr[5]],bus_db);var iocr_id=get_value(sim.ep.states[s_expr[4]]);var iodr_id=get_value(sim.ep.states[s_expr[5]]);if(iocr_id<0||iocr_id>7)return;set_var(sim.ep.internal_states.io_int_factory[iocr_id].period,iodr_id);set_var(sim.ep.internal_states.io_int_factory[iocr_id].probability,1);if(0==iodr_id){set_var(sim.ep.internal_states.io_int_factory[iocr_id].probability,0)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab==IOSR_ID)verbal=\"I/O device write at IOSR with value \"+bus_db+\". \";if(bus_ab==IOCR_ID)verbal=\"I/O device write at IOCR with value \"+bus_db+\". \";if(bus_ab==IODR_ID)verbal=\"I/O device write at IODR with value \"+bus_db+\". \";return verbal})/"},"IO_CHK_I":{"nparameters":4,"types":["E","S","E"],"operation":"/Function(function(s_expr){var clk=get_value(sim.ep.states[s_expr[1]]);for(var i=sim.ep.internal_states.io_int_factory.length-1;i>=0;i--){if(get_var(sim.ep.internal_states.io_int_factory[i].period)==0)continue;if(get_var(sim.ep.internal_states.io_int_factory[i].active)==true){set_value(sim.ep.signals[s_expr[2]],1);set_value(sim.ep.states[s_expr[3]],i)}if(clk%get_var(sim.ep.internal_states.io_int_factory[i].period)==0){if(Math.random()>get_var(sim.ep.internal_states.io_int_factory[i].probability))continue;var acc=get_var(sim.ep.internal_states.io_int_factory[i].accumulated);set_var(sim.ep.internal_states.io_int_factory[i].accumulated,acc+1);set_var(sim.ep.internal_states.io_int_factory[i].active,true);if(typeof sim.ep.events.io[clk]==\"undefined\"){sim.ep.events.io[clk]=[]}sim.ep.events.io[clk].push(i);set_value(sim.ep.signals[s_expr[2]],1);set_value(sim.ep.states[s_expr[3]],i)}}})/","verbal":"/Function(function(s_expr){return\"Check I/O Interruption. \"})/"},"INTA":{"nparameters":6,"types":["E","S","S","E","E"],"operation":"/Function(function(s_expr){var clk=get_value(sim.ep.states[s_expr[1]]);if(typeof sim.ep.events.io[clk]!=\"undefined\"){set_value(sim.ep.states[s_expr[4]],sim.ep.events.io[clk][0]);return}set_value(sim.ep.signals[s_expr[2]],0);set_value(sim.ep.states[s_expr[5]],0);for(var i=0;i>24;var y=(iodr&16711680)>>16;var z=(iodr&65280)>>8;var p=z*Math.pow(sim.ep.internal_states.l3d_dim,2)+y*sim.ep.internal_states.l3d_dim+x;var s=get_var(sim.ep.internal_states.l3d_state[p].active);set_value(sim.ep.states[s_expr[2]],s)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==L3DSR_ID)verbal=\"I/O device read at L3DSR of value \"+iosr+\". \";if(bus_ab==L3DCR_ID)verbal=\"I/O device read at L3DCR of value \"+iocr+\". \";if(bus_ab==L3DDR_ID)verbal=\"I/O device read at L3DDR of value \"+iodr+\". \";return verbal})/"},"L3D_IOW":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab!=L3DSR_ID&&bus_ab!=L3DCR_ID&&bus_ab!=L3DDR_ID){return}if(bus_ab==L3DSR_ID){set_value(sim.ep.states[s_expr[3]],bus_db)}if(bus_ab==L3DDR_ID){set_value(sim.ep.states[s_expr[5]],bus_db)}if(bus_ab==L3DCR_ID){set_value(sim.ep.states[s_expr[4]],bus_db);var x=(bus_db&4278190080)>>24;var y=(bus_db&16711680)>>16;var z=(bus_db&65280)>>8;var p=z*Math.pow(sim.ep.internal_states.l3d_dim,2)+y*sim.ep.internal_states.l3d_dim+x;var s=(bus_db&255)!=0;set_var(sim.ep.internal_states.l3d_state[p].active,s)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab==L3DSR_ID)verbal=\"I/O device write at L3DSR with value \"+bus_db+\". \";if(bus_ab==L3DCR_ID)verbal=\"I/O device write at L3DCR with value \"+bus_db+\". \";if(bus_ab==L3DDR_ID)verbal=\"I/O device write at L3DDR with value \"+bus_db+\". \";return verbal})/"},"L3D_RESET":{"nparameters":1,"operation":"/Function(function(s_expr){sim.ep.events.l3d={};var n=sim.ep.internal_states.l3d_state.length;for(var i=0;i>24;var y=(iodr&16711680)>>16;var p=y*sim.ep.internal_states.ledm_dim+x;var s=get_var(sim.ep.internal_states.ledm_state[p].color);set_value(sim.ep.states[s_expr[2]],s)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==LEDMSR_ID)verbal=\"I/O device read at LEDMSR of value \"+iosr+\". \";if(bus_ab==LEDMCR_ID)verbal=\"I/O device read at LEDMCR of value \"+iocr+\". \";if(bus_ab==LEDMDR_ID)verbal=\"I/O device read at LEDMDR of value \"+iodr+\". \";return verbal})/"},"LEDM_IOW":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);switch(bus_ab){case LEDMSR_ID:set_value(sim.ep.states[s_expr[3]],bus_db);break;case LEDMDR_ID:set_value(sim.ep.states[s_expr[5]],bus_db);break;case LEDMCR_ID:set_value(sim.ep.states[s_expr[4]],bus_db);break;default:break}if(LEDMCR_ID==bus_ab){var dr=get_value(sim.ep.states[s_expr[5]]);if(16&bus_db){var x=(dr&4278190080)>>24;var y=(dr&16711680)>>16;var s=dr&255;set_value(sim.ep.states[s_expr[3]],1);if(x>=sim.ep.internal_states.ledm_dim&&y>=sim.ep.internal_states.ledm_dim){set_value(sim.ep.states[s_expr[3]],-1);return}var p=y*sim.ep.internal_states.ledm_dim+x;set_var(sim.ep.internal_states.ledm_state[p].color,s)}if(32&bus_db){set_value(sim.ep.states[s_expr[3]],1);var s=0;var neltos=sim.ep.internal_states.ledm_neltos;for(var p=0;p>0);set_var(sim.ep.internal_states.ledm_state[p+1].color,(s&65280)>>8);set_var(sim.ep.internal_states.ledm_state[p+2].color,(s&16711680)>>16);set_var(sim.ep.internal_states.ledm_state[p+3].color,(s&4278190080)>>24)}}if(64&bus_db){set_value(sim.ep.states[s_expr[3]],1);var s=0;var c=\"\";var neltos=sim.ep.internal_states.ledm_colors.length;for(var p=0;p>>8;s=s.toString(16);c=\"#\"+simcoreui_pack(s,6);sim.ep.internal_states.ledm_colors[p]=c}neltos=sim.ep.internal_states.ledm_neltos;for(var p=0;p>24;var y=(dr&16711680)>>16;var s=dr&255;verbal=\"I/O device write at LEDMCR with value \"+bus_db+\" (set pixel x:\"+x+\", y:\"+y+\", with color:\"+s+\"). \"}if(64&bus_db){verbal=\"I/O device write at LEDMCR with value \"+bus_db+\" (set color palette at:\"+bus_db+\"). \"}break;default:break}return verbal})/"},"LEDM_RESET":{"nparameters":1,"operation":"/Function(function(s_expr){sim.ep.events.ledm={};sim.ep.internal_states.ledm_colors=colors_clone(\"\");for(var i=0;i>>0;if(value!=0){vec.CPU[\"R\"+i]={type:\"register\",default_value:0,id:\"R\"+i,op:\"=\",value:\"0x\"+value.toString(16)}}}for(i=0;i>>0;if(value!=0){vec.CPU[internal_reg[i]]={type:\"register\",default_value:0,id:internal_reg[i],op:\"=\",value:\"0x\"+value.toString(16)}}}return vec})/","read_state":"/Function(function(vec,check){if(typeof vec.CPU==\"undefined\"){vec.CPU={}}var key=check[\"id\"].toUpperCase().trim();var val=parseInt(check[\"value\"]).toString(16);if(\"REGISTER\"==check[\"type\"].toUpperCase().trim()){vec.CPU[key]={type:\"register\",default_value:0,id:key,op:check[\"condition\"],value:\"0x\"+val};return true}return false})/","get_state":"/Function(function(reg){var value=0;var r_reg=reg.toUpperCase().trim();if(typeof sim.ep.states[\"REG_\"+r_reg]!=\"undefined\"){value=get_value(sim.ep.states[\"REG_\"+r_reg])>>>0;return\"0x\"+value.toString(16)}r_reg=r_reg.replace(\"R\",\"\");var index=parseInt(r_reg);if(typeof sim.ep.states.BR[index]!=\"undefined\"){value=get_value(sim.ep.states.BR[index])>>>0;return\"0x\"+value.toString(16)}return null})/","get_value":"/Function(function(elto){if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index))return get_value(simhw_sim_state(elto))>>>0;return get_value(simhw_sim_states().BR[index])>>>0})/","set_value":"/Function(function(elto,value){var pc_name=simhw_sim_ctrlStates_get().pc.state;if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index)){set_value(simhw_sim_state(elto),value);if(pc_name===elto){show_asmdbg_pc()}return value}return set_value(simhw_sim_states().BR[index],value)})/"},"MEMORY":{"name":"MEMORY","version":"1","abilities":["MEMORY"],"details_name":["MEMORY","MEMORY_CONFIG"],"details_fire":[["svg_p:text3001"],[]],"write_state":"/Function(function(vec){if(typeof vec.MEMORY==\"undefined\")vec.MEMORY={};var key=0;var value=0;for(var index in sim.ep.internal_states.MP){value=main_memory_getvalue(sim.ep.internal_states.MP,index);value=parseInt(value);if(value!=0){key=parseInt(index).toString(16);vec.MEMORY[\"0x\"+key]={type:\"memory\",default_value:0,id:\"0x\"+key,op:\"=\",value:\"0x\"+value.toString(16)}}}return vec})/","read_state":"/Function(function(vec,check){if(typeof vec.MEMORY==\"undefined\")vec.MEMORY={};var key=parseInt(check.id).toString(16);var val=parseInt(check.value).toString(16);if(\"MEMORY\"==check.type.toUpperCase().trim()){vec.MEMORY[\"0x\"+key]={type:\"memory\",default_value:0,id:\"0x\"+key,op:check.condition,value:\"0x\"+val};return true}return false})/","get_state":"/Function(function(pos){var index=parseInt(pos);var value=main_memory_getvalue(sim.ep.internal_states.MP,elto);if(typeof value===\"undefined\"){return null}return\"0x\"+parseInt(value).toString(16)})/","get_value":"/Function(function(elto){var value=main_memory_getvalue(sim.ep.internal_states.MP,elto);show_main_memory(sim.ep.internal_states.MP,elto,false,false);return value>>>0})/","set_value":"/Function(function(elto,value){var origin=\"\";var r_value=main_memory_get_program_counter();if(r_value!=null){origin=\"PC=0x\"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.ep.internal_states.MP,elto,melto);show_main_memory(sim.ep.internal_states.MP,elto,typeof valref===\"undefined\",true);return value})/"},"IO":{"name":"IO","version":"1","abilities":["IO_TIMER"],"details_name":["IO_STATS","IO_CONFIG"],"details_fire":[["svg_p:text3775"],[]],"write_state":"/Function(function(vec){return vec})/","read_state":"/Function(function(o,check){return false})/","get_state":"/Function(function(reg){return null})/","get_value":"/Function(function(elto){var associated_state=simhw_internalState_get(\"io_hash\",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_signal(\"IOR\"),1);compute_behavior(\"FIRE IOR\");value=get_value(simhw_sim_state(\"BUS_DB\"));return value})/","set_value":"/Function(function(elto,value){var associated_state=simhw_internalState_get(\"io_hash\",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_state(\"BUS_DB\"),value);set_value(simhw_sim_signal(\"IOW\"),1);compute_behavior(\"FIRE IOW\");return value})/"},"KBD":{"name":"KBD","version":"1","abilities":["KEYBOARD"],"details_name":["KEYBOARD"],"details_fire":[["svg_p:text3829"]],"write_state":"/Function(function(vec){return vec})/","read_state":"/Function(function(o,check){return false})/","get_state":"/Function(function(reg){return null})/","get_value":"/Function(function(elto){return sim.ep.internal_states.keyboard_content})/","set_value":"/Function(function(elto,value){sim.ep.internal_states.keyboard_content=value;return value})/"},"SCREEN":{"name":"SCREEN","version":"1","abilities":["SCREEN"],"details_name":["SCREEN"],"details_fire":[["svg_p:text3845"]],"write_state":"/Function(function(vec){if(typeof vec.SCREEN==\"undefined\"){vec.SCREEN={}}var sim_screen=sim.ep.internal_states.screen_content;var sim_lines=sim_screen.trim().split(\"\\n\");for(var i=0;i>>0;set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_signal(\"IOR\"),1);compute_behavior(\"FIRE IOR\");value=get_value(simhw_sim_state(\"BUS_DB\"));return value})/","set_value":"/Function(function(elto,value){var associated_state=simhw_internalState_get(\"io_hash\",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_state(\"BUS_DB\"),value);set_value(simhw_sim_signal(\"IOW\"),1);compute_behavior(\"FIRE IOW\");return value})/"},"LEDM":{"name":"LEDM","version":"1","abilities":["LEDMATRIX"],"details_name":["LEDMATRIX"],"details_fire":[[]],"write_state":"/Function(function(vec){return vec})/","read_state":"/Function(function(o,check){return false})/","get_state":"/Function(function(reg){return null})/","get_value":"/Function(function(elto){var associated_state=simhw_internalState_get(\"io_hash\",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_signal(\"IOR\"),1);compute_behavior(\"FIRE IOR\");value=get_value(simhw_sim_state(\"BUS_DB\"));return value})/","set_value":"/Function(function(elto,value){var associated_state=simhw_internalState_get(\"io_hash\",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_state(\"BUS_DB\"),value);set_value(simhw_sim_signal(\"IOW\"),1);compute_behavior(\"FIRE IOW\");return value})/"}},"states":{"BR":[{"name":"R0","verbal":"Register 0","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R1","verbal":"Register 1","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R2","verbal":"Register 2","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R3","verbal":"Register 3","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R4","verbal":"Register 4","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R5","verbal":"Register 5","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R6","verbal":"Register 6","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R7","verbal":"Register 7","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R8","verbal":"Register 8","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R9","verbal":"Register 9","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R10","verbal":"Register 10","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R11","verbal":"Register 11","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R12","verbal":"Register 12","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R13","verbal":"Register 13","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R14","verbal":"Register 14","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R15","verbal":"Register 15","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R16","verbal":"Register 16","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R17","verbal":"Register 17","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R18","verbal":"Register 18","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R19","verbal":"Register 19","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R20","verbal":"Register 20","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R21","verbal":"Register 21","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R22","verbal":"Register 22","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R23","verbal":"Register 23","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R24","verbal":"Register 24","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R25","verbal":"Register 25","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R26","verbal":"Register 26","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R27","verbal":"Register 27","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R28","verbal":"Register 28","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R29","verbal":"Register 29","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R30","verbal":"Register 30","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R31","verbal":"Register 31","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]}],"REG_PC":{"name":"PC","verbal":"Program Counter Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_MAR":{"name":"MAR","verbal":"Memory Address Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_MBR":{"name":"MBR","verbal":"Memory Data Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_IR":{"name":"IR","verbal":"Instruction Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_RT1":{"name":"RT1","verbal":"Temporal 1 Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_RT2":{"name":"RT2","verbal":"Temporal 2 Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_RT3":{"name":"RT3","verbal":"Temporal 3 Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_SR":{"name":"SR","verbal":"State Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_IB":{"name":"I_BUS","verbal":"Internal Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_AB":{"name":"A_BUS","verbal":"Address Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_CB":{"name":"C_BUS","verbal":"Control Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_DB":{"name":"D_BUS","verbal":"Data Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"C2_T2":{"name":"C2_T2","verbal":"Output of PC","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"RA_T9":{"name":"RA_T9","verbal":"Input of T9 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"RB_T10":{"name":"RB_T10","verbal":"Input of T10 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"HPC_T12":{"name":"HPC_T12","verbal":"Input of T12 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"SELEC_T3":{"name":"SELEC_T3","verbal":"Input of T3 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"SELP_M7":{"name":"SELP_M7","verbal":"Output of MUX SelP","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"ALU_C6":{"name":"ALU_C6","verbal":"Input of Temporal 3 Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"MA_ALU":{"name":"MA_ALU","verbal":"Input ALU via MA","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"MB_ALU":{"name":"MB_ALU","verbal":"Input ALU via MB","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"FLAG_C":{"name":"FLAG_C","verbal":"Carry Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_V":{"name":"FLAG_V","verbal":"Overflow Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_N":{"name":"FLAG_N","verbal":"Negative Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_Z":{"name":"FLAG_Z","verbal":"Zero Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_I":{"name":"FLAG_I","verbal":"Interruption Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_U":{"name":"FLAG_U","verbal":"User Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"REG_MICROADDR":{"name":"µADDR","verbal":"Microaddress Register","visible":true,"nbits":"12","value":0,"default_value":0,"draw_data":["svg_cu:text4667"]},"REG_MICROINS":{"name":"µINS","verbal":"Microinstruction Register","visible":true,"nbits":"77","value":{},"default_value":{},"draw_data":[]},"FETCH":{"name":"FETCH","verbal":"Input Fetch","visible":false,"nbits":"12","value":0,"default_value":0,"draw_data":[]},"ROM_MUXA":{"name":"ROM_MUXA","verbal":"Input ROM","visible":false,"nbits":"12","value":0,"default_value":0,"draw_data":[]},"SUM_ONE":{"name":"SUM_ONE","verbal":"Input next microinstruction","visible":false,"nbits":"12","value":1,"default_value":1,"draw_data":[]},"MUXA_MICROADDR":{"name":"MUXA_MICROADDR","verbal":"Input microaddress","visible":false,"nbits":"12","value":0,"default_value":0,"draw_data":[]},"MUXC_MUXB":{"name":"MUXC_MUXB","verbal":"Output of MUX C","visible":false,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"INEX":{"name":"INEX","verbal":"Illegal Instruction Exception","visible":false,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"BS_M1":{"name":"BS_M1","verbal":"from Memory","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BS_TD":{"name":"BS_TD","verbal":"Memory","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"INTV":{"name":"INTV","verbal":"Interruption Vector","visible":false,"nbits":"8","value":0,"default_value":0,"draw_data":[]},"M2_C2":{"name":"M2_C2","verbal":"Input of Program Counter","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"M1_C1":{"name":"M1_C1","verbal":"Input of Memory Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"M7_C7":{"name":"M7_C7","verbal":"Input of State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"VAL_ZERO":{"name":"VAL_ZERO","verbal":"Wired Zero","visible":false,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"VAL_ONE":{"name":"VAL_ONE","verbal":"Wired One","visible":false,"nbits":"32","value":1,"default_value":1,"draw_data":[]},"VAL_FOUR":{"name":"VAL_FOUR","verbal":"Wired Four","visible":false,"nbits":"32","value":4,"default_value":4,"draw_data":[]},"REG_IR_DECO":{"name":"IR_DECO","verbal":"Instruction Decoded","visible":true,"nbits":"0","value":0,"default_value":0,"draw_data":[]},"DECO_INS":{"name":"DECO_INS","verbal":"Instruction decoded in binary","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"CLK":{"name":"CLK","verbal":"Clock","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"ACC_TIME":{"name":"ACC_TIME","verbal":"Accumulated CPU time","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"TTCPU":{"name":"TTCPU","verbal":"Several Tristates to the internal data bus in CPU activated","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"ACC_PWR":{"name":"ACC_PWR","verbal":"Accumulated Energy Consumption","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"IOSR":{"name":"IOSR","verbal":"IO State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"IOCR":{"name":"IOCR","verbal":"IO Control Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"IODR":{"name":"IODR","verbal":"IO Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"KBDR":{"name":"KBDR","verbal":"Keyboard Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"KBSR":{"name":"KBSR","verbal":"Keyboard Status Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"DDR":{"name":"DDR","verbal":"Display Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"DSR":{"name":"DSR","verbal":"Display State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"L3DSR":{"name":"L3DSR","verbal":"L3D State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"L3DCR":{"name":"L3DCR","verbal":"L3D Control Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"L3DDR":{"name":"L3DDR","verbal":"L3D Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"LEDMSR":{"name":"LEDMSR","verbal":"LEDM State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"LEDMCR":{"name":"LEDMCR","verbal":"LEDM Control Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"LEDMDR":{"name":"LEDMDR","verbal":"LEDM Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]}},"signals":{"C":{"name":"C","visible":true,"type":"L","value":0,"default_value":0,"nbits":"4","behavior":["MV MUXC_MUXB VAL_ZERO; FIRE B","MBIT MUXC_MUXB INT 0 1; FIRE B","MBIT MUXC_MUXB IORDY 0 1; FIRE B","MBIT MUXC_MUXB MRDY 0 1; FIRE B","MBIT MUXC_MUXB REG_SR 0 1; FIRE B","MBIT MUXC_MUXB REG_SR 1 1; FIRE B","MBIT MUXC_MUXB REG_SR 28 1; FIRE B","MBIT MUXC_MUXB REG_SR 29 1; FIRE B","MBIT MUXC_MUXB REG_SR 30 1; FIRE B","MBIT MUXC_MUXB REG_SR 31 1; FIRE B","MV MUXC_MUXB INEX; FIRE B"],"fire_name":["svg_cu:text3410"],"draw_data":[["svg_cu:path3108"],["svg_cu:path3062"],["svg_cu:path3060"],["svg_cu:path3136"],["svg_cu:path3482"],["svg_cu:path3480"],["svg_cu:path3488"],["svg_cu:path3486"],["svg_cu:path3484"],["svg_cu:path3484-9"],["svg_cu:path3108-3","svg_cu:path3260-3-8-6","svg_cu:path3260-3-8","svg_cu:path3260-3"]],"draw_name":[["svg_cu:path3496","svg_cu:path3414","svg_cu:path3194-08"]]},"B":{"name":"B","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV A1 MUXC_MUXB; FIRE A1","NOT_ES A1 MUXC_MUXB; FIRE A1"],"depends_on":["CLK"],"fire_name":["svg_cu:text3408"],"draw_data":[["svg_cu:path3100-8-7","svg_cu:path3108-1","svg_cu:path3200-1"],["svg_cu:path3392","svg_cu:path3372","svg_cu:path3390","svg_cu:path3384","svg_cu:path3100-8-7","svg_cu:path3386"]],"draw_name":[[],["svg_cu:path3194-0","svg_cu:path3138-8","svg_cu:path3498-6"]]},"A0":{"name":"A0","visible":false,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["SBIT_SIGNAL A0A1 0 1; FIRE A0A1","SBIT_SIGNAL A0A1 1 1; FIRE A0A1"],"depends_on":["CLK"],"fire_name":["svg_cu:text3406"],"draw_data":[["svg_cu:path3096"],["svg_cu:path3096"]],"draw_name":[[],["svg_cu:path3138-8-1","svg_cu:path3098-2","svg_cu:path3124-2-5"]]},"A1":{"name":"A1","visible":false,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["SBIT_SIGNAL A0A1 0 0; FIRE A0A1","SBIT_SIGNAL A0A1 1 0; FIRE A0A1"],"depends_on":["CLK"],"fire_name":[],"draw_data":[["svg_cu:path3094"],["svg_cu:path3094"]],"draw_name":[[]]},"A0A1":{"name":"A0A1","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["PLUS1 MUXA_MICROADDR REG_MICROADDR","CP_FIELD MUXA_MICROADDR REG_MICROINS/MADDR","MV MUXA_MICROADDR ROM_MUXA","MV MUXA_MICROADDR FETCH"],"depends_on":["CLK"],"fire_name":[],"draw_data":[["svg_cu:path3102","svg_cu:path3100","svg_cu:path3098","svg_cu:path3100-9","svg_cu:path3088","svg_cu:path3082"],["svg_cu:path3104","svg_cu:path3134","svg_cu:path3500","svg_cu:path3416"],["svg_cu:path3124-2-4","svg_cu:path3124-2","svg_cu:path3504","svg_cu:path3100-8","svg_cu:path3234-9"],["svg_cu:path3124"]],"draw_name":[[]]},"C0":{"name":"C0","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_MAR BUS_IB"],"fire_name":["svg_p:text3077"],"draw_data":[["svg_p:path3081"]],"draw_name":[["svg_p:path3075"]]},"C1":{"name":"C1","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_MBR M1_C1"],"fire_name":["svg_p:text3079"],"draw_data":[["svg_p:path3055"]],"draw_name":[["svg_p:path3073"]]},"C2":{"name":"C2","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_PC M2_C2; UPDATEDPC"],"fire_name":["svg_p:text3179"],"draw_data":[["svg_p:path3485"]],"draw_name":[["svg_p:path3177"]]},"C3":{"name":"C3","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_IR BUS_IB; DECO; FIRE_IFSET C 10"],"fire_name":["svg_p:text3439"],"draw_data":[["svg_p:path3339"]],"draw_name":[["svg_p:path3337"]]},"C4":{"name":"C4","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_RT1 BUS_IB"],"fire_name":["svg_p:text3441"],"draw_data":[["svg_p:path3263"]],"draw_name":[["svg_p:path3255"]]},"C5":{"name":"C5","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_RT2 BUS_IB"],"fire_name":["svg_p:text3443"],"draw_data":[["svg_p:path3277"]],"draw_name":[["svg_p:path3269"]]},"C6":{"name":"C6","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_RT3 ALU_C6"],"fire_name":["svg_p:text3445"],"draw_data":[["svg_p:path3325","svg_p:path3323","svg_p:path3321","svg_p:path3261-8","svg_p:path3317-9","svg_p:path3901-6-9"]],"draw_name":[["svg_p:path3245"]]},"C7":{"name":"C7","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LOAD REG_SR M7_C7"],"fire_name":["svg_p:text3655"],"draw_data":[["svg_p:path3651-9"]],"draw_name":[["svg_p:path3681"]]},"TA":{"name":"TA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV BUS_AB REG_MAR; MOVE_BITSE A1A0 0 2 BUS_AB 0; FIRE_IFCHANGED A1A0 A1A0"],"fire_name":["svg_p:text3091"],"draw_data":[["svg_p:path3061-2","svg_p:path3083","svg_p:path3089","svg_p:path3597","svg_p:path3513","svg_p:path3601","svg_p:path3601-2","svg_p:path3187","svg_p:path3087","svg_p:path2995","svg_p:path3535"]],"draw_name":[["svg_p:path3085"]]},"TD":{"name":"TD","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; CHECK_RTD","MV BUS_DB BS_TD; MOVE_BITSE A1A0 0 2 BUS_AB 0; FIRE_IFCHANGED A1A0 A1A0; CHECK_RTD"],"fire_name":["svg_p:text3103"],"draw_data":[["svg_p:path3545","svg_p:path3093","svg_p:path3101","svg_p:path3587","svg_p:path3515","svg_p:path3071","svg_p:path3419","svg_p:path3099","svg_p:path3097","svg_p:path3559-5","svg_p:path3419-1-0","svg_p:path3583","svg_p:path3419-1","svg_p:path3491","svg_p:path3641","svg_p:path3541"]],"draw_name":[["svg_p:path3095"]]},"T1":{"name":"T1","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 0","MV BUS_IB REG_MBR; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 0"],"fire_name":["svg_p:text3105"],"draw_data":[["svg_p:path3071","svg_p:path3065","svg_p:path3071","svg_p:path3049","svg_p:path3063-9","svg_p:path3071","svg_p:path3071","svg_p:path3069"]],"draw_name":[["svg_p:path3067"]]},"T2":{"name":"T2","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 1","MV BUS_IB REG_PC; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 1"],"fire_name":["svg_p:text3449"],"draw_data":[["svg_p:path3195","svg_p:path3199","svg_p:path3201","svg_p:path3049"]],"draw_name":[["svg_p:path3329"]]},"T3":{"name":"T3","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 2","MV BUS_IB SELEC_T3; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 2"],"fire_name":["svg_p:text3451"],"draw_data":[["svg_p:path3341","svg_p:path3347","svg_p:path3349","svg_p:path3931","svg_p:path3345","svg_p:path3049"]],"draw_name":[["svg_p:path3351"]]},"T4":{"name":"T4","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 3","MV BUS_IB REG_RT1; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 3"],"fire_name":["svg_p:text3453"],"draw_data":[["svg_p:path3257","svg_p:path3261","svg_p:path3259","svg_p:path3049"]],"draw_name":[["svg_p:path3305"]]},"T5":{"name":"T5","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 4","MV BUS_IB REG_RT2; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 4"],"fire_name":["svg_p:text3455"],"draw_data":[["svg_p:path3271","svg_p:path3275","svg_p:path3273","svg_p:path3049"]],"draw_name":[["svg_p:path3307"]]},"T6":{"name":"T6","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 5","MV BUS_IB ALU_C6; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 5"],"fire_name":["svg_p:text3457"],"draw_data":[["svg_p:path3315","svg_p:path3589","svg_p:path3317","svg_p:path3163-2","svg_p:path3049","svg_p:path3321","svg_p:path3261-8","svg_p:path3317-9","svg_p:path3901-6-9"]],"draw_name":[["svg_p:path3319"]]},"T7":{"name":"T7","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 6","MV BUS_IB REG_RT3; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 6"],"fire_name":["svg_p:text3459"],"draw_data":[["svg_p:path3309","svg_p:path3327","svg_p:path3311","svg_p:path3049"]],"draw_name":[["svg_p:path3313"]]},"T8":{"name":"T8","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 7","MV BUS_IB REG_SR; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 7"],"fire_name":["svg_p:text3657"],"draw_data":[["svg_p:path3645","svg_p:path3651","svg_p:path3647","svg_p:path3049"]],"draw_name":[["svg_p:path3649"]]},"T9":{"name":"T9","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 8","MV BUS_IB RA_T9; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 8"],"fire_name":["svg_p:text3147"],"draw_data":[["svg_p:path3131","svg_p:path3143","svg_p:path3139","svg_p:path3049","svg_p:path3143-9"]],"draw_name":[["svg_p:path3133"]]},"T10":{"name":"T10","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 9","MV BUS_IB RB_T10; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 9"],"fire_name":["svg_p:text3149"],"draw_data":[["svg_p:path3135","svg_p:path3145","svg_p:path3141","svg_p:path3049","svg_p:path3145-5"]],"draw_name":[["svg_p:path3137"]]},"T11":{"name":"T11","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 10","CP_FIELD BUS_IB REG_MICROINS/EXCODE; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 10"],"fire_name":["svg_p:text3147-5","svg_cu:tspan4426"],"draw_data":[["svg_cu:path3131-3","svg_p:path3131-3","svg_p:path3145","svg_p:path3081-3","svg_p:path3139-7","svg_p:path3049","svg_cu:path3081-3","svg_cu:path3139-7"]],"draw_name":[["svg_p:path3133-6","svg_cu:path3133-6"]]},"T12":{"name":"T12","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 11","MV BUS_IB HPC_T12; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 11"],"fire_name":["svg_p:text3147-5-0-1-1"],"draw_data":[["svg_p:path3131-3-8-4-31","svg_p:path3139-7-1-4-3","svg_p:path3049","svg_p:path3081-3-8-5-3"]],"draw_name":[["svg_p:path3133-6-9-7-5"]]},"M1":{"name":"M1","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV M1_C1 BUS_IB","MV M1_C1 BS_M1"],"depends_on":["C1"],"fire_name":["svg_p:text3469"],"draw_data":[["svg_p:path3063","svg_p:path3061","svg_p:path3059"],["svg_p:path3057","svg_p:path3641","svg_p:path3419","svg_p:path3583"]],"draw_name":[[],["svg_p:path3447"]]},"M2":{"name":"M2","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV M2_C2 BUS_IB","PLUS4 M2_C2 REG_PC"],"depends_on":["C2"],"fire_name":["svg_p:text3471"],"draw_data":[["svg_p:path3217","svg_p:path3215","svg_p:path3213","svg_p:path3213-9"],["svg_p:path3211","svg_p:path3209","svg_p:path3193","svg_p:path3207","svg_p:path3197","svg_p:path3201"]],"draw_name":[[],["svg_p:path3467","svg_p:path3467"]]},"M7":{"name":"M7","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV M7_C7 BUS_IB","MV M7_C7 SELP_M7"],"depends_on":["C7"],"fire_name":["svg_p:text3673"],"draw_data":[["svg_p:path3691","svg_p:path3693","svg_p:path3659"],["svg_p:path3695"]],"draw_name":[[],["svg_p:path3667"]]},"MA":{"name":"MA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV MA_ALU RA_T9; FIRE COP","MV MA_ALU REG_RT1; FIRE COP"],"depends_on":["SELA","SELB"],"fire_name":["svg_p:text3463"],"draw_data":[["svg_p:path3249","svg_p:path3161","svg_p:path3165"],["svg_p:path3279"]],"draw_name":[[],["svg_p:path3423"]]},"MB":{"name":"MB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["MV MB_ALU RB_T10; FIRE COP","MV MB_ALU REG_RT2; FIRE COP","MV MB_ALU VAL_FOUR; FIRE COP","MV MB_ALU VAL_ONE; FIRE COP"],"depends_on":["SELA","SELB"],"fire_name":["svg_p:text3465"],"draw_data":[["svg_p:path3281","svg_p:path3171","svg_p:path3169"],["svg_p:path3283"],["svg_p:path3295","svg_p:path3293"],["svg_p:path3297","svg_p:path3299"]],"draw_name":[[],["svg_p:path3425","svg_p:path3427"]]},"MH":{"name":"MH","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["MV HPC_T12 CLK","MV HPC_T12 ACC_TIME","MV HPC_T12 ACC_PWR","NOP"],"fire_name":["svg_p:text3147-5-0-1-8-4"],"draw_data":[[],["svg_p:path3081-3-8-5-3"]],"draw_name":[[],["svg_p:path3306-8-7-6"]]},"COP":{"name":"COP","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","forbidden":true,"behavior":["NOP_ALU; UPDATE_NZVC","AND ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","OR ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","NOT ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","XOR ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SRL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SRA ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","RR ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","RL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","ADD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SUB ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MUL ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","DIV ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MOD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","LUI ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FADD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FSUB ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FMUL ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FDIV ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FCVT ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FCLASS ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","ADDU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SUBU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MULU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","DIVU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU"],"depends_on":["SELCOP"],"fire_name":["svg_p:text3303"],"draw_data":[["svg_p:path3237","svg_p:path3239","svg_p:path3261-8","svg_p:path3321","svg_p:path3901-6","svg_p:path3317-9"]],"draw_name":[["svg_p:path3009","svg_p:path3301"]]},"SELP":{"name":"SELP","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["NOP","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_U 0; FIRE M7","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_I 1; FIRE M7","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_C 31; UPDATE_FLAG SELP_M7 FLAG_V 30; UPDATE_FLAG SELP_M7 FLAG_N 29; UPDATE_FLAG SELP_M7 FLAG_Z 28; FIRE M7"],"fire_name":["svg_p:text3703"],"draw_data":[[],["svg_p:path3643"],["svg_p:path3705"],["svg_p:path3675","svg_p:path3331"]],"draw_name":[[],["svg_p:path3697"]]},"SELA":{"name":"SELA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["FIRE MR_RA"],"depends_on":["RA"],"fire_name":["svg_cu:text3164"],"draw_data":[[]],"draw_name":[[]]},"SELB":{"name":"SELB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["FIRE MR_RB"],"depends_on":["RB"],"fire_name":["svg_cu:text3168"],"draw_data":[[]],"draw_name":[[]]},"SELC":{"name":"SELC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["FIRE MR_RC"],"depends_on":["RC"],"fire_name":["svg_cu:text3172"],"draw_data":[[]],"draw_name":[[]]},"SELCOP":{"name":"SELCOP","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["FIRE MC"],"depends_on":["COP"],"fire_name":["svg_cu:text3312"],"draw_data":[[]],"draw_name":[[]]},"EXCODE":{"name":"EXCODE","visible":true,"type":"L","value":0,"default_value":0,"nbits":"4","behavior":["FIRE T11"],"fire_name":["svg_cu:text3312-6"],"draw_data":[[]],"draw_name":[]},"RA":{"name":"RA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","forbidden":true,"behavior":["GET RA_T9 BR RA; FIRE_IFSET T9 1; FIRE_IFSET MA 0"],"depends_on":["SELA"],"fire_name":["svg_p:text3107"],"draw_data":[[]],"draw_name":[["svg_p:path3109"]]},"RB":{"name":"RB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","forbidden":true,"behavior":["GET RB_T10 BR RB; FIRE_IFSET T10 1; FIRE_IFSET MB 0"],"depends_on":["SELB"],"fire_name":["svg_p:text3123"],"draw_data":[[]],"draw_name":[["svg_p:path3113"]]},"RC":{"name":"RC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","forbidden":true,"behavior":["FIRE LC"],"depends_on":["SELC"],"fire_name":["svg_p:text3125"],"draw_data":[[]],"draw_name":[["svg_p:path3117"]]},"LC":{"name":"LC","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","SET BR RC BUS_IB"],"fire_name":["svg_p:text3127"],"draw_data":[["svg_p:path3153","svg_p:path3151","svg_p:path3129"]],"draw_name":[["svg_p:path3121"]]},"SE":{"name":"SE","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3; MOVE_BITS SBWA 4 1 SE; FIRE_IFCHANGED SBWA SE","MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3; MOVE_BITS SBWA 4 1 SE; FIRE_IFCHANGED SBWA SE"],"depends_on":["T3"],"fire_name":["svg_p:text3593","svg_p:text3431"],"draw_data":[[]],"draw_name":[["svg_p:path3591","svg_p:path3447-7-7"]]},"SIZE":{"name":"SIZE","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3"],"depends_on":["T3"],"fire_name":["svg_p:text3363"],"draw_data":[[]],"draw_name":[["svg_p:path3355"]]},"OFFSET":{"name":"OFFSET","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3"],"depends_on":["T3"],"fire_name":["svg_p:text3707"],"draw_data":[[]],"draw_name":[["svg_p:path3359"]]},"MC":{"name":"MC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT COP REG_IR 0 5; FIRE COP;","CP_FIELD COP REG_MICROINS/SELCOP; FIRE COP;"],"depends_on":["SELCOP"],"fire_name":["svg_cu:text3322","svg_cu:text3172-1-5"],"draw_data":[["svg_cu:path3320","svg_cu:path3142"],["svg_cu:path3318","svg_cu:path3502-6"]],"draw_name":[[],["svg_cu:path3306"]]},"MR":{"name":"MR","verbal":["Copy from IR[SelA], from IR[SelB], and from IR[SelB] into RA, RB, and RC. ","Copy SelA, SelB, and SelB into RA, RB, and RC. "],"visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV MR_RA MR; FIRE MR_RA; MV MR_RB MR; FIRE MR_RB; MV MR_RC MR; FIRE MR_RC;","MV MR_RA MR; FIRE MR_RA; MV MR_RB MR; FIRE MR_RB; MV MR_RC MR; FIRE MR_RC;"],"depends_on":["SELA","SELB","SELC"],"fire_name":["svg_cu:text3222","svg_cu:text3242","svg_cu:text3254","svg_cu:text3172-1"],"draw_data":[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3260","svg_cu:path3196","svg_cu:path3278","svg_cu:path3292","svg_cu:path3142","svg_cu:path3258-4","svg_cu:path3390-7","svg_cu:path3258","svg_cu:path3280"],["svg_cu:path3270","svg_cu:path3282","svg_cu:path3300","svg_cu:path3258","svg_cu:path3260","svg_cu:path3258-4","svg_cu:path3278","svg_cu:path3196","svg_cu:path3294","svg_cu:path3292","svg_cu:path3288","svg_cu:path3280","svg_cu:path3258","svg_cu:path3258-4","svg_cu:path3390-7"]],"draw_name":[[],["svg_cu:path3220","svg_cu:path3240","svg_cu:path3252"]]},"MR_RA":{"name":"MR_RA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT_SN RA REG_IR REG_MICROINS/SELA 5; FIRE RA;","CP_FIELD RA REG_MICROINS/SELA; FIRE RA;"],"fire_name":[],"draw_data":[[]],"draw_name":[[]]},"MR_RB":{"name":"MR_RB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT_SN RB REG_IR REG_MICROINS/SELB 5; FIRE RB;","CP_FIELD RB REG_MICROINS/SELB; FIRE RB;"],"fire_name":[],"draw_data":[[]],"draw_name":[[]]},"MR_RC":{"name":"MR_RC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT_SN RC REG_IR REG_MICROINS/SELC 5; FIRE RC;","CP_FIELD RC REG_MICROINS/SELC; FIRE RC;"],"fire_name":[],"draw_data":[[]],"draw_name":[[]]},"BW":{"name":"BW","verbal":["Select one byte (based on A1A0) from Word. ","Select two bytes (one Half Word based on A1A0) from Word. ","","Select the full Word. "],"visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW"],"fire_name":["svg_p:text3433"],"draw_data":[["svg_p:path3061-2-6","svg_p:path3101-8","svg_p:path3535-8"]],"draw_name":[[],[]]},"A1A0":{"name":"A1A0","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA"],"fire_name":["svg_p:text3603"],"draw_data":[[],[]],"draw_name":[[],[]]},"BWA":{"name":"BWA","visible":false,"type":"L","value":0,"default_value":0,"nbits":"4","behavior":["BSEL BS_TD 0 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 8 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 24 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W"],"fire_name":["svg_p:text3533-5"],"draw_data":[[],[]],"draw_name":[[],[]]},"SBWA":{"name":"SBWA","visible":false,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["BSEL BS_M1 0 8 BUS_DB 0; FIRE M1","BSEL BS_M1 0 8 BUS_DB 8; FIRE M1","BSEL BS_M1 0 8 BUS_DB 16; FIRE M1","BSEL BS_M1 0 8 BUS_DB 24; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","BSEL BS_M1 0 8 BUS_DB 0; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 8; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 16; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 24; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1"],"fire_name":[],"draw_data":[[],[]],"draw_name":[[],[]]},"IOR":{"name":"IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MOVE_BITS KBD_IOR 0 1 IOR; MOVE_BITS SCR_IOR 0 1 IOR; MOVE_BITS L3D_IOR 0 1 IOR; MOVE_BITS L3D_IOR 0 1 IOR; FIRE KBD_IOR; FIRE SCR_IOR; FIRE L3D_IOR; FIRE LEDM_IOR"],"fire_name":["svg_p:text3715"],"draw_data":[[],["svg_p:path3733","svg_p:path3491","svg_p:text3715"]],"draw_name":[[],[]]},"IOW":{"name":"IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MOVE_BITS SCR_IOW 0 1 IOW; FIRE SCR_IOW; MOVE_BITS IO_IOW 0 1 IOW; FIRE IO_IOW; MOVE_BITS L3D_IOW 0 1 IOW; FIRE L3D_IOW; MOVE_BITS LEDM_IOW 0 1 IOW; FIRE LEDM_IOW"],"fire_name":["svg_p:text3717"],"draw_data":[[],["svg_p:path3735","svg_p:path3491","svg_p:text3717"]],"draw_name":[[],[]]},"I":{"name":"I","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV FLAG_I VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_I VAL_ONE; FIRE_IFSET SELP 2"],"fire_name":[],"draw_data":[[],[]],"draw_name":[[],[]]},"U":{"name":"U","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV FLAG_U VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_U VAL_ONE; FIRE_IFSET SELP 2"],"fire_name":[],"draw_data":[[],[]],"draw_name":[[],[]]},"TEST_C":{"name":"TEST_C","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_C VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_C VAL_ONE; FIRE_IFSET SELP 3"],"depends_on":["SELCOP","COP"],"fire_name":["svg_p:text3701-3"],"draw_data":[["svg_p:text3701-3"]],"draw_name":[[]]},"TEST_V":{"name":"TEST_V","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_V VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_V VAL_ONE; FIRE_IFSET SELP 3"],"depends_on":["SELCOP","COP"],"fire_name":["svg_p:text3701-3-1"],"draw_data":[["svg_p:text3701-3-1"]],"draw_name":[[]]},"TEST_N":{"name":"TEST_N","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_N VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_N VAL_ONE; FIRE_IFSET SELP 3"],"depends_on":["SELCOP","COP"],"fire_name":["svg_p:text3701-3-2"],"draw_data":[["svg_p:text3701-3-2"]],"draw_name":[[]]},"TEST_Z":{"name":"TEST_Z","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_Z VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_Z VAL_ONE; FIRE_IFSET SELP 3"],"depends_on":["SELCOP","COP"],"fire_name":["svg_p:text3701-3-5"],"draw_data":[["svg_p:text3701-3-5"]],"draw_name":[[]]},"TEST_I":{"name":"TEST_I","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV FLAG_I VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_I VAL_ONE; FIRE_IFSET SELP 2"],"depends_on":["CLK"],"fire_name":["svg_p:text3669"],"draw_data":[["svg_p:text3669"]],"draw_name":[[]]},"TEST_U":{"name":"TEST_U","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV FLAG_U VAL_ZERO; FIRE_IFSET SELP 1","MV FLAG_U VAL_ONE; FIRE_IFSET SELP 1"],"depends_on":["CLK"],"fire_name":["svg_p:text3669-1"],"draw_data":[["svg_p:text3669-1"]],"draw_name":[[]]},"TEST_INTV":{"name":"TEST_INTV","visible":true,"type":"L","value":0,"default_value":0,"nbits":"8","forbidden":true,"behavior":["MBIT INTV TEST_INTV 0 32"],"depends_on":["INT"],"fire_name":["svg_p:tspan4225"],"draw_data":[["svg_p:path3749"]],"draw_name":[[]]},"MRDY":{"name":"MRDY","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","depends_on":["CLK"],"behavior":["FIRE_IFCHANGED MRDY C","FIRE_IFCHANGED MRDY C"],"fire_name":["svg_p:tspan3916","svg_p:text3909"],"draw_data":[[],["svg_p:path3895","svg_p:path3541"]],"draw_name":[[],[]]},"R":{"name":"R","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; CHECK_RTD","MEM_READ BUS_AB BUS_DB BWA MRDY CLK; FIRE MRDY; CHECK_RTD"],"fire_name":["svg_p:text3533-5-2","svg_p:text3713"],"draw_data":[[],["svg_p:path3557","svg_p:path3571"]],"draw_name":[[],[]]},"W":{"name":"W","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MEM_WRITE BUS_AB BUS_DB BWA MRDY CLK; FIRE MRDY"],"fire_name":["svg_p:text3533-5-08","svg_p:text3527","svg_p:text3431-7"],"draw_data":[[],["svg_p:path3559","svg_p:path3575","svg_p:path3447-7"]],"draw_name":[[],[]]},"INT":{"name":"INT","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","depends_on":["CLK"],"behavior":["FIRE C","FIRE C"],"fire_name":["svg_p:tspan4199"],"draw_data":[[],["svg_p:path3809"]],"draw_name":[[],[]]},"IORDY":{"name":"IORDY","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","depends_on":["CLK"],"behavior":["FIRE_IFCHANGED IORDY C","FIRE_IFCHANGED IORDY C"],"fire_name":["svg_p:tspan4089","svg_p:path3793","svg_p:text3911"],"draw_data":[[],["svg_p:path3897"]],"draw_name":[[],[]]},"IO_IOR":{"name":"IO_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","IO_IOR BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE SBWA"],"fire_name":["svg_p:tspan4173"],"draw_data":[[],["svg_p:path3795","svg_p:path3733"]],"draw_name":[[],[]]},"IO_IOW":{"name":"IO_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","IO_IOW BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE SBWA"],"fire_name":["svg_p:text3785-0-6-0-5-5"],"draw_data":[[],["svg_p:path3805","svg_p:path3733"]],"draw_name":[[],[]]},"IO_IE":{"name":"IO_IE","visible":true,"type":"L","value":1,"default_value":1,"nbits":"1","behavior":["NOP","IO_CHK_I CLK INT INTV; FIRE C"],"fire_name":[],"draw_data":[[],[]],"draw_name":[[],[]]},"INTA":{"name":"INTA","visible":true,"type":"L","value":1,"default_value":0,"nbits":"1","behavior":["NOP","INTA CLK INT INTA BUS_DB INTV; FIRE BW; FIRE C"],"fire_name":["svg_p:text3785-0-6-0-5-5-1-1"],"draw_data":[[],["svg_p:path3807","svg_p:path3737"]],"draw_name":[[],[]]},"KBD_IOR":{"name":"KBD_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","KBD_IOR BUS_AB BUS_DB KBDR KBSR CLK; FIRE SBWA"],"fire_name":["svg_p:tspan4057"],"draw_data":[[],["svg_p:path3863","svg_p:path3847"]],"draw_name":[[],[]]},"SCR_IOR":{"name":"SCR_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","SCR_IOR BUS_AB BUS_DB DDR DSR CLK"],"fire_name":["svg_p:tspan4004"],"draw_data":[[],["svg_p:path3871","svg_p:path3857"]],"draw_name":[[],[]]},"SCR_IOW":{"name":"SCR_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","SCR_IOW BUS_AB BUS_DB DDR DSR CLK"],"fire_name":["svg_p:tspan4006"],"draw_data":[[],["svg_p:path3873","svg_p:path3857"]],"draw_name":[[],[]]},"L3D_IOR":{"name":"L3D_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","L3D_IOR BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE SBWA"],"fire_name":["svg_p:tspan4173"],"draw_data":[[],["svg_p:path3795","svg_p:path3733"]],"draw_name":[[],[]]},"L3D_IOW":{"name":"L3D_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","L3D_IOW BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE SBWA; L3D_SYNC"],"fire_name":["svg_p:text3785-0-6-0-5-5"],"draw_data":[[],["svg_p:path3805","svg_p:path3733"]],"draw_name":[[],[]]},"LEDM_IOR":{"name":"LEDM_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LEDM_IOR BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE SBWA"],"fire_name":["svg_p:tspan4173"],"draw_data":[[],["svg_p:path3795","svg_p:path3733"]],"draw_name":[[],[]]},"LEDM_IOW":{"name":"LEDM_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LEDM_IOW BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE SBWA; LEDM_SYNC"],"fire_name":["svg_p:text3785-0-6-0-5-5"],"draw_data":[[],["svg_p:path3805","svg_p:path3733"]],"draw_name":[[],[]]}},"behaviors":{"PRINT_S":{"nparameters":2,"types":["S"],"operation":"/Function(function(s_expr){console.log(s_expr[1]+\": 0x\"+sim.ep.signals[s_expr[1]].value.toString(16))})/","verbal":"/Function(function(s_expr){return\"Print value of signal \"+s_expr[1]+\": 0x\"+sim.ep.signals[s_expr[1]].value.toString(16)+\". \"})/"},"PRINT_E":{"nparameters":2,"types":["E"],"operation":"/Function(function(s_expr){console.log(s_expr[1]+\": 0x\"+sim.ep.states[s_expr[1]].value.toString(16))})/","verbal":"/Function(function(s_expr){return\"Print value of state \"+s_expr[1]+\": 0x\"+sim.ep.states[s_expr[1]].value.toString(16)+\". \"})/"},"NOP":{"nparameters":1,"operation":"/Function(function(s_expr){})/","verbal":"/Function(function(s_expr){return\"\"})/"},"NOP_ALU":{"nparameters":1,"operation":"/Function(function(s_expr){sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0})/","verbal":"/Function(function(s_expr){return\"\"})/"},"MV":{"nparameters":3,"types":["X","X"],"operation":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)})/","verbal":"/Function(function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+show_verbal(s_expr[2])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(newval)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" (\"+show_value(newval)+\"). \"})/"},"LOAD":{"nparameters":3,"types":["X","X"],"operation":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)})/","verbal":"/Function(function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Load from \"+show_verbal(s_expr[2])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(newval)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" (\"+show_value(newval)+\"). \"})/"},"CP_FIELD":{"nparameters":3,"types":["X","X"],"operation":"/Function(function(s_expr){r=s_expr[2].split(\"/\");sim_elto_org=get_reference(r[0]);newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval!=\"undefined\"){sim_elto_dst=get_reference(s_expr[1]);set_value(sim_elto_dst,newval)}})/","verbal":"/Function(function(s_expr){var newval=0;var r=s_expr[2].split(\"/\");var sim_elto_org=get_reference(r[0]);var sim_elto_dst=get_reference(r[1]);if(typeof sim_elto_dst==\"undefined\")sim_elto_dst={};if(typeof sim_elto_org.value[r[1]]!=\"undefined\")newval=sim_elto_org.value[r[1]];else if(typeof sim_elto_dst.default_value!=\"undefined\")newval=sim_elto_dst.default_value;else newval=\"<undefined>\";var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from Field \"+r[1]+\" of \"+show_verbal(r[0])+\" to \"+show_verbal(s_expr[1])+\" value \"+newval+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(r[0])+\".\"+r[1]+\" (\"+newval+\"). \"})/"},"NOT_ES":{"nparameters":3,"types":["S","E"],"operation":"/Function(function(s_expr){set_value(sim.ep.signals[s_expr[1]],Math.abs(get_value(sim.ep.states[s_expr[2]])-1))})/","verbal":"/Function(function(s_expr){var value=Math.abs(get_value(sim.ep.states[s_expr[2]])-1);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Set \"+show_verbal(s_expr[1])+\" with value \"+show_value(value)+\" (Logical NOT of \"+s_expr[2]+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_value(value)+\" (Logical NOT \"+s_expr[2]+\"). \"})/"},"GET":{"nparameters":4,"types":["E","E","S"],"operation":"/Function(function(s_expr){set_value(sim.ep.states[s_expr[1]],get_value(sim.ep.states[s_expr[2]][sim.ep.signals[s_expr[3]].value]))})/","verbal":"/Function(function(s_expr){var value=get_value(sim.ep.states[s_expr[2]][sim.ep.signals[s_expr[3]].value]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Set \"+show_verbal(s_expr[1])+\" with value \"+show_value(value)+\" (Register File \"+s_expr[3]+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_value(value)+\" (Register File \"+s_expr[3]+\"). \"})/"},"SET":{"nparameters":4,"types":["E","S","E"],"operation":"/Function(function(s_expr){set_value(sim.ep.states[s_expr[1]][sim.ep.signals[s_expr[2]].value],get_value(sim.ep.states[s_expr[3]]))})/","verbal":"/Function(function(s_expr){var value=get_value(sim.ep.states[s_expr[3]]);var o_ref=sim.ep.states[s_expr[1]][sim.ep.signals[s_expr[2]].value];var o_verbal=o_ref.name;if(typeof o_ref.verbal!=\"undefined\")o_verbal=o_ref.verbal;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy to \"+o_verbal+\" the value \"+show_value(value)+\". \"}return o_verbal+\" = \"+show_value(value)+\". \"})/"},"AND":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])&get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])&get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU AND with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (AND). \"})/"},"OR":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])|get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])|get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU OR with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (OR). \"})/"},"NOT":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=~get_value(sim.ep.states[s_expr[2]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=~get_value(sim.ep.states[s_expr[2]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU NOT with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (NOT). \"})/"},"XOR":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])^get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])^get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU XOR with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (XOR). \"})/"},"SRL":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Shift Right Logical with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SRL). \"})/"},"SRA":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Shift Right Arithmetic with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SRA). \"})/"},"SL":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=result>>>31})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Shift Left with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SL). \"})/"},"RR":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1|(get_value(sim.ep.states[s_expr[2]])&1)<<31;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1|(get_value(sim.ep.states[s_expr[2]])&1)<<31;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Right Rotation with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (RR). \"})/"},"RL":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1|(get_value(sim.ep.states[s_expr[2]])&2147483648)>>>31;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1|(get_value(sim.ep.states[s_expr[2]])&2147483648)>>>31;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Left Rotation with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (LR). \"})/"},"ADD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a+b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a+b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU ADD with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (ADD). \"})/"},"SUB":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a-b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a-b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU SUB with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SUB). \"})/"},"MUL":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a*b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a*b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU MUL with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (MUL). \"})/"},"DIV":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){return\"ALU DIV zero by zero (oops!). \"}var result=Math.floor(a/b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU DIV with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (DIV). \"})/"},"MOD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=a%b;set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){return\"ALU MOD zero by zero (oops!). \"}var result=a%b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU MOD with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (MOD). \"})/"},"LUI":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<16;set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<16;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Load Upper Immediate with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (LUI). \"})/"},"ADDU":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a+b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a+b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU ADDU with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (ADDU). \"})/"},"SUBU":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a-b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a-b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU SUBU with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SUBU). \"})/"},"MULU":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a*b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a*b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU MULU with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (MULU). \"})/"},"DIVU":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;if(0==b){return\"ALU DIVU zero by zero (oops!). \"}var result=Math.floor(a/b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU DIVU with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (DIVU). \"})/"},"FADD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)+hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)+hex2float(b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU FADD with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (FADD). \"})/"},"FSUB":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU FSUB with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (FSUB). \"})/"},"FMUL":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)*hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)*hex2float(b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU FMUL with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (FMUL). \"})/"},"FDIV":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)/hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU FDIV with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (FDIV). \"})/"},"FCVT":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]]);var result=a;switch(b){case 1:result=hex2float(result);result=Math.trunc(result);break;case 2:result=hex2float(result);result=Math.round(result);break;case 4:result=result.toFixed(5);result=parseFloat(result);result=float2decimal(result);break;default:break}set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]]);var result=a;switch(b){case 1:result=hex2float(result);result=Math.trunc(result);break;case 2:result=hex2float(result);result=Math.round(result);break;case 4:result=result.toFixed(5);result=parseFloat(result);result=float2decimal(result);break;default:break}var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU FCVT with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (FCVT). \"})/"},"FCLASS":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var result=float_class(a);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])>>>0;var result=float_class(a);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU FCLASS with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (FCLASS). \"})/"},"PLUS1":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+1;set_value(sim.ep.states[s_expr[1]],result>>>0)})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy to \"+show_verbal(s_expr[1])+\" \"+show_verbal(s_expr[2])+\" plus one with result \"+show_value(result)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" + 1\"+\" (\"+show_value(result)+\"). \"})/"},"PLUS4":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+4;set_value(sim.ep.states[s_expr[1]],result>>>0)})/","verbal":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+4;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy to \"+show_verbal(s_expr[1])+\" \"+show_verbal(s_expr[2])+\" plus four with result \"+show_value(result)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" + 4\"+\" (\"+show_value(result)+\"). \"})/"},"SET_TT":{"nparameters":3,"types":["E","I"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a|m;set_value(sim.ep.states[s_expr[1]],r);update_cpu_bus_fire(r,b)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"RST_TT":{"nparameters":3,"types":["E","I"],"operation":"/Function(function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a&~m;set_value(sim.ep.states[s_expr[1]],r);update_cpu_bus_fire(r,b)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"CHECK_RTD":{"nparameters":1,"operation":"/Function(function(s_expr){var number_active_tri=parseInt(simhw_sim_signal(\"TD\").value)+parseInt(simhw_sim_signal(\"R\").value);update_system_bus_fire(number_active_tri)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"MBIT":{"nparameters":5,"types":["X","X","I","I"],"operation":"/Function(function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);set_value(sim_elto_dst,parseInt(n2,2))})/","verbal":"/Function(function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=parseInt(n2,2);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+show_verbal(s_expr[2])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(n3)+\" (copied \"+size+\" bits from bit \"+offset+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" (\"+show_value(n3)+\", \"+size+\" bits from bit \"+offset+\"). \"})/"},"MBIT_SN":{"nparameters":5,"types":["S","E","E","I"],"operation":"/Function(function(s_expr){var base=0;var r=s_expr[3].split(\"/\");if(1==r.length)base=get_value(sim.ep.states[s_expr[3]]);else if(typeof sim.ep.states[r[0]].value[r[1]]!=\"undefined\")base=sim.ep.states[r[0]].value[r[1]];else if(typeof sim.ep.signals[r[1]].default_value!=\"undefined\")base=sim.ep.signals[r[1]].default_value;else if(typeof sim.ep.states[r[1]].default_value!=\"undefined\")base=sim.ep.states[r[1]].default_value;else ws_alert(\"WARN: undefined state/field pair -> \"+r[0]+\"/\"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.ep.states[s_expr[2]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){var base=0;var r=s_expr[3].split(\"/\");if(1==r.length)base=get_value(sim.ep.states[s_expr[3]]);else if(typeof sim.ep.states[r[0]].value[r[1]]!=\"undefined\")base=sim.ep.states[r[0]].value[r[1]];else if(typeof sim.ep.signals[r[1]].default_value!=\"undefined\")base=sim.ep.signals[r[1]].default_value;else if(typeof sim.ep.states[r[1]].default_value!=\"undefined\")base=sim.ep.states[r[1]].default_value;else ws_alert(\"WARN: undefined state/field pair -> \"+r[0]+\"/\"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.ep.states[s_expr[2]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);var from_elto=\"\";if(1==r.length)from_elto=show_verbal(s_expr[3]);else from_elto=show_verbal(s_expr[2])+\"[\"+r[1]+\"] \";var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+from_elto+\"into \"+show_verbal(s_expr[1])+\" \"+\"value \"+parseInt(n3,2)+\". \"}return show_verbal(s_expr[1])+\" = \"+from_elto+\" (\"+parseInt(n3,2)+\"). \"})/"},"SBIT_SIGNAL":{"nparameters":4,"types":["X","I","I"],"operation":"/Function(function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)})/","verbal":"/Function(function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)})/"},"UPDATE_FLAG":{"nparameters":4,"types":["X","X","I"],"operation":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value&~(1<>>0)})/","verbal":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Update \"+show_verbal(s_expr[2])+\" to value \"+sim_elto_org.value+\". \"}return show_verbal(s_expr[1])+\".\"+show_verbal(s_expr[3])+\" = \"+sim_elto_org.value+\". \"})/"},"MBITS":{"nparameters":8,"types":["E","I","E","S","S","I","S"],"operation":"/Function(function(s_expr){var offset=parseInt(sim.ep.signals[s_expr[4]].value);var size=parseInt(sim.ep.signals[s_expr[5]].value);var n1=get_value(sim.ep.states[s_expr[3]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;if(\"1\"==sim.ep.signals[s_expr[7]].value&&\"1\"==n2.substr(0,1)){n3=\"11111111111111111111111111111111\".substring(0,32-n2.length)+n2}set_value(sim.ep.states[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){var offset=parseInt(sim.ep.signals[s_expr[4]].value);var size=parseInt(sim.ep.signals[s_expr[5]].value);var n1=get_value(sim.ep.states[s_expr[3]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;if(\"1\"==sim.ep.signals[s_expr[7]].value&&\"1\"==n2.substr(0,1)){n3=\"11111111111111111111111111111111\".substring(0,32-n2.length)+n2}n1=parseInt(n3,2);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\" Copy from \"+show_verbal(s_expr[3])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(n1)+\" (copied \"+size+\" bits from bit \"+offset+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[3])+\" (\"+show_value(n1)+\", \"+size+\" bits from bit \"+offset+\"). \"})/"},"BSEL":{"nparameters":6,"types":["E","I","I","E","I"],"operation":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var n4=\"00000000000000000000000000000000\".substr(0,posd);n3=n3+n4;set_value(sim.ep.states[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var len=parseInt(s_expr[3]);var poso=parseInt(s_expr[5]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var n4=\"00000000000000000000000000000000\".substr(0,posd);n3=n3+n4;var n5=parseInt(n3,2);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+show_verbal(s_expr[4])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(n5)+\" (copied \"+len+\" bits, from bit \"+poso+\" of \"+s_expr[4]+\" to bit \"+posd+\" of \"+s_expr[1]+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[4])+\" (\"+show_value(n5)+\", \"+len+\" bits, from bit \"+poso+\" of \"+s_expr[4]+\" to bit \"+posd+\" of \"+s_expr[1]+\"). \"})/"},"EXT_SIG":{"nparameters":3,"types":["E","I"],"operation":"/Function(function(s_expr){var n1=get_value(sim.ep.states[s_expr[1]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if(\"1\"==n2[31-s_expr[2]]){n4=\"11111111111111111111111111111111\".substring(0,32-n3.length)+n4}set_value(sim.ep.states[s_expr[1]],parseInt(n4,2))})/","verbal":"/Function(function(s_expr){var n1=get_value(sim.ep.states[s_expr[1]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if(\"1\"==n2[31-s_expr[2]]){n4=\"11111111111111111111111111111111\".substring(0,32-n3.length)+n4}var n5=parseInt(n4,2);return\"Sign Extension with value \"+show_value(n5)+\". \"})/"},"MOVE_BITS":{"nparameters":5,"types":["S","I","I","S"],"operation":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var poso=0;var len=parseInt(s_expr[3]);var n1=sim.ep.signals[s_expr[4]].value.toString(2);n1=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.ep.signals[s_expr[1]].value.toString(2);n2=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){return\"\"})/"},"MOVE_BITSE":{"nparameters":6,"types":["S","I","I","E","I"],"operation":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);n1=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.ep.signals[s_expr[1]].value.toString(2);n2=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){return\"\"})/"},"DECO":{"nparameters":1,"operation":"/Function(function(s_expr){sim.ep.states[\"INEX\"].value=0;var oi=decode_instruction(sim.ep.internal_states.FIRMWARE,sim.ep.ctrl_states.ir,get_value(sim.ep.states[\"REG_IR\"]));if(null==oi.oinstruction){ws_alert(\"ERROR: undefined instruction code in IR (\"+\"co:\"+oi.op_code.toString(2)+\", \"+\"cop:\"+oi.cop_code.toString(2)+\")\");sim.ep.states[\"ROM_MUXA\"].value=0;sim.ep.states[\"INEX\"].value=1;return-1}var rom_addr=oi.op_code<<6;if(typeof oi.oinstruction.cop!=\"undefined\"){rom_addr=rom_addr+oi.cop_code}if(typeof sim.ep.internal_states[\"ROM\"][rom_addr]==\"undefined\"){ws_alert(\"ERROR: undefined rom address \"+rom_addr+\" in firmware\");sim.ep.states[\"ROM_MUXA\"].value=0;return-1}sim.ep.states[\"ROM_MUXA\"].value=sim.ep.internal_states[\"ROM\"][rom_addr];var val=get_value(sim.ep.states[\"DECO_INS\"]);set_value(sim.ep.states[\"DECO_INS\"],val+1);var pc=get_value(sim.ep.states[\"REG_PC\"])-4;var decins=get_deco_from_pc(pc);set_value(sim.ep.states[\"REG_IR_DECO\"],decins);show_dbg_ir(get_value(sim.ep.states[\"REG_IR_DECO\"]))})/","verbal":"/Function(function(s_expr){return\"Decode instruction. \"})/"},"FIRE":{"nparameters":2,"types":["S"],"operation":"/Function(function(s_expr){if(sim.ep.internal_states.fire_stack.indexOf(s_expr[1])!=-1){return}sim.ep.internal_states.fire_stack.push(s_expr[1]);update_draw(sim.ep.signals[s_expr[1]],sim.ep.signals[s_expr[1]].value);if(\"L\"==sim.ep.signals[s_expr[1]].type){update_state(s_expr[1])}sim.ep.internal_states.fire_stack.pop(s_expr[1])})/","verbal":"/Function(function(s_expr){return\"\"})/"},"FIRE_IFSET":{"nparameters":3,"types":["S","I"],"operation":"/Function(function(s_expr){if(get_value(sim.ep.signals[s_expr[1]])!=parseInt(s_expr[2])){return}sim.ep.behaviors[\"FIRE\"].operation(s_expr)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"FIRE_IFCHANGED":{"nparameters":3,"types":["S","X"],"operation":"/Function(function(s_expr){sim_elto=get_reference(s_expr[2]);if(sim_elto.changed==false){return}sim.ep.behaviors[\"FIRE\"].operation(s_expr)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"RESET_CHANGED":{"nparameters":2,"types":["X"],"operation":"/Function(function(s_expr){sim_elto=get_reference(s_expr[1]);sim_elto.changed=false})/","verbal":"/Function(function(s_expr){return\"\"})/"},"CLOCK":{"nparameters":1,"operation":"/Function(function(s_expr){var new_maddr=null;var mcelto=null;var t0=performance.now();var val=get_value(sim.ep.states[\"CLK\"]);set_value(sim.ep.states[\"CLK\"],val+1);set_value(sim.ep.states[\"TTCPU\"],0);new_maddr=get_value(sim.ep.states[\"REG_MICROADDR\"]);mcelto=sim.ep.internal_states[\"MC\"][new_maddr];if(typeof mcelto!==\"undefined\"&&false==mcelto.is_native){for(var i=0;i0){remain=sim.ep.events.mem[clk-1]-1}var first_time=typeof sim.ep.events.mem[clk]==\"undefined\";sim.ep.events.mem[clk]=remain;if(remain>0){return}address=address&4294967292;var value=main_memory_getvalue(sim.ep.internal_states.MP,address);var full_redraw=false;if(typeof value===\"undefined\"){value=0;full_redraw=true}dbvalue=main_memory_fusionvalues(dbvalue,value,bw);sim.ep.states[s_expr[2]].value=dbvalue>>>0;sim.ep.signals[s_expr[4]].value=1;show_main_memory(sim.ep.internal_states.MP,address,full_redraw,false);if(first_time&&sim.ep.internal_states.CM.length>0){cache_memory_access(sim.ep.internal_states.CM[0],address,\"read\",clk)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);var bw_type=\"word\";if(0==(bw&12))bw_type=\"byte\";else if(1==(bw&12))bw_type=\"half\";var value=main_memory_getvalue(sim.ep.internal_states.MP,address);if(typeof value===\"undefined\")value=0;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){verbal=\"Try to read a \"+bw_type+\" from memory \"+\"at address 0x\"+address.toString(16)+\" with value 0x\"+value.toString(16)+\". \"}verbal=\"Memory output = 0x\"+value.toString(16)+\" (Read a \"+bw_type+\" from 0x\"+address.toString(16)+\"). \";return verbal})/"},"MEM_WRITE":{"nparameters":6,"types":["E","E","S","S","E"],"operation":"/Function(function(s_expr){var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);sim.ep.signals[s_expr[4]].value=0;var remain=get_value(sim.ep.internal_states.MP_wc);if(typeof sim.ep.events.mem[clk-1]!=\"undefined\"&&sim.ep.events.mem[clk-1]>0){remain=sim.ep.events.mem[clk-1]-1}var first_time=typeof sim.ep.events.mem[clk]==\"undefined\";sim.ep.events.mem[clk]=remain;if(remain>0){return}address=address&4294967292;var value=main_memory_getvalue(sim.ep.internal_states.MP,address);var full_redraw=false;if(typeof value===\"undefined\"){value=0;full_redraw=true}value=main_memory_fusionvalues(value,dbvalue,bw);var origin=\"\";var r_value=main_memory_get_program_counter();if(r_value!=null){origin=\"PC=0x\"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.ep.internal_states.MP,address,melto);sim.ep.signals[s_expr[4]].value=1;show_main_memory(sim.ep.internal_states.MP,address,full_redraw,true);if(first_time&&sim.ep.internal_states.CM.length>0){cache_memory_access(sim.ep.internal_states.CM[0],address,\"write\",clk)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);var bw_type=\"word\";if(0==(bw&12))bw_type=\"byte\";else if(1==(bw&12))bw_type=\"half\";var value=main_memory_getvalue(sim.ep.internal_states.MP,address);if(typeof value===\"undefined\")value=0;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){verbal=\"Try to write a \"+bw_type+\" to memory \"+\"at address 0x\"+address.toString(16)+\" with value \"+value.toString(16)+\". \"}verbal=\"Memory[0x\"+address.toString(16)+\"] = \"+\"0x\"+value.toString(16)+\" (Write a \"+bw_type+\" to 0x\"+address.toString(16)+\"). \";return verbal})/"},"MEMORY_RESET":{"nparameters":1,"operation":"/Function(function(s_expr){sim.ep.events.mem={}})/","verbal":"/Function(function(s_expr){return\"Reset main memory (all values will be zeroes). \"})/"},"IO_IOR":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==IOSR_ID)set_value(sim.ep.states[s_expr[2]],iosr);if(bus_ab==IOCR_ID)set_value(sim.ep.states[s_expr[2]],iocr);if(bus_ab==IODR_ID)set_value(sim.ep.states[s_expr[2]],iodr)})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==IOSR_ID)verbal=\"I/O device read at IOSR of value \"+iosr+\". \";if(bus_ab==IOCR_ID)verbal=\"I/O device read at IOCR of value \"+iocr+\". \";if(bus_ab==IODR_ID)verbal=\"I/O device read at IODR of value \"+iodr+\". \";return verbal})/"},"IO_IOW":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab!=IOSR_ID&&bus_ab!=IOCR_ID&&bus_ab!=IODR_ID){return}if(bus_ab==IOSR_ID)set_value(sim.ep.states[s_expr[3]],bus_db);if(bus_ab==IOCR_ID)set_value(sim.ep.states[s_expr[4]],bus_db);if(bus_ab==IODR_ID)set_value(sim.ep.states[s_expr[5]],bus_db);var iocr_id=get_value(sim.ep.states[s_expr[4]]);var iodr_id=get_value(sim.ep.states[s_expr[5]]);if(iocr_id<0||iocr_id>7)return;set_var(sim.ep.internal_states.io_int_factory[iocr_id].period,iodr_id);set_var(sim.ep.internal_states.io_int_factory[iocr_id].probability,1);if(0==iodr_id){set_var(sim.ep.internal_states.io_int_factory[iocr_id].probability,0)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab==IOSR_ID)verbal=\"I/O device write at IOSR with value \"+bus_db+\". \";if(bus_ab==IOCR_ID)verbal=\"I/O device write at IOCR with value \"+bus_db+\". \";if(bus_ab==IODR_ID)verbal=\"I/O device write at IODR with value \"+bus_db+\". \";return verbal})/"},"IO_CHK_I":{"nparameters":4,"types":["E","S","E"],"operation":"/Function(function(s_expr){var clk=get_value(sim.ep.states[s_expr[1]]);for(var i=sim.ep.internal_states.io_int_factory.length-1;i>=0;i--){if(get_var(sim.ep.internal_states.io_int_factory[i].period)==0)continue;if(get_var(sim.ep.internal_states.io_int_factory[i].active)==true){set_value(sim.ep.signals[s_expr[2]],1);set_value(sim.ep.states[s_expr[3]],i)}if(clk%get_var(sim.ep.internal_states.io_int_factory[i].period)==0){if(Math.random()>get_var(sim.ep.internal_states.io_int_factory[i].probability))continue;var acc=get_var(sim.ep.internal_states.io_int_factory[i].accumulated);set_var(sim.ep.internal_states.io_int_factory[i].accumulated,acc+1);set_var(sim.ep.internal_states.io_int_factory[i].active,true);if(typeof sim.ep.events.io[clk]==\"undefined\"){sim.ep.events.io[clk]=[]}sim.ep.events.io[clk].push(i);set_value(sim.ep.signals[s_expr[2]],1);set_value(sim.ep.states[s_expr[3]],i)}}})/","verbal":"/Function(function(s_expr){return\"Check I/O Interruption. \"})/"},"INTA":{"nparameters":6,"types":["E","S","S","E","E"],"operation":"/Function(function(s_expr){var clk=get_value(sim.ep.states[s_expr[1]]);if(typeof sim.ep.events.io[clk]!=\"undefined\"){set_value(sim.ep.states[s_expr[4]],sim.ep.events.io[clk][0]);return}set_value(sim.ep.signals[s_expr[2]],0);set_value(sim.ep.states[s_expr[5]],0);for(var i=0;i>24;var y=(iodr&16711680)>>16;var z=(iodr&65280)>>8;var p=z*Math.pow(sim.ep.internal_states.l3d_dim,2)+y*sim.ep.internal_states.l3d_dim+x;var s=get_var(sim.ep.internal_states.l3d_state[p].active);set_value(sim.ep.states[s_expr[2]],s)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==L3DSR_ID)verbal=\"I/O device read at L3DSR of value \"+iosr+\". \";if(bus_ab==L3DCR_ID)verbal=\"I/O device read at L3DCR of value \"+iocr+\". \";if(bus_ab==L3DDR_ID)verbal=\"I/O device read at L3DDR of value \"+iodr+\". \";return verbal})/"},"L3D_IOW":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab!=L3DSR_ID&&bus_ab!=L3DCR_ID&&bus_ab!=L3DDR_ID){return}if(bus_ab==L3DSR_ID){set_value(sim.ep.states[s_expr[3]],bus_db)}if(bus_ab==L3DDR_ID){set_value(sim.ep.states[s_expr[5]],bus_db)}if(bus_ab==L3DCR_ID){set_value(sim.ep.states[s_expr[4]],bus_db);var x=(bus_db&4278190080)>>24;var y=(bus_db&16711680)>>16;var z=(bus_db&65280)>>8;var p=z*Math.pow(sim.ep.internal_states.l3d_dim,2)+y*sim.ep.internal_states.l3d_dim+x;var s=(bus_db&255)!=0;set_var(sim.ep.internal_states.l3d_state[p].active,s)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab==L3DSR_ID)verbal=\"I/O device write at L3DSR with value \"+bus_db+\". \";if(bus_ab==L3DCR_ID)verbal=\"I/O device write at L3DCR with value \"+bus_db+\". \";if(bus_ab==L3DDR_ID)verbal=\"I/O device write at L3DDR with value \"+bus_db+\". \";return verbal})/"},"L3D_RESET":{"nparameters":1,"operation":"/Function(function(s_expr){sim.ep.events.l3d={};var n=sim.ep.internal_states.l3d_state.length;for(var i=0;i>24;var y=(iodr&16711680)>>16;var p=y*sim.ep.internal_states.ledm_dim+x;var s=get_var(sim.ep.internal_states.ledm_state[p].color);set_value(sim.ep.states[s_expr[2]],s)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==LEDMSR_ID)verbal=\"I/O device read at LEDMSR of value \"+iosr+\". \";if(bus_ab==LEDMCR_ID)verbal=\"I/O device read at LEDMCR of value \"+iocr+\". \";if(bus_ab==LEDMDR_ID)verbal=\"I/O device read at LEDMDR of value \"+iodr+\". \";return verbal})/"},"LEDM_IOW":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);switch(bus_ab){case LEDMSR_ID:set_value(sim.ep.states[s_expr[3]],bus_db);break;case LEDMDR_ID:set_value(sim.ep.states[s_expr[5]],bus_db);break;case LEDMCR_ID:set_value(sim.ep.states[s_expr[4]],bus_db);break;default:break}if(LEDMCR_ID==bus_ab){var dr=get_value(sim.ep.states[s_expr[5]]);if(16&bus_db){var x=(dr&4278190080)>>24;var y=(dr&16711680)>>16;var s=dr&255;set_value(sim.ep.states[s_expr[3]],1);if(x>=sim.ep.internal_states.ledm_dim&&y>=sim.ep.internal_states.ledm_dim){set_value(sim.ep.states[s_expr[3]],-1);return}var p=y*sim.ep.internal_states.ledm_dim+x;set_var(sim.ep.internal_states.ledm_state[p].color,s)}if(32&bus_db){set_value(sim.ep.states[s_expr[3]],1);var s=0;var neltos=sim.ep.internal_states.ledm_neltos;for(var p=0;p>0);set_var(sim.ep.internal_states.ledm_state[p+1].color,(s&65280)>>8);set_var(sim.ep.internal_states.ledm_state[p+2].color,(s&16711680)>>16);set_var(sim.ep.internal_states.ledm_state[p+3].color,(s&4278190080)>>24)}}if(64&bus_db){set_value(sim.ep.states[s_expr[3]],1);var s=0;var c=\"\";var neltos=sim.ep.internal_states.ledm_colors.length;for(var p=0;p>>8;s=s.toString(16);c=\"#\"+simcoreui_pack(s,6);sim.ep.internal_states.ledm_colors[p]=c}neltos=sim.ep.internal_states.ledm_neltos;for(var p=0;p>24;var y=(dr&16711680)>>16;var s=dr&255;verbal=\"I/O device write at LEDMCR with value \"+bus_db+\" (set pixel x:\"+x+\", y:\"+y+\", with color:\"+s+\"). \"}if(64&bus_db){verbal=\"I/O device write at LEDMCR with value \"+bus_db+\" (set color palette at:\"+bus_db+\"). \"}break;default:break}return verbal})/"},"LEDM_RESET":{"nparameters":1,"operation":"/Function(function(s_expr){sim.ep.events.ledm={};sim.ep.internal_states.ledm_colors=colors_clone(\"\");for(var i=0;i + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + stroke-width="0.05" + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> SelCop + stroke-width="1.0px" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;">SelCop - - + style="stroke-dasharray:none" /> + stroke-width="0.03" + style="stroke-dasharray:none;image-rendering:optimizeSpeed" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + stroke-width="0.35" + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + style="stroke-dasharray:none" /> + + - + MUX @@ -179,7 +179,7 @@ 4 - + SELEC @@ -297,7 +297,7 @@ SR - + 2 @@ -514,16 +514,16 @@ Control Bus - - HPC + + HPC - 2 + 2 - T12 + T12 - - MH + + MH diff --git a/ws_dist/examples/hardware/poc/hw_def.json b/ws_dist/examples/hardware/poc/hw_def.json index 1e549716f..6d1dd4c63 100644 --- a/ws_dist/examples/hardware/poc/hw_def.json +++ b/ws_dist/examples/hardware/poc/hw_def.json @@ -1 +1 @@ -{"sim_name":"Proof-Of-Concept Processor","sim_short_name":"poc","sim_img_processor":"examples/hardware/poc/images/processor.svg","sim_img_controlunit":"examples/hardware/poc/images/controlunit.svg","sim_img_cpu":"examples/hardware/poc/images/cpu.svg","components":{"CPU":{"name":"CPU","version":"1","abilities":["CPU"],"details_name":["REGISTER_FILE","CONTROL_MEMORY","CLOCK","CPU_STATS"],"details_fire":[["svg_p:text3495","svg_p:text3029","svg_p:text3031"],["svg_cu:text3010"],["svg_p:text3459-7","svg_cu:text4138","svg_cu:text4138-7","svg_cu:tspan4140-2"],["svg_p:text3495"]],"write_state":"/Function(function(vec){if(typeof vec.CPU==\"undefined\"){vec.CPU={}}var internal_reg=[\"PC\",\"SR\"];var value=0;for(var i=0;i>>0;if(value!=0){vec.CPU[\"R\"+i]={type:\"register\",default_value:0,id:\"R\"+i,op:\"=\",value:\"0x\"+value.toString(16)}}}for(var i=0;i>>0;if(value!=0){vec.CPU[internal_reg[i]]={type:\"register\",default_value:0,id:internal_reg[i],op:\"=\",value:\"0x\"+value.toString(16)}}}return vec})/","read_state":"/Function(function(vec,check){if(typeof vec.CPU==\"undefined\")vec.CPU={};var key=check[\"id\"].toUpperCase().trim();var val=parseInt(check[\"value\"]).toString(16);if(\"REGISTER\"==check[\"type\"].toUpperCase().trim()){vec.CPU[key]={type:\"register\",default_value:0,id:key,op:check[\"condition\"],value:\"0x\"+val};return true}return false})/","get_state":"/Function(function(reg){var r_reg=reg.toUpperCase().trim();if(typeof sim.poc.states[\"REG_\"+r_reg]!=\"undefined\"){var value=get_value(sim.poc.states[\"REG_\"+r_reg])>>>0;return\"0x\"+value.toString(16)}r_reg=r_reg.replace(\"R\",\"\");var index=parseInt(r_reg);if(typeof sim.poc.states.BR[index]!=\"undefined\"){var value=get_value(sim.poc.states.BR[index])>>>0;return\"0x\"+value.toString(16)}return null})/","get_value":"/Function(function(elto){if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index))return get_value(simhw_sim_state(elto))>>>0;return get_value(simhw_sim_states().BR[index])>>>0})/","set_value":"/Function(function(elto,value){var pc_name=simhw_sim_ctrlStates_get().pc.state;if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index)){set_value(simhw_sim_state(elto),value);if(pc_name===elto){show_asmdbg_pc()}return value}return set_value(simhw_sim_states().BR[index],value)})/"},"MEMORY":{"name":"MEMORY","version":"1","abilities":["MEMORY"],"details_name":["MEMORY","MEMORY_CONFIG"],"details_fire":[["svg_p:text3001"],[]],"write_state":"/Function(function(vec){if(typeof vec.MEMORY==\"undefined\")vec.MEMORY={};var key=0;var value=0;for(var index in sim.poc.internal_states.MP){value=main_memory_getvalue(sim.poc.internal_states.MP,index);value=parseInt(value);if(value!=0){key=parseInt(index).toString(16);vec.MEMORY[\"0x\"+key]={type:\"memory\",default_value:0,id:\"0x\"+key,op:\"=\",value:\"0x\"+value.toString(16)}}}return vec})/","read_state":"/Function(function(vec,check){if(typeof vec.MEMORY==\"undefined\"){vec.MEMORY={}}var key=parseInt(check.id).toString(16);var val=parseInt(check.value).toString(16);if(\"MEMORY\"==check.type.toUpperCase().trim()){vec.MEMORY[\"0x\"+key]={type:\"memory\",default_value:0,id:\"0x\"+key,op:check.condition,value:\"0x\"+val};return true}return false})/","get_state":"/Function(function(pos){var index=parseInt(pos);var value=main_memory_getvalue(sim.poc.internal_states.MP,index);if(typeof value===\"undefined\"){return null}return\"0x\"+parseInt(value).toString(16)})/","get_value":"/Function(function(elto){var value=main_memory_getvalue(sim.poc.internal_states.MP,elto);show_main_memory(sim.poc.internal_states.MP,elto,false,false);return value>>>0})/","set_value":"/Function(function(elto,value){var origin=\"\";var r_value=main_memory_get_program_counter();if(r_value!=null){origin=\"PC=0x\"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.poc.internal_states.MP,elto,melto);show_main_memory(sim.poc.internal_states.MP,elto,typeof valref===\"undefined\",true);return value})/"},"IO":{"name":"IO","version":"1","abilities":["IO_TIMER"],"details_name":["IO_STATS","IO_CONFIG"],"details_fire":[["svg_p:text3775"],[]],"write_state":"/Function(function(vec){return vec})/","read_state":"/Function(function(o,check){return false})/","get_state":"/Function(function(reg){return null})/","get_value":"/Function(function(elto){var associated_state=simhw_internalState_get(\"io_hash\",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_signal(\"IOR\"),1);compute_behavior(\"FIRE IOR\");value=get_value(simhw_sim_state(\"BUS_DB\"));return value})/","set_value":"/Function(function(elto,value){var associated_state=simhw_internalState_get(\"io_hash\",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_state(\"BUS_DB\"),value);set_value(simhw_sim_signal(\"IOW\"),1);compute_behavior(\"FIRE IOW\");return value})/"},"KBD":{"name":"KBD","version":"1","abilities":["KEYBOARD"],"details_name":["KEYBOARD"],"details_fire":[["svg_p:text3829"]],"write_state":"/Function(function(vec){return vec})/","read_state":"/Function(function(o,check){return false})/","get_state":"/Function(function(reg){return null})/","get_value":"/Function(function(elto){return sim.poc.internal_states.keyboard_content})/","set_value":"/Function(function(elto,value){sim.poc.internal_states.keyboard_content=value;return value})/"},"SCREEN":{"name":"SCREEN","version":"1","abilities":["SCREEN"],"details_name":["SCREEN"],"details_fire":[["svg_p:text3845"]],"write_state":"/Function(function(vec){if(typeof vec.SCREEN==\"undefined\"){vec.SCREEN={}}var sim_screen=sim.poc.internal_states.screen_content;var sim_lines=sim_screen.trim().split(\"\\n\");for(var i=0;i>>0;set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_signal(\"L3DR\"),1);compute_behavior(\"FIRE L3DR\");value=get_value(simhw_sim_state(\"BUS_DB\"));return value})/","set_value":"/Function(function(elto,value){var associated_state=simhw_internalState_get(\"io_hash\",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_state(\"BUS_DB\"),value);set_value(simhw_sim_signal(\"L3DW\"),1);compute_behavior(\"FIRE L3DW\");return value})/"},"LEDM":{"name":"LEDM","version":"1","abilities":["LEDMATRIX"],"details_name":["LEDMATRIX"],"details_fire":[[]],"write_state":"/Function(function(vec){return vec})/","read_state":"/Function(function(o,check){return false})/","get_state":"/Function(function(reg){return null})/","get_value":"/Function(function(elto){var associated_state=simhw_internalState_get(\"io_hash\",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_signal(\"LEDMR\"),1);compute_behavior(\"FIRE LEDMR\");value=get_value(simhw_sim_state(\"BUS_DB\"));return value})/","set_value":"/Function(function(elto,value){var associated_state=simhw_internalState_get(\"io_hash\",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_state(\"BUS_DB\"),value);set_value(simhw_sim_signal(\"LEDMW\"),1);compute_behavior(\"FIRE LEDMW\");return value})/"}},"states":{"BR":[{"name":"R0","verbal":"Register 0","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R1","verbal":"Register 1","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R2","verbal":"Register 2","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R3","verbal":"Register 3","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R4","verbal":"Register 4","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R5","verbal":"Register 5","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R6","verbal":"Register 6","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R7","verbal":"Register 7","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R8","verbal":"Register 8","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R9","verbal":"Register 9","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R10","verbal":"Register 10","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R11","verbal":"Register 11","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R12","verbal":"Register 12","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R13","verbal":"Register 13","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R14","verbal":"Register 14","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R15","verbal":"Register 15","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R16","verbal":"Register 16","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R17","verbal":"Register 17","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R18","verbal":"Register 18","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R19","verbal":"Register 19","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R20","verbal":"Register 20","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R21","verbal":"Register 21","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R22","verbal":"Register 22","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R23","verbal":"Register 23","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R24","verbal":"Register 24","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R25","verbal":"Register 25","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R26","verbal":"Register 26","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R27","verbal":"Register 27","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R28","verbal":"Register 28","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R29","verbal":"Register 29","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R30","verbal":"Register 30","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R31","verbal":"Register 31","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R32","verbal":"Register 32","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R33","verbal":"Register 33","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R34","verbal":"Register 34","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R35","verbal":"Register 35","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R36","verbal":"Register 36","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R37","verbal":"Register 37","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R38","verbal":"Register 38","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R39","verbal":"Register 39","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R40","verbal":"Register 40","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R41","verbal":"Register 41","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R42","verbal":"Register 42","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R43","verbal":"Register 43","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R44","verbal":"Register 44","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R45","verbal":"Register 45","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R46","verbal":"Register 46","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R47","verbal":"Register 47","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R48","verbal":"Register 48","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R49","verbal":"Register 49","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R50","verbal":"Register 50","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R51","verbal":"Register 51","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R52","verbal":"Register 52","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R53","verbal":"Register 53","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R54","verbal":"Register 54","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R55","verbal":"Register 55","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R56","verbal":"Register 56","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R57","verbal":"Register 57","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R58","verbal":"Register 58","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R59","verbal":"Register 59","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R60","verbal":"Register 60","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R61","verbal":"Register 61","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R62","verbal":"Register 62","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R63","verbal":"Register 63","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]}],"REG_PC":{"name":"PC","verbal":"Program Counter Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_MAR":{"name":"MAR","verbal":"Memory Address Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_MBR":{"name":"MBR","verbal":"Memory Data Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_IR":{"name":"IR","verbal":"Instruction Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_SR":{"name":"SR","verbal":"State Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_RT1":{"name":"RT1","verbal":"Temporal Register 1","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_IB":{"name":"I_BUS","verbal":"Internal Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_AB":{"name":"A_BUS","verbal":"Address Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_CB":{"name":"C_BUS","verbal":"Control Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_DB":{"name":"D_BUS","verbal":"Data Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"RA_T9":{"name":"RA_T9","verbal":"Input of T9 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"RB_T10":{"name":"RB_T10","verbal":"Input of T10 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"HPC_T12":{"name":"HPC_T12","verbal":"Input of T12 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"SELEC_T3":{"name":"SELEC_T3","verbal":"Input of T3 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"ALU_T6":{"name":"ALU_T6","verbal":"Input of T6 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"MA_ALU":{"name":"MA_ALU","verbal":"Input ALU via MA","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"MB_ALU":{"name":"MB_ALU","verbal":"Input ALU via MB","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"FLAG_C":{"name":"FLAG_C","verbal":"Carry Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_V":{"name":"FLAG_V","verbal":"Overflow Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_N":{"name":"FLAG_N","verbal":"Negative Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_Z":{"name":"FLAG_Z","verbal":"Zero Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_I":{"name":"FLAG_I","verbal":"Interruption Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_U":{"name":"FLAG_U","verbal":"User Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"REG_MICROADDR":{"name":"µADDR","verbal":"Microaddress Register","visible":true,"nbits":"12","value":0,"default_value":0,"draw_data":["svg_cu:text4667"]},"REG_MICROINS":{"name":"µINS","verbal":"Microinstruction Register","visible":true,"nbits":"77","value":{},"default_value":{},"draw_data":[]},"FETCH":{"name":"FETCH","verbal":"Input Fetch","visible":false,"nbits":"12","value":0,"default_value":0,"draw_data":[]},"ROM_MUXA":{"name":"ROM_MUXA","verbal":"Input ROM","visible":false,"nbits":"12","value":0,"default_value":0,"draw_data":[]},"SUM_ONE":{"name":"SUM_ONE","verbal":"Input next microinstruction","visible":false,"nbits":"12","value":1,"default_value":1,"draw_data":[]},"MUXA_MICROADDR":{"name":"MUXA_MICROADDR","verbal":"Input microaddress","visible":false,"nbits":"12","value":0,"default_value":0,"draw_data":[]},"MUXC_MUXB":{"name":"MUXC_MUXB","verbal":"Output of MUX C","visible":false,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"INEX":{"name":"INEX","verbal":"Illegal Instruction Exception","visible":false,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"BS_M1":{"name":"BS_M1","verbal":"from Memory","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BS_TD":{"name":"BS_TD","verbal":"Memory","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"INTV":{"name":"INTV","verbal":"Interruption Vector","visible":false,"nbits":"8","value":0,"default_value":0,"draw_data":[]},"M1_C1":{"name":"M1_C1","verbal":"Input of Memory Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"M7_C7":{"name":"M7_C7","verbal":"Input of State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"VAL_ZERO":{"name":"VAL_ZERO","verbal":"Wired Zero","visible":false,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"VAL_ONE":{"name":"VAL_ONE","verbal":"Wired One","visible":false,"nbits":"32","value":1,"default_value":1,"draw_data":[]},"VAL_FOUR":{"name":"VAL_FOUR","verbal":"Wired Four","visible":false,"nbits":"32","value":4,"default_value":4,"draw_data":[]},"REG_IR_DECO":{"name":"IR_DECO","verbal":"Instruction Decoded","visible":true,"nbits":"0","value":0,"default_value":0,"draw_data":[]},"DECO_INS":{"name":"DECO_INS","verbal":"Instruction decoded in binary","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"CLK":{"name":"CLK","verbal":"Clock","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"ACC_TIME":{"name":"ACC_TIME","verbal":"Accumulated CPU time","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"TTCPU":{"name":"TTCPU","verbal":"Several Tristates to the internal data bus in CPU activated","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"ACC_PWR":{"name":"ACC_PWR","verbal":"Accumulated Energy Consumption","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"IOSR":{"name":"IOSR","verbal":"IO State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"IOCR":{"name":"IOCR","verbal":"IO Control Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"IODR":{"name":"IODR","verbal":"IO Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"KBDR":{"name":"KBDR","verbal":"Keyboard Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"KBSR":{"name":"KBSR","verbal":"Keyboard Status Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"DDR":{"name":"DDR","verbal":"Display Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"DSR":{"name":"DSR","verbal":"Display State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"L3DSR":{"name":"L3DSR","verbal":"L3D State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"L3DCR":{"name":"L3DCR","verbal":"L3D Control Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"L3DDR":{"name":"L3DDR","verbal":"L3D Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"LEDMSR":{"name":"LEDMSR","verbal":"LEDM State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"LEDMCR":{"name":"LEDMCR","verbal":"LEDM Control Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"LEDMDR":{"name":"LEDMDR","verbal":"LEDM Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]}},"signals":{"C":{"name":"C","visible":true,"type":"L","value":0,"default_value":0,"nbits":"4","behavior":["MV MUXC_MUXB VAL_ZERO; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB INT 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB IORDY 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB MRDY 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 1 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 28 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 29 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 30 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 31 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MV MUXC_MUXB INEX; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB"],"fire_name":["svg_cu:text3410"],"draw_data":[["svg_cu:path3108"],["svg_cu:path3062"],["svg_cu:path3060"],["svg_cu:path3136"],["svg_cu:path3482"],["svg_cu:path3480"],["svg_cu:path3488"],["svg_cu:path3486"],["svg_cu:path3484"],["svg_cu:path3484-9"],["svg_cu:path3108-3","svg_cu:path3260-3-8-6","svg_cu:path3260-3-8","svg_cu:path3260-3"]],"draw_name":[["svg_cu:path3496","svg_cu:path3414","svg_cu:path3194-08"]]},"B":{"name":"B","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV A1 MUXC_MUXB; FIRE A1","NOT_ES A1 MUXC_MUXB; FIRE A1"],"depends_on":["CLK"],"fire_name":["svg_cu:text3408"],"draw_data":[["svg_cu:path3094-7"],["svg_cu:path3392","svg_cu:path3372","svg_cu:path3390","svg_cu:path3384","svg_cu:path3108-1","svg_cu:path3100-8-7"]],"draw_name":[[],["svg_cu:path3194-0","svg_cu:path3138-8","svg_cu:path3498-6"]]},"A0":{"name":"A0","visible":false,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["SBIT_SIGNAL A0A1 0 1; FIRE A0A1","SBIT_SIGNAL A0A1 1 1; FIRE A0A1"],"depends_on":["CLK"],"fire_name":["svg_cu:text3406"],"draw_data":[["svg_cu:path3096"],["svg_cu:path3096"]],"draw_name":[[],["svg_cu:path3138-8-1","svg_cu:path3098-2","svg_cu:path3124-2-5"]]},"A1":{"name":"A1","visible":false,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["SBIT_SIGNAL A0A1 0 0; FIRE A0A1","SBIT_SIGNAL A0A1 1 0; FIRE A0A1"],"depends_on":["CLK"],"fire_name":[],"draw_data":[["svg_cu:path3094"],["svg_cu:path3094"]],"draw_name":[[]]},"A0A1":{"name":"A0A1","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["PLUS1 MUXA_MICROADDR REG_MICROADDR","CP_FIELD MUXA_MICROADDR REG_MICROINS/MADDR","MV MUXA_MICROADDR ROM_MUXA","MV MUXA_MICROADDR FETCH"],"depends_on":["CLK"],"fire_name":[],"draw_data":[["svg_cu:path3102","svg_cu:path3100","svg_cu:path3098","svg_cu:path3100-9","svg_cu:path3088"],["svg_cu:path3104","svg_cu:path3134","svg_cu:path3500","svg_cu:path3416"],["svg_cu:path3504","svg_cu:path3100-8","svg_cu:path3234-9"],["svg_cu:path3124"]],"draw_name":[[]]},"C0":{"name":"C0","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV REG_MAR BUS_IB"],"fire_name":["svg_p:text3077"],"draw_data":[["svg_p:path3081"]],"draw_name":[["svg_p:path3075"]]},"C1":{"name":"C1","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV REG_MBR M1_C1"],"fire_name":["svg_p:text3079"],"draw_data":[["svg_p:path3055"]],"draw_name":[["svg_p:path3073"]]},"C2":{"name":"C2","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV REG_PC BUS_IB; UPDATEDPC"],"fire_name":["svg_p:text3179"],"draw_data":[["svg_p:path3217"]],"draw_name":[["svg_p:path3177"]]},"C3":{"name":"C3","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV REG_IR BUS_IB; DECO; FIRE_IFSET C 10"],"fire_name":["svg_p:text3439"],"draw_data":[["svg_p:path3339","svg_p:path3913-4"]],"draw_name":[["svg_p:path3337"]]},"C4":{"name":"C4","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV REG_RT1 BUS_IB"],"fire_name":["svg_p:tspan482"],"draw_data":[["svg_p:path3339-4"]],"draw_name":[["svg_p:path3337-0"]]},"C7":{"name":"C7","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV REG_SR M7_C7"],"fire_name":["svg_p:text3655"],"draw_data":[["svg_p:path3651-9"]],"draw_name":[["svg_p:path3681"]]},"TA":{"name":"TA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV BUS_AB REG_MAR"],"fire_name":["svg_p:text3091"],"draw_data":[["svg_p:path3083","svg_p:path3089","svg_p:path3597","svg_p:path3513","svg_p:path3601","svg_p:path3601-2","svg_p:path3187","svg_p:path3087","svg_p:path2995","svg_p:path3535"]],"draw_name":[["svg_p:path3085"]]},"TD":{"name":"TD","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; CHECK_RTD","MV BUS_DB REG_MBR; FIRE R; FIRE W; CHECK_RTD"],"fire_name":["svg_p:text3103"],"draw_data":[["svg_p:path3093","svg_p:path3101","svg_p:path3587","svg_p:path3419-8","svg_p:path3071","svg_p:path3099","svg_p:path3097","svg_p:path3559-5","svg_p:path3419-1-0","svg_p:path3583","svg_p:path3419-1","svg_p:path3491","svg_p:path3641","svg_p:path3541"]],"draw_name":[["svg_p:path3095"]]},"T1":{"name":"T1","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 0","MV BUS_IB REG_MBR; FIRE M7; FIRE M1; SET_TT TTCPU 0"],"fire_name":["svg_p:text3105"],"draw_data":[["svg_p:path3065","svg_p:path3071","svg_p:path3069","svg_p:path3049","svg_p:path3063-9","svg_p:path3071"]],"draw_name":[["svg_p:path3067"]]},"T2":{"name":"T2","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 1","MV BUS_IB REG_PC; FIRE M7; FIRE M1; SET_TT TTCPU 1"],"fire_name":["svg_p:text3449"],"draw_data":[["svg_p:path3195","svg_p:path3199","svg_p:path3201","svg_p:path3049"]],"draw_name":[["svg_p:path3329"]]},"T3":{"name":"T3","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 2","MV BUS_IB SELEC_T3; FIRE M7; FIRE M1; SET_TT TTCPU 2"],"fire_name":["svg_p:text3451"],"draw_data":[["svg_p:path3347","svg_p:path3349","svg_p:path3931","svg_p:path3345","svg_p:path3049"]],"draw_name":[["svg_p:path3351"]]},"T6":{"name":"T6","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 3","MV BUS_IB ALU_T6; FIRE M7; FIRE M1; SET_TT TTCPU 3"],"fire_name":["svg_p:text3457"],"draw_data":[["svg_p:path3315","svg_p:path3589","svg_p:path3317","svg_p:path3163-2","svg_p:path3049","svg_p:path3317-9","svg_p:path3321","svg_p:path3261-8"]],"draw_name":[["svg_p:path3319"]]},"T8":{"name":"T8","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 4","MV BUS_IB REG_SR; FIRE M7; FIRE M1; SET_TT TTCPU 4"],"fire_name":["svg_p:text3657"],"draw_data":[["svg_p:path3645","svg_p:path3651","svg_p:path3647","svg_p:path3049"]],"draw_name":[["svg_p:path3649"]]},"T9":{"name":"T9","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 5","MV BUS_IB RA_T9; FIRE M7; FIRE M1; SET_TT TTCPU 5"],"fire_name":["svg_p:text3147"],"draw_data":[["svg_p:path3131","svg_p:path3143","svg_p:path3139","svg_p:path3049","svg_p:path3143-9"]],"draw_name":[["svg_p:path3133"]]},"T10":{"name":"T10","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 6","MV BUS_IB RB_T10; FIRE M7; FIRE M1; SET_TT TTCPU 6"],"fire_name":["svg_p:text3149"],"draw_data":[["svg_p:path3135","svg_p:path3145","svg_p:path3141","svg_p:path3049","svg_p:path3145-5"]],"draw_name":[["svg_p:path3137"]]},"T11":{"name":"T11","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 7","CP_FIELD BUS_IB REG_MICROINS/EXCODE; FIRE M7; FIRE M1; SET_TT TTCPU 7"],"fire_name":["svg_p:text3147-5","svg_cu:tspan4426"],"draw_data":[["svg_p:path3131-3","svg_p:path3081-3","svg_p:path3139-7","svg_p:path3049","svg_cu:path3081-3","svg_cu:path3139-7","svg_cu:path3502"]],"draw_name":[["svg_p:path3133-6","svg_cu:path3133-6"]]},"T12":{"name":"T12","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 8","MV BUS_IB HPC_T12; FIRE M7; FIRE M1; SET_TT TTCPU 8"],"fire_name":["svg_p:text3147-5-0-1-1"],"draw_data":[["svg_p:path3131-3-8-4-31","svg_p:path3139-7-1-4-3","svg_cu:path3049"]],"draw_name":[["svg_cu:path3133-6-9-7-5"]]},"M1":{"name":"M1","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV M1_C1 BUS_IB","MV M1_C1 BUS_DB"],"depends_on":["C1"],"fire_name":["svg_p:text3469"],"draw_data":[["svg_p:path3063","svg_p:path3061","svg_p:path3059"],["svg_p:path3057","svg_p:path3641","svg_p:path3419","svg_p:path3583"]],"draw_name":[[],["svg_p:path3447"]]},"M7":{"name":"M7","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV M7_C7 BUS_IB","MV M7_C7 REG_SR; UPDATE_FLAG M7_C7 FLAG_C 31; UPDATE_FLAG M7_C7 FLAG_V 30; UPDATE_FLAG M7_C7 FLAG_N 29; UPDATE_FLAG M7_C7 FLAG_Z 28"],"depends_on":["C7"],"fire_name":["svg_p:text3673"],"draw_data":[["svg_p:path3691","svg_p:path3693","svg_p:path3659"],["svg_p:path3695"]],"draw_name":[[],["svg_p:path3667"]]},"MA":{"name":"MA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV MA_ALU RA_T9; FIRE COP","MV MA_ALU BUS_IB; FIRE COP"],"depends_on":["SELA","SELB"],"fire_name":["svg_p:text3463"],"draw_data":[["svg_p:path3249","svg_p:path3161","svg_p:path3165"],["svg_p:path3279"]],"draw_name":[[],["svg_p:path3423"]]},"MB":{"name":"MB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV MB_ALU RB_T10; FIRE COP","MV MB_ALU REG_PC; FIRE COP"],"depends_on":["SELA","SELB"],"fire_name":["svg_p:text3465"],"draw_data":[["svg_p:path3281","svg_p:path3171","svg_p:path3169"],["svg_p:path3283"]],"draw_name":[[],["svg_p:path3425","svg_p:path3427"]]},"MH":{"name":"MH","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["MV HPC_T12 CLK","MV HPC_T12 ACC_TIME","MV HPC_T12 ACC_PWR","NOP"],"fire_name":["svg_p:text3147-5-0-1-8-4"],"draw_data":[[],["svg_p:path3081-3-8-5-3"]],"draw_name":[[],["svg_p:path3306-8-7-6"]]},"COP":{"name":"COP","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","forbidden":true,"behavior":["NOP_ALU; UPDATE_NZVC","AND ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","OR ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","NOT ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","XOR ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SRL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SRA ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","RR ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","RL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUB ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","MUL ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","DIV ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","MOD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","LUI ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADDFOUR ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADDONE ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUBFOUR ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUBONE ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FADD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FSUB ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FMUL ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FDIV ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FMOD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU"],"depends_on":["SELCOP"],"fire_name":["svg_p:text3303"],"draw_data":[["svg_p:path3237","svg_p:path3239","svg_p:path3261-8","svg_p:path3321","svg_p:path3901-6","svg_p:path3317-9"]],"draw_name":[["svg_p:path3009","svg_p:path3301"]]},"SELA":{"name":"SELA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"6","behavior":["FIRE_IFCHANGED MRA SELA; RESET_CHANGED SELA"],"depends_on":["RA"],"fire_name":["svg_cu:text3164"],"draw_data":[[]],"draw_name":[[]]},"SELB":{"name":"SELB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"6","behavior":["FIRE_IFCHANGED MRB SELB; RESET_CHANGED SELB"],"depends_on":["RB"],"fire_name":["svg_cu:text3168"],"draw_data":[[]],"draw_name":[[]]},"SELC":{"name":"SELC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"6","behavior":["FIRE_IFCHANGED MRC SELC; RESET_CHANGED SELC"],"depends_on":["RC"],"fire_name":["svg_cu:text3172"],"draw_data":[[]],"draw_name":[[]]},"SELCOP":{"name":"SELCOP","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["FIRE_IFCHANGED MC SELCOP; RESET_CHANGED SELCOP"],"depends_on":["COP"],"fire_name":["svg_cu:text3312"],"draw_data":[[]],"draw_name":[[]]},"EXCODE":{"name":"EXCODE","visible":true,"type":"L","value":0,"default_value":0,"nbits":"4","behavior":["FIRE T11"],"fire_name":["svg_cu:text3312-6"],"draw_data":[[]],"draw_name":[[]]},"RA":{"name":"RA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"6","forbidden":true,"behavior":["GET RA_T9 BR RA; FIRE_IFSET T9 1; FIRE_IFSET MA 0"],"depends_on":["SELA"],"fire_name":["svg_p:text3107"],"draw_data":[[]],"draw_name":[["svg_p:path3109"]]},"RB":{"name":"RB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"6","forbidden":true,"behavior":["GET RB_T10 BR RB; FIRE_IFSET T10 1; FIRE_IFSET MB 0"],"depends_on":["SELB"],"fire_name":["svg_p:text3123"],"draw_data":[[]],"draw_name":[["svg_p:path3113"]]},"RC":{"name":"RC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"6","forbidden":true,"behavior":["FIRE LC"],"depends_on":["SELC"],"fire_name":["svg_p:text3125"],"draw_data":[[]],"draw_name":[["svg_p:path3117"]]},"LC":{"name":"LC","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","SET BR RC BUS_IB"],"fire_name":["svg_p:text3127"],"draw_data":[["svg_p:path3153","svg_p:path3151","svg_p:path3129"]],"draw_name":[["svg_p:path3121"]]},"SE":{"name":"SE","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3","MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],"depends_on":["T3"],"fire_name":["svg_p:text3593"],"draw_data":[[]],"draw_name":[["svg_p:path3591","svg_p:path3447-7-7"]]},"SIZE":{"name":"SIZE","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],"depends_on":["T3"],"fire_name":["svg_p:text3363"],"draw_data":[[]],"draw_name":[["svg_p:path3355"]]},"OFFSET":{"name":"OFFSET","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],"depends_on":["T3"],"fire_name":["svg_p:text3707"],"draw_data":[[]],"draw_name":[["svg_p:path3359"]]},"MC":{"name":"MC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT COP REG_IR 0 5; FIRE_IFCHANGED COP MC","CP_FIELD COP REG_MICROINS/SELCOP; FIRE_IFCHANGED COP MC"],"depends_on":["SELCOP"],"fire_name":["svg_cu:text3322","svg_cu:text3172-1-5"],"draw_data":[["svg_cu:path3320","svg_cu:path3142"],["svg_cu:path3318","svg_cu:path3502-6","svg_cu:path3232-6"]],"draw_name":[[],["svg_cu:path3306"]]},"MRA":{"name":"MRA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT_SN RA REG_IR REG_MICROINS/SELA 5; FIRE RA;","CP_FIELD RA REG_MICROINS/SELA; FIRE RA;"],"depends_on":["SELA"],"fire_name":["svg_cu:text3222"],"draw_data":[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3142b","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3260"],["svg_cu:path3270","svg_cu:path3258","svg_cu:path3260","svg_cu:path3294","svg_cu:path3288","svg_cu:path3280"]],"draw_name":[[],["svg_cu:path3220"]]},"MRB":{"name":"MRB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT_SN RB REG_IR REG_MICROINS/SELB 5; FIRE RB;","CP_FIELD RB REG_MICROINS/SELB; FIRE RB;"],"depends_on":["SELB"],"fire_name":["svg_cu:text3242"],"draw_data":[["svg_cu:path3196","svg_cu:path3278","svg_cu:path3292"],["svg_cu:path3282","svg_cu:path3258-4","svg_cu:path3278","svg_cu:path3196"]],"draw_name":[[],["svg_cu:path3240"]]},"MRC":{"name":"MRC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT_SN RC REG_IR REG_MICROINS/SELC 5; FIRE RC;","CP_FIELD RC REG_MICROINS/SELC; FIRE RC;"],"depends_on":["SELC"],"fire_name":["svg_cu:text3254"],"draw_data":[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3142b","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3232","svg_cu:path3292"],["svg_cu:path3300","svg_cu:path3294","svg_cu:path3292","svg_cu:path3288","svg_cu:path3232"]],"draw_name":[[],["svg_cu:path3252"]]},"IOR":{"name":"IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MOVE_BITS SCR_IOR 0 1 IOR; FIRE SCR_IOR; MOVE_BITS IO_IOR 0 1 IOR; FIRE IO_IOR; MOVE_BITS L3D_IOR 0 1 IOR; FIRE L3D_IOR; MOVE_BITS KBD_IOR 0 1 IOR; FIRE KBD_IOR; MOVE_BITS LEDM_IOR 0 1 IOR; FIRE LEDM_IOR"],"fire_name":[],"draw_data":[[],["svg_p:path3733","svg_p:path3491","svg_p:text3715"]],"draw_name":[[],[]]},"IOW":{"name":"IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MOVE_BITS SCR_IOW 0 1 IOW; FIRE SCR_IOW; MOVE_BITS IO_IOW 0 1 IOW; FIRE IO_IOW; MOVE_BITS L3D_IOW 0 1 IOW; FIRE L3D_IOW; MOVE_BITS LEDM_IOW 0 1 IOW; FIRE LEDM_IOW"],"fire_name":[],"draw_data":[[],["svg_p:path3735","svg_p:path3491","svg_p:text3717"]],"draw_name":[[],[]]},"TEST_C":{"name":"TEST_C","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_C VAL_ZERO; FIRE M7","MV FLAG_C VAL_ONE; FIRE M7"],"depends_on":["SELCOP"],"fire_name":["svg_p:text3701-3"],"draw_data":[["svg_p:text3701-3"]],"draw_name":[[]]},"TEST_V":{"name":"TEST_V","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_V VAL_ZERO; FIRE M7","MV FLAG_V VAL_ONE; FIRE M7"],"depends_on":["SELCOP"],"fire_name":["svg_p:text3701-3-1"],"draw_data":[["svg_p:text3701-3-1"]],"draw_name":[[]]},"TEST_N":{"name":"TEST_N","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_N VAL_ZERO; FIRE M7","MV FLAG_N VAL_ONE; FIRE M7"],"depends_on":["SELCOP"],"fire_name":["svg_p:text3701-3-2"],"draw_data":[["svg_p:text3701-3-2"]],"draw_name":[[]]},"TEST_Z":{"name":"TEST_Z","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_Z VAL_ZERO; FIRE M7","MV FLAG_Z VAL_ONE; FIRE M7"],"depends_on":["SELCOP"],"fire_name":["svg_p:text3701-3-5"],"draw_data":[["svg_p:text3701-3-5"]],"draw_name":[[]]},"TEST_I":{"name":"TEST_I","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV FLAG_I VAL_ZERO; FIRE M7","MV FLAG_I VAL_ONE; FIRE M7"],"depends_on":["CLK"],"fire_name":["svg_cu:text3440"],"draw_data":[["svg_cu:text3440"]],"draw_name":[[]]},"TEST_U":{"name":"TEST_U","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV FLAG_U VAL_ZERO; FIRE M7","MV FLAG_U VAL_ONE; FIRE M7"],"depends_on":["CLK"],"fire_name":["svg_cu:text3442"],"draw_data":[["svg_cu:text3442"]],"draw_name":[[]]},"TEST_INTV":{"name":"TEST_INTV","visible":true,"type":"L","value":0,"default_value":0,"nbits":"8","forbidden":true,"behavior":["MBIT INTV TEST_INTV 0 32"],"depends_on":["INT"],"fire_name":["svg_p:tspan4225"],"draw_data":[["svg_p:path3749"]],"draw_name":[[]]},"MRDY":{"name":"MRDY","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","depends_on":["CLK"],"behavior":["FIRE_IFCHANGED MRDY C","FIRE_IFCHANGED MRDY C"],"fire_name":["svg_p:tspan3916"],"draw_data":[[],["svg_p:path3895","svg_p:path3541"]],"draw_name":[[],[]]},"R":{"name":"R","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; CHECK_RTD","MEM_READ BUS_AB BUS_DB BW MRDY CLK; FIRE M1; FIRE MRDY; CHECK_RTD"],"fire_name":["svg_p:text3533-5-2"],"draw_data":[[],["svg_p:path3557","svg_p:path3571"]],"draw_name":[[],[]]},"W":{"name":"W","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MEM_WRITE BUS_AB BUS_DB BW MRDY CLK; FIRE M1; FIRE MRDY"],"fire_name":["svg_p:text3533-5-08"],"draw_data":[[],["svg_p:path3559","svg_p:path3575","svg_p:path3447-7"]],"draw_name":[[],[]]},"BW":{"name":"BW","verbal":["Access to one byte from memory. ","Access to two bytes from memory. ","Access to three bytes from memory. ","Access to a word from memory. "],"visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["FIRE R; FIRE W","FIRE R; FIRE W","FIRE R; FIRE W","FIRE R; FIRE W"],"fire_name":["svg_p:text3533-5-2-8"],"draw_data":[["svg_p:path3557-0"]],"draw_name":[[],[]]},"INT":{"name":"INT","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","depends_on":["CLK"],"behavior":["FIRE C","FIRE C"],"fire_name":["svg_p:tspan4199"],"draw_data":[[],["svg_p:path3809"]],"draw_name":[[],[]]},"IORDY":{"name":"IORDY","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","depends_on":["CLK"],"behavior":["FIRE_IFCHANGED IORDY C","FIRE_IFCHANGED IORDY C"],"fire_name":["svg_p:tspan4089","svg_p:path3793","svg_p:tspan4089"],"draw_data":[[],["svg_p:path3897"]],"draw_name":[[],[]]},"IO_IOR":{"name":"IO_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","IO_IOR BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE M1"],"fire_name":["svg_p:tspan4173"],"draw_data":[[],["svg_p:path3795","svg_p:path3733"]],"draw_name":[[],[]]},"IO_IOW":{"name":"IO_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","IO_IOW BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE M1"],"fire_name":["svg_p:text3785-0-6-0-5-5"],"draw_data":[[],["svg_p:path3805","svg_p:path3733"]],"draw_name":[[],[]]},"IO_IE":{"name":"IO_IE","visible":true,"type":"L","value":1,"default_value":1,"nbits":"1","behavior":["NOP","IO_CHK_I CLK INT INTV; FIRE C"],"fire_name":[],"draw_data":[[],[]],"draw_name":[[],[]]},"INTA":{"name":"INTA","visible":true,"type":"L","value":1,"default_value":0,"nbits":"1","behavior":["NOP","INTA CLK INT INTA BUS_DB INTV; FIRE M1; FIRE C"],"fire_name":["svg_p:text3785-0-6-0-5-5-1-1"],"draw_data":[[],["svg_p:path3807","svg_p:path3737"]],"draw_name":[[],[]]},"KBD_IOR":{"name":"KBD_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","KBD_IOR BUS_AB BUS_DB KBDR KBSR CLK; FIRE M1"],"fire_name":["svg_p:tspan4057"],"draw_data":[[],["svg_p:path3863","svg_p:path3847"]],"draw_name":[[],[]]},"SCR_IOR":{"name":"SCR_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","SCR_IOR BUS_AB BUS_DB DDR DSR CLK"],"fire_name":["svg_p:tspan4004"],"draw_data":[[],["svg_p:path3871","svg_p:path3857"]],"draw_name":[[],[]]},"SCR_IOW":{"name":"SCR_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","SCR_IOW BUS_AB BUS_DB DDR DSR CLK"],"fire_name":["svg_p:tspan4006"],"draw_data":[[],["svg_p:path3873","svg_p:path3857"]],"draw_name":[[],[]]},"L3D_IOR":{"name":"L3D_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","L3D_IOR BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE M1"],"fire_name":["svg_p:tspan4173"],"draw_data":[[],["svg_p:path3795","svg_p:path3733"]],"draw_name":[[],[]]},"L3D_IOW":{"name":"L3D_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","L3D_IOW BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE M1; L3D_SYNC"],"fire_name":["svg_p:text3785-0-6-0-5-5"],"draw_data":[[],["svg_p:path3805","svg_p:path3733"]],"draw_name":[[],[]]},"LEDM_IOR":{"name":"LEDM_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LEDM_IOR BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE M1"],"fire_name":["svg_p:tspan4173"],"draw_data":[[],["svg_p:path3795","svg_p:path3733"]],"draw_name":[[],[]]},"LEDM_IOW":{"name":"LEDM_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LEDM_IOW BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE M1; LEDM_SYNC"],"fire_name":["svg_p:text3785-0-6-0-5-5"],"draw_data":[[],["svg_p:path3805","svg_p:path3733"]],"draw_name":[[],[]]}},"behaviors":{"PRINT_S":{"nparameters":2,"types":["S"],"operation":"/Function(function(s_expr){console.log(s_expr[1]+\": 0x\"+sim.poc.signals[s_expr[1]].value.toString(16))})/","verbal":"/Function(function(s_expr){return\"Print value of signal \"+s_expr[1]+\": 0x\"+sim.poc.signals[s_expr[1]].value.toString(16)+\". \"})/"},"PRINT_E":{"nparameters":2,"types":["E"],"operation":"/Function(function(s_expr){console.log(s_expr[1]+\": 0x\"+sim.poc.states[s_expr[1]].value.toString(16))})/","verbal":"/Function(function(s_expr){return\"Print value of state \"+s_expr[1]+\": 0x\"+sim.poc.states[s_expr[1]].value.toString(16)+\". \"})/"},"NOP":{"nparameters":1,"operation":"/Function(function(s_expr){})/","verbal":"/Function(function(s_expr){return\"\"})/"},"NOP_ALU":{"nparameters":1,"operation":"/Function(function(s_expr){sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){return\"Reset ALU flags. \"})/"},"MV":{"nparameters":3,"types":["X","X"],"operation":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)})/","verbal":"/Function(function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"short\"){return\"Copy from \"+show_verbal(s_expr[2])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(newval)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" (\"+show_value(newval)+\"). \"})/"},"LOAD":{"nparameters":3,"types":["X","X"],"operation":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)})/","verbal":"/Function(function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Load from \"+show_verbal(s_expr[2])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(newval)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_value(newval)+\" ( \"+show_verbal(s_expr[2])+\"). \"})/"},"CP_FIELD":{"nparameters":3,"types":["X","X"],"operation":"/Function(function(s_expr){r=s_expr[2].split(\"/\");sim_elto_org=get_reference(r[0]);newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval!=\"undefined\"){sim_elto_dst=get_reference(s_expr[1]);set_value(sim_elto_dst,newval)}})/","verbal":"/Function(function(s_expr){var r=s_expr[2].split(\"/\");var sim_elto_org=get_reference(r[0]);var newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval==\"undefined\")newval=\"<undefined>\";else newval=show_value(newval);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return'Copy from \"'+show_verbal(r[0])+'\"['+r[1]+\"] \"+\"to \"+show_verbal(s_expr[1])+\" (value \"+newval+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(r[0])+\".\"+r[1]+\" (\"+newval+\"). \"})/"},"NOT_ES":{"nparameters":3,"types":["S","E"],"operation":"/Function(function(s_expr){set_value(sim.poc.signals[s_expr[1]],Math.abs(get_value(sim.poc.states[s_expr[2]])-1))})/","verbal":"/Function(function(s_expr){var value=Math.abs(get_value(sim.poc.states[s_expr[2]])-1);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Set \"+show_verbal(s_expr[1])+\" with value \"+show_value(value)+\" (Logical NOT of \"+s_expr[2]+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_value(value)+\" (Logical NOT \"+s_expr[2]+\"). \"})/"},"GET":{"nparameters":4,"types":["E","E","S"],"operation":"/Function(function(s_expr){set_value(sim.poc.states[s_expr[1]],get_value(sim.poc.states[s_expr[2]][sim.poc.signals[s_expr[3]].value]))})/","verbal":"/Function(function(s_expr){var value=get_value(sim.poc.states[s_expr[2]][sim.poc.signals[s_expr[3]].value]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Set \"+show_verbal(s_expr[1])+\" with value \"+show_value(value)+\" (Register File \"+s_expr[3]+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_value(value)+\" (Register File \"+s_expr[3]+\"). \"})/"},"SET":{"nparameters":4,"types":["E","S","E"],"operation":"/Function(function(s_expr){set_value(sim.poc.states[s_expr[1]][sim.poc.signals[s_expr[2]].value],get_value(sim.poc.states[s_expr[3]]))})/","verbal":"/Function(function(s_expr){var value=get_value(sim.poc.states[s_expr[3]]);var o_ref=sim.poc.states[s_expr[1]][sim.poc.signals[s_expr[2]].value];var o_verbal=o_ref.name;if(typeof o_ref.verbal!=\"undefined\")o_verbal=o_ref.verbal;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy to \"+o_verbal+\" the value \"+show_value(value)+\". \"}return o_verbal+\" = \"+show_value(value)+\". \"})/"},"AND":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])&get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])&get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU AND with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (AND). \"})/"},"OR":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])|get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])|get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU OR with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (OR). \"})/"},"NOT":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=~get_value(sim.poc.states[s_expr[2]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=~get_value(sim.poc.states[s_expr[2]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU NOT with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (NOT). \"})/"},"XOR":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])^get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])^get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU XOR with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (XOR). \"})/"},"SRL":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Shift Right Logical with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SRL). \"})/"},"SRA":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Shift Right Arithmetic with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SRA). \"})/"},"SL":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Shift Left with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SL). \"})/"},"RR":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1|(get_value(sim.poc.states[s_expr[2]])&1)<<31;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1|(get_value(sim.poc.states[s_expr[2]])&1)<<31;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Right Rotation with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (RR). \"})/"},"RL":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1|(get_value(sim.poc.states[s_expr[2]])&2147483648)>>>31;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1|(get_value(sim.poc.states[s_expr[2]])&2147483648)>>>31;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Left Rotation with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (LR). \"})/"},"ADD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a+b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a+b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU ADD with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (ADD). \"})/"},"SUB":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a-b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a-b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU SUB with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SUB). \"})/"},"MUL":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a*b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a*b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU MUL with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (MUL). \"})/"},"DIV":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){return\"ALU DIV zero by zero (oops!). \"}var result=Math.floor(a/b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU DIV with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (DIV). \"})/"},"MOD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=a%b;set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){return\"ALU MOD zero by zero (oops!). \"}var result=a%b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU MOD with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (MOD). \"})/"},"LUI":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;return\"ALU Load Upper Immediate with result \"+show_value(result)+\". \"})/"},"ADDFOUR":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;return\"ALU ADD 4 with result \"+show_value(result)+\". \"})/"},"ADDONE":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;return\"ALU ADD 1 with result \"+show_value(result)+\". \"})/"},"SUBFOUR":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-4;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-4;return\"ALU SUB 4 with result \"+show_value(result)+\". \"})/"},"SUBONE":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-1;return\"ALU SUB 1 with result \"+show_value(result)+\". \"})/"},"FADD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)+b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)+b.toFixed(2);return\"ALU Float ADD with result \"+result+\". \"})/"},"FSUB":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)-b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)-b.toFixed(2);return\"ALU Float SUB with result \"+result+\". \"})/"},"FMUL":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)*b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)*b.toFixed(2);return\"ALU Float MUL with result \"+result+\". \"})/"},"FDIV":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)/b.toFixed(2);return\"ALU Float DIV with result \"+result+\". \"})/"},"FMOD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=(get_value(sim.poc.states[s_expr[2]])<<0)%(get_value(sim.poc.states[s_expr[3]])<<0);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)%b.toFixed(2);return\"ALU Float MOD with result \"+result+\". \"})/"},"PLUS1":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;set_value(sim.poc.states[s_expr[1]],result>>>0)})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Add one to \"+show_verbal(s_expr[2])+\" and copy to \"+show_verbal(s_expr[1])+\" with result \"+show_value(result)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" + 1\"+\" (\"+show_value(result)+\"). \"})/"},"PLUS4":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;set_value(sim.poc.states[s_expr[1]],result>>>0)})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Add four to \"+show_verbal(s_expr[2])+\" and copy to \"+show_verbal(s_expr[1])+\" with result \"+show_value(result)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" + 4\"+\" (\"+show_value(result)+\"). \"})/"},"SET_TT":{"nparameters":3,"types":["E","I"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a|m;set_value(sim.poc.states[s_expr[1]],r);update_cpu_bus_fire(r,b)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"RST_TT":{"nparameters":3,"types":["E","I"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a&~m;set_value(sim.poc.states[s_expr[1]],r);update_cpu_bus_fire(r,b)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"CHECK_RTD":{"nparameters":1,"operation":"/Function(function(s_expr){var number_active_tri=parseInt(simhw_sim_signal(\"TD\").value)+parseInt(simhw_sim_signal(\"R\").value);update_system_bus_fire(number_active_tri)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"MBIT":{"nparameters":5,"types":["X","X","I","I"],"operation":"/Function(function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);set_value(sim_elto_dst,parseInt(n2,2))})/","verbal":"/Function(function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=parseInt(n2,2);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+show_verbal(s_expr[2])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(n3)+\" (copied \"+size+\" bits from bit \"+offset+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" (\"+show_value(n3)+\", \"+size+\" bits from bit \"+offset+\"). \"})/"},"MBIT_SN":{"nparameters":5,"types":["S","E","E","I"],"operation":"/Function(function(s_expr){var base=0;var r=s_expr[3].split(\"/\");if(1==r.length)base=get_value(sim.poc.states[s_expr[3]]);else if(typeof sim.poc.states[r[0]].value[r[1]]!=\"undefined\")base=sim.poc.states[r[0]].value[r[1]];else if(typeof sim.poc.signals[r[1]].default_value!=\"undefined\")base=sim.poc.signals[r[1]].default_value;else if(typeof sim.poc.states[r[1]].default_value!=\"undefined\")base=sim.poc.states[r[1]].default_value;else ws_alert(\"WARN: undefined state/field pair -> \"+r[0]+\"/\"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.poc.states[s_expr[2]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){var base=0;var r=s_expr[3].split(\"/\");if(1==r.length)base=get_value(sim.poc.states[s_expr[3]]);else if(typeof sim.poc.states[r[0]].value[r[1]]!=\"undefined\")base=sim.poc.states[r[0]].value[r[1]];else if(typeof sim.poc.signals[r[1]].default_value!=\"undefined\")base=sim.poc.signals[r[1]].default_value;else if(typeof sim.poc.states[r[1]].default_value!=\"undefined\")base=sim.poc.states[r[1]].default_value;else ws_alert(\"WARN: undefined state/field pair -> \"+r[0]+\"/\"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.poc.states[s_expr[2]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);var from_elto=\"\";if(1==r.length)from_elto=show_verbal(s_expr[3]);else from_elto='\"'+show_verbal(s_expr[2])+'\"['+r[1]+\"] \";var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+from_elto+\"into \"+show_verbal(s_expr[1])+\" \"+\"value \"+parseInt(n3,2)+\". \"}return show_verbal(s_expr[1])+\" = \"+from_elto+\" (\"+parseInt(n3,2)+\"). \"})/"},"SBIT_SIGNAL":{"nparameters":4,"types":["X","I","I"],"operation":"/Function(function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)})/","verbal":"/Function(function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)})/"},"UPDATE_FLAG":{"nparameters":4,"types":["X","X","I"],"operation":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value&~(1<>>0)})/","verbal":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Update \"+show_verbal(s_expr[2])+\" to value \"+sim_elto_org.value+\". \"}return show_verbal(s_expr[1])+\".\"+show_verbal(s_expr[3])+\" = \"+sim_elto_org.value+\". \"})/"},"MBITS":{"nparameters":8,"types":["E","I","E","S","S","I","S"],"operation":"/Function(function(s_expr){var offset=parseInt(sim.poc.signals[s_expr[4]].value);var size=parseInt(sim.poc.signals[s_expr[5]].value);var n1=get_value(sim.poc.states[s_expr[3]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;if(\"1\"==sim.poc.signals[s_expr[7]].value&&\"1\"==n2.substr(0,1)){n3=\"11111111111111111111111111111111\".substring(0,32-n2.length)+n2}set_value(sim.poc.states[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){var offset=parseInt(sim.poc.signals[s_expr[4]].value);var size=parseInt(sim.poc.signals[s_expr[5]].value);var n1=get_value(sim.poc.states[s_expr[3]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;if(\"1\"==sim.poc.signals[s_expr[7]].value&&\"1\"==n2.substr(0,1)){n3=\"11111111111111111111111111111111\".substring(0,32-n2.length)+n2}n1=parseInt(n3,2);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\" Copy from \"+show_verbal(s_expr[3])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(n1)+\" (copied \"+size+\" bits from bit \"+offset+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[3])+\" (\"+show_value(n1)+\", \"+size+\" bits from bit \"+offset+\"). \"})/"},"BSEL":{"nparameters":6,"types":["E","I","I","E","I"],"operation":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var n4=\"00000000000000000000000000000000\".substr(0,posd);n3=n3+n4;set_value(sim.poc.states[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var len=parseInt(s_expr[3]);var poso=parseInt(s_expr[5]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var n4=\"00000000000000000000000000000000\".substr(0,posd);n3=n3+n4;var n5=parseInt(n3,2);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+show_verbal(s_expr[4])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(n5)+\" (copied \"+len+\" bits, from bit \"+poso+\" of \"+s_expr[4]+\" to bit \"+posd+\" of \"+s_expr[1]+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[4])+\" (\"+show_value(n5)+\", \"+len+\" bits, from bit \"+poso+\" of \"+s_expr[4]+\" to bit \"+posd+\" of \"+s_expr[1]+\"). \"})/"},"EXT_SIG":{"nparameters":3,"types":["E","I"],"operation":"/Function(function(s_expr){var n1=get_value(sim.poc.states[s_expr[1]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if(\"1\"==n2[31-s_expr[2]]){n4=\"11111111111111111111111111111111\".substring(0,32-n3.length)+n4}set_value(sim.poc.states[s_expr[1]],parseInt(n4,2))})/","verbal":"/Function(function(s_expr){var n1=get_value(sim.poc.states[s_expr[1]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if(\"1\"==n2[31-s_expr[2]]){n4=\"11111111111111111111111111111111\".substring(0,32-n3.length)+n4}var n5=parseInt(n4,2);return\"Sign Extension with value \"+show_value(n5)+\". \"})/"},"MOVE_BITS":{"nparameters":5,"types":["S","I","I","S"],"operation":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var poso=0;var len=parseInt(s_expr[3]);var n1=sim.poc.signals[s_expr[4]].value.toString(2);n1=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.poc.signals[s_expr[1]].value.toString(2);n2=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){return\"\"})/"},"MOVE_BITSE":{"nparameters":6,"types":["S","I","I","E","I"],"operation":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);n1=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.poc.signals[s_expr[1]].value.toString(2);n2=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){return\"\"})/"},"DECO":{"nparameters":1,"operation":"/Function(function(s_expr){sim.poc.states[\"INEX\"].value=0;var oi=decode_instruction(sim.poc.internal_states.FIRMWARE,sim.poc.ctrl_states.ir,get_value(sim.poc.states[\"REG_IR\"]));if(null==oi.oinstruction){ws_alert(\"ERROR: undefined instruction code in IR (\"+\"co:\"+oi.op_code.toString(2)+\", \"+\"cop:\"+oi.cop_code.toString(2)+\")\");sim.poc.states[\"ROM_MUXA\"].value=0;sim.poc.states[\"INEX\"].value=1;return-1}var rom_addr=oi.op_code<<6;if(typeof oi.oinstruction.cop!=\"undefined\"){rom_addr=rom_addr+oi.cop_code}if(typeof sim.poc.internal_states[\"ROM\"][rom_addr]==\"undefined\"){ws_alert(\"ERROR: undefined rom address \"+rom_addr+\" in firmware\");sim.poc.states[\"ROM_MUXA\"].value=0;return-1}sim.poc.states[\"ROM_MUXA\"].value=sim.poc.internal_states[\"ROM\"][rom_addr];var val=get_value(sim.poc.states[\"DECO_INS\"]);set_value(sim.poc.states[\"DECO_INS\"],val+1);var pc=get_value(sim.poc.states[\"REG_PC\"])-4;var decins=get_deco_from_pc(pc);set_value(sim.poc.states[\"REG_IR_DECO\"],decins);show_dbg_ir(get_value(sim.poc.states[\"REG_IR_DECO\"]))})/","verbal":"/Function(function(s_expr){return\"Decode instruction. \"})/"},"FIRE":{"nparameters":2,"types":["S"],"operation":"/Function(function(s_expr){if(sim.poc.internal_states.fire_stack.indexOf(s_expr[1])!=-1){return}sim.poc.internal_states.fire_stack.push(s_expr[1]);update_draw(sim.poc.signals[s_expr[1]],sim.poc.signals[s_expr[1]].value);if(\"L\"==sim.poc.signals[s_expr[1]].type){update_state(s_expr[1])}sim.poc.internal_states.fire_stack.pop(s_expr[1])})/","verbal":"/Function(function(s_expr){return\"\"})/"},"FIRE_IFSET":{"nparameters":3,"types":["S","I"],"operation":"/Function(function(s_expr){if(get_value(sim.poc.signals[s_expr[1]])!=parseInt(s_expr[2])){return}sim.poc.behaviors[\"FIRE\"].operation(s_expr)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"FIRE_IFCHANGED":{"nparameters":3,"types":["S","X"],"operation":"/Function(function(s_expr){sim_elto=get_reference(s_expr[2]);if(sim_elto.changed==false)return;sim.poc.behaviors[\"FIRE\"].operation(s_expr)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"RESET_CHANGED":{"nparameters":2,"types":["X"],"operation":"/Function(function(s_expr){sim_elto=get_reference(s_expr[1]);sim_elto.changed=false})/","verbal":"/Function(function(s_expr){return\"\"})/"},"CLOCK":{"nparameters":1,"operation":"/Function(function(s_expr){var new_maddr=null;var mcelto=null;var t0=performance.now();var val=get_value(sim.poc.states[\"CLK\"]);set_value(sim.poc.states[\"CLK\"],val+1);set_value(sim.poc.states[\"TTCPU\"],0);new_maddr=get_value(sim.poc.states[\"REG_MICROADDR\"]);mcelto=sim.poc.internal_states[\"MC\"][new_maddr];if(typeof mcelto!==\"undefined\"&&false==mcelto.is_native){for(var i=0;i0){remain=sim.poc.events.mem[clk-1]-1}var first_time=typeof sim.poc.events.mem[clk]==\"undefined\";sim.poc.events.mem[clk]=remain;if(remain>0){return}var wordress=address&4294967292;var value=main_memory_getvalue(sim.poc.internal_states.MP,wordress);var full_redraw=false;if(typeof value===\"undefined\"){value=0;full_redraw=true}dbvalue=main_memory_extractvalues(value,bw,address&3);sim.poc.states[s_expr[2]].value=dbvalue>>>0;sim.poc.signals[s_expr[4]].value=1;show_main_memory(sim.poc.internal_states.MP,wordress,full_redraw,false);if(first_time&&sim.poc.internal_states.CM.length>0){cache_memory_access(sim.poc.internal_states.CM[0],address,\"read\",clk)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);switch(bw){case 0:bw_type=\"byte\";break;case 1:bw_type=\"half\";break;case 2:bw_type=\"three bytes\";break;case 3:bw_type=\"word\";break}var value=main_memory_getvalue(sim.poc.internal_states.MP,address);if(typeof value===\"undefined\"){value=0}verbal=\"Try to read a \"+bw_type+\" from memory \"+\"at address 0x\"+address.toString(16)+\" with value \"+value.toString(16)+\". \";return verbal})/"},"MEM_WRITE":{"nparameters":6,"types":["E","E","S","S","E"],"operation":"/Function(function(s_expr){var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);sim.poc.signals[s_expr[4]].value=0;var remain=get_value(sim.poc.internal_states.MP_wc);if(typeof sim.poc.events.mem[clk-1]!=\"undefined\"&&sim.poc.events.mem[clk-1]>0){remain=sim.poc.events.mem[clk-1]-1}var first_time=typeof sim.poc.events.mem[clk]==\"undefined\";sim.poc.events.mem[clk]=remain;if(remain>0){return}var wordress=address&4294967292;var value=main_memory_getvalue(sim.poc.internal_states.MP,wordress);var full_redraw=false;if(typeof value===\"undefined\"){value=0;full_redraw=true}value=main_memory_updatevalues(value,dbvalue,bw,address&3);var origin=\"\";var r_value=main_memory_get_program_counter();if(r_value!=null){origin=\"PC=0x\"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var elto=main_memory_set(sim.poc.internal_states.MP,wordress,melto);sim.poc.signals[s_expr[4]].value=1;show_main_memory(sim.poc.internal_states.MP,wordress,full_redraw,true);if(first_time&&sim.poc.internal_states.CM.length>0){cache_memory_access(sim.poc.internal_states.CM[0],address,\"write\",clk)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);switch(bw){case 0:bw_type=\"byte\";break;case 1:bw_type=\"half\";break;case 2:bw_type=\"three bytes\";break;case 3:bw_type=\"word\";break}var value=main_memory_getvalue(sim.poc.internal_states.MP,address);if(typeof value===\"undefined\"){value=0}verbal=\"Try to write a \"+bw_type+\" to memory \"+\"at address 0x\"+address.toString(16)+\" with value \"+value.toString(16)+\". \";return verbal})/"},"MEMORY_RESET":{"nparameters":1,"operation":"/Function(function(s_expr){sim.poc.events.mem={}})/","verbal":"/Function(function(s_expr){return\"Reset the memory (all values will be zeroes). \"})/"},"IO_IOR":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==IOSR_ID)set_value(sim.poc.states[s_expr[2]],iosr);if(bus_ab==IOCR_ID)set_value(sim.poc.states[s_expr[2]],iocr);if(bus_ab==IODR_ID)set_value(sim.poc.states[s_expr[2]],iodr)})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==IOSR_ID)verbal=\"I/O device read at IOSR of value \"+iosr+\". \";if(bus_ab==IOCR_ID)verbal=\"I/O device read at IOCR of value \"+iocr+\". \";if(bus_ab==IODR_ID)verbal=\"I/O device read at IODR of value \"+iodr+\". \";return verbal})/"},"IO_IOW":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab!=IOSR_ID&&bus_ab!=IOCR_ID&&bus_ab!=IODR_ID){return}if(bus_ab==IOSR_ID)set_value(sim.poc.states[s_expr[3]],bus_db);if(bus_ab==IOCR_ID)set_value(sim.poc.states[s_expr[4]],bus_db);if(bus_ab==IODR_ID)set_value(sim.poc.states[s_expr[5]],bus_db);var iocr_id=get_value(sim.poc.states[s_expr[4]]);var iodr_id=get_value(sim.poc.states[s_expr[5]]);if(iocr_id<0||iocr_id>7)return;set_var(sim.poc.internal_states.io_int_factory[iocr_id].period,iodr_id);set_var(sim.poc.internal_states.io_int_factory[iocr_id].probability,1);if(0==iodr_id)set_var(sim.poc.internal_states.io_int_factory[iocr_id].probability,0)})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab==IOSR_ID)verbal=\"I/O device write at IOSR with value \"+bus_db+\". \";if(bus_ab==IOCR_ID)verbal=\"I/O device write at IOCR with value \"+bus_db+\". \";if(bus_ab==IODR_ID)verbal=\"I/O device write at IODR with value \"+bus_db+\". \";return verbal})/"},"IO_CHK_I":{"nparameters":4,"types":["E","S","E"],"operation":"/Function(function(s_expr){var clk=get_value(sim.poc.states[s_expr[1]]);for(var i=sim.poc.internal_states.io_int_factory.length-1;i>=0;i--){if(get_var(sim.poc.internal_states.io_int_factory[i].period)==0)continue;if(get_var(sim.poc.internal_states.io_int_factory[i].active)==true){set_value(sim.poc.signals[s_expr[2]],1);set_value(sim.poc.states[s_expr[3]],i)}if(clk%get_var(sim.poc.internal_states.io_int_factory[i].period)==0){if(Math.random()>get_var(sim.poc.internal_states.io_int_factory[i].probability))continue;set_var(sim.poc.internal_states.io_int_factory[i].accumulated,get_var(sim.poc.internal_states.io_int_factory[i].accumulated)+1);set_var(sim.poc.internal_states.io_int_factory[i].active,true);if(typeof sim.poc.events.io[clk]==\"undefined\")sim.poc.events.io[clk]=[];sim.poc.events.io[clk].push(i);set_value(sim.poc.signals[s_expr[2]],1);set_value(sim.poc.states[s_expr[3]],i)}}})/","verbal":"/Function(function(s_expr){return\"Check I/O Interruption. \"})/"},"INTA":{"nparameters":6,"types":["E","S","S","E","E"],"operation":"/Function(function(s_expr){var clk=get_value(sim.poc.states[s_expr[1]]);if(typeof sim.poc.events.io[clk]!=\"undefined\"){set_value(sim.poc.states[s_expr[4]],sim.poc.events.io[clk][0]);return}set_value(sim.poc.signals[s_expr[2]],0);set_value(sim.poc.states[s_expr[5]],0);for(var i=0;i>24;var y=(iodr&16711680)>>16;var z=(iodr&65280)>>8;var p=z*Math.pow(sim.poc.internal_states.l3d_dim,2)+y*sim.poc.internal_states.l3d_dim+x;var s=get_var(sim.poc.internal_states.l3d_state[p].active);set_value(sim.poc.states[s_expr[2]],s)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==L3DSR_ID)verbal=\"I/O device read at L3DSR of value \"+iosr+\". \";if(bus_ab==L3DCR_ID)verbal=\"I/O device read at L3DCR of value \"+iocr+\". \";if(bus_ab==L3DDR_ID)verbal=\"I/O device read at L3DDR of value \"+iodr+\". \";return verbal})/"},"L3D_IOW":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab!=L3DSR_ID&&bus_ab!=L3DCR_ID&&bus_ab!=L3DDR_ID){return}if(bus_ab==L3DSR_ID){set_value(sim.poc.states[s_expr[3]],bus_db)}if(bus_ab==L3DDR_ID){set_value(sim.poc.states[s_expr[5]],bus_db)}if(bus_ab==L3DCR_ID){set_value(sim.poc.states[s_expr[4]],bus_db);var x=(bus_db&4278190080)>>24;var y=(bus_db&16711680)>>16;var z=(bus_db&65280)>>8;var p=z*Math.pow(sim.poc.internal_states.l3d_dim,2)+y*sim.poc.internal_states.l3d_dim+x;var s=(bus_db&255)!=0;var l3dstates=sim.poc.internal_states.l3d_state;set_var(l3dstates[p].active,s)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab==L3DSR_ID)verbal=\"I/O device write at L3DSR with value \"+bus_db+\". \";if(bus_ab==L3DCR_ID)verbal=\"I/O device write at L3DCR with value \"+bus_db+\". \";if(bus_ab==L3DDR_ID)verbal=\"I/O device write at L3DDR with value \"+bus_db+\". \";return verbal})/"},"L3D_RESET":{"nparameters":1,"operation":"/Function(function(s_expr){sim.poc.events.l3d={};var n=sim.poc.internal_states.l3d_state.length;for(var i=0;i>24;var y=(iodr&16711680)>>16;var p=y*sim.poc.internal_states.ledm_dim+x;var s=get_var(sim.poc.internal_states.ledm_state[p].color);set_value(sim.poc.states[s_expr[2]],s)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==LEDMSR_ID)verbal=\"I/O device read at LEDMSR of value \"+iosr+\". \";if(bus_ab==LEDMCR_ID)verbal=\"I/O device read at LEDMCR of value \"+iocr+\". \";if(bus_ab==LEDMDR_ID)verbal=\"I/O device read at LEDMDR of value \"+iodr+\". \";return verbal})/"},"LEDM_IOW":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);switch(bus_ab){case LEDMSR_ID:set_value(sim.poc.states[s_expr[3]],bus_db);break;case LEDMDR_ID:set_value(sim.poc.states[s_expr[5]],bus_db);break;case LEDMCR_ID:set_value(sim.poc.states[s_expr[4]],bus_db);break;default:break}if(LEDMCR_ID==bus_ab){var dr=get_value(sim.poc.states[s_expr[5]]);if(16&bus_db){var x=(dr&4278190080)>>24;var y=(dr&16711680)>>16;var s=dr&255;set_value(sim.poc.states[s_expr[3]],1);if(x>=sim.poc.internal_states.ledm_dim&&y>=sim.poc.internal_states.ledm_dim){set_value(sim.poc.states[s_expr[3]],-1);return}var p=y*sim.poc.internal_states.ledm_dim+x;set_var(sim.poc.internal_states.ledm_state[p].color,s)}if(32&bus_db){set_value(sim.poc.states[s_expr[3]],1);var s=0;var neltos=sim.poc.internal_states.ledm_neltos;var ldmstates=sim.poc.internal_states.ledm_state;for(var p=0;p>0);set_var(sim.poc.internal_states.ledm_state[p+1].color,(s&65280)>>8);set_var(sim.poc.internal_states.ledm_state[p+2].color,(s&16711680)>>16);set_var(sim.poc.internal_states.ledm_state[p+3].color,(s&4278190080)>>24)}}if(64&bus_db){set_value(sim.poc.states[s_expr[3]],1);var s=0;var c=\"\";var neltos=sim.poc.internal_states.ledm_colors.length;for(var p=0;p>>8;s=s.toString(16);c=\"#\"+simcoreui_pack(s,6);sim.poc.internal_states.ledm_colors[p]=c}neltos=sim.poc.internal_states.ledm_neltos;for(var p=0;p>24;var y=(dr&16711680)>>16;var s=dr&255;verbal=\"I/O device write at LEDMCR with value \"+bus_db+\" (set pixel x:\"+x+\", y:\"+y+\", with color:\"+s+\"). \"}if(64&bus_db){verbal=\"I/O device write at LEDMCR with value \"+bus_db+\" (set color palette at:\"+bus_db+\"). \"}break;default:break}return verbal})/"},"LEDM_RESET":{"nparameters":1,"operation":"/Function(function(s_expr){sim.poc.events.ledm={};sim.poc.internal_states.ledm_colors=colors_clone(\"\");for(var i=0;i>>0;if(value!=0){vec.CPU[\"R\"+i]={type:\"register\",default_value:0,id:\"R\"+i,op:\"=\",value:\"0x\"+value.toString(16)}}}for(var i=0;i>>0;if(value!=0){vec.CPU[internal_reg[i]]={type:\"register\",default_value:0,id:internal_reg[i],op:\"=\",value:\"0x\"+value.toString(16)}}}return vec})/","read_state":"/Function(function(vec,check){if(typeof vec.CPU==\"undefined\")vec.CPU={};var key=check[\"id\"].toUpperCase().trim();var val=parseInt(check[\"value\"]).toString(16);if(\"REGISTER\"==check[\"type\"].toUpperCase().trim()){vec.CPU[key]={type:\"register\",default_value:0,id:key,op:check[\"condition\"],value:\"0x\"+val};return true}return false})/","get_state":"/Function(function(reg){var r_reg=reg.toUpperCase().trim();if(typeof sim.poc.states[\"REG_\"+r_reg]!=\"undefined\"){var value=get_value(sim.poc.states[\"REG_\"+r_reg])>>>0;return\"0x\"+value.toString(16)}r_reg=r_reg.replace(\"R\",\"\");var index=parseInt(r_reg);if(typeof sim.poc.states.BR[index]!=\"undefined\"){var value=get_value(sim.poc.states.BR[index])>>>0;return\"0x\"+value.toString(16)}return null})/","get_value":"/Function(function(elto){if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index))return get_value(simhw_sim_state(elto))>>>0;return get_value(simhw_sim_states().BR[index])>>>0})/","set_value":"/Function(function(elto,value){var pc_name=simhw_sim_ctrlStates_get().pc.state;if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index)){set_value(simhw_sim_state(elto),value);if(pc_name===elto){show_asmdbg_pc()}return value}return set_value(simhw_sim_states().BR[index],value)})/"},"MEMORY":{"name":"MEMORY","version":"1","abilities":["MEMORY"],"details_name":["MEMORY","MEMORY_CONFIG"],"details_fire":[["svg_p:text3001"],[]],"write_state":"/Function(function(vec){if(typeof vec.MEMORY==\"undefined\")vec.MEMORY={};var key=0;var value=0;for(var index in sim.poc.internal_states.MP){value=main_memory_getvalue(sim.poc.internal_states.MP,index);value=parseInt(value);if(value!=0){key=parseInt(index).toString(16);vec.MEMORY[\"0x\"+key]={type:\"memory\",default_value:0,id:\"0x\"+key,op:\"=\",value:\"0x\"+value.toString(16)}}}return vec})/","read_state":"/Function(function(vec,check){if(typeof vec.MEMORY==\"undefined\"){vec.MEMORY={}}var key=parseInt(check.id).toString(16);var val=parseInt(check.value).toString(16);if(\"MEMORY\"==check.type.toUpperCase().trim()){vec.MEMORY[\"0x\"+key]={type:\"memory\",default_value:0,id:\"0x\"+key,op:check.condition,value:\"0x\"+val};return true}return false})/","get_state":"/Function(function(pos){var index=parseInt(pos);var value=main_memory_getvalue(sim.poc.internal_states.MP,index);if(typeof value===\"undefined\"){return null}return\"0x\"+parseInt(value).toString(16)})/","get_value":"/Function(function(elto){var value=main_memory_getvalue(sim.poc.internal_states.MP,elto);show_main_memory(sim.poc.internal_states.MP,elto,false,false);return value>>>0})/","set_value":"/Function(function(elto,value){var origin=\"\";var r_value=main_memory_get_program_counter();if(r_value!=null){origin=\"PC=0x\"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.poc.internal_states.MP,elto,melto);show_main_memory(sim.poc.internal_states.MP,elto,typeof valref===\"undefined\",true);return value})/"},"IO":{"name":"IO","version":"1","abilities":["IO_TIMER"],"details_name":["IO_STATS","IO_CONFIG"],"details_fire":[["svg_p:text3775"],[]],"write_state":"/Function(function(vec){return vec})/","read_state":"/Function(function(o,check){return false})/","get_state":"/Function(function(reg){return null})/","get_value":"/Function(function(elto){var associated_state=simhw_internalState_get(\"io_hash\",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_signal(\"IOR\"),1);compute_behavior(\"FIRE IOR\");value=get_value(simhw_sim_state(\"BUS_DB\"));return value})/","set_value":"/Function(function(elto,value){var associated_state=simhw_internalState_get(\"io_hash\",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_state(\"BUS_DB\"),value);set_value(simhw_sim_signal(\"IOW\"),1);compute_behavior(\"FIRE IOW\");return value})/"},"KBD":{"name":"KBD","version":"1","abilities":["KEYBOARD"],"details_name":["KEYBOARD"],"details_fire":[["svg_p:text3829"]],"write_state":"/Function(function(vec){return vec})/","read_state":"/Function(function(o,check){return false})/","get_state":"/Function(function(reg){return null})/","get_value":"/Function(function(elto){return sim.poc.internal_states.keyboard_content})/","set_value":"/Function(function(elto,value){sim.poc.internal_states.keyboard_content=value;return value})/"},"SCREEN":{"name":"SCREEN","version":"1","abilities":["SCREEN"],"details_name":["SCREEN"],"details_fire":[["svg_p:text3845"]],"write_state":"/Function(function(vec){if(typeof vec.SCREEN==\"undefined\"){vec.SCREEN={}}var sim_screen=sim.poc.internal_states.screen_content;var sim_lines=sim_screen.trim().split(\"\\n\");for(var i=0;i>>0;set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_signal(\"L3DR\"),1);compute_behavior(\"FIRE L3DR\");value=get_value(simhw_sim_state(\"BUS_DB\"));return value})/","set_value":"/Function(function(elto,value){var associated_state=simhw_internalState_get(\"io_hash\",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_state(\"BUS_DB\"),value);set_value(simhw_sim_signal(\"L3DW\"),1);compute_behavior(\"FIRE L3DW\");return value})/"},"LEDM":{"name":"LEDM","version":"1","abilities":["LEDMATRIX"],"details_name":["LEDMATRIX"],"details_fire":[[]],"write_state":"/Function(function(vec){return vec})/","read_state":"/Function(function(o,check){return false})/","get_state":"/Function(function(reg){return null})/","get_value":"/Function(function(elto){var associated_state=simhw_internalState_get(\"io_hash\",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_signal(\"LEDMR\"),1);compute_behavior(\"FIRE LEDMR\");value=get_value(simhw_sim_state(\"BUS_DB\"));return value})/","set_value":"/Function(function(elto,value){var associated_state=simhw_internalState_get(\"io_hash\",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state(\"BUS_AB\"),elto);set_value(simhw_sim_state(\"BUS_DB\"),value);set_value(simhw_sim_signal(\"LEDMW\"),1);compute_behavior(\"FIRE LEDMW\");return value})/"}},"states":{"BR":[{"name":"R0","verbal":"Register 0","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R1","verbal":"Register 1","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R2","verbal":"Register 2","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R3","verbal":"Register 3","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R4","verbal":"Register 4","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R5","verbal":"Register 5","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R6","verbal":"Register 6","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R7","verbal":"Register 7","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R8","verbal":"Register 8","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R9","verbal":"Register 9","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R10","verbal":"Register 10","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R11","verbal":"Register 11","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R12","verbal":"Register 12","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R13","verbal":"Register 13","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R14","verbal":"Register 14","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R15","verbal":"Register 15","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R16","verbal":"Register 16","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R17","verbal":"Register 17","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R18","verbal":"Register 18","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R19","verbal":"Register 19","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R20","verbal":"Register 20","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R21","verbal":"Register 21","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R22","verbal":"Register 22","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R23","verbal":"Register 23","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R24","verbal":"Register 24","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R25","verbal":"Register 25","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R26","verbal":"Register 26","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R27","verbal":"Register 27","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R28","verbal":"Register 28","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R29","verbal":"Register 29","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R30","verbal":"Register 30","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R31","verbal":"Register 31","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R32","verbal":"Register 32","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R33","verbal":"Register 33","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R34","verbal":"Register 34","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R35","verbal":"Register 35","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R36","verbal":"Register 36","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R37","verbal":"Register 37","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R38","verbal":"Register 38","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R39","verbal":"Register 39","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R40","verbal":"Register 40","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R41","verbal":"Register 41","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R42","verbal":"Register 42","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R43","verbal":"Register 43","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R44","verbal":"Register 44","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R45","verbal":"Register 45","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R46","verbal":"Register 46","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R47","verbal":"Register 47","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R48","verbal":"Register 48","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R49","verbal":"Register 49","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R50","verbal":"Register 50","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R51","verbal":"Register 51","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R52","verbal":"Register 52","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R53","verbal":"Register 53","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R54","verbal":"Register 54","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R55","verbal":"Register 55","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R56","verbal":"Register 56","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R57","verbal":"Register 57","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R58","verbal":"Register 58","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R59","verbal":"Register 59","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R60","verbal":"Register 60","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R61","verbal":"Register 61","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R62","verbal":"Register 62","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},{"name":"R63","verbal":"Register 63","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]}],"REG_PC":{"name":"PC","verbal":"Program Counter Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_MAR":{"name":"MAR","verbal":"Memory Address Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_MBR":{"name":"MBR","verbal":"Memory Data Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_IR":{"name":"IR","verbal":"Instruction Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_SR":{"name":"SR","verbal":"State Register","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"REG_RT1":{"name":"RT1","verbal":"Temporal Register 1","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_IB":{"name":"I_BUS","verbal":"Internal Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_AB":{"name":"A_BUS","verbal":"Address Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_CB":{"name":"C_BUS","verbal":"Control Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BUS_DB":{"name":"D_BUS","verbal":"Data Bus","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"RA_T9":{"name":"RA_T9","verbal":"Input of T9 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"RB_T10":{"name":"RB_T10","verbal":"Input of T10 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"HPC_T12":{"name":"HPC_T12","verbal":"Input of T12 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"SELEC_T3":{"name":"SELEC_T3","verbal":"Input of T3 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"ALU_T6":{"name":"ALU_T6","verbal":"Input of T6 Tristate","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"MA_ALU":{"name":"MA_ALU","verbal":"Input ALU via MA","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"MB_ALU":{"name":"MB_ALU","verbal":"Input ALU via MB","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"FLAG_C":{"name":"FLAG_C","verbal":"Carry Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_V":{"name":"FLAG_V","verbal":"Overflow Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_N":{"name":"FLAG_N","verbal":"Negative Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_Z":{"name":"FLAG_Z","verbal":"Zero Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_I":{"name":"FLAG_I","verbal":"Interruption Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"FLAG_U":{"name":"FLAG_U","verbal":"User Flag","visible":true,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"REG_MICROADDR":{"name":"µADDR","verbal":"Microaddress Register","visible":true,"nbits":"12","value":0,"default_value":0,"draw_data":["svg_cu:text4667"]},"REG_MICROINS":{"name":"µINS","verbal":"Microinstruction Register","visible":true,"nbits":"77","value":{},"default_value":{},"draw_data":[]},"FETCH":{"name":"FETCH","verbal":"Input Fetch","visible":false,"nbits":"12","value":0,"default_value":0,"draw_data":[]},"ROM_MUXA":{"name":"ROM_MUXA","verbal":"Input ROM","visible":false,"nbits":"12","value":0,"default_value":0,"draw_data":[]},"SUM_ONE":{"name":"SUM_ONE","verbal":"Input next microinstruction","visible":false,"nbits":"12","value":1,"default_value":1,"draw_data":[]},"MUXA_MICROADDR":{"name":"MUXA_MICROADDR","verbal":"Input microaddress","visible":false,"nbits":"12","value":0,"default_value":0,"draw_data":[]},"MUXC_MUXB":{"name":"MUXC_MUXB","verbal":"Output of MUX C","visible":false,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"INEX":{"name":"INEX","verbal":"Illegal Instruction Exception","visible":false,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"BS_M1":{"name":"BS_M1","verbal":"from Memory","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"BS_TD":{"name":"BS_TD","verbal":"Memory","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"INTV":{"name":"INTV","verbal":"Interruption Vector","visible":false,"nbits":"8","value":0,"default_value":0,"draw_data":[]},"M1_C1":{"name":"M1_C1","verbal":"Input of Memory Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"M7_C7":{"name":"M7_C7","verbal":"Input of State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"VAL_ZERO":{"name":"VAL_ZERO","verbal":"Wired Zero","visible":false,"nbits":"1","value":0,"default_value":0,"draw_data":[]},"VAL_ONE":{"name":"VAL_ONE","verbal":"Wired One","visible":false,"nbits":"32","value":1,"default_value":1,"draw_data":[]},"VAL_FOUR":{"name":"VAL_FOUR","verbal":"Wired Four","visible":false,"nbits":"32","value":4,"default_value":4,"draw_data":[]},"REG_IR_DECO":{"name":"IR_DECO","verbal":"Instruction Decoded","visible":true,"nbits":"0","value":0,"default_value":0,"draw_data":[]},"DECO_INS":{"name":"DECO_INS","verbal":"Instruction decoded in binary","visible":true,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"CLK":{"name":"CLK","verbal":"Clock","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"ACC_TIME":{"name":"ACC_TIME","verbal":"Accumulated CPU time","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"TTCPU":{"name":"TTCPU","verbal":"Several Tristates to the internal data bus in CPU activated","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"ACC_PWR":{"name":"ACC_PWR","verbal":"Accumulated Energy Consumption","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"IOSR":{"name":"IOSR","verbal":"IO State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"IOCR":{"name":"IOCR","verbal":"IO Control Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"IODR":{"name":"IODR","verbal":"IO Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"KBDR":{"name":"KBDR","verbal":"Keyboard Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"KBSR":{"name":"KBSR","verbal":"Keyboard Status Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"DDR":{"name":"DDR","verbal":"Display Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"DSR":{"name":"DSR","verbal":"Display State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"L3DSR":{"name":"L3DSR","verbal":"L3D State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"L3DCR":{"name":"L3DCR","verbal":"L3D Control Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"L3DDR":{"name":"L3DDR","verbal":"L3D Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"LEDMSR":{"name":"LEDMSR","verbal":"LEDM State Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"LEDMCR":{"name":"LEDMCR","verbal":"LEDM Control Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]},"LEDMDR":{"name":"LEDMDR","verbal":"LEDM Data Register","visible":false,"nbits":"32","value":0,"default_value":0,"draw_data":[]}},"signals":{"C":{"name":"C","visible":true,"type":"L","value":0,"default_value":0,"nbits":"4","behavior":["MV MUXC_MUXB VAL_ZERO; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB INT 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB IORDY 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB MRDY 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 1 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 28 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 29 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 30 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 31 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MV MUXC_MUXB INEX; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB"],"fire_name":["svg_cu:text3410"],"draw_data":[["svg_cu:path3108"],["svg_cu:path3062"],["svg_cu:path3060"],["svg_cu:path3136"],["svg_cu:path3482"],["svg_cu:path3480"],["svg_cu:path3488"],["svg_cu:path3486"],["svg_cu:path3484"],["svg_cu:path3484-9"],["svg_cu:path3108-3","svg_cu:path3260-3-8-6","svg_cu:path3260-3-8","svg_cu:path3260-3"]],"draw_name":[["svg_cu:path3496","svg_cu:path3414","svg_cu:path3194-08"]]},"B":{"name":"B","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV A1 MUXC_MUXB; FIRE A1","NOT_ES A1 MUXC_MUXB; FIRE A1"],"depends_on":["CLK"],"fire_name":["svg_cu:text3408"],"draw_data":[["svg_cu:path3094-7","svg_cu:path3100-8-7","svg_cu:path3198-7","svg_cu:path3200-1"],["svg_cu:path3392","svg_cu:path3372","svg_cu:path3390","svg_cu:path3384","svg_cu:path3108-1","svg_cu:path3100-8-7","svg_cu:path3200-1","svg_cu:path3386"]],"draw_name":[[],["svg_cu:path3194-0","svg_cu:path3138-8","svg_cu:path3498-6"]]},"A0":{"name":"A0","visible":false,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["SBIT_SIGNAL A0A1 0 1; FIRE A0A1","SBIT_SIGNAL A0A1 1 1; FIRE A0A1"],"depends_on":["CLK"],"fire_name":["svg_cu:text3406"],"draw_data":[["svg_cu:path3096"],["svg_cu:path3096"]],"draw_name":[[],["svg_cu:path3138-8-1","svg_cu:path3098-2","svg_cu:path3124-2-5"]]},"A1":{"name":"A1","visible":false,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["SBIT_SIGNAL A0A1 0 0; FIRE A0A1","SBIT_SIGNAL A0A1 1 0; FIRE A0A1"],"depends_on":["CLK"],"fire_name":[],"draw_data":[["svg_cu:path3094"],["svg_cu:path3094"]],"draw_name":[[]]},"A0A1":{"name":"A0A1","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["PLUS1 MUXA_MICROADDR REG_MICROADDR","CP_FIELD MUXA_MICROADDR REG_MICROINS/MADDR","MV MUXA_MICROADDR ROM_MUXA","MV MUXA_MICROADDR FETCH"],"depends_on":["CLK"],"fire_name":[],"draw_data":[["svg_cu:path3102","svg_cu:path3100","svg_cu:path3098","svg_cu:path3100-9","svg_cu:path3088","svg_cu:path3082"],["svg_cu:path3104","svg_cu:path3134","svg_cu:path3500","svg_cu:path3416","svg_cu:path3124-2-4","svg_cu:path3124-2"],["svg_cu:path3504","svg_cu:path3100-8","svg_cu:path3234-9"],["svg_cu:path3124"]],"draw_name":[[]]},"C0":{"name":"C0","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV REG_MAR BUS_IB"],"fire_name":["svg_p:text3077"],"draw_data":[["svg_p:path3081"]],"draw_name":[["svg_p:path3075"]]},"C1":{"name":"C1","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV REG_MBR M1_C1"],"fire_name":["svg_p:text3079"],"draw_data":[["svg_p:path3055"]],"draw_name":[["svg_p:path3073"]]},"C2":{"name":"C2","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV REG_PC BUS_IB; UPDATEDPC"],"fire_name":["svg_p:text3179"],"draw_data":[["svg_p:path3217"]],"draw_name":[["svg_p:path3177"]]},"C3":{"name":"C3","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV REG_IR BUS_IB; DECO; FIRE_IFSET C 10"],"fire_name":["svg_p:text3439"],"draw_data":[["svg_p:path3339","svg_p:path3913-4"]],"draw_name":[["svg_p:path3337"]]},"C4":{"name":"C4","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV REG_RT1 BUS_IB"],"fire_name":["svg_p:tspan482"],"draw_data":[["svg_p:path3339-4"]],"draw_name":[["svg_p:path3337-0"]]},"C7":{"name":"C7","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV REG_SR M7_C7"],"fire_name":["svg_p:text3655"],"draw_data":[["svg_p:path3651-9"]],"draw_name":[["svg_p:path3681"]]},"TA":{"name":"TA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MV BUS_AB REG_MAR"],"fire_name":["svg_p:text3091"],"draw_data":[["svg_p:path3083","svg_p:path3089","svg_p:path3597","svg_p:path3513","svg_p:path3601","svg_p:path3601-2","svg_p:path3187","svg_p:path3087","svg_p:path2995","svg_p:path3535"]],"draw_name":[["svg_p:path3085"]]},"TD":{"name":"TD","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; CHECK_RTD","MV BUS_DB REG_MBR; FIRE R; FIRE W; CHECK_RTD"],"fire_name":["svg_p:text3103"],"draw_data":[["svg_p:path3093","svg_p:path3101","svg_p:path3587","svg_p:path3419-8","svg_p:path3071","svg_p:path3099","svg_p:path3097","svg_p:path3559-5","svg_p:path3419-1-0","svg_p:path3583","svg_p:path3419-1","svg_p:path3491","svg_p:path3641","svg_p:path3541"]],"draw_name":[["svg_p:path3095"]]},"T1":{"name":"T1","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 0","MV BUS_IB REG_MBR; FIRE M7; FIRE M1; SET_TT TTCPU 0"],"fire_name":["svg_p:text3105"],"draw_data":[["svg_p:path3065","svg_p:path3071","svg_p:path3069","svg_p:path3049","svg_p:path3063-9","svg_p:path3071"]],"draw_name":[["svg_p:path3067"]]},"T2":{"name":"T2","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 1","MV BUS_IB REG_PC; FIRE M7; FIRE M1; SET_TT TTCPU 1"],"fire_name":["svg_p:text3449"],"draw_data":[["svg_p:path3195","svg_p:path3199","svg_p:path3201","svg_p:path3049"]],"draw_name":[["svg_p:path3329"]]},"T3":{"name":"T3","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 2","MV BUS_IB SELEC_T3; FIRE M7; FIRE M1; SET_TT TTCPU 2"],"fire_name":["svg_p:text3451"],"draw_data":[["svg_p:path3347","svg_p:path3349","svg_p:path3931","svg_p:path3345","svg_p:path3049"]],"draw_name":[["svg_p:path3351"]]},"T6":{"name":"T6","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 3","MV BUS_IB ALU_T6; FIRE M7; FIRE M1; SET_TT TTCPU 3"],"fire_name":["svg_p:text3457"],"draw_data":[["svg_p:path3315","svg_p:path3589","svg_p:path3317","svg_p:path3163-2","svg_p:path3049","svg_p:path3317-9","svg_p:path3321","svg_p:path3261-8"]],"draw_name":[["svg_p:path3319"]]},"T8":{"name":"T8","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 4","MV BUS_IB REG_SR; FIRE M7; FIRE M1; SET_TT TTCPU 4"],"fire_name":["svg_p:text3657"],"draw_data":[["svg_p:path3645","svg_p:path3651","svg_p:path3647","svg_p:path3049"]],"draw_name":[["svg_p:path3649"]]},"T9":{"name":"T9","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 5","MV BUS_IB RA_T9; FIRE M7; FIRE M1; SET_TT TTCPU 5"],"fire_name":["svg_p:text3147"],"draw_data":[["svg_p:path3131","svg_p:path3143","svg_p:path3139","svg_p:path3049","svg_p:path3143-9"]],"draw_name":[["svg_p:path3133"]]},"T10":{"name":"T10","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 6","MV BUS_IB RB_T10; FIRE M7; FIRE M1; SET_TT TTCPU 6"],"fire_name":["svg_p:text3149"],"draw_data":[["svg_p:path3135","svg_p:path3145","svg_p:path3141","svg_p:path3049","svg_p:path3145-5"]],"draw_name":[["svg_p:path3137"]]},"T11":{"name":"T11","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 7","CP_FIELD BUS_IB REG_MICROINS/EXCODE; FIRE M7; FIRE M1; SET_TT TTCPU 7"],"fire_name":["svg_p:text3147-5","svg_cu:tspan4426"],"draw_data":[["svg_p:path3131-3","svg_p:path3081-3","svg_p:path3139-7","svg_p:path3049","svg_cu:path3081-3","svg_cu:path3139-7","svg_cu:path3502"]],"draw_name":[["svg_p:path3133-6","svg_cu:path3133-6"]]},"T12":{"name":"T12","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; RST_TT TTCPU 8","MV BUS_IB HPC_T12; FIRE M7; FIRE M1; SET_TT TTCPU 8"],"fire_name":["svg_p:text3147-5-0-1-1"],"draw_data":[["svg_p:path3131-3-8-4-31","svg_p:path3139-7-1-4-3","svg_cu:path3049"]],"draw_name":[["svg_cu:path3133-6-9-7-5"]]},"M1":{"name":"M1","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV M1_C1 BUS_IB","MV M1_C1 BUS_DB"],"depends_on":["C1"],"fire_name":["svg_p:text3469"],"draw_data":[["svg_p:path3063","svg_p:path3061","svg_p:path3059"],["svg_p:path3057","svg_p:path3641","svg_p:path3419","svg_p:path3583"]],"draw_name":[[],["svg_p:path3447"]]},"M7":{"name":"M7","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV M7_C7 BUS_IB","MV M7_C7 REG_SR; UPDATE_FLAG M7_C7 FLAG_C 31; UPDATE_FLAG M7_C7 FLAG_V 30; UPDATE_FLAG M7_C7 FLAG_N 29; UPDATE_FLAG M7_C7 FLAG_Z 28"],"depends_on":["C7"],"fire_name":["svg_p:text3673"],"draw_data":[["svg_p:path3691","svg_p:path3693","svg_p:path3659"],["svg_p:path3695"]],"draw_name":[[],["svg_p:path3667"]]},"MA":{"name":"MA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV MA_ALU RA_T9; FIRE COP","MV MA_ALU BUS_IB; FIRE COP"],"depends_on":["SELA","SELB"],"fire_name":["svg_p:text3463"],"draw_data":[["svg_p:path3249","svg_p:path3161","svg_p:path3165"],["svg_p:path3279"]],"draw_name":[[],["svg_p:path3423"]]},"MB":{"name":"MB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV MB_ALU RB_T10; FIRE COP","MV MB_ALU REG_PC; FIRE COP"],"depends_on":["SELA","SELB"],"fire_name":["svg_p:text3465"],"draw_data":[["svg_p:path3281","svg_p:path3171","svg_p:path3169"],["svg_p:path3283"]],"draw_name":[[],["svg_p:path3425","svg_p:path3427"]]},"MH":{"name":"MH","visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["MV HPC_T12 CLK","MV HPC_T12 ACC_TIME","MV HPC_T12 ACC_PWR","NOP"],"fire_name":["svg_p:text3147-5-0-1-8-4"],"draw_data":[[],["svg_p:path3081-3-8-5-3"]],"draw_name":[[],["svg_p:path3306-8-7-6"]]},"COP":{"name":"COP","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","forbidden":true,"behavior":["NOP_ALU; UPDATE_NZVC","AND ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","OR ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","NOT ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","XOR ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SRL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SRA ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","RR ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","RL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUB ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","MUL ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","DIV ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","MOD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","LUI ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADDFOUR ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADDONE ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUBFOUR ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUBONE ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FADD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FSUB ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FMUL ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FDIV ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FMOD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU"],"depends_on":["SELCOP"],"fire_name":["svg_p:text3303"],"draw_data":[["svg_p:path3237","svg_p:path3239","svg_p:path3261-8","svg_p:path3321","svg_p:path3901-6","svg_p:path3317-9"]],"draw_name":[["svg_p:path3009","svg_p:path3301"]]},"SELA":{"name":"SELA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"6","behavior":["FIRE_IFCHANGED MRA SELA; RESET_CHANGED SELA"],"depends_on":["RA"],"fire_name":["svg_cu:text3164"],"draw_data":[[]],"draw_name":[[]]},"SELB":{"name":"SELB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"6","behavior":["FIRE_IFCHANGED MRB SELB; RESET_CHANGED SELB"],"depends_on":["RB"],"fire_name":["svg_cu:text3168"],"draw_data":[[]],"draw_name":[[]]},"SELC":{"name":"SELC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"6","behavior":["FIRE_IFCHANGED MRC SELC; RESET_CHANGED SELC"],"depends_on":["RC"],"fire_name":["svg_cu:text3172"],"draw_data":[[]],"draw_name":[[]]},"SELCOP":{"name":"SELCOP","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["FIRE_IFCHANGED MC SELCOP; RESET_CHANGED SELCOP"],"depends_on":["COP"],"fire_name":["svg_cu:text3312"],"draw_data":[[]],"draw_name":[[]]},"EXCODE":{"name":"EXCODE","visible":true,"type":"L","value":0,"default_value":0,"nbits":"4","behavior":["FIRE T11"],"fire_name":["svg_cu:text3312-6"],"draw_data":[[]],"draw_name":[[]]},"RA":{"name":"RA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"6","forbidden":true,"behavior":["GET RA_T9 BR RA; FIRE_IFSET T9 1; FIRE_IFSET MA 0"],"depends_on":["SELA"],"fire_name":["svg_p:text3107"],"draw_data":[[]],"draw_name":[["svg_p:path3109"]]},"RB":{"name":"RB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"6","forbidden":true,"behavior":["GET RB_T10 BR RB; FIRE_IFSET T10 1; FIRE_IFSET MB 0"],"depends_on":["SELB"],"fire_name":["svg_p:text3123"],"draw_data":[[]],"draw_name":[["svg_p:path3113"]]},"RC":{"name":"RC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"6","forbidden":true,"behavior":["FIRE LC"],"depends_on":["SELC"],"fire_name":["svg_p:text3125"],"draw_data":[[]],"draw_name":[["svg_p:path3117"]]},"LC":{"name":"LC","visible":true,"type":"E","value":0,"default_value":0,"nbits":"1","behavior":["NOP","SET BR RC BUS_IB"],"fire_name":["svg_p:text3127"],"draw_data":[["svg_p:path3153","svg_p:path3151","svg_p:path3129"]],"draw_name":[["svg_p:path3121"]]},"SE":{"name":"SE","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3","MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],"depends_on":["T3"],"fire_name":["svg_p:text3593"],"draw_data":[[]],"draw_name":[["svg_p:path3591","svg_p:path3447-7-7"]]},"SIZE":{"name":"SIZE","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],"depends_on":["T3"],"fire_name":["svg_p:text3363"],"draw_data":[[]],"draw_name":[["svg_p:path3355"]]},"OFFSET":{"name":"OFFSET","visible":true,"type":"L","value":0,"default_value":0,"nbits":"5","behavior":["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],"depends_on":["T3"],"fire_name":["svg_p:text3707"],"draw_data":[[]],"draw_name":[["svg_p:path3359"]]},"MC":{"name":"MC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT COP REG_IR 0 5; FIRE_IFCHANGED COP MC","CP_FIELD COP REG_MICROINS/SELCOP; FIRE_IFCHANGED COP MC"],"depends_on":["SELCOP"],"fire_name":["svg_cu:text3322","svg_cu:text3172-1-5"],"draw_data":[["svg_cu:path3320","svg_cu:path3142"],["svg_cu:path3318","svg_cu:path3502-6","svg_cu:path3232-6"]],"draw_name":[[],["svg_cu:path3306"]]},"MRA":{"name":"MRA","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT_SN RA REG_IR REG_MICROINS/SELA 5; FIRE RA;","CP_FIELD RA REG_MICROINS/SELA; FIRE RA;"],"depends_on":["SELA"],"fire_name":["svg_cu:text3222"],"draw_data":[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3142b","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3260"],["svg_cu:path3270","svg_cu:path3258","svg_cu:path3260","svg_cu:path3294","svg_cu:path3288","svg_cu:path3280"]],"draw_name":[[],["svg_cu:path3220"]]},"MRB":{"name":"MRB","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT_SN RB REG_IR REG_MICROINS/SELB 5; FIRE RB;","CP_FIELD RB REG_MICROINS/SELB; FIRE RB;"],"depends_on":["SELB"],"fire_name":["svg_cu:text3242"],"draw_data":[["svg_cu:path3196","svg_cu:path3278","svg_cu:path3292"],["svg_cu:path3282","svg_cu:path3258-4","svg_cu:path3278","svg_cu:path3196"]],"draw_name":[[],["svg_cu:path3240"]]},"MRC":{"name":"MRC","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MBIT_SN RC REG_IR REG_MICROINS/SELC 5; FIRE RC;","CP_FIELD RC REG_MICROINS/SELC; FIRE RC;"],"depends_on":["SELC"],"fire_name":["svg_cu:text3254"],"draw_data":[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3142b","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3232","svg_cu:path3292"],["svg_cu:path3300","svg_cu:path3294","svg_cu:path3292","svg_cu:path3288","svg_cu:path3232"]],"draw_name":[[],["svg_cu:path3252"]]},"IOR":{"name":"IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MOVE_BITS SCR_IOR 0 1 IOR; FIRE SCR_IOR; MOVE_BITS IO_IOR 0 1 IOR; FIRE IO_IOR; MOVE_BITS L3D_IOR 0 1 IOR; FIRE L3D_IOR; MOVE_BITS KBD_IOR 0 1 IOR; FIRE KBD_IOR; MOVE_BITS LEDM_IOR 0 1 IOR; FIRE LEDM_IOR"],"fire_name":[],"draw_data":[[],["svg_p:path3733","svg_p:path3491","svg_p:text3715"]],"draw_name":[[],[]]},"IOW":{"name":"IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MOVE_BITS SCR_IOW 0 1 IOW; FIRE SCR_IOW; MOVE_BITS IO_IOW 0 1 IOW; FIRE IO_IOW; MOVE_BITS L3D_IOW 0 1 IOW; FIRE L3D_IOW; MOVE_BITS LEDM_IOW 0 1 IOW; FIRE LEDM_IOW"],"fire_name":[],"draw_data":[[],["svg_p:path3735","svg_p:path3491","svg_p:text3717"]],"draw_name":[[],[]]},"TEST_C":{"name":"TEST_C","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_C VAL_ZERO; FIRE M7","MV FLAG_C VAL_ONE; FIRE M7"],"depends_on":["SELCOP"],"fire_name":["svg_p:text3701-3"],"draw_data":[["svg_p:text3701-3"]],"draw_name":[[]]},"TEST_V":{"name":"TEST_V","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_V VAL_ZERO; FIRE M7","MV FLAG_V VAL_ONE; FIRE M7"],"depends_on":["SELCOP"],"fire_name":["svg_p:text3701-3-1"],"draw_data":[["svg_p:text3701-3-1"]],"draw_name":[[]]},"TEST_N":{"name":"TEST_N","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_N VAL_ZERO; FIRE M7","MV FLAG_N VAL_ONE; FIRE M7"],"depends_on":["SELCOP"],"fire_name":["svg_p:text3701-3-2"],"draw_data":[["svg_p:text3701-3-2"]],"draw_name":[[]]},"TEST_Z":{"name":"TEST_Z","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","forbidden":true,"behavior":["MV FLAG_Z VAL_ZERO; FIRE M7","MV FLAG_Z VAL_ONE; FIRE M7"],"depends_on":["SELCOP"],"fire_name":["svg_p:text3701-3-5"],"draw_data":[["svg_p:text3701-3-5"]],"draw_name":[[]]},"TEST_I":{"name":"TEST_I","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV FLAG_I VAL_ZERO; FIRE M7","MV FLAG_I VAL_ONE; FIRE M7"],"depends_on":["CLK"],"fire_name":["svg_cu:text3440"],"draw_data":[["svg_cu:text3440"]],"draw_name":[[]]},"TEST_U":{"name":"TEST_U","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["MV FLAG_U VAL_ZERO; FIRE M7","MV FLAG_U VAL_ONE; FIRE M7"],"depends_on":["CLK"],"fire_name":["svg_cu:text3442"],"draw_data":[["svg_cu:text3442"]],"draw_name":[[]]},"TEST_INTV":{"name":"TEST_INTV","visible":true,"type":"L","value":0,"default_value":0,"nbits":"8","forbidden":true,"behavior":["MBIT INTV TEST_INTV 0 32"],"depends_on":["INT"],"fire_name":["svg_p:tspan4225"],"draw_data":[["svg_p:path3749"]],"draw_name":[[]]},"MRDY":{"name":"MRDY","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","depends_on":["CLK"],"behavior":["FIRE_IFCHANGED MRDY C","FIRE_IFCHANGED MRDY C"],"fire_name":["svg_p:tspan3916"],"draw_data":[[],["svg_p:path3895","svg_p:path3541"]],"draw_name":[[],[]]},"R":{"name":"R","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP; CHECK_RTD","MEM_READ BUS_AB BUS_DB BW MRDY CLK; FIRE M1; FIRE MRDY; CHECK_RTD"],"fire_name":["svg_p:text3533-5-2"],"draw_data":[[],["svg_p:path3557","svg_p:path3571"]],"draw_name":[[],[]]},"W":{"name":"W","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","MEM_WRITE BUS_AB BUS_DB BW MRDY CLK; FIRE M1; FIRE MRDY"],"fire_name":["svg_p:text3533-5-08"],"draw_data":[[],["svg_p:path3559","svg_p:path3575","svg_p:path3447-7"]],"draw_name":[[],[]]},"BW":{"name":"BW","verbal":["Access to one byte from memory. ","Access to two bytes from memory. ","Access to three bytes from memory. ","Access to a word from memory. "],"visible":true,"type":"L","value":0,"default_value":0,"nbits":"2","behavior":["FIRE R; FIRE W","FIRE R; FIRE W","FIRE R; FIRE W","FIRE R; FIRE W"],"fire_name":["svg_p:text3533-5-2-8"],"draw_data":[["svg_p:path3557-0"]],"draw_name":[[],[]]},"INT":{"name":"INT","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","depends_on":["CLK"],"behavior":["FIRE C","FIRE C"],"fire_name":["svg_p:tspan4199"],"draw_data":[[],["svg_p:path3809"]],"draw_name":[[],[]]},"IORDY":{"name":"IORDY","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","depends_on":["CLK"],"behavior":["FIRE_IFCHANGED IORDY C","FIRE_IFCHANGED IORDY C"],"fire_name":["svg_p:tspan4089","svg_p:path3793","svg_p:tspan4089"],"draw_data":[[],["svg_p:path3897"]],"draw_name":[[],[]]},"IO_IOR":{"name":"IO_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","IO_IOR BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE M1"],"fire_name":["svg_p:tspan4173"],"draw_data":[[],["svg_p:path3795","svg_p:path3733"]],"draw_name":[[],[]]},"IO_IOW":{"name":"IO_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","IO_IOW BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE M1"],"fire_name":["svg_p:text3785-0-6-0-5-5"],"draw_data":[[],["svg_p:path3805","svg_p:path3733"]],"draw_name":[[],[]]},"IO_IE":{"name":"IO_IE","visible":true,"type":"L","value":1,"default_value":1,"nbits":"1","behavior":["NOP","IO_CHK_I CLK INT INTV; FIRE C"],"fire_name":[],"draw_data":[[],[]],"draw_name":[[],[]]},"INTA":{"name":"INTA","visible":true,"type":"L","value":1,"default_value":0,"nbits":"1","behavior":["NOP","INTA CLK INT INTA BUS_DB INTV; FIRE M1; FIRE C"],"fire_name":["svg_p:text3785-0-6-0-5-5-1-1"],"draw_data":[[],["svg_p:path3807","svg_p:path3737"]],"draw_name":[[],[]]},"KBD_IOR":{"name":"KBD_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","KBD_IOR BUS_AB BUS_DB KBDR KBSR CLK; FIRE M1"],"fire_name":["svg_p:tspan4057"],"draw_data":[[],["svg_p:path3863","svg_p:path3847"]],"draw_name":[[],[]]},"SCR_IOR":{"name":"SCR_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","SCR_IOR BUS_AB BUS_DB DDR DSR CLK"],"fire_name":["svg_p:tspan4004"],"draw_data":[[],["svg_p:path3871","svg_p:path3857"]],"draw_name":[[],[]]},"SCR_IOW":{"name":"SCR_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","SCR_IOW BUS_AB BUS_DB DDR DSR CLK"],"fire_name":["svg_p:tspan4006"],"draw_data":[[],["svg_p:path3873","svg_p:path3857"]],"draw_name":[[],[]]},"L3D_IOR":{"name":"L3D_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","L3D_IOR BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE M1"],"fire_name":["svg_p:tspan4173"],"draw_data":[[],["svg_p:path3795","svg_p:path3733"]],"draw_name":[[],[]]},"L3D_IOW":{"name":"L3D_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","L3D_IOW BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE M1; L3D_SYNC"],"fire_name":["svg_p:text3785-0-6-0-5-5"],"draw_data":[[],["svg_p:path3805","svg_p:path3733"]],"draw_name":[[],[]]},"LEDM_IOR":{"name":"LEDM_IOR","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LEDM_IOR BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE M1"],"fire_name":["svg_p:tspan4173"],"draw_data":[[],["svg_p:path3795","svg_p:path3733"]],"draw_name":[[],[]]},"LEDM_IOW":{"name":"LEDM_IOW","visible":true,"type":"L","value":0,"default_value":0,"nbits":"1","behavior":["NOP","LEDM_IOW BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE M1; LEDM_SYNC"],"fire_name":["svg_p:text3785-0-6-0-5-5"],"draw_data":[[],["svg_p:path3805","svg_p:path3733"]],"draw_name":[[],[]]}},"behaviors":{"PRINT_S":{"nparameters":2,"types":["S"],"operation":"/Function(function(s_expr){console.log(s_expr[1]+\": 0x\"+sim.poc.signals[s_expr[1]].value.toString(16))})/","verbal":"/Function(function(s_expr){return\"Print value of signal \"+s_expr[1]+\": 0x\"+sim.poc.signals[s_expr[1]].value.toString(16)+\". \"})/"},"PRINT_E":{"nparameters":2,"types":["E"],"operation":"/Function(function(s_expr){console.log(s_expr[1]+\": 0x\"+sim.poc.states[s_expr[1]].value.toString(16))})/","verbal":"/Function(function(s_expr){return\"Print value of state \"+s_expr[1]+\": 0x\"+sim.poc.states[s_expr[1]].value.toString(16)+\". \"})/"},"NOP":{"nparameters":1,"operation":"/Function(function(s_expr){})/","verbal":"/Function(function(s_expr){return\"\"})/"},"NOP_ALU":{"nparameters":1,"operation":"/Function(function(s_expr){sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){return\"Reset ALU flags. \"})/"},"MV":{"nparameters":3,"types":["X","X"],"operation":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)})/","verbal":"/Function(function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"short\"){return\"Copy from \"+show_verbal(s_expr[2])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(newval)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" (\"+show_value(newval)+\"). \"})/"},"LOAD":{"nparameters":3,"types":["X","X"],"operation":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)})/","verbal":"/Function(function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Load from \"+show_verbal(s_expr[2])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(newval)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_value(newval)+\" ( \"+show_verbal(s_expr[2])+\"). \"})/"},"CP_FIELD":{"nparameters":3,"types":["X","X"],"operation":"/Function(function(s_expr){r=s_expr[2].split(\"/\");sim_elto_org=get_reference(r[0]);newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval!=\"undefined\"){sim_elto_dst=get_reference(s_expr[1]);set_value(sim_elto_dst,newval)}})/","verbal":"/Function(function(s_expr){var r=s_expr[2].split(\"/\");var sim_elto_org=get_reference(r[0]);var newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval==\"undefined\")newval=\"<undefined>\";else newval=show_value(newval);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return'Copy from \"'+show_verbal(r[0])+'\"['+r[1]+\"] \"+\"to \"+show_verbal(s_expr[1])+\" (value \"+newval+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(r[0])+\".\"+r[1]+\" (\"+newval+\"). \"})/"},"NOT_ES":{"nparameters":3,"types":["S","E"],"operation":"/Function(function(s_expr){set_value(sim.poc.signals[s_expr[1]],Math.abs(get_value(sim.poc.states[s_expr[2]])-1))})/","verbal":"/Function(function(s_expr){var value=Math.abs(get_value(sim.poc.states[s_expr[2]])-1);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Set \"+show_verbal(s_expr[1])+\" with value \"+show_value(value)+\" (Logical NOT of \"+s_expr[2]+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_value(value)+\" (Logical NOT \"+s_expr[2]+\"). \"})/"},"GET":{"nparameters":4,"types":["E","E","S"],"operation":"/Function(function(s_expr){set_value(sim.poc.states[s_expr[1]],get_value(sim.poc.states[s_expr[2]][sim.poc.signals[s_expr[3]].value]))})/","verbal":"/Function(function(s_expr){var value=get_value(sim.poc.states[s_expr[2]][sim.poc.signals[s_expr[3]].value]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Set \"+show_verbal(s_expr[1])+\" with value \"+show_value(value)+\" (Register File \"+s_expr[3]+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_value(value)+\" (Register File \"+s_expr[3]+\"). \"})/"},"SET":{"nparameters":4,"types":["E","S","E"],"operation":"/Function(function(s_expr){set_value(sim.poc.states[s_expr[1]][sim.poc.signals[s_expr[2]].value],get_value(sim.poc.states[s_expr[3]]))})/","verbal":"/Function(function(s_expr){var value=get_value(sim.poc.states[s_expr[3]]);var o_ref=sim.poc.states[s_expr[1]][sim.poc.signals[s_expr[2]].value];var o_verbal=o_ref.name;if(typeof o_ref.verbal!=\"undefined\")o_verbal=o_ref.verbal;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy to \"+o_verbal+\" the value \"+show_value(value)+\". \"}return o_verbal+\" = \"+show_value(value)+\". \"})/"},"AND":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])&get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])&get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU AND with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (AND). \"})/"},"OR":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])|get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])|get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU OR with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (OR). \"})/"},"NOT":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=~get_value(sim.poc.states[s_expr[2]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=~get_value(sim.poc.states[s_expr[2]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU NOT with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (NOT). \"})/"},"XOR":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])^get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])^get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU XOR with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (XOR). \"})/"},"SRL":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Shift Right Logical with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SRL). \"})/"},"SRA":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Shift Right Arithmetic with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SRA). \"})/"},"SL":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Shift Left with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SL). \"})/"},"RR":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1|(get_value(sim.poc.states[s_expr[2]])&1)<<31;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1|(get_value(sim.poc.states[s_expr[2]])&1)<<31;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Right Rotation with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (RR). \"})/"},"RL":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1|(get_value(sim.poc.states[s_expr[2]])&2147483648)>>>31;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1|(get_value(sim.poc.states[s_expr[2]])&2147483648)>>>31;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU Left Rotation with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (LR). \"})/"},"ADD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a+b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a+b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU ADD with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (ADD). \"})/"},"SUB":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a-b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a-b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU SUB with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (SUB). \"})/"},"MUL":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a*b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a*b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU MUL with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (MUL). \"})/"},"DIV":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){return\"ALU DIV zero by zero (oops!). \"}var result=Math.floor(a/b);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU DIV with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (DIV). \"})/"},"MOD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=a%b;set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){return\"ALU MOD zero by zero (oops!). \"}var result=a%b;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"ALU MOD with result \"+show_value(result)+\". \"}return\"ALU output = \"+show_value(result)+\" (MOD). \"})/"},"LUI":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;return\"ALU Load Upper Immediate with result \"+show_value(result)+\". \"})/"},"ADDFOUR":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;return\"ALU ADD 4 with result \"+show_value(result)+\". \"})/"},"ADDONE":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;return\"ALU ADD 1 with result \"+show_value(result)+\". \"})/"},"SUBFOUR":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-4;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-4;return\"ALU SUB 4 with result \"+show_value(result)+\". \"})/"},"SUBONE":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-1;return\"ALU SUB 1 with result \"+show_value(result)+\". \"})/"},"FADD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)+b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)+b.toFixed(2);return\"ALU Float ADD with result \"+result+\". \"})/"},"FSUB":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)-b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)-b.toFixed(2);return\"ALU Float SUB with result \"+result+\". \"})/"},"FMUL":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)*b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)*b.toFixed(2);return\"ALU Float MUL with result \"+result+\". \"})/"},"FDIV":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)/b.toFixed(2);return\"ALU Float DIV with result \"+result+\". \"})/"},"FMOD":{"nparameters":4,"types":["E","E","E"],"operation":"/Function(function(s_expr){var result=(get_value(sim.poc.states[s_expr[2]])<<0)%(get_value(sim.poc.states[s_expr[3]])<<0);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)%b.toFixed(2);return\"ALU Float MOD with result \"+result+\". \"})/"},"PLUS1":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;set_value(sim.poc.states[s_expr[1]],result>>>0)})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Add one to \"+show_verbal(s_expr[2])+\" and copy to \"+show_verbal(s_expr[1])+\" with result \"+show_value(result)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" + 1\"+\" (\"+show_value(result)+\"). \"})/"},"PLUS4":{"nparameters":3,"types":["E","E"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;set_value(sim.poc.states[s_expr[1]],result>>>0)})/","verbal":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Add four to \"+show_verbal(s_expr[2])+\" and copy to \"+show_verbal(s_expr[1])+\" with result \"+show_value(result)+\". \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" + 4\"+\" (\"+show_value(result)+\"). \"})/"},"SET_TT":{"nparameters":3,"types":["E","I"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a|m;set_value(sim.poc.states[s_expr[1]],r);update_cpu_bus_fire(r,b)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"RST_TT":{"nparameters":3,"types":["E","I"],"operation":"/Function(function(s_expr){var a=get_value(sim.poc.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a&~m;set_value(sim.poc.states[s_expr[1]],r);update_cpu_bus_fire(r,b)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"CHECK_RTD":{"nparameters":1,"operation":"/Function(function(s_expr){var number_active_tri=parseInt(simhw_sim_signal(\"TD\").value)+parseInt(simhw_sim_signal(\"R\").value);update_system_bus_fire(number_active_tri)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"MBIT":{"nparameters":5,"types":["X","X","I","I"],"operation":"/Function(function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);set_value(sim_elto_dst,parseInt(n2,2))})/","verbal":"/Function(function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=parseInt(n2,2);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+show_verbal(s_expr[2])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(n3)+\" (copied \"+size+\" bits from bit \"+offset+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[2])+\" (\"+show_value(n3)+\", \"+size+\" bits from bit \"+offset+\"). \"})/"},"MBIT_SN":{"nparameters":5,"types":["S","E","E","I"],"operation":"/Function(function(s_expr){var base=0;var r=s_expr[3].split(\"/\");if(1==r.length)base=get_value(sim.poc.states[s_expr[3]]);else if(typeof sim.poc.states[r[0]].value[r[1]]!=\"undefined\")base=sim.poc.states[r[0]].value[r[1]];else if(typeof sim.poc.signals[r[1]].default_value!=\"undefined\")base=sim.poc.signals[r[1]].default_value;else if(typeof sim.poc.states[r[1]].default_value!=\"undefined\")base=sim.poc.states[r[1]].default_value;else ws_alert(\"WARN: undefined state/field pair -> \"+r[0]+\"/\"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.poc.states[s_expr[2]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){var base=0;var r=s_expr[3].split(\"/\");if(1==r.length)base=get_value(sim.poc.states[s_expr[3]]);else if(typeof sim.poc.states[r[0]].value[r[1]]!=\"undefined\")base=sim.poc.states[r[0]].value[r[1]];else if(typeof sim.poc.signals[r[1]].default_value!=\"undefined\")base=sim.poc.signals[r[1]].default_value;else if(typeof sim.poc.states[r[1]].default_value!=\"undefined\")base=sim.poc.states[r[1]].default_value;else ws_alert(\"WARN: undefined state/field pair -> \"+r[0]+\"/\"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.poc.states[s_expr[2]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);var from_elto=\"\";if(1==r.length)from_elto=show_verbal(s_expr[3]);else from_elto='\"'+show_verbal(s_expr[2])+'\"['+r[1]+\"] \";var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+from_elto+\"into \"+show_verbal(s_expr[1])+\" \"+\"value \"+parseInt(n3,2)+\". \"}return show_verbal(s_expr[1])+\" = \"+from_elto+\" (\"+parseInt(n3,2)+\"). \"})/"},"SBIT_SIGNAL":{"nparameters":4,"types":["X","I","I"],"operation":"/Function(function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)})/","verbal":"/Function(function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)})/"},"UPDATE_FLAG":{"nparameters":4,"types":["X","X","I"],"operation":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value&~(1<>>0)})/","verbal":"/Function(function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Update \"+show_verbal(s_expr[2])+\" to value \"+sim_elto_org.value+\". \"}return show_verbal(s_expr[1])+\".\"+show_verbal(s_expr[3])+\" = \"+sim_elto_org.value+\". \"})/"},"MBITS":{"nparameters":8,"types":["E","I","E","S","S","I","S"],"operation":"/Function(function(s_expr){var offset=parseInt(sim.poc.signals[s_expr[4]].value);var size=parseInt(sim.poc.signals[s_expr[5]].value);var n1=get_value(sim.poc.states[s_expr[3]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;if(\"1\"==sim.poc.signals[s_expr[7]].value&&\"1\"==n2.substr(0,1)){n3=\"11111111111111111111111111111111\".substring(0,32-n2.length)+n2}set_value(sim.poc.states[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){var offset=parseInt(sim.poc.signals[s_expr[4]].value);var size=parseInt(sim.poc.signals[s_expr[5]].value);var n1=get_value(sim.poc.states[s_expr[3]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;if(\"1\"==sim.poc.signals[s_expr[7]].value&&\"1\"==n2.substr(0,1)){n3=\"11111111111111111111111111111111\".substring(0,32-n2.length)+n2}n1=parseInt(n3,2);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\" Copy from \"+show_verbal(s_expr[3])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(n1)+\" (copied \"+size+\" bits from bit \"+offset+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[3])+\" (\"+show_value(n1)+\", \"+size+\" bits from bit \"+offset+\"). \"})/"},"BSEL":{"nparameters":6,"types":["E","I","I","E","I"],"operation":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var n4=\"00000000000000000000000000000000\".substr(0,posd);n3=n3+n4;set_value(sim.poc.states[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var len=parseInt(s_expr[3]);var poso=parseInt(s_expr[5]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var n4=\"00000000000000000000000000000000\".substr(0,posd);n3=n3+n4;var n5=parseInt(n3,2);var verbose=get_cfg(\"verbal_verbose\");if(verbose!==\"math\"){return\"Copy from \"+show_verbal(s_expr[4])+\" to \"+show_verbal(s_expr[1])+\" value \"+show_value(n5)+\" (copied \"+len+\" bits, from bit \"+poso+\" of \"+s_expr[4]+\" to bit \"+posd+\" of \"+s_expr[1]+\"). \"}return show_verbal(s_expr[1])+\" = \"+show_verbal(s_expr[4])+\" (\"+show_value(n5)+\", \"+len+\" bits, from bit \"+poso+\" of \"+s_expr[4]+\" to bit \"+posd+\" of \"+s_expr[1]+\"). \"})/"},"EXT_SIG":{"nparameters":3,"types":["E","I"],"operation":"/Function(function(s_expr){var n1=get_value(sim.poc.states[s_expr[1]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if(\"1\"==n2[31-s_expr[2]]){n4=\"11111111111111111111111111111111\".substring(0,32-n3.length)+n4}set_value(sim.poc.states[s_expr[1]],parseInt(n4,2))})/","verbal":"/Function(function(s_expr){var n1=get_value(sim.poc.states[s_expr[1]]).toString(2);var n2=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if(\"1\"==n2[31-s_expr[2]]){n4=\"11111111111111111111111111111111\".substring(0,32-n3.length)+n4}var n5=parseInt(n4,2);return\"Sign Extension with value \"+show_value(n5)+\". \"})/"},"MOVE_BITS":{"nparameters":5,"types":["S","I","I","S"],"operation":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var poso=0;var len=parseInt(s_expr[3]);var n1=sim.poc.signals[s_expr[4]].value.toString(2);n1=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.poc.signals[s_expr[1]].value.toString(2);n2=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){return\"\"})/"},"MOVE_BITSE":{"nparameters":6,"types":["S","I","I","E","I"],"operation":"/Function(function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);n1=\"00000000000000000000000000000000\".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.poc.signals[s_expr[1]].value.toString(2);n2=\"00000000000000000000000000000000\".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))})/","verbal":"/Function(function(s_expr){return\"\"})/"},"DECO":{"nparameters":1,"operation":"/Function(function(s_expr){sim.poc.states[\"INEX\"].value=0;var oi=decode_instruction(sim.poc.internal_states.FIRMWARE,sim.poc.ctrl_states.ir,get_value(sim.poc.states[\"REG_IR\"]));if(null==oi.oinstruction){ws_alert(\"ERROR: undefined instruction code in IR (\"+\"co:\"+oi.op_code.toString(2)+\", \"+\"cop:\"+oi.cop_code.toString(2)+\")\");sim.poc.states[\"ROM_MUXA\"].value=0;sim.poc.states[\"INEX\"].value=1;return-1}var rom_addr=oi.op_code<<6;if(typeof oi.oinstruction.cop!=\"undefined\"){rom_addr=rom_addr+oi.cop_code}if(typeof sim.poc.internal_states[\"ROM\"][rom_addr]==\"undefined\"){ws_alert(\"ERROR: undefined rom address \"+rom_addr+\" in firmware\");sim.poc.states[\"ROM_MUXA\"].value=0;return-1}sim.poc.states[\"ROM_MUXA\"].value=sim.poc.internal_states[\"ROM\"][rom_addr];var val=get_value(sim.poc.states[\"DECO_INS\"]);set_value(sim.poc.states[\"DECO_INS\"],val+1);var pc=get_value(sim.poc.states[\"REG_PC\"])-4;var decins=get_deco_from_pc(pc);set_value(sim.poc.states[\"REG_IR_DECO\"],decins);show_dbg_ir(get_value(sim.poc.states[\"REG_IR_DECO\"]))})/","verbal":"/Function(function(s_expr){return\"Decode instruction. \"})/"},"FIRE":{"nparameters":2,"types":["S"],"operation":"/Function(function(s_expr){if(sim.poc.internal_states.fire_stack.indexOf(s_expr[1])!=-1){return}sim.poc.internal_states.fire_stack.push(s_expr[1]);update_draw(sim.poc.signals[s_expr[1]],sim.poc.signals[s_expr[1]].value);if(\"L\"==sim.poc.signals[s_expr[1]].type){update_state(s_expr[1])}sim.poc.internal_states.fire_stack.pop(s_expr[1])})/","verbal":"/Function(function(s_expr){return\"\"})/"},"FIRE_IFSET":{"nparameters":3,"types":["S","I"],"operation":"/Function(function(s_expr){if(get_value(sim.poc.signals[s_expr[1]])!=parseInt(s_expr[2])){return}sim.poc.behaviors[\"FIRE\"].operation(s_expr)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"FIRE_IFCHANGED":{"nparameters":3,"types":["S","X"],"operation":"/Function(function(s_expr){sim_elto=get_reference(s_expr[2]);if(sim_elto.changed==false)return;sim.poc.behaviors[\"FIRE\"].operation(s_expr)})/","verbal":"/Function(function(s_expr){return\"\"})/"},"RESET_CHANGED":{"nparameters":2,"types":["X"],"operation":"/Function(function(s_expr){sim_elto=get_reference(s_expr[1]);sim_elto.changed=false})/","verbal":"/Function(function(s_expr){return\"\"})/"},"CLOCK":{"nparameters":1,"operation":"/Function(function(s_expr){var new_maddr=null;var mcelto=null;var t0=performance.now();var val=get_value(sim.poc.states[\"CLK\"]);set_value(sim.poc.states[\"CLK\"],val+1);set_value(sim.poc.states[\"TTCPU\"],0);new_maddr=get_value(sim.poc.states[\"REG_MICROADDR\"]);mcelto=sim.poc.internal_states[\"MC\"][new_maddr];if(typeof mcelto!==\"undefined\"&&false==mcelto.is_native){for(var i=0;i0){remain=sim.poc.events.mem[clk-1]-1}var first_time=typeof sim.poc.events.mem[clk]==\"undefined\";sim.poc.events.mem[clk]=remain;if(remain>0){return}var wordress=address&4294967292;var value=main_memory_getvalue(sim.poc.internal_states.MP,wordress);var full_redraw=false;if(typeof value===\"undefined\"){value=0;full_redraw=true}dbvalue=main_memory_extractvalues(value,bw,address&3);sim.poc.states[s_expr[2]].value=dbvalue>>>0;sim.poc.signals[s_expr[4]].value=1;show_main_memory(sim.poc.internal_states.MP,wordress,full_redraw,false);if(first_time&&sim.poc.internal_states.CM.length>0){cache_memory_access(sim.poc.internal_states.CM[0],address,\"read\",clk)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);switch(bw){case 0:bw_type=\"byte\";break;case 1:bw_type=\"half\";break;case 2:bw_type=\"three bytes\";break;case 3:bw_type=\"word\";break}var value=main_memory_getvalue(sim.poc.internal_states.MP,address);if(typeof value===\"undefined\"){value=0}verbal=\"Try to read a \"+bw_type+\" from memory \"+\"at address 0x\"+address.toString(16)+\" with value \"+value.toString(16)+\". \";return verbal})/"},"MEM_WRITE":{"nparameters":6,"types":["E","E","S","S","E"],"operation":"/Function(function(s_expr){var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);sim.poc.signals[s_expr[4]].value=0;var remain=get_value(sim.poc.internal_states.MP_wc);if(typeof sim.poc.events.mem[clk-1]!=\"undefined\"&&sim.poc.events.mem[clk-1]>0){remain=sim.poc.events.mem[clk-1]-1}var first_time=typeof sim.poc.events.mem[clk]==\"undefined\";sim.poc.events.mem[clk]=remain;if(remain>0){return}var wordress=address&4294967292;var value=main_memory_getvalue(sim.poc.internal_states.MP,wordress);var full_redraw=false;if(typeof value===\"undefined\"){value=0;full_redraw=true}value=main_memory_updatevalues(value,dbvalue,bw,address&3);var origin=\"\";var r_value=main_memory_get_program_counter();if(r_value!=null){origin=\"PC=0x\"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var elto=main_memory_set(sim.poc.internal_states.MP,wordress,melto);sim.poc.signals[s_expr[4]].value=1;show_main_memory(sim.poc.internal_states.MP,wordress,full_redraw,true);if(first_time&&sim.poc.internal_states.CM.length>0){cache_memory_access(sim.poc.internal_states.CM[0],address,\"write\",clk)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);switch(bw){case 0:bw_type=\"byte\";break;case 1:bw_type=\"half\";break;case 2:bw_type=\"three bytes\";break;case 3:bw_type=\"word\";break}var value=main_memory_getvalue(sim.poc.internal_states.MP,address);if(typeof value===\"undefined\"){value=0}verbal=\"Try to write a \"+bw_type+\" to memory \"+\"at address 0x\"+address.toString(16)+\" with value \"+value.toString(16)+\". \";return verbal})/"},"MEMORY_RESET":{"nparameters":1,"operation":"/Function(function(s_expr){sim.poc.events.mem={}})/","verbal":"/Function(function(s_expr){return\"Reset the memory (all values will be zeroes). \"})/"},"IO_IOR":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==IOSR_ID)set_value(sim.poc.states[s_expr[2]],iosr);if(bus_ab==IOCR_ID)set_value(sim.poc.states[s_expr[2]],iocr);if(bus_ab==IODR_ID)set_value(sim.poc.states[s_expr[2]],iodr)})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==IOSR_ID)verbal=\"I/O device read at IOSR of value \"+iosr+\". \";if(bus_ab==IOCR_ID)verbal=\"I/O device read at IOCR of value \"+iocr+\". \";if(bus_ab==IODR_ID)verbal=\"I/O device read at IODR of value \"+iodr+\". \";return verbal})/"},"IO_IOW":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab!=IOSR_ID&&bus_ab!=IOCR_ID&&bus_ab!=IODR_ID){return}if(bus_ab==IOSR_ID)set_value(sim.poc.states[s_expr[3]],bus_db);if(bus_ab==IOCR_ID)set_value(sim.poc.states[s_expr[4]],bus_db);if(bus_ab==IODR_ID)set_value(sim.poc.states[s_expr[5]],bus_db);var iocr_id=get_value(sim.poc.states[s_expr[4]]);var iodr_id=get_value(sim.poc.states[s_expr[5]]);if(iocr_id<0||iocr_id>7)return;set_var(sim.poc.internal_states.io_int_factory[iocr_id].period,iodr_id);set_var(sim.poc.internal_states.io_int_factory[iocr_id].probability,1);if(0==iodr_id)set_var(sim.poc.internal_states.io_int_factory[iocr_id].probability,0)})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab==IOSR_ID)verbal=\"I/O device write at IOSR with value \"+bus_db+\". \";if(bus_ab==IOCR_ID)verbal=\"I/O device write at IOCR with value \"+bus_db+\". \";if(bus_ab==IODR_ID)verbal=\"I/O device write at IODR with value \"+bus_db+\". \";return verbal})/"},"IO_CHK_I":{"nparameters":4,"types":["E","S","E"],"operation":"/Function(function(s_expr){var clk=get_value(sim.poc.states[s_expr[1]]);for(var i=sim.poc.internal_states.io_int_factory.length-1;i>=0;i--){if(get_var(sim.poc.internal_states.io_int_factory[i].period)==0)continue;if(get_var(sim.poc.internal_states.io_int_factory[i].active)==true){set_value(sim.poc.signals[s_expr[2]],1);set_value(sim.poc.states[s_expr[3]],i)}if(clk%get_var(sim.poc.internal_states.io_int_factory[i].period)==0){if(Math.random()>get_var(sim.poc.internal_states.io_int_factory[i].probability))continue;set_var(sim.poc.internal_states.io_int_factory[i].accumulated,get_var(sim.poc.internal_states.io_int_factory[i].accumulated)+1);set_var(sim.poc.internal_states.io_int_factory[i].active,true);if(typeof sim.poc.events.io[clk]==\"undefined\")sim.poc.events.io[clk]=[];sim.poc.events.io[clk].push(i);set_value(sim.poc.signals[s_expr[2]],1);set_value(sim.poc.states[s_expr[3]],i)}}})/","verbal":"/Function(function(s_expr){return\"Check I/O Interruption. \"})/"},"INTA":{"nparameters":6,"types":["E","S","S","E","E"],"operation":"/Function(function(s_expr){var clk=get_value(sim.poc.states[s_expr[1]]);if(typeof sim.poc.events.io[clk]!=\"undefined\"){set_value(sim.poc.states[s_expr[4]],sim.poc.events.io[clk][0]);return}set_value(sim.poc.signals[s_expr[2]],0);set_value(sim.poc.states[s_expr[5]],0);for(var i=0;i>24;var y=(iodr&16711680)>>16;var z=(iodr&65280)>>8;var p=z*Math.pow(sim.poc.internal_states.l3d_dim,2)+y*sim.poc.internal_states.l3d_dim+x;var s=get_var(sim.poc.internal_states.l3d_state[p].active);set_value(sim.poc.states[s_expr[2]],s)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==L3DSR_ID)verbal=\"I/O device read at L3DSR of value \"+iosr+\". \";if(bus_ab==L3DCR_ID)verbal=\"I/O device read at L3DCR of value \"+iocr+\". \";if(bus_ab==L3DDR_ID)verbal=\"I/O device read at L3DDR of value \"+iodr+\". \";return verbal})/"},"L3D_IOW":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab!=L3DSR_ID&&bus_ab!=L3DCR_ID&&bus_ab!=L3DDR_ID){return}if(bus_ab==L3DSR_ID){set_value(sim.poc.states[s_expr[3]],bus_db)}if(bus_ab==L3DDR_ID){set_value(sim.poc.states[s_expr[5]],bus_db)}if(bus_ab==L3DCR_ID){set_value(sim.poc.states[s_expr[4]],bus_db);var x=(bus_db&4278190080)>>24;var y=(bus_db&16711680)>>16;var z=(bus_db&65280)>>8;var p=z*Math.pow(sim.poc.internal_states.l3d_dim,2)+y*sim.poc.internal_states.l3d_dim+x;var s=(bus_db&255)!=0;var l3dstates=sim.poc.internal_states.l3d_state;set_var(l3dstates[p].active,s)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab==L3DSR_ID)verbal=\"I/O device write at L3DSR with value \"+bus_db+\". \";if(bus_ab==L3DCR_ID)verbal=\"I/O device write at L3DCR with value \"+bus_db+\". \";if(bus_ab==L3DDR_ID)verbal=\"I/O device write at L3DDR with value \"+bus_db+\". \";return verbal})/"},"L3D_RESET":{"nparameters":1,"operation":"/Function(function(s_expr){sim.poc.events.l3d={};var n=sim.poc.internal_states.l3d_state.length;for(var i=0;i>24;var y=(iodr&16711680)>>16;var p=y*sim.poc.internal_states.ledm_dim+x;var s=get_var(sim.poc.internal_states.ledm_state[p].color);set_value(sim.poc.states[s_expr[2]],s)}})/","verbal":"/Function(function(s_expr){var verbal=\"\";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==LEDMSR_ID)verbal=\"I/O device read at LEDMSR of value \"+iosr+\". \";if(bus_ab==LEDMCR_ID)verbal=\"I/O device read at LEDMCR of value \"+iocr+\". \";if(bus_ab==LEDMDR_ID)verbal=\"I/O device read at LEDMDR of value \"+iodr+\". \";return verbal})/"},"LEDM_IOW":{"nparameters":7,"types":["E","E","E","E","E","E"],"operation":"/Function(function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);switch(bus_ab){case LEDMSR_ID:set_value(sim.poc.states[s_expr[3]],bus_db);break;case LEDMDR_ID:set_value(sim.poc.states[s_expr[5]],bus_db);break;case LEDMCR_ID:set_value(sim.poc.states[s_expr[4]],bus_db);break;default:break}if(LEDMCR_ID==bus_ab){var dr=get_value(sim.poc.states[s_expr[5]]);if(16&bus_db){var x=(dr&4278190080)>>24;var y=(dr&16711680)>>16;var s=dr&255;set_value(sim.poc.states[s_expr[3]],1);if(x>=sim.poc.internal_states.ledm_dim&&y>=sim.poc.internal_states.ledm_dim){set_value(sim.poc.states[s_expr[3]],-1);return}var p=y*sim.poc.internal_states.ledm_dim+x;set_var(sim.poc.internal_states.ledm_state[p].color,s)}if(32&bus_db){set_value(sim.poc.states[s_expr[3]],1);var s=0;var neltos=sim.poc.internal_states.ledm_neltos;var ldmstates=sim.poc.internal_states.ledm_state;for(var p=0;p>0);set_var(sim.poc.internal_states.ledm_state[p+1].color,(s&65280)>>8);set_var(sim.poc.internal_states.ledm_state[p+2].color,(s&16711680)>>16);set_var(sim.poc.internal_states.ledm_state[p+3].color,(s&4278190080)>>24)}}if(64&bus_db){set_value(sim.poc.states[s_expr[3]],1);var s=0;var c=\"\";var neltos=sim.poc.internal_states.ledm_colors.length;for(var p=0;p>>8;s=s.toString(16);c=\"#\"+simcoreui_pack(s,6);sim.poc.internal_states.ledm_colors[p]=c}neltos=sim.poc.internal_states.ledm_neltos;for(var p=0;p>24;var y=(dr&16711680)>>16;var s=dr&255;verbal=\"I/O device write at LEDMCR with value \"+bus_db+\" (set pixel x:\"+x+\", y:\"+y+\", with color:\"+s+\"). \"}if(64&bus_db){verbal=\"I/O device write at LEDMCR with value \"+bus_db+\" (set color palette at:\"+bus_db+\"). \"}break;default:break}return verbal})/"},"LEDM_RESET":{"nparameters":1,"operation":"/Function(function(s_expr){sim.poc.events.ledm={};sim.poc.internal_states.ledm_colors=colors_clone(\"\");for(var i=0;i - - - - - image/svg+xml - - - - - - - - - Control Memory - MUX C - - - 80 - - - - SR - - - - - - - - - + + + + + + + image/svg+xml + + + + + + + + Control Memory + MUX C + + + 80 + + + + SR + + + + + + + + + - - - 0 - A0 - MUX A - µInstruction - MADDR - µAddr - - +1 - - - - - - - - - - - 4 - - 12 - - 0 - (fetch) - - - - 0 - - - - - - - SelA - SelB - SelC - - - - - - - - - - - - - - - - - - - - 49 - - MUX - - MRA - Rest of CPU - control - signals - - - - MUX - - MRB - - - MUX - - MRC - - - - - - - - - - 6 - - - - - - 6 - - - - 6 - - - MUX - - - - SelCop - - - - - MC - - - IR3 -- IR0 - 4 - 6 - 6 - 6 - 0 - 1 - RB - RC - RA - Cop - 0 - 1 - 0 - 1 - A1 - MUX B - - 0 - 1 - - 00 - 01 - 10 - 11 - - - - - - - - - A0 - B - C - µAddress - - - - - - - - - - C - V - N - I - U - - 31 - 30 - 29 - 1 - MRdy - IORdy - INT - 7 - 6 - 5 - 4 - 3 - 2 - 1 - 0 - 8 - - - - - - - - - - - - - - - - - - - - - - + + + 0 + A0 + MUX A + µInstruction + MADDR + µAddr + + +1 + + + + + + + + + + + 4 + + 12 + + 0 + (fetch) + + + + 0 + + + + + + + SelA + SelB + SelC + + + + + + + + + + + + + + + + + + + + 49 + + MUX + + MRA + Rest of CPU + control + signals + + + + MUX + + MRB + + + MUX + + MRC + + + + + + + + + + 6 + + + + + + 6 + + + + 6 + + + MUX + + + + SelCop + + + + + MC + + + IR3 -- IR0 + 4 + 6 + 6 + 6 + 0 + 1 + RB + RC + RA + Cop + 0 + 1 + 0 + 1 + A1 + MUX B + + 0 + 1 + + 00 + 01 + 10 + 11 + + + + + + + + + A0 + B + C + µAddress + + + + + + + + + + C + V + N + I + U + + 31 + 30 + 29 + 1 + MRdy + IORdy + INT + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 0 + 8 + + + + + + + + + + + + + + + + + + + + + + - - - ... - - MC - - CLK - - ExCode - - 4 - - - - T11 - - - Z - 28 - 9 - - 10 - - - - co2µaddr - - CO - IR - - - - 6 - - - 4 - - - - InEx - - - - - Sel RA - Sel RB - Sel RC - 0 - 1 - - - - - - CLK - - - - - - - - ... - - - ... - COP - - + + + ... + + MC + + CLK + + ExCode + + 4 + + + + T11 + + + Z + 28 + 9 + + 10 + + + + co2µaddr + + CO + IR + + + + 6 + + + 4 + + + + InEx + + + + + Sel RA + Sel RB + Sel RC + 0 + 1 + + + + + + CLK + + + + + + + + ... + + + ... + COP + diff --git a/ws_dist/examples/hardware/poc/images/processor.svg b/ws_dist/examples/hardware/poc/images/processor.svg index 40ec52d43..2a9938f30 100644 --- a/ws_dist/examples/hardware/poc/images/processor.svg +++ b/ws_dist/examples/hardware/poc/images/processor.svg @@ -85,37 +85,47 @@ visibility="hidden" style="visibility:hidden" /> Memory Address Bus ALU @@ -190,7 +211,9 @@ font-size="16.938px" xml:space="preserve" transform="scale(1.054676,0.94815848)" - style="font-size:16.9384px;line-height:125%;font-family:Arial;text-decoration:underline;text-decoration-line:underline;fill:#000000;stroke-width:1.00002" + stroke-width="1.0px" + fill="#000000" + style="font-size:16.9384px;line-height:125%;font-family:Arial;text-decoration:underline;text-decoration-line:underline;" id="text3029">Register File MAR IR +0 1 MUX MBR C0 C1 Ta Td T1 RA RB RC LC T9 T10 B PC C2 Control Unit @@ -657,23 +776,28 @@ d="m 229.02272,135.6238 c 0,-1.3566 1.1435,-2.4694 2.5579,-2.4694 1.4146,0 2.5578,1.1128 2.5578,2.4694 0,1.3671 -1.1434,2.4799 -2.5578,2.4799 -1.4145,0 -2.5579,-1.1128 -2.5579,-2.4799" id="path3185" /> MUX 0 1 MUX A @@ -751,41 +887,49 @@ d="m 287.44688,446.75834 c 0,-1.3566 1.1316,-2.4799 2.5461,-2.4799 1.4145,0 2.5696,1.1234 2.5696,2.4799 0,1.3777 -1.1552,2.4798 -2.5696,2.4798 -1.4145,0 -2.5461,-1.1023 -2.5461,-2.4798" id="path3163" /> 4 SELEC Control Signals C3 T2 T3 T6 MA MB M1 5 Internal Bus 6 6 6 Processor A31 - A0 @@ -1175,12 +1384,14 @@ d="m 638.39432,167.5938 c 0,-1.3566 1.1787,-2.4587 2.5932,-2.4587 1.3673,0 2.5461,1.1023 2.5461,2.4587 0,1.3989 -1.1788,2.5011 -2.5461,2.5011 -1.4144,0 -2.5932,-1.1023 -2.5932,-2.5011" id="path3517" /> @@ -1190,12 +1401,14 @@ d="m 229.53172,135.9438 c 0,-1.3566 1.1434,-2.4694 2.5578,-2.4694 1.4028,0 2.546,1.1128 2.546,2.4694 0,1.3671 -1.1433,2.4798 -2.546,2.4798 -1.4145,0 -2.5578,-1.1128 -2.5578,-2.4798" id="path3537" /> @@ -1205,17 +1418,20 @@ d="m 285.89072,151.8838 c 0,-1.3671 1.1434,-2.4798 2.5578,-2.4798 1.4028,0 2.5461,1.1128 2.5461,2.4798 0,1.3671 -1.1434,2.4694 -2.5461,2.4694 -1.4144,0 -2.5578,-1.1023 -2.5578,-2.4694" id="path3543" /> @@ -1225,7 +1441,8 @@ d="m 206.82856,167.48208 c 0,-1.3777 1.1552,-2.4799 2.5698,-2.4799 1.3908,0 2.5461,1.1023 2.5461,2.4799 0,1.3566 -1.1552,2.4587 -2.5461,2.4587 -1.4144,0 -2.5698,-1.1023 -2.5698,-2.4587" id="path3569" /> @@ -1235,7 +1452,8 @@ d="m 183.99404,167.36658 c 0,-1.3777 1.1316,-2.4799 2.5461,-2.4799 1.4145,0 2.546,1.1023 2.546,2.4799 0,1.3566 -1.1316,2.4587 -2.546,2.4587 -1.4145,0 -2.5461,-1.1023 -2.5461,-2.4587" id="path3573" /> @@ -1246,12 +1464,15 @@ id="path3589" sodipodi:nodetypes="ccccccccccc" /> SE C7 Offset 5 KBSR Keyboard DSR + style="fill-rule:evenodd;" /> 0 MRdy ADDR DATA R 0 1 ADDR IOW ADDR DATA D0 C V Z Data Bus V7 - IODR IORdy ADDR DATA IOR IOW INT INTA "+index+"/"+ws_records.length+" "+msg)}if(ws_record_pb_obj!==null){var next_pbval=100*index/ws_records.length;ws_record_pb_obj.css("width",next_pbval+"%").attr("aria-valuenow",next_pbval)}}function simcore_record_playAt(index_current,index_last){if(ws_is_playing===false){simcore_record_showMsg(ws_last_played,"Stopped by user.");return}ws_last_played=index_current;if(index_current>=index_last){simcore_record_showMsg(index_last,"Done.");return}if(ws_records[index_current].description==="_pending event_"){simcore_record_playAt(index_current+1,index_last);return}eval(ws_records[index_current].element);var index_next=index_current+1;simcore_record_showMsg(index_next,ws_records[index_current].description);var wait_time=500;if(index_next0&&ws_records[ws_records.length-1].description==="_pending event_"){distance=ws_glowing_time}simcore_record_pushElto("_pending event_",";",distance)}}function simcore_record_resolve_pending(description,elto){if(ws_is_recording===true){var last_pending=ws_records.length;while(last_pending>0){last_pending--;if(ws_records[last_pending].description==="_pending event_"){break}}if(last_pending===0){simcore_record_setTimeBeforeNow(0);simcore_record_append_new(description,elto);return}ws_records[last_pending].description=description;ws_records[last_pending].element=elto;simcore_record_showMsg(0,"Recording...")}}function simcore_record_setTimeBeforeNow(distance){ws_last_time=Date.now()-distance}function simcore_record_addTimeAfterLast(distance){ws_last_time=ws_last_time+distance}function array_includes(arr,val){if(typeof arr.includes!="undefined"){return arr.includes(val)}for(var i=0;i0){e=i;n=n+1}}if(n>0){var tri_state_names=simhw_internalState("tri_state_names");var tri_name=tri_state_names[e];update_draw(simhw_sim_signal(tri_name),1)}if(n>1){update_bus_visibility("internalbus_fire","visible");simhw_internalState_set("fire_visible","internalbus",true);simhw_sim_state("BUS_IB").value=4294967295}else{update_bus_visibility("internalbus_fire","hidden");simhw_internalState_set("fire_visible","internalbus",false)}return n}function update_system_bus_fire(number_active_tri){if(simhw_internalState_get("fire_visible","databus")==true){update_bus_visibility("databus_fire","hidden");simhw_internalState_set("fire_visible","databus",false)}if(number_active_tri>1){update_bus_visibility("databus_fire","visible");simhw_internalState_set("fire_visible","databus",true);simhw_sim_state("BUS_DB").value=4294967295}return number_active_tri}function fn_updateE_now(key){if("E"==simhw_sim_signal(key).type){update_state(key)}}function fn_updateE_future(key){if(jit_fire_ndep[key]<1)fn_updateE_now(key);else return new Promise((function(resolve,reject){fn_updateE_now(key)}))}function fn_updateL_now(key){update_draw(simhw_sim_signal(key),simhw_sim_signal(key).value);if("L"==simhw_sim_signal(key).type){update_state(key)}}function fn_updateL_future(key){if(jit_fire_ndep[key]<1)fn_updateL_now(key);else return new Promise((function(resolve,reject){fn_updateL_now(key)}))}function update_state(key){var index_behavior=0;switch(simhw_sim_signal(key).behavior.length){case 0:return;break;case 1:index_behavior=0;break;default:index_behavior=simhw_sim_signal(key).value;if(simhw_sim_signal(key).behavior.lengthreg_maddr){break}assoc_i=i}if(-1==assoc_i){ws_alert("A new 'unknown' instruction is inserted,\n"+"please edit it (co, nwords, etc.) in the firmware textarea.");var new_ins=new Object;new_ins["name"]="unknown";new_ins["signature"]="unknown";new_ins["signatureGlobal"]="unknown";new_ins["co"]=0;new_ins["nwords"]=0;new_ins["mc-start"]=0;new_ins["fields"]=new Array;new_ins["microcode"]=new Array;new_ins["microcomments"]=new Array;SIMWARE["firmware"].push(new_ins);assoc_i=SIMWARE["firmware"].length-1}var pos=reg_maddr-parseInt(SIMWARE["firmware"][assoc_i]["mc-start"]);if(typeof SIMWARE["firmware"][assoc_i]["microcode"][pos]=="undefined"){SIMWARE["firmware"][assoc_i]["microcode"][pos]=new Object;SIMWARE["firmware"][assoc_i]["microcomments"][pos]=""}SIMWARE["firmware"][assoc_i]["microcode"][pos][key]=simhw_sim_signal(key).value;if(simhw_sim_signal(key).default_value==simhw_sim_signal(key).value){delete SIMWARE["firmware"][assoc_i]["microcode"][pos][key]}var bits=get_value(simhw_sim_state("REG_IR")).toString(2);bits="00000000000000000000000000000000".substring(0,32-bits.length)+bits;show_memories_values()}function propage_signal_update(key){if(true===get_cfg("is_interactive")){if(simhw_sim_signal(key).value!=simhw_sim_signal(key).default_value)simhw_sim_state("REG_MICROINS").value[key]=simhw_sim_signal(key).value;else delete simhw_sim_state("REG_MICROINS").value[key];var maddr_name=simhw_sim_ctrlStates_get().mpc.state;var curr_maddr=get_value(simhw_sim_state(maddr_name));var mc_obj=simhw_internalState("MC");var mcelto=control_memory_get(mc_obj,curr_maddr);if(typeof mcelto==="undefined"){mcelto={value:{},comments:null}}mcelto.value[key]=simhw_sim_signal(key).value;mcelto.comments=[];control_memory_set(mc_obj,curr_maddr,mcelto);update_signal_firmware(key);var SIMWARE=get_simware();document.getElementById("inputFirmware").value=saveFirmware(SIMWARE)}compute_behavior("FIRE "+key)}function update_memories(preSIMWARE){var i=0;set_simware(preSIMWARE);var SIMWARE=get_simware();simhw_internalState_reset("MC",{});var mc_obj=simhw_internalState("MC");var mcelto=null;for(i=0;i>23&255)-127;var mantissa=1+(hexvalue&8388607)/8388608;var valuef=sign*mantissa*Math.pow(2,exponent);if(-127===exponent)if(1===mantissa)valuef=sign===1?"+0":"-0";else valuef=sign*((hexvalue&8388607)/8388607)*Math.pow(2,-126);if(128===exponent)if(1===mantissa)valuef=sign===1?"+Inf":"-Inf";else valuef="NaN";return valuef}function uint_to_float32(value){var buf=new ArrayBuffer(4);new Uint32Array(buf)[0]=value;return new Float32Array(buf)[0]}function float32_to_uint(value){var buf=new ArrayBuffer(4);new Float32Array(buf)[0]=value;return new Uint32Array(buf)[0]}function float_class(a){var s=a&2147483648;s=s>>31;var e=a&2139095040;e=e>>23;var m=a&8388607;let rd=0;if(!m&&!e){rd=s?3:4}else if(!e){rd=s?2:6}else if(!(e^255)){if(m)rd=s?8:9;else rd=s?0:7}else{rd=s?1:5}return rd}function float_class_power2(a){var s=a&2147483648;s=s>>31;var e=a&2139095040;e=e>>23;var m=a&8388607;let rd=0;if(!m&&!e){rd=s?1<<3:1<<4}else if(!e){rd=s?1<<2:1<<6}else if(!(e^255)){if(m)rd=s?1<<8:1<<9;else rd=s?1<<0:1<<7}else{rd=s?1<<1:1<<5}return rd}function hex2char8(hexvalue){var valuec=[];valuec[0]=String.fromCharCode((hexvalue&4278190080)>>24);valuec[1]=String.fromCharCode((hexvalue&16711680)>>16);valuec[2]=String.fromCharCode((hexvalue&65280)>>8);valuec[3]=String.fromCharCode((hexvalue&255)>>0);return valuec}function simcoreui_pack(val,pack_size){var base_str="0".repeat(pack_size);return base_str.substring(0,pack_size-val.length)+val}function hex2bin(hexvalue){var valuebin=hexvalue.toString(2);valuebin=simcoreui_pack(valuebin,32);valuebin=valuebin.substring(0,4)+" "+valuebin.substring(4,8)+" "+valuebin.substring(8,12)+" "+valuebin.substring(12,16)+"
"+valuebin.substring(16,20)+" "+valuebin.substring(20,24)+" "+valuebin.substring(24,28)+" "+valuebin.substring(28,32);return valuebin}function value2string(format,value){var fmt_value="";var fmt=format.split("_");switch(fmt[0]){case"unsigned":fmt_value=value.toString(fmt[1]).toUpperCase();break;case"float":fmt_value=hex2float(value);break;case"char":fmt_value="'"+String.fromCharCode(value)+"'";break;default:fmt_value=value.toString()}if(fmt[2]==="fill"){fmt_value=simcoreui_pack(fmt_value,8)}return fmt_value}function show_rf_names(){return simcore_action_ui("CPU",0,"show_rf_names")()}function get_screen_content(){return simcore_action_ui("SCREEN",0,"get_screen_content")()}function set_screen_content(screen){simcore_action_ui("SCREEN",0,"set_screen_content")(screen)}function get_keyboard_content(){return simcore_action_ui("KBD",0,"get_keyboard_content")()}function set_keyboard_content(keystrokes){simcore_action_ui("KBD",0,"set_keyboard_content")(keystrokes)}function show_main_memory(memory,index,redraw,updates){return simcore_action_ui("MEMORY",0,"show_main_memory")(memory,index,redraw,updates)}function show_control_memory(memory,index,redraw){return simcore_action_ui("MEMORY",0,"show_control_memory")(memory,index,redraw)}function show_cache_memory(memory){return simcore_action_ui("MEMORY",0,"show_cache_memory")(memory)}function show_memories_values(){var pc_name=simhw_sim_ctrlStates_get().pc.state;var reg_pc=get_value(simhw_sim_state(pc_name));show_main_memory(simhw_internalState("MP"),reg_pc,true,true);var maddr_name=simhw_sim_ctrlStates_get().mpc.state;var reg_maddr=get_value(simhw_sim_state(maddr_name));show_control_memory(simhw_internalState("MC"),reg_maddr,true);show_cache_memory(simhw_internalState("CM"))}function update_draw(obj,value){return simcore_action_ui("CPU",1,"update_draw")(obj,value)}function update_bus_visibility(bus_name,value){return simcore_action_ui("CPU",1,"update_bus_visibility")(bus_name,value)}function refresh(){for(var key in simhw_sim_signals()){update_draw(simhw_sim_signals()[key],simhw_sim_signals()[key].value)}show_dbg_ir(get_value(simhw_sim_state("REG_IR_DECO")))}function show_dbg_ir(value){return simcore_action_ui("MEMORY",0,"show_dbg_ir")(value)}function show_dbg_mpc(){return simcore_action_ui("MEMORY",0,"show_dbg_mpc")()}function show_asmdbg_pc(){return simcore_action_ui("MEMORY",0,"show_asmdbg_pc")()}function ws_alert(msg){if(typeof document==="undefined"){console.log(msg);return true}alert(msg);return true}function element_scroll_get(list_id){var offset=0;var obj_byid=$(list_id);if(obj_byid.length>0){offset=obj_byid[0].scrollTop}return offset}function element_scroll_set(list_id,offset){var obj_byid=$(list_id);if(obj_byid.length>0){obj_byid[0].scrollTop=offset}}function element_scroll_setRelative(list_id,obj_id,offset){var obj_byid=$(obj_id);if(obj_byid.length>0){var topPos=obj_byid[0].offsetTop;element_scroll_set(list_id,topPos+offset)}}var colors_schemes={color14:["#000000","#FFFFFF","#FF0000","#FF8800","#FFFF00","#88FF00","#00FF00","#00FF88","#00FFFF","#0088FF","#0000FF","#8800FF","#FF00FF","#FF0088"],color16:["#000000","#FFFFFF","#9D9D9D","#BE2633","#E06F8B","#493C2B","#A46422","#EB8931","#F7E26B","#2F484E","#44891A","#A3CE27","#1B2632","#005784","#31A2F2","#B2DCEF"],color256:["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff","#000000","#00005f","#000087","#0000af","#0000d7","#0000ff","#005f00","#005f5f","#005f87","#005faf","#005fd7","#005fff","#008700","#00875f","#008787","#0087af","#0087d7","#0087ff","#00af00","#00af5f","#00af87","#00afaf","#00afd7","#00afff","#00d700","#00d75f","#00d787","#00d7af","#00d7d7","#00d7ff","#00ff00","#00ff5f","#00ff87","#00ffaf","#00ffd7","#00ffff","#5f0000","#5f005f","#5f0087","#5f00af","#5f00d7","#5f00ff","#5f5f00","#5f5f5f","#5f5f87","#5f5faf","#5f5fd7","#5f5fff","#5f8700","#5f875f","#5f8787","#5f87af","#5f87d7","#5f87ff","#5faf00","#5faf5f","#5faf87","#5fafaf","#5fafd7","#5fafff","#5fd700","#5fd75f","#5fd787","#5fd7af","#5fd7d7","#5fd7ff","#5fff00","#5fff5f","#5fff87","#5fffaf","#5fffd7","#5fffff","#870000","#87005f","#870087","#8700af","#8700d7","#8700ff","#875f00","#875f5f","#875f87","#875faf","#875fd7","#875fff","#878700","#87875f","#878787","#8787af","#8787d7","#8787ff","#87af00","#87af5f","#87af87","#87afaf","#87afd7","#87afff","#87d700","#87d75f","#87d787","#87d7af","#87d7d7","#87d7ff","#87ff00","#87ff5f","#87ff87","#87ffaf","#87ffd7","#87ffff","#af0000","#af005f","#af0087","#af00af","#af00d7","#af00ff","#af5f00","#af5f5f","#af5f87","#af5faf","#af5fd7","#af5fff","#af8700","#af875f","#af8787","#af87af","#af87d7","#af87ff","#afaf00","#afaf5f","#afaf87","#afafaf","#afafd7","#afafff","#afd700","#afd75f","#afd787","#afd7af","#afd7d7","#afd7ff","#afff00","#afff5f","#afff87","#afffaf","#afffd7","#afffff","#d70000","#d7005f","#d70087","#d700af","#d700d7","#d700ff","#d75f00","#d75f5f","#d75f87","#d75faf","#d75fd7","#d75fff","#d78700","#d7875f","#d78787","#d787af","#d787d7","#d787ff","#d7af00","#d7af5f","#d7af87","#d7afaf","#d7afd7","#d7afff","#d7d700","#d7d75f","#d7d787","#d7d7af","#d7d7d7","#d7d7ff","#d7ff00","#d7ff5f","#d7ff87","#d7ffaf","#d7ffd7","#d7ffff","#ff0000","#ff005f","#ff0087","#ff00af","#ff00d7","#ff00ff","#ff5f00","#ff5f5f","#ff5f87","#ff5faf","#ff5fd7","#ff5fff","#ff8700","#ff875f","#ff8787","#ff87af","#ff87d7","#ff87ff","#ffaf00","#ffaf5f","#ffaf87","#ffafaf","#ffafd7","#ffafff","#ffd700","#ffd75f","#ffd787","#ffd7af","#ffd7d7","#ffd7ff","#ffff00","#ffff5f","#ffff87","#ffffaf","#ffffd7","#ffffff","#080808","#121212","#1c1c1c","#262626","#303030","#3a3a3a","#444444","#4e4e4e","#585858","#626262","#6c6c6c","#767676","#808080","#8a8a8a","#949494","#9e9e9e","#a8a8a8","#b2b2b2","#bcbcbc","#c6c6c6","#d0d0d0","#dadada","#e4e4e4","#eeeeee"]};function colors_clone(cs){var colors=colors_schemes[cs];if(typeof colors=="undefined"){colors=colors_schemes["color16"]}return colors.map((x=>x))}function simcore_init(with_ui){var ret={};ret.msg="";ret.ok=true;if(with_ui){restore_cfg()}else{reset_cfg_values()}return ret}function simcore_init_hw(simhw_name){var ret={};ret.msg="";ret.ok=true;var hwid=simhw_getIdByName(simhw_name);if(hwid<0){ret.msg="ERROR: unknown hardware: "+simhw_name+".
\n";ret.ok=false;return ret}simhw_setActive(hwid);var ret1=simcore_init_ui({});if(false===ret1.ok){ret.msg=ret.msg;ret.ok=false;return ret}return ret}function simcore_welcome(){var ret={};ret.msg="";ret.ok=true;console.log("");console.log("██╗ ██╗███████╗██████╗ ███████╗██╗███╗ ███╗");console.log("██║ ██║██╔════╝██╔══██╗██╔════╝██║████╗ ████║");console.log("██║ █╗ ██║█████╗ ██████╔╝███████╗██║██╔████╔██║");console.log("██║███╗██║██╔══╝ ██╔═══╝ ╚════██║██║██║╚██╔╝██║");console.log("╚███╔███╔╝███████╗██║ ███████║██║██║ ╚═╝ ██║");console.log(" ╚══╝╚══╝ ╚══════╝╚═╝ ╚══════╝╚═╝╚═╝ ╚═╝");console.log("");console.log("Stable: https://github.com/wepsim/wepsim");console.log("Beta: https://github.com/acaldero/wepsim");console.log("");return ret}function simcore_init_ui(hash_detail2init){var ret={};ret.msg="";ret.ok=true;var detail_id=0;var sim_components=simhw_sim_components();for(var elto in sim_components){sim_components[elto].details_ui=[];for(var index in sim_components[elto].details_name){sim_components[elto].details_ui[index]={};detail_id=sim_components[elto].details_name[index];if(typeof hash_detail2init[detail_id]!=="undefined"){sim_components[elto].details_ui[index]=hash_detail2init[detail_id];sim_components[elto].details_ui[index].init()}}}return ret}function simcore_action_ui(component_name,detail_id,action_name){var sim_components=simhw_sim_components();if(typeof sim_components[component_name].details_ui[detail_id][action_name]==="undefined"){return simcore_do_nothing_handler}return sim_components[component_name].details_ui[detail_id][action_name]}function simcore_init_eventlistener(context,hash_detail2action,hash_signal2action){var context_obj=null;var r=[];var o=null;context_obj=document.getElementById(context).contentDocument;if(null==context_obj){console.log('warning: unreferenced graphic element context named "'+r[0]+'".');return}var sim_signals=simhw_sim_signals();for(var key in sim_signals){if(typeof hash_signal2action[key+"click"]==="undefined"){hash_signal2action[key+"click"]=function(key_value){return function(){hash_signal2action[""](key_value,"click")}}(key)}if(typeof hash_signal2action[key+"dblclick"]==="undefined"){hash_signal2action[key+"dblclick"]=function(key_value){return function(){hash_signal2action[""](key_value,"dblclick")}}(key)}for(var j=0;j\n"+"Please load some assembly code.
";ret.ok=false;return ret}var SIMWARE=get_simware();if(!(typeof curr_segments[".ktext"]!="undefined"&&SIMWARE.labels2.kmain)&&!(typeof curr_segments[".text"]!="undefined"&&SIMWARE.labels2.main)){ret.msg="labels 'kmain' (in .ktext) or 'main' (in .text) do not exist!";ret.ok=false;return ret}return ret}function simcore_packerror_at(reg_maddr,msg){var ret={};var hex_maddr="0x"+parseInt(reg_maddr).toString(16);ret.ok=false;ret.msg=msg+" at maddr="+hex_maddr+".";return ret}function simcore_check_if_can_continue2(reg_maddr,reg_pc){var ret={};ret.ok=true;ret.msg="";var curr_MC=simhw_internalState("MC");var mcelto=control_memory_get(curr_MC,reg_maddr);if(typeof mcelto==="undefined"){return simcore_packerror_at(reg_maddr,"Error: undefined microinstruction")}if(simhw_internalState_get("fire_visible","databus")==true||simhw_internalState_get("fire_visible","internalbus")==true){return simcore_packerror_at(reg_maddr,"Error: two or more tri-states are active")}var curr_segments=simhw_internalState("segments");if(reg_pc=curr_segments[".ktext"].begin){return ret}if(reg_pc=curr_segments[".text"].begin){return ret}if(mcelto.is_native&&0===reg_maddr){if(reg_pc==curr_segments[".ktext"].end||reg_pc==curr_segments[".text"].end){return ret}}if(false==mcelto.is_native&&0!==reg_maddr){if(reg_pc==curr_segments[".ktext"].end||reg_pc==curr_segments[".text"].end){return ret}}ret.ok=false;ret.msg="The program has finished because the PC register points outside .ktext/.text code segments";return ret}function simcore_check_if_can_continue(){var pc_name=simhw_sim_ctrlStates_get().pc.state;var reg_pc=parseInt(get_value(simhw_sim_state(pc_name)));var maddr_name=simhw_sim_ctrlStates_get().mpc.state;var reg_maddr=get_value(simhw_sim_state(maddr_name));return simcore_check_if_can_continue2(reg_maddr,reg_pc)}function simcore_reset(){var ret={};ret.msg="";ret.ok=true;var SIMWARE=get_simware();var curr_firm=simhw_internalState("FIRMWARE");var curr_segments=simhw_internalState("segments");var curr_MC=simhw_internalState("MC");var sim_components=simhw_sim_components();var ctrl_states=simhw_sim_ctrlStates_get();var pc_name=ctrl_states.pc.state;var pc_state=simhw_sim_state(pc_name);var sp_name=ctrl_states.sp.state;var sp_state=simhw_sim_state(sp_name);if(curr_firm.stackRegister!=null){sp_name=curr_firm.stackRegister;sp_state=simhw_sim_states().BR[sp_name];ctrl_states.sp.state="BR."+curr_firm.stackRegister}for(var elto in sim_components){var reset_signal_name=sim_components[elto].name+"_RESET";compute_general_behavior(reset_signal_name)}if(typeof curr_segments[".ktext"]!=="undefined"&&SIMWARE.labels2.kmain){set_value(pc_state,parseInt(SIMWARE.labels2.kmain));show_asmdbg_pc()}else if(typeof curr_segments[".text"]!=="undefined"&&SIMWARE.labels2.main){set_value(pc_state,parseInt(SIMWARE.labels2.main));show_asmdbg_pc()}if(typeof curr_segments[".stack"]!=="undefined"&&typeof sp_state!=="undefined"){set_value(sp_state,parseInt(curr_segments[".stack"].end)&4294967292)}var new_maddr=get_value(simhw_sim_state("MUXA_MICROADDR"));var mcelto=control_memory_get(curr_MC,new_maddr);if(typeof mcelto==="undefined"){mcelto={value:simhw_sim_state("REG_MICROINS").default_value,is_native:false}}var new_mins=get_value(mcelto);if(false==mcelto.is_native){compute_general_behavior("CLOCK")}show_dbg_ir(get_value(simhw_sim_state("REG_IR_DECO")));for(elto in sim_components){for(var index in sim_components[elto].details_name){if(typeof sim_components[elto].details_ui[index].reset!=="undefined"){sim_components[elto].details_ui[index].reset()}}}return ret}function simcore_execute_microinstruction(){var ret=simcore_check_if_can_continue();if(false===ret.ok){return ret}compute_general_behavior("CLOCK");show_dbg_mpc();return ret}function simcore_execute_microinstruction2(reg_maddr,reg_pc){var ret=simcore_check_if_can_continue2(reg_maddr,reg_pc);if(false===ret.ok){return ret}compute_general_behavior("CLOCK");show_dbg_mpc();return ret}function simcore_execute_microprogram(options){var ret=simcore_check_if_can_continue();if(false===ret.ok){return ret}var before_state=null;var after_state=null;var curr_mpc="";var curr_MC=simhw_internalState("MC");var maddr_name=simhw_sim_ctrlStates_get().mpc.state;var maddr_state=simhw_sim_state(maddr_name);if(typeof options.before_microinstruction==="undefined"){options.before_microinstruction=simcore_do_nothing_handler}if(typeof options.after_microinstruction==="undefined"){options.after_microinstruction=simcore_do_nothing_handler}var i_clks=0;var limitless=options.cycles_limit<0;var cur_addr=0;var mcelto=null;var oolimits=false;do{options.before_microinstruction(curr_MC,cur_addr);compute_general_behavior("CLOCK");i_clks++;options.after_microinstruction(curr_MC,cur_addr);if(limitless===false&&i_clks>=options.cycles_limit){ret.msg="Warning: clock cycles limit reached in a single instruction.";ret.ok=false;break}cur_addr=get_value(maddr_state);mcelto=control_memory_get(curr_MC,cur_addr);if(typeof mcelto==="undefined"){ret.msg="Error: undefined microinstruction at "+cur_addr+".";ret.ok=false;break}if(i_clks>=options.cycles_limit&&-1!=options.cycles_limit){oolimits=true}}while(false==oolimits&&0!=cur_addr);if(true==ret.ok&&mcelto.is_native){compute_general_behavior("CLOCK")}if(get_cfg("DBG_level")=="microinstruction"){show_dbg_mpc()}return ret}function simcore_execute_program(options){var ret={};ret.ok=true;ret.msg="";var curr_segments=simhw_internalState("segments");var pc_name=simhw_sim_ctrlStates_get().pc.state;var pc_state=simhw_sim_state(pc_name);var reg_pc=get_value(pc_state);var reg_pc_before=get_value(pc_state)-4;var code_begin=0;if(typeof curr_segments[".text"]!="undefined"&&typeof curr_segments[".text"].begin!="undefined")code_begin=parseInt(curr_segments[".text"].begin);var code_end=0;if(typeof curr_segments[".text"]!="undefined"&&typeof curr_segments[".text"].end!="undefined")code_end=parseInt(curr_segments[".text"].end);var kcode_begin=0;if(typeof curr_segments[".ktext"]!="undefined"&&typeof curr_segments[".ktext"].begin!="undefined")kcode_begin=parseInt(curr_segments[".ktext"].begin);var kcode_end=0;if(typeof curr_segments[".ktext"]!="undefined"&&typeof curr_segments[".ktext"].end!="undefined")kcode_end=parseInt(curr_segments[".ktext"].end);var ret1=null;var before_state=null;var after_state=null;var curr_pc="";var SIMWARE=get_simware();if(typeof options.verbalize!=="undefined"){set_cfg("verbal_verbose",options.verbalize)}if(typeof options.before_instruction==="undefined"){options.before_instruction=simcore_do_nothing_handler}if(typeof options.after_instruction==="undefined"){options.after_instruction=simcore_do_nothing_handler}var ins_executed=0;while(reg_pc=code_begin||reg_pc=kcode_begin){options.before_instruction(SIMWARE,reg_pc);ret1=simcore_execute_microprogram(options);if(false===ret1.ok){return ret1}options.after_instruction(SIMWARE,reg_pc);ins_executed++;if(ins_executed>options.instruction_limit&&-1!=options.instruction_limit){ret.ok=false;ret.msg="more than "+options.instruction_limit+" instructions executed before application ends.";return ret}reg_pc_before=reg_pc;reg_pc=get_value(pc_state)}return ret}function simcore_do_nothing_handler(){return null}function simcore_compile_firmware(textToMCompile){var ret={};ret.msg="";ret.ok=true;if(""==textToMCompile){ret.msg="Empty Firmware";ret.ok=false;return ret}var preSM=null;try{preSM=loadFirmware(textToMCompile);ret.simware=preSM}catch(e){ret.msg="ERROR: at line: "+e.lineNumber+" and column: "+e.columnNumber;ret.ok=false;return ret}if(preSM.error!=null){ret.msg=preSM.error;ret.ok=false;return ret}update_memories(preSM);simcore_reset();return ret}function simcore_compile_assembly(textToCompile){var ret={};ret.msg="";ret.ok=true;var SIMWARE=get_simware();if(SIMWARE.firmware.length===0){ret.msg="Empty microcode, please load the microcode first.";ret.ok=false;return ret}var SIMWAREaddon=simlang_compile(textToCompile,SIMWARE);ret.simware=SIMWAREaddon;if(SIMWAREaddon.error!=null){ret.msg=SIMWAREaddon.error;ret.ok=false;return ret}set_simware(SIMWAREaddon);update_memories(SIMWARE);simcore_reset();return ret}function simcore_hardware_export(hw_name){var ret={};ret.msg="{}";ret.ok=false;var hw_obj=simhw_getObjByName(hw_name);if(null===hw_obj){return ret}ret.ok=true;ret.msg=JSON.stringify(hw_obj,(function(key,value){if(typeof value==="function"){return"/Function("+value.toString()+")/"}return value}));return ret}function simcore_hardware_import(hw_json){var ret={};ret.msg="";ret.ok=true;hw_obj=JSON.parse(hw_json,(function(key,value){if(typeof value==="string"&&value.startsWith("/Function(")&&value.endsWith(")/")){value=value.substring(10,value.length-2);return eval("("+value+")")}return value}));simhw_add(hw_obj);return ret}function simcore_native_get_signal(elto){return get_value(simhw_sim_signal(elto))>>>0}function simcore_native_set_signal(elto,value){set_value(simhw_sim_signal(elto),value);compute_behavior("FIRE "+elto);return value}function simcore_native_get_value(component,elto){var index=0;var sim_components=simhw_sim_components();var compo_index=component;if("BR"===component)compo_index="CPU";if("DEVICE"===component)compo_index="IO";if(typeof sim_components[compo_index].get_value!=="undefined"){return sim_components[compo_index].get_value(elto)}return false}function simcore_native_set_value(component,elto,value){var index=0;var sim_components=simhw_sim_components();var compo_index=component;if("BR"===component)compo_index="CPU";if("DEVICE"===component)compo_index="IO";if(typeof sim_components[compo_index].set_value!=="undefined"){return sim_components[compo_index].set_value(elto,value)}return false}function simcore_native_get_fields(signature_raw){var SIMWARE=get_simware();for(var key in SIMWARE.firmware){if(SIMWARE.firmware[key].signatureRaw===signature_raw){return SIMWARE.firmware[key].fields}}}function simcore_native_get_field_from_ir(fields,index){if(typeof fields[index]==="undefined"){ws_alert("simcore_native_get_field_from_ir: index ("+index+") out of range.");return false}var value=get_value(simhw_sim_state("REG_IR"));var left_shift=31-parseInt(fields[index].startbit);var right_shift=parseInt(fields[index].stopbit);value=value<>>left_shift;value=value>>>right_shift;return value}function simcore_native_deco(){compute_behavior("DECO")}function simcore_native_go_maddr(maddr){set_value(simhw_sim_state("MUXA_MICROADDR"),maddr)}function simcore_native_go_opcode(){var maddr=get_value(simhw_sim_state("ROM_MUXA"));set_value(simhw_sim_state("MUXA_MICROADDR"),maddr)}function simcore_native_go_instruction(signature_raw){var SIMWARE=get_simware();for(var key in SIMWARE.firmware){if(SIMWARE.firmware[key].signatureRaw===signature_raw){var maddr=SIMWARE.firmware[key]["mc-start"];set_value(simhw_sim_state("MUXA_MICROADDR"),maddr);return}}}function simcore_simstate_checklist2state(checklist){var o={};var ret=false;checklist=checklist.replace(/;|==|!=|>=|<=|=|>|v!=""));for(var i=0;i"===expected_result[compo][elto].op)diff.fulfill=parseInt(diff.obtained)>parseInt(diff.expected);else if("<"===expected_result[compo][elto].op)diff.fulfill=parseInt(diff.obtained)="===expected_result[compo][elto].op)diff.fulfill=parseInt(diff.obtained)>=parseInt(diff.expected);else if("<="===expected_result[compo][elto].op)diff.fulfill=parseInt(diff.obtained)<=parseInt(diff.expected);else if("=="===expected_result[compo][elto].op)diff.fulfill=diff.expected==diff.obtained;else if("!="===expected_result[compo][elto].op)diff.fulfill=diff.expected!=diff.obtained;d.result.push(diff);if(diff.fulfill===false)d.errors++}}if(newones_too&&typeof obtained_result[compo]!="undefined"){for(elto in obtained_result[compo]){d.neltos_obtained++;if(typeof expected_result[compo]!="undefined"&&typeof expected_result[compo][elto]!="undefined"){continue}diff={};diff.expected=obtained_result[compo][elto].default_value;diff.obtained=obtained_result[compo][elto].value;diff.fulfill=diff.expected===diff.obtained;diff.elto_type=compo.toLowerCase();diff.elto_id=obtained_result[compo][elto].id;diff.elto_op="=";d.result.push(diff);if(diff.fulfill===false)d.errors++}}}return d}function simcore_simstate_diff_results(expected_result,obtained_result){return simcore_simstate_check_results(expected_result,obtained_result,true)}function simcore_simstate_diff_states(before_state_obj,after_state_obj){var before_arr=simcore_simstate_state2checklist(before_state_obj,"").split(";");var after_arr=simcore_simstate_state2checklist(after_state_obj,"").split(";");return after_arr.filter((function(elto){return!before_arr.includes(elto)})).join(";").trim()}function simcore_simstate_checkreport2txt(checklist){var o="";for(var i=0;i"+""+""+"Type"+"IdentificationId."+"Values in the clipboard state"+"Values in the selected state"+""+""+"";for(var i=0;i"+""+checklist[i].elto_type+""+""+checklist[i].elto_id+""+""+checklist[i].elto_op+" "+checklist[i].expected+""+""+checklist[i].obtained+""+""}o+=""+"";return o}function simcore_voice_canSpeak(){if(typeof window.speechSynthesis=="undefined"){return false}if(false===get_cfg("use_voice")){return false}return true}function simcore_voice_speak(msg){var ssu=null;if(simcore_voice_canSpeak()){ssu=new SpeechSynthesisUtterance(msg);ssu.lang="es-ES";if("en"==get_cfg("ws_idiom"))ssu.lang="en-US";if("es"==get_cfg("ws_idiom"))ssu.lang="es-EN";window.speechSynthesis.speak(ssu)}}function simcore_voice_stopSpeak(){if(simcore_voice_canSpeak()){window.speechSynthesis.cancel()}}var simcore_rest={};function simcore_rest_reset(){simcore_rest={}}function simcore_rest_add(name,description){simcore_rest[name]={endpoint:description.endpoint,user:description.user,pass:description.pass,last_request:null}}function simcore_rest_list(){return simcore_rest}function simcore_rest_get(name){return simcore_rest[name]}function simcore_rest_call(name,method,uri,data){var rest_info=simcore_rest[name];if(typeof rest_info==="undefined"){return false}var api_endpoint=rest_info.endpoint;if(api_endpoint.value instanceof Vuex.Store){api_endpoint=get_value(api_endpoint)}if(api_endpoint.trim()===""){return false}var basic_auth="Basic "+btoa(rest_info.user+":"+rest_info.pass);var enc_data=JSON.stringify(data);var request={url:api_endpoint+uri,type:method,contentType:"application/json",accepts:"application/json",cache:false,dataType:"json",data:enc_data,beforeSend:function(xhr){if(rest_info.user.trim()!==""){xhr.setRequestHeader("Authorization",basic_auth)}},error:function(jqXHR){console.log("ajax error "+jqXHR.status)}};rest_info.last_request=$.ajax(request);return true}var simcore_notifications=[];function simcore_notifications_get(){return simcore_notifications}function simcore_notifications_reset(){simcore_notifications=[]}function simcore_notifications_add2(ntf){simcore_notifications.push({title:ntf.title,message:ntf.message,type:ntf.type,date:ntf.date})}function simcore_notifications_add(ntf_title,ntf_message,ntf_type,ntf_delay){simcore_notifications.push({title:$("

").html(ntf_title).text(),message:$("

").html(ntf_message).text(),type:ntf_type,date:(new Date).getTime()})}function get_value(sim_obj){if(sim_obj.value instanceof Vuex.Store){return sim_obj.value.state.value}return sim_obj.value}function set_value(sim_obj,value){if(sim_obj.value instanceof Vuex.Store){sim_obj.value.commit("set_value",value);return}var old_value=sim_obj.value;sim_obj.value=value;if(old_value!=value){sim_obj.changed=true}}function reset_value(sim_obj){if(sim_obj.value instanceof Vuex.Store){set_value(sim_obj,sim_obj.default_value);return}if(typeof sim_obj.default_value=="object"){sim_obj.changed=true;sim_obj.value=Object.create(sim_obj.default_value);return}if(sim_obj instanceof Array){sim_obj.changed=true;for(var i=0;i",""":'"',"'":"'"};function treatHTMLSequences(text_with_html){var re=null;var key=null;for(key in html_sequences){re=new RegExp(key,"gi");text_with_html=text_with_html.replace(re,html_sequences[key])}return text_with_html}function control_memory_getkeys(memory){return Object.keys(memory)}function control_memory_get(memory,elto){return memory[elto]}function control_memory_set(memory,elto,melto){if(typeof melto.changed==="undefined")melto.changed=false;if(typeof melto.state==="undefined")melto.state=false;if(typeof melto.breakpoint==="undefined")melto.breakpoint=false;if(typeof melto.notify==="undefined")melto.notify=[];if(typeof melto.is_native==="undefined")melto.is_native=false;var comments_str="";if(null!=melto.comments){comments_str=melto.comments;if(melto.comments instanceof Array)comments_str=melto.comments.join("\n");melto.state=melto.state||comments_str.trim().split("state:").length>1;melto.breakpoint=melto.breakpoint||comments_str.trim().split("break:").length>1;melto.notify=comments_str.trim().split("notify:");for(var k=0;k";if(active_verbal.trim()==="")active_verbal="";return"Activated signals are: "+active_signals+". Associated actions are: "+active_verbal}function main_memory_getkeys(memory){return Object.keys(memory)}function main_memory_get(memory,elto){return memory[elto]}function main_memory_set(memory,elto,melto){if(typeof melto.changed==="undefined")melto.changed=false;if(typeof melto.state==="undefined")melto.state=false;if(typeof melto.breakpoint==="undefined")melto.breakpoint=false;if(typeof melto.notify==="undefined")melto.notify=[];if(typeof melto.is_assembly==="undefined")melto.is_assembly=false;if(typeof melto.source==="undefined")melto.source="";var comments_str="";if(null!=melto.comments){comments_str=melto.comments.join("\n");melto.state=melto.state||comments_str.trim().split("state:").length>1;melto.breakpoint=melto.breakpoint||comments_str.trim().split("break:").length>1;melto.notify=comments_str.trim().split("notify:");for(var k=0;k>8;if(2==filter_elto)dbvalue=(value&16711680)>>16;if(3==filter_elto)dbvalue=(value&4278190080)>>24;break;case 1:if(0==filter_elto)dbvalue=value&65535;if(1==filter_elto)dbvalue=value&65535;if(2==filter_elto)dbvalue=(value&4294901760)>>16;if(3==filter_elto)dbvalue=(value&4294901760)>>16;break;case 2:if(0==filter_elto)dbvalue=value&16777215;if(1==filter_elto)dbvalue=value&4294967040;break;case 3:dbvalue=value;break}return dbvalue}function main_memory_updatevalues(value,dbvalue,filter_size,filter_elto){switch(filter_size){case 0:if(0==filter_elto)value=value&4294967040|dbvalue&255;if(1==filter_elto)value=value&4294902015|(dbvalue&255)<<8;if(2==filter_elto)value=value&4278255615|(dbvalue&255)<<16;if(3==filter_elto)value=value&16777215|(dbvalue&255)<<24;break;case 1:if(0==filter_elto)value=value&4294901760|dbvalue&65535;if(1==filter_elto)value=value&4294901760|dbvalue&65535;if(2==filter_elto)value=value&65535|(dbvalue&65535)<<16;if(3==filter_elto)value=value&65535|(dbvalue&65535)<<16;break;case 2:if(0==filter_elto)value=value&4278190080|dbvalue&16777215;if(1==filter_elto)value=value&255|dbvalue&4294967040;break;case 3:value=dbvalue;break}return value}function main_memory_get_program_counter(){var r_ref=simhw_sim_ctrlStates_get().pc;var r_value=null;if(typeof r_ref!=="undefined"){r_ref=simhw_sim_state(r_ref.state)}if(typeof r_ref!=="undefined"){r_value=get_value(r_ref)}return r_value}function main_memory_get_baseaddr(){var r_ref=simhw_sim_ctrlStates_get();if(typeof r_ref==="undefined"){return null}var parts=null;var r_value=0;var r_ref2=null;var all_baseaddr={};for(var elto in r_ref){if(r_ref[elto].is_pointer==false){continue}parts=r_ref[elto].state.split(".");if(parts[0]=="BR"){r_value=4294967292;r_ref2=simhw_sim_states().BR[parts[1]]}else{r_value=0;r_ref2=simhw_sim_state(r_ref[elto].state)}if(typeof r_ref2!=="undefined"){r_value=get_value(r_ref2)}all_baseaddr[elto]=r_value}return all_baseaddr}function get_deco_from_pc(pc){var mp_obj=simhw_internalState("MP");if(typeof mp_obj==="undefined"||typeof mp_obj[pc]==="undefined"||typeof mp_obj[pc].source==="undefined"){return""}return mp_obj[pc].source}function get_verbal_from_current_pc(){var pc_name=simhw_sim_ctrlStates_get().pc.state;var reg_pc=get_value(simhw_sim_state(pc_name));var pc=parseInt(reg_pc)-4;var decins=get_deco_from_pc(pc);if(""==decins.trim()){decins="not jet defined"}return"Current instruction is: "+decins+" and PC points to "+show_value(pc)+". "}function cache_memory_update_stats(memory,address,parts,r_w,m_h,clock_timestamp){memory.stats.n_access++;memory.stats.last_addr=address;memory.stats.last_parts=parts;memory.stats.last_r_w=r_w;memory.stats.last_h_m=m_h;if(m_h=="miss"){memory.stats.n_misses++}else{memory.stats.n_hits++}memory.sets[parts.set].tags[parts.tag].n_access++;if(r_w=="write"){memory.sets[parts.set].tags[parts.tag].dirty=1}memory.sets[parts.set].tags[parts.tag].timestamp=clock_timestamp}function cache_memory_select_victim(memory,set){var keys=Object.keys(memory.sets[set].tags);var tag_victim=0;if(memory.cfg.replace_pol=="lfu"){tag_victim=keys[0];var tag_naccess=memory.sets[parts.set].tags[tag_victim].n_access;for(var i=1;imemory.sets[parts.set].tags[keys[i]].n_access){tag_victim=keys[i];tag_naccess=memory.sets[parts.set].tags[tag_victim].n_access}}}else if(memory.cfg.replace_pol=="fifo"){tag_victim=keys[0];var tag_stamp=memory.sets[parts.set].tags[tag_victim].timestamp;for(var i=1;imemory.sets[parts.set].tags[keys[i]].timestamp){tag_victim=keys[i];tag_stamp=memory.sets[parts.set].tags[tag_victim].timestamp}}}else if(memory.cfg.replace_pol=="first"){tag_victim=keys[0]}return tag_victim}function cache_memory_init(name,via_size,off_size,set_size,replace_pol,su_pol,next_cache){var c={stats:{},cfg:{},sets:{}};c.cfg.name=name;c.cfg.via_size=via_size;c.cfg.off_size=off_size;c.cfg.set_size=set_size;c.cfg.vps_size=via_size-set_size;c.cfg.tag_size=32-set_size-off_size;c.cfg.mask_tag=Math.pow(2,c.cfg.tag_size)-1>>>0;c.cfg.mask_set=Math.pow(2,c.cfg.set_size)-1>>>0;c.cfg.mask_off=Math.pow(2,c.cfg.off_size)-1>>>0;c.cfg.mask_tag=c.cfg.mask_tag<<32-c.cfg.tag_size>>>0;c.cfg.mask_set=c.cfg.mask_set<>>0;c.cfg.replace_pol=replace_pol;c.cfg.su_pol=su_pol;c.cfg.next_cache=next_cache;c.stats.n_access=0;c.stats.n_hits=0;c.stats.n_misses=0;c.stats.last_addr=0;c.stats.last_parts=cache_memory_split(c,0);c.stats.last_r_w="";c.stats.last_h_m="";return c}function cache_memory_init2(cfg){return cache_memory_init(cfg.name,cfg.via_size,cfg.off_size,cfg.set_size,cfg.replace_pol,cfg.su_pol,cfg.next_cache)}function cache_memory_init3(array_cm_cfg){var array_cm=[];for(var i=0;i>>0;parts.tag=(address&memory.cfg.mask_tag)>>>32-memory.cfg.tag_size;parts.set=(address&memory.cfg.mask_set)>>>memory.cfg.off_size;parts.offset=address&memory.cfg.mask_off;return parts}function cache_memory_access(memory,address,r_w,clock_timestamp){if(memory.cfg.su_pol!="unified"){if("split_i"==memory.cfg.su_pol&&segments_addr_within_text(address)==false){return false}if("split_d"==memory.cfg.su_pol&&segments_addr_within_data(address)==false){return false}}var parts=cache_memory_split(memory,address);if(typeof memory.sets[parts.set]=="undefined"){memory.sets[parts.set]={tags:{},number_tags:0}}if(typeof memory.sets[parts.set].tags[parts.tag]!="undefined"&&memory.sets[parts.set].tags[parts.tag].valid==1){cache_memory_update_stats(memory,address,parts,r_w,"hit",clock_timestamp);return true}if(typeof memory.sets[parts.set].number_tags>3){var tag_victim=cache_memory_select_victim(memory,parts.set);memory.sets[parts.set].tags[tag_victim].valid=0;memory.sets[parts.set].number_tags--}memory.sets[parts.set].tags[parts.tag]={n_access:0,valid:1,dirty:0};memory.sets[parts.set].number_tags++;cache_memory_update_stats(memory,address,parts,r_w,"miss",clock_timestamp);if(memory.cfg.next_cache!=null){cache_memory_access(memory.cfg.next_cache,address,r_w)}return false}var sim={systems:[],active:null,index:0};function simhw_add(newElto){var found=-1;for(var m=0;m=0&&sim.systems.length>=newActive){sim.active=sim.systems[newActive];sim.index=newActive}compile_behaviors();firedep_to_fireorder(jit_fire_dep);compute_references();compile_verbals()}function simhw_getIdByName(short_name){for(var m=0;m>>0).toString(16)}function check_behavior(){if(0==simhw_sim_signals().length){ws_alert("ALERT: empty signals!!!")}if(0==simhw_sim_states().length){ws_alert("ALERT: empty states!!!")}for(var key in simhw_sim_signals()){for(var key2 in simhw_sim_signal(key).behavior){var behaviors=simhw_sim_signal(key).behavior[key2].split(";");for(var i=0;i "+behavior_k[0]+" ("+behavior_i+")");return}if(behavior_k.length!=simhw_syntax_behavior(behavior_k[0]).nparameters){ws_alert("ALERT: Behavior has an incorrect number of elements --\x3e "+behavior_i+"/"+simhw_syntax_behavior(behavior_k[0]).nparameters);return}for(var j=1;j '"+behavior_i);return}else if("S"==t&&typeof simhw_sim_signal(s[0])=="undefined"){ws_alert("ALERT: Behavior has an undefined reference to a signal -> '"+behavior_i);return}else if("X"==t&&typeof simhw_sim_state(s[0])=="undefined"&&typeof simhw_sim_signal(s[0])=="undefined"){ws_alert("ALERT: Behavior has an undefined reference to a object state OR signal -> '"+behavior_i);return}}}}}}var jit_behaviors=false;var jit_verbals=false;var jit_fire_dep=null;var jit_fire_order=null;var jit_dep_network=null;var jit_fire_ndep=null;function firedep_to_fireorder(jit_fire_dep){var allfireto=false;jit_fire_order=[];jit_fire_ndep=[];for(var sig in simhw_sim_signals()){if(typeof jit_fire_dep[sig]=="undefined"){jit_fire_order.push(sig);continue}ndep=0;allfireto=false;for(var sigorg in jit_fire_dep[sig]){ndep++;if(jit_fire_dep[sig][sigorg]==simhw_sim_signal(sigorg).behavior.length){allfireto=true}}jit_fire_ndep[sig]=ndep;if(allfireto==false)jit_fire_order.push(sig)}}function compile_behaviors(){var jit_bes="";jit_fire_dep={};var sig_obj=null;var expr_obj=null;for(var sig in simhw_sim_signals()){jit_bes+="simhw_sim_signal('"+sig+"').behavior_fn = new Array();\n";for(var val in simhw_sim_signal(sig).behavior){var input_behavior=simhw_sim_signal(sig).behavior[val];var jit_be="";var s_exprs=input_behavior.split(";");for(var i=0;i"+v+"";if("Signals"!=enum_name)o+="("+(i+1)+") "+v;else o+="("+(i+1)+") "+hash_eltos[array_eltos[i]].ref+": "+v;if(i!=array_eltos.length-1){o+=str_enditem}}o+=". ";return o}function simhwelto_describe_component_enum(elto_path,array_eltos,hash_eltos,enum_name){var o="";o+=""+i18n_get_TagFor("hw","It has")+""+" "+array_eltos.length+" "+""+i18n_get_TagFor("hw",enum_name)+""+": "+simhwelto_describe_component_enum_aux(elto_path,array_eltos,hash_eltos,enum_name,", ");return o}function simhwelto_describe_component(elto_path,elto,format){var o="";o+=elto.description+".

    "+"
  • "+simhwelto_describe_component_enum(elto_path+":states:",elto.states_inputs,elto.states,"inputs")+"
    "+"
  • "+simhwelto_describe_component_enum(elto_path+":states:",elto.states_outputs,elto.states,"outputs")+"
    "+"
  • "+simhwelto_describe_component_enum(elto_path+":signals:",elto.signals_inputs,elto.signals,"signals")+"
    "+"
";if(format!="html"){o.replace(/<[^>]*>?/gm,"")}return o}var ep_def={sim_name:"Elemental Processor",sim_short_name:"ep",sim_img_processor:"examples/hardware/ep/images/processor.svg",sim_img_controlunit:"examples/hardware/ep/images/controlunit.svg",sim_img_cpu:"examples/hardware/ep/images/cpu.svg",components:{},states:{},signals:{},behaviors:{},elements:{},internal_states:{},ctrl_states:{},events:{}};simhw_add(ep_def);sim.ep.behaviors.PRINT_S={nparameters:2,types:["S"],operation:function(s_expr){console.log(s_expr[1]+": 0x"+sim.ep.signals[s_expr[1]].value.toString(16))},verbal:function(s_expr){return"Print value of signal "+s_expr[1]+": 0x"+sim.ep.signals[s_expr[1]].value.toString(16)+". "}};sim.ep.behaviors.PRINT_E={nparameters:2,types:["E"],operation:function(s_expr){console.log(s_expr[1]+": 0x"+sim.ep.states[s_expr[1]].value.toString(16))},verbal:function(s_expr){return"Print value of state "+s_expr[1]+": 0x"+sim.ep.states[s_expr[1]].value.toString(16)+". "}};sim.ep.components["CPU"]={name:"CPU",version:"1",abilities:["CPU"],details_name:["REGISTER_FILE","CONTROL_MEMORY","CLOCK","CPU_STATS"],details_fire:[["svg_p:text3029","svg_p:text3031"],["svg_cu:text3010"],["svg_p:text3459-7","svg_cu:text4138","svg_cu:text4138-7"],["svg_p:text3495"]],write_state:function(vec){if(typeof vec.CPU=="undefined"){vec.CPU={}}var internal_reg=["PC","SR"];var value=0;for(var i=0;i>>0;if(value!=0){vec.CPU["R"+i]={type:"register",default_value:0,id:"R"+i,op:"=",value:"0x"+value.toString(16)}}}for(i=0;i>>0;if(value!=0){vec.CPU[internal_reg[i]]={type:"register",default_value:0,id:internal_reg[i],op:"=",value:"0x"+value.toString(16)}}}return vec},read_state:function(vec,check){if(typeof vec.CPU=="undefined"){vec.CPU={}}var key=check["id"].toUpperCase().trim();var val=parseInt(check["value"]).toString(16);if("REGISTER"==check["type"].toUpperCase().trim()){vec.CPU[key]={type:"register",default_value:0,id:key,op:check["condition"],value:"0x"+val};return true}return false},get_state:function(reg){var value=0;var r_reg=reg.toUpperCase().trim();if(typeof sim.ep.states["REG_"+r_reg]!="undefined"){value=get_value(sim.ep.states["REG_"+r_reg])>>>0;return"0x"+value.toString(16)}r_reg=r_reg.replace("R","");var index=parseInt(r_reg);if(typeof sim.ep.states.BR[index]!="undefined"){value=get_value(sim.ep.states.BR[index])>>>0;return"0x"+value.toString(16)}return null},get_value:function(elto){if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index))return get_value(simhw_sim_state(elto))>>>0;return get_value(simhw_sim_states().BR[index])>>>0},set_value:function(elto,value){var pc_name=simhw_sim_ctrlStates_get().pc.state;if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index)){set_value(simhw_sim_state(elto),value);if(pc_name===elto){show_asmdbg_pc()}return value}return set_value(simhw_sim_states().BR[index],value)}};sim.ep.ctrl_states.pc={name:"PC",state:"REG_PC",is_pointer:true};sim.ep.ctrl_states.sp={name:"SP",state:"BR.29",is_pointer:true};sim.ep.ctrl_states.fp={name:"FP",state:"BR.30",is_pointer:true};sim.ep.ctrl_states.ir={name:"IR",state:"REG_IR",default_eltos:{co:{begin:0,end:5,length:6},cop:{begin:28,end:31,length:4}},is_pointer:false};sim.ep.ctrl_states.mpc={name:"mPC",state:"REG_MICROADDR",is_pointer:false};sim.ep.internal_states.MC={};sim.ep.internal_states.ROM={};sim.ep.internal_states.FIRMWARE=ws_empty_firmware;sim.ep.internal_states.io_hash={};sim.ep.internal_states.fire_stack=[];sim.ep.internal_states.tri_state_names=["T1","T2","T3","T4","T5","T6","T7","T8","T9","T10","T11","T12"];sim.ep.internal_states.fire_visible={databus:false,internalbus:false};sim.ep.internal_states.filter_states=["REG_IR_DECO,col-12","REG_IR,col-auto","REG_PC,col-auto","REG_MAR,col-auto","REG_MBR,col-auto","REG_RT1,col-auto","REG_RT2,col-auto","REG_RT3,col-auto","REG_SR,col-auto","REG_MICROADDR,col-auto"];sim.ep.internal_states.filter_signals=["A0,0","B,0","C,0","SELA,5","SELB,5","SELC,2","SELCOP,0","MR,0","MC,0","C0,0","C1,0","C2,0","C3,0","C4,0","C5,0","C6,0","C7,0","T1,0","T2,0","T3,0","T4,0","T5,0","T6,0","T7,0","T8,0","T9,0","T10,0","T11,0","M1,0","M2,0","M7,0","MA,0","MB,0","SELP,0","LC,0","SE,0","SIZE,0","OFFSET,0","BW,0","R,0","W,0","TA,0","TD,0","IOR,0","IOW,0","TEST_I,0","TEST_U,0"];sim.ep.internal_states.alu_flags={flag_n:0,flag_z:0,flag_v:0,flag_c:0};sim.ep.states.BR=[];sim.ep.states.BR[0]={name:"R0",verbal:"Register 0",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[1]={name:"R1",verbal:"Register 1",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[2]={name:"R2",verbal:"Register 2",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[3]={name:"R3",verbal:"Register 3",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[4]={name:"R4",verbal:"Register 4",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[5]={name:"R5",verbal:"Register 5",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[6]={name:"R6",verbal:"Register 6",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[7]={name:"R7",verbal:"Register 7",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[8]={name:"R8",verbal:"Register 8",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[9]={name:"R9",verbal:"Register 9",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[10]={name:"R10",verbal:"Register 10",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[11]={name:"R11",verbal:"Register 11",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[12]={name:"R12",verbal:"Register 12",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[13]={name:"R13",verbal:"Register 13",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[14]={name:"R14",verbal:"Register 14",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[15]={name:"R15",verbal:"Register 15",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[16]={name:"R16",verbal:"Register 16",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[17]={name:"R17",verbal:"Register 17",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[18]={name:"R18",verbal:"Register 18",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[19]={name:"R19",verbal:"Register 19",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[20]={name:"R20",verbal:"Register 20",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[21]={name:"R21",verbal:"Register 21",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[22]={name:"R22",verbal:"Register 22",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[23]={name:"R23",verbal:"Register 23",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[24]={name:"R24",verbal:"Register 24",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[25]={name:"R25",verbal:"Register 25",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[26]={name:"R26",verbal:"Register 26",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[27]={name:"R27",verbal:"Register 27",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[28]={name:"R28",verbal:"Register 28",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[29]={name:"R29",verbal:"Register 29",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[30]={name:"R30",verbal:"Register 30",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[31]={name:"R31",verbal:"Register 31",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_PC"]={name:"PC",verbal:"Program Counter Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_MAR"]={name:"MAR",verbal:"Memory Address Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_MBR"]={name:"MBR",verbal:"Memory Data Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_IR"]={name:"IR",verbal:"Instruction Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_RT1"]={name:"RT1",verbal:"Temporal 1 Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_RT2"]={name:"RT2",verbal:"Temporal 2 Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_RT3"]={name:"RT3",verbal:"Temporal 3 Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_SR"]={name:"SR",verbal:"State Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BUS_IB"]={name:"I_BUS",verbal:"Internal Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BUS_AB"]={name:"A_BUS",verbal:"Address Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BUS_CB"]={name:"C_BUS",verbal:"Control Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BUS_DB"]={name:"D_BUS",verbal:"Data Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["C2_T2"]={name:"C2_T2",verbal:"Output of PC",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["RA_T9"]={name:"RA_T9",verbal:"Input of T9 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["RB_T10"]={name:"RB_T10",verbal:"Input of T10 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["HPC_T12"]={name:"HPC_T12",verbal:"Input of T12 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["SELEC_T3"]={name:"SELEC_T3",verbal:"Input of T3 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["SELP_M7"]={name:"SELP_M7",verbal:"Output of MUX SelP",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["ALU_C6"]={name:"ALU_C6",verbal:"Input of Temporal 3 Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["MA_ALU"]={name:"MA_ALU",verbal:"Input ALU via MA",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["MB_ALU"]={name:"MB_ALU",verbal:"Input ALU via MB",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_C"]={name:"FLAG_C",verbal:"Carry Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_V"]={name:"FLAG_V",verbal:"Overflow Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_N"]={name:"FLAG_N",verbal:"Negative Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_Z"]={name:"FLAG_Z",verbal:"Zero Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_I"]={name:"FLAG_I",verbal:"Interruption Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_U"]={name:"FLAG_U",verbal:"User Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_MICROADDR"]={name:"µADDR",verbal:"Microaddress Register",visible:true,nbits:"12",value:0,default_value:0,draw_data:["svg_cu:text4667"]};sim.ep.states["REG_MICROINS"]={name:"µINS",verbal:"Microinstruction Register",visible:true,nbits:"77",value:{},default_value:{},draw_data:[]};sim.ep.states["FETCH"]={name:"FETCH",verbal:"Input Fetch",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.ep.states["ROM_MUXA"]={name:"ROM_MUXA",verbal:"Input ROM",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.ep.states["SUM_ONE"]={name:"SUM_ONE",verbal:"Input next microinstruction",visible:false,nbits:"12",value:1,default_value:1,draw_data:[]};sim.ep.states["MUXA_MICROADDR"]={name:"MUXA_MICROADDR",verbal:"Input microaddress",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.ep.states["MUXC_MUXB"]={name:"MUXC_MUXB",verbal:"Output of MUX C",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["INEX"]={name:"INEX",verbal:"Illegal Instruction Exception",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["BS_M1"]={name:"BS_M1",verbal:"from Memory",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BS_TD"]={name:"BS_TD",verbal:"Memory",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["INTV"]={name:"INTV",verbal:"Interruption Vector",visible:false,nbits:"8",value:0,default_value:0,draw_data:[]};sim.ep.states["M2_C2"]={name:"M2_C2",verbal:"Input of Program Counter",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["M1_C1"]={name:"M1_C1",verbal:"Input of Memory Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["M7_C7"]={name:"M7_C7",verbal:"Input of State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["VAL_ZERO"]={name:"VAL_ZERO",verbal:"Wired Zero",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["VAL_ONE"]={name:"VAL_ONE",verbal:"Wired One",visible:false,nbits:"32",value:1,default_value:1,draw_data:[]};sim.ep.states["VAL_FOUR"]={name:"VAL_FOUR",verbal:"Wired Four",visible:false,nbits:"32",value:4,default_value:4,draw_data:[]};sim.ep.states["REG_IR_DECO"]={name:"IR_DECO",verbal:"Instruction Decoded",visible:true,nbits:"0",value:0,default_value:0,draw_data:[]};sim.ep.states["DECO_INS"]={name:"DECO_INS",verbal:"Instruction decoded in binary",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["CLK"]={name:"CLK",verbal:"Clock",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["ACC_TIME"]={name:"ACC_TIME",verbal:"Accumulated CPU time",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["TTCPU"]={name:"TTCPU",verbal:"Several Tristates to the internal data bus in CPU activated",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["ACC_PWR"]={name:"ACC_PWR",verbal:"Accumulated Energy Consumption",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.signals["C"]={name:"C",visible:true,type:"L",value:0,default_value:0,nbits:"4",behavior:["MV MUXC_MUXB VAL_ZERO; FIRE B","MBIT MUXC_MUXB INT 0 1; FIRE B","MBIT MUXC_MUXB IORDY 0 1; FIRE B","MBIT MUXC_MUXB MRDY 0 1; FIRE B","MBIT MUXC_MUXB REG_SR 0 1; FIRE B","MBIT MUXC_MUXB REG_SR 1 1; FIRE B","MBIT MUXC_MUXB REG_SR 28 1; FIRE B","MBIT MUXC_MUXB REG_SR 29 1; FIRE B","MBIT MUXC_MUXB REG_SR 30 1; FIRE B","MBIT MUXC_MUXB REG_SR 31 1; FIRE B","MV MUXC_MUXB INEX; FIRE B"],fire_name:["svg_cu:text3410"],draw_data:[["svg_cu:path3108"],["svg_cu:path3062"],["svg_cu:path3060"],["svg_cu:path3136"],["svg_cu:path3482"],["svg_cu:path3480"],["svg_cu:path3488"],["svg_cu:path3486"],["svg_cu:path3484"],["svg_cu:path3484-9"],["svg_cu:path3108-3","svg_cu:path3260-3-8-6","svg_cu:path3260-3-8","svg_cu:path3260-3"]],draw_name:[["svg_cu:path3496","svg_cu:path3414","svg_cu:path3194-08"]]};sim.ep.signals["B"]={name:"B",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV A1 MUXC_MUXB; FIRE A1","NOT_ES A1 MUXC_MUXB; FIRE A1"],depends_on:["CLK"],fire_name:["svg_cu:text3408"],draw_data:[["svg_cu:path3100-8-7","svg_cu:path3108-1"],["svg_cu:path3392","svg_cu:path3372","svg_cu:path3390","svg_cu:path3384","svg_cu:path3100-8-7"]],draw_name:[[],["svg_cu:path3194-0","svg_cu:path3138-8","svg_cu:path3498-6"]]};sim.ep.signals["A0"]={name:"A0",visible:false,type:"L",value:0,default_value:0,nbits:"1",behavior:["SBIT_SIGNAL A0A1 0 1; FIRE A0A1","SBIT_SIGNAL A0A1 1 1; FIRE A0A1"],depends_on:["CLK"],fire_name:["svg_cu:text3406"],draw_data:[["svg_cu:path3096"],["svg_cu:path3096"]],draw_name:[[],["svg_cu:path3138-8-1","svg_cu:path3098-2","svg_cu:path3124-2-5"]]};sim.ep.signals["A1"]={name:"A1",visible:false,type:"L",value:0,default_value:0,nbits:"1",behavior:["SBIT_SIGNAL A0A1 0 0; FIRE A0A1","SBIT_SIGNAL A0A1 1 0; FIRE A0A1"],depends_on:["CLK"],fire_name:[],draw_data:[["svg_cu:path3094"],["svg_cu:path3094"]],draw_name:[[]]};sim.ep.signals["A0A1"]={name:"A0A1",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["PLUS1 MUXA_MICROADDR REG_MICROADDR","CP_FIELD MUXA_MICROADDR REG_MICROINS/MADDR","MV MUXA_MICROADDR ROM_MUXA","MV MUXA_MICROADDR FETCH"],depends_on:["CLK"],fire_name:[],draw_data:[["svg_cu:path3102","svg_cu:path3100","svg_cu:path3098","svg_cu:path3100-9","svg_cu:path3088"],["svg_cu:path3104","svg_cu:path3134","svg_cu:path3500","svg_cu:path3416"],["svg_cu:path3504","svg_cu:path3100-8","svg_cu:path3234-9"],["svg_cu:path3124"]],draw_name:[[]]};sim.ep.signals["C0"]={name:"C0",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_MAR BUS_IB"],fire_name:["svg_p:text3077"],draw_data:[["svg_p:path3081"]],draw_name:[["svg_p:path3075"]]};sim.ep.signals["C1"]={name:"C1",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_MBR M1_C1"],fire_name:["svg_p:text3079"],draw_data:[["svg_p:path3055"]],draw_name:[["svg_p:path3073"]]};sim.ep.signals["C2"]={name:"C2",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_PC M2_C2; UPDATEDPC"],fire_name:["svg_p:text3179"],draw_data:[["svg_p:path3485"]],draw_name:[["svg_p:path3177"]]};sim.ep.signals["C3"]={name:"C3",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_IR BUS_IB; DECO; FIRE_IFSET C 10"],fire_name:["svg_p:text3439"],draw_data:[["svg_p:path3339"]],draw_name:[["svg_p:path3337"]]};sim.ep.signals["C4"]={name:"C4",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_RT1 BUS_IB"],fire_name:["svg_p:text3441"],draw_data:[["svg_p:path3263"]],draw_name:[["svg_p:path3255"]]};sim.ep.signals["C5"]={name:"C5",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_RT2 BUS_IB"],fire_name:["svg_p:text3443"],draw_data:[["svg_p:path3277"]],draw_name:[["svg_p:path3269"]]};sim.ep.signals["C6"]={name:"C6",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_RT3 ALU_C6"],fire_name:["svg_p:text3445"],draw_data:[["svg_p:path3325","svg_p:path3323","svg_p:path3321","svg_p:path3261-8","svg_p:path3317-9","svg_p:path3901-6-9"]],draw_name:[["svg_p:path3245"]]};sim.ep.signals["C7"]={name:"C7",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_SR M7_C7"],fire_name:["svg_p:text3655"],draw_data:[["svg_p:path3651-9"]],draw_name:[["svg_p:path3681"]]};sim.ep.signals["TA"]={name:"TA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MV BUS_AB REG_MAR; MOVE_BITSE A1A0 0 2 BUS_AB 0; FIRE_IFCHANGED A1A0 A1A0"],fire_name:["svg_p:text3091"],draw_data:[["svg_p:path3083","svg_p:path3089","svg_p:path3597","svg_p:path3513","svg_p:path3601","svg_p:path3601-2","svg_p:path3187","svg_p:path3087","svg_p:path2995","svg_p:path3535"]],draw_name:[["svg_p:path3085"]]};sim.ep.signals["TD"]={name:"TD",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; CHECK_RTD","MV BUS_DB BS_TD; MOVE_BITSE A1A0 0 2 BUS_AB 0; FIRE_IFCHANGED A1A0 A1A0; CHECK_RTD"],fire_name:["svg_p:text3103"],draw_data:[["svg_p:path3093","svg_p:path3101","svg_p:path3587","svg_p:path3515","svg_p:path3071","svg_p:path3419","svg_p:path3099","svg_p:path3097","svg_p:path3559-5","svg_p:path3419-1-0","svg_p:path3583","svg_p:path3419-1","svg_p:path3491","svg_p:path3641","svg_p:path3541"]],draw_name:[["svg_p:path3095"]]};sim.ep.signals["T1"]={name:"T1",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 0","MV BUS_IB REG_MBR; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 0"],fire_name:["svg_p:text3105"],draw_data:[["svg_p:path3065","svg_p:path3071","svg_p:path3049","svg_p:path3063-9","svg_p:path3071","svg_p:path3071","svg_p:path3069"]],draw_name:[["svg_p:path3067"]]};sim.ep.signals["T2"]={name:"T2",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 1","MV BUS_IB REG_PC; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 1"],fire_name:["svg_p:text3449"],draw_data:[["svg_p:path3195","svg_p:path3199","svg_p:path3201","svg_p:path3049"]],draw_name:[["svg_p:path3329"]]};sim.ep.signals["T3"]={name:"T3",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 2","MV BUS_IB SELEC_T3; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 2"],fire_name:["svg_p:text3451"],draw_data:[["svg_p:path3347","svg_p:path3349","svg_p:path3931","svg_p:path3345","svg_p:path3049"]],draw_name:[["svg_p:path3351"]]};sim.ep.signals["T4"]={name:"T4",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 3","MV BUS_IB REG_RT1; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 3"],fire_name:["svg_p:text3453"],draw_data:[["svg_p:path3257","svg_p:path3261","svg_p:path3259","svg_p:path3049"]],draw_name:[["svg_p:path3305"]]};sim.ep.signals["T5"]={name:"T5",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 4","MV BUS_IB REG_RT2; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 4"],fire_name:["svg_p:text3455"],draw_data:[["svg_p:path3271","svg_p:path3275","svg_p:path3273","svg_p:path3049"]],draw_name:[["svg_p:path3307"]]};sim.ep.signals["T6"]={name:"T6",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 5","MV BUS_IB ALU_C6; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 5"],fire_name:["svg_p:text3457"],draw_data:[["svg_p:path3315","svg_p:path3589","svg_p:path3317","svg_p:path3163-2","svg_p:path3049","svg_p:path3321","svg_p:path3261-8","svg_p:path3317-9","svg_p:path3901-6-9"]],draw_name:[["svg_p:path3319"]]};sim.ep.signals["T7"]={name:"T7",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 6","MV BUS_IB REG_RT3; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 6"],fire_name:["svg_p:text3459"],draw_data:[["svg_p:path3309","svg_p:path3327","svg_p:path3311","svg_p:path3049"]],draw_name:[["svg_p:path3313"]]};sim.ep.signals["T8"]={name:"T8",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 7","MV BUS_IB REG_SR; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 7"],fire_name:["svg_p:text3657"],draw_data:[["svg_p:path3645","svg_p:path3651","svg_p:path3647","svg_p:path3049"]],draw_name:[["svg_p:path3649"]]};sim.ep.signals["T9"]={name:"T9",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 8","MV BUS_IB RA_T9; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 8"],fire_name:["svg_p:text3147"],draw_data:[["svg_p:path3131","svg_p:path3143","svg_p:path3139","svg_p:path3049","svg_p:path3143-9"]],draw_name:[["svg_p:path3133"]]};sim.ep.signals["T10"]={name:"T10",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 9","MV BUS_IB RB_T10; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 9"],fire_name:["svg_p:text3149"],draw_data:[["svg_p:path3135","svg_p:path3145","svg_p:path3141","svg_p:path3049","svg_p:path3145-5"]],draw_name:[["svg_p:path3137"]]};sim.ep.signals["T11"]={name:"T11",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 10","CP_FIELD BUS_IB REG_MICROINS/EXCODE; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 10"],fire_name:["svg_p:text3147-5","svg_cu:tspan4426"],draw_data:[["svg_p:path3131-3","svg_p:path3145","svg_p:path3081-3","svg_p:path3139-7","svg_p:path3049","svg_cu:path3081-3","svg_cu:path3139-7"]],draw_name:[["svg_p:path3133-6","svg_cu:path3133-6"]]};sim.ep.signals["T12"]={name:"T12",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 11","MV BUS_IB HPC_T12; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 11"],fire_name:["svg_p:text3147-5-0-1-1"],draw_data:[["svg_p:path3131-3-8-4-31","svg_p:path3139-7-1-4-3","svg_p:path3049","svg_p:path3081-3-8-5-3"]],draw_name:[["svg_p:path3133-6-9-7-5"]]};sim.ep.signals["M1"]={name:"M1",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M1_C1 BUS_IB","MV M1_C1 BS_M1"],depends_on:["C1"],fire_name:["svg_p:text3469"],draw_data:[["svg_p:path3063","svg_p:path3061","svg_p:path3059"],["svg_p:path3057","svg_p:path3641","svg_p:path3419","svg_p:path3583"]],draw_name:[[],["svg_p:path3447"]]};sim.ep.signals["M2"]={name:"M2",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M2_C2 BUS_IB","PLUS4 M2_C2 REG_PC"],depends_on:["C2"],fire_name:["svg_p:text3471"],draw_data:[["svg_p:path3217","svg_p:path3215","svg_p:path3213","svg_p:path3213-9"],["svg_p:path3211","svg_p:path3209","svg_p:path3193","svg_p:path3207","svg_p:path3197","svg_p:path3201"]],draw_name:[[],["svg_p:path3467","svg_p:path3467"]]};sim.ep.signals["M7"]={name:"M7",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M7_C7 BUS_IB","MV M7_C7 SELP_M7"],depends_on:["C7"],fire_name:["svg_p:text3673"],draw_data:[["svg_p:path3691","svg_p:path3693","svg_p:path3659"],["svg_p:path3695"]],draw_name:[[],["svg_p:path3667"]]};sim.ep.signals["MA"]={name:"MA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV MA_ALU RA_T9; FIRE COP","MV MA_ALU REG_RT1; FIRE COP"],depends_on:["SELA","SELB"],fire_name:["svg_p:text3463"],draw_data:[["svg_p:path3249","svg_p:path3161","svg_p:path3165"],["svg_p:path3279"]],draw_name:[[],["svg_p:path3423"]]};sim.ep.signals["MB"]={name:"MB",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MV MB_ALU RB_T10; FIRE COP","MV MB_ALU REG_RT2; FIRE COP","MV MB_ALU VAL_FOUR; FIRE COP","MV MB_ALU VAL_ONE; FIRE COP"],depends_on:["SELA","SELB"],fire_name:["svg_p:text3465"],draw_data:[["svg_p:path3281","svg_p:path3171","svg_p:path3169"],["svg_p:path3283"],["svg_p:path3295","svg_p:path3293"],["svg_p:path3297","svg_p:path3299"]],draw_name:[[],["svg_p:path3425","svg_p:path3427"]]};sim.ep.signals["MH"]={name:"MH",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MV HPC_T12 CLK","MV HPC_T12 ACC_TIME","MV HPC_T12 ACC_PWR","NOP"],fire_name:["svg_p:text3147-5-0-1-8-4"],draw_data:[[],["svg_p:path3081-3-8-5-3"]],draw_name:[[],["svg_p:path3306-8-7-6"]]};sim.ep.signals["COP"]={name:"COP",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["NOP_ALU; UPDATE_NZVC","AND ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","OR ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","NOT ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","XOR ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SRL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SRA ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","RR ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","RL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","ADD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SUB ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MUL ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","DIV ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MOD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","LUI ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FADD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FSUB ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FMUL ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FDIV ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FCVT ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FCLASS ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","ADDU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SUBU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MULU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","DIVU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU"],depends_on:["SELCOP"],fire_name:["svg_p:text3303"],draw_data:[["svg_p:path3237","svg_p:path3239","svg_p:path3261-8","svg_p:path3321","svg_p:path3901-6","svg_p:path3317-9"]],draw_name:[["svg_p:path3009","svg_p:path3301"]]};sim.ep.signals["SELP"]={name:"SELP",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["NOP","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_U 0; FIRE M7","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_I 1; FIRE M7","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_C 31; UPDATE_FLAG SELP_M7 FLAG_V 30; UPDATE_FLAG SELP_M7 FLAG_N 29; UPDATE_FLAG SELP_M7 FLAG_Z 28; FIRE M7"],fire_name:["svg_p:text3703"],draw_data:[[],["svg_p:path3643"],["svg_p:path3705"],["svg_p:path3675","svg_p:path3331"]],draw_name:[[],["svg_p:path3697"]]};sim.ep.signals["SELA"]={name:"SELA",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE MR_RA"],depends_on:["RA"],fire_name:["svg_cu:text3164"],draw_data:[[]],draw_name:[[]]};sim.ep.signals["SELB"]={name:"SELB",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE MR_RB"],depends_on:["RB"],fire_name:["svg_cu:text3168"],draw_data:[[]],draw_name:[[]]};sim.ep.signals["SELC"]={name:"SELC",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE MR_RC"],depends_on:["RC"],fire_name:["svg_cu:text3172"],draw_data:[[]],draw_name:[[]]};sim.ep.signals["SELCOP"]={name:"SELCOP",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE MC"],depends_on:["COP"],fire_name:["svg_cu:text3312"],draw_data:[[]],draw_name:[[]]};sim.ep.signals["EXCODE"]={name:"EXCODE",visible:true,type:"L",value:0,default_value:0,nbits:"4",behavior:["FIRE T11"],fire_name:["svg_cu:text3312-6"],draw_data:[[]],draw_name:[]};sim.ep.signals["RA"]={name:"RA",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["GET RA_T9 BR RA; FIRE_IFSET T9 1; FIRE_IFSET MA 0"],depends_on:["SELA"],fire_name:["svg_p:text3107"],draw_data:[[]],draw_name:[["svg_p:path3109"]]};sim.ep.signals["RB"]={name:"RB",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["GET RB_T10 BR RB; FIRE_IFSET T10 1; FIRE_IFSET MB 0"],depends_on:["SELB"],fire_name:["svg_p:text3123"],draw_data:[[]],draw_name:[["svg_p:path3113"]]};sim.ep.signals["RC"]={name:"RC",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["FIRE LC"],depends_on:["SELC"],fire_name:["svg_p:text3125"],draw_data:[[]],draw_name:[["svg_p:path3117"]]};sim.ep.signals["LC"]={name:"LC",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","SET BR RC BUS_IB"],fire_name:["svg_p:text3127"],draw_data:[["svg_p:path3153","svg_p:path3151","svg_p:path3129"]],draw_name:[["svg_p:path3121"]]};sim.ep.signals["SE"]={name:"SE",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3; MOVE_BITS SBWA 4 1 SE; FIRE_IFCHANGED SBWA SE","MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3; MOVE_BITS SBWA 4 1 SE; FIRE_IFCHANGED SBWA SE"],depends_on:["T3"],fire_name:["svg_p:text3593","svg_p:text3431"],draw_data:[[]],draw_name:[["svg_p:path3591","svg_p:path3447-7-7"]]};sim.ep.signals["SIZE"]={name:"SIZE",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3363"],draw_data:[[]],draw_name:[["svg_p:path3355"]]};sim.ep.signals["OFFSET"]={name:"OFFSET",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3707"],draw_data:[[]],draw_name:[["svg_p:path3359"]]};sim.ep.signals["MC"]={name:"MC",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT COP REG_IR 0 5; FIRE COP;","CP_FIELD COP REG_MICROINS/SELCOP; FIRE COP;"],depends_on:["SELCOP"],fire_name:["svg_cu:text3322","svg_cu:text3172-1-5"],draw_data:[["svg_cu:path3320","svg_cu:path3142"],["svg_cu:path3318","svg_cu:path3502-6"]],draw_name:[[],["svg_cu:path3306"]]};sim.ep.signals["MR"]={name:"MR",verbal:["Copy from IR[SelA], from IR[SelB], and from IR[SelB] into RA, RB, and RC. ","Copy SelA, SelB, and SelB into RA, RB, and RC. "],visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV MR_RA MR; FIRE MR_RA; MV MR_RB MR; FIRE MR_RB; MV MR_RC MR; FIRE MR_RC;","MV MR_RA MR; FIRE MR_RA; MV MR_RB MR; FIRE MR_RB; MV MR_RC MR; FIRE MR_RC;"],depends_on:["SELA","SELB","SELC"],fire_name:["svg_cu:text3222","svg_cu:text3242","svg_cu:text3254","svg_cu:text3172-1"],draw_data:[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3260","svg_cu:path3196","svg_cu:path3278","svg_cu:path3292","svg_cu:path3142","svg_cu:path3258-4","svg_cu:path3390-7","svg_cu:path3258","svg_cu:path3280"],["svg_cu:path3270","svg_cu:path3282","svg_cu:path3300","svg_cu:path3258","svg_cu:path3260","svg_cu:path3258-4","svg_cu:path3278","svg_cu:path3196","svg_cu:path3294","svg_cu:path3292","svg_cu:path3288","svg_cu:path3280","svg_cu:path3258","svg_cu:path3258-4","svg_cu:path3390-7"]],draw_name:[[],["svg_cu:path3220","svg_cu:path3240","svg_cu:path3252"]]};sim.ep.signals["MR_RA"]={name:"MR_RA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RA REG_IR REG_MICROINS/SELA 5; FIRE RA;","CP_FIELD RA REG_MICROINS/SELA; FIRE RA;"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.ep.signals["MR_RB"]={name:"MR_RB",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RB REG_IR REG_MICROINS/SELB 5; FIRE RB;","CP_FIELD RB REG_MICROINS/SELB; FIRE RB;"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.ep.signals["MR_RC"]={name:"MR_RC",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RC REG_IR REG_MICROINS/SELC 5; FIRE RC;","CP_FIELD RC REG_MICROINS/SELC; FIRE RC;"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.ep.signals["BW"]={name:"BW",verbal:["Select one byte (based on A1A0) from Word. ","Select two bytes (one Half Word based on A1A0) from Word. ","","Select the full Word. "],visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW"],fire_name:["svg_p:text3433"],draw_data:[["svg_p:path3061-2-6","svg_p:path3101-8","svg_p:path3535-8"]],draw_name:[[],[]]};sim.ep.signals["A1A0"]={name:"A1A0",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA"],fire_name:["svg_p:text3603"],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["BWA"]={name:"BWA",visible:false,type:"L",value:0,default_value:0,nbits:"4",behavior:["BSEL BS_TD 0 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 8 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 24 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W"],fire_name:["svg_p:text3533-5"],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["SBWA"]={name:"SBWA",visible:false,type:"L",value:0,default_value:0,nbits:"5",behavior:["BSEL BS_M1 0 8 BUS_DB 0; FIRE M1","BSEL BS_M1 0 8 BUS_DB 8; FIRE M1","BSEL BS_M1 0 8 BUS_DB 16; FIRE M1","BSEL BS_M1 0 8 BUS_DB 24; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","BSEL BS_M1 0 8 BUS_DB 0; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 8; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 16; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 24; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["IOR"]={name:"IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MOVE_BITS KBD_IOR 0 1 IOR; MOVE_BITS SCR_IOR 0 1 IOR; MOVE_BITS L3D_IOR 0 1 IOR; MOVE_BITS L3D_IOR 0 1 IOR; FIRE KBD_IOR; FIRE SCR_IOR; FIRE L3D_IOR; FIRE LEDM_IOR"],fire_name:["svg_p:text3715"],draw_data:[[],["svg_p:path3733","svg_p:path3491","svg_p:text3715"]],draw_name:[[],[]]};sim.ep.signals["IOW"]={name:"IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MOVE_BITS SCR_IOW 0 1 IOW; FIRE SCR_IOW; MOVE_BITS IO_IOW 0 1 IOW; FIRE IO_IOW; MOVE_BITS L3D_IOW 0 1 IOW; FIRE L3D_IOW; MOVE_BITS LEDM_IOW 0 1 IOW; FIRE LEDM_IOW"],fire_name:["svg_p:text3717"],draw_data:[[],["svg_p:path3735","svg_p:path3491","svg_p:text3717"]],draw_name:[[],[]]};sim.ep.signals["I"]={name:"I",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_I VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_I VAL_ONE; FIRE_IFSET SELP 2"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["U"]={name:"U",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_U VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_U VAL_ONE; FIRE_IFSET SELP 2"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["TEST_C"]={name:"TEST_C",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_C VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_C VAL_ONE; FIRE_IFSET SELP 3"],depends_on:["SELCOP","COP"],fire_name:["svg_p:text3701-3"],draw_data:[["svg_p:text3701-3"]],draw_name:[[]]};sim.ep.signals["TEST_V"]={name:"TEST_V",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_V VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_V VAL_ONE; FIRE_IFSET SELP 3"],depends_on:["SELCOP","COP"],fire_name:["svg_p:text3701-3-1"],draw_data:[["svg_p:text3701-3-1"]],draw_name:[[]]};sim.ep.signals["TEST_N"]={name:"TEST_N",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_N VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_N VAL_ONE; FIRE_IFSET SELP 3"],depends_on:["SELCOP","COP"],fire_name:["svg_p:text3701-3-2"],draw_data:[["svg_p:text3701-3-2"]],draw_name:[[]]};sim.ep.signals["TEST_Z"]={name:"TEST_Z",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_Z VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_Z VAL_ONE; FIRE_IFSET SELP 3"],depends_on:["SELCOP","COP"],fire_name:["svg_p:text3701-3-5"],draw_data:[["svg_p:text3701-3-5"]],draw_name:[[]]};sim.ep.signals["TEST_I"]={name:"TEST_I",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_I VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_I VAL_ONE; FIRE_IFSET SELP 2"],depends_on:["CLK"],fire_name:["svg_p:text3669"],draw_data:[["svg_p:text3669"]],draw_name:[[]]};sim.ep.signals["TEST_U"]={name:"TEST_U",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_U VAL_ZERO; FIRE_IFSET SELP 1","MV FLAG_U VAL_ONE; FIRE_IFSET SELP 1"],depends_on:["CLK"],fire_name:["svg_p:text3669-1"],draw_data:[["svg_p:text3669-1"]],draw_name:[[]]};sim.ep.signals["TEST_INTV"]={name:"TEST_INTV",visible:true,type:"L",value:0,default_value:0,nbits:"8",forbidden:true,behavior:["MBIT INTV TEST_INTV 0 32"],depends_on:["INT"],fire_name:["svg_p:tspan4225"],draw_data:[["svg_p:path3749"]],draw_name:[[]]};sim.ep.behaviors["NOP"]={nparameters:1,operation:function(s_expr){},verbal:function(s_expr){return""}};sim.ep.behaviors["NOP_ALU"]={nparameters:1,operation:function(s_expr){sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0},verbal:function(s_expr){return""}};sim.ep.behaviors["MV"]={nparameters:3,types:["X","X"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)},verbal:function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(newval)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(newval)+"). "}};sim.ep.behaviors["LOAD"]={nparameters:3,types:["X","X"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)},verbal:function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Load from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(newval)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(newval)+"). "}};sim.ep.behaviors["CP_FIELD"]={nparameters:3,types:["X","X"],operation:function(s_expr){r=s_expr[2].split("/");sim_elto_org=get_reference(r[0]);newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval!="undefined"){sim_elto_dst=get_reference(s_expr[1]);set_value(sim_elto_dst,newval)}},verbal:function(s_expr){var newval=0;var r=s_expr[2].split("/");var sim_elto_org=get_reference(r[0]);var sim_elto_dst=get_reference(r[1]);if(typeof sim_elto_dst=="undefined")sim_elto_dst={};if(typeof sim_elto_org.value[r[1]]!="undefined")newval=sim_elto_org.value[r[1]];else if(typeof sim_elto_dst.default_value!="undefined")newval=sim_elto_dst.default_value;else newval="<undefined>";var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from Field "+r[1]+" of "+show_verbal(r[0])+" to "+show_verbal(s_expr[1])+" value "+newval+". "}return show_verbal(s_expr[1])+" = "+show_verbal(r[0])+"."+r[1]+" ("+newval+"). "}};sim.ep.behaviors["NOT_ES"]={nparameters:3,types:["S","E"],operation:function(s_expr){set_value(sim.ep.signals[s_expr[1]],Math.abs(get_value(sim.ep.states[s_expr[2]])-1))},verbal:function(s_expr){var value=Math.abs(get_value(sim.ep.states[s_expr[2]])-1);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Set "+show_verbal(s_expr[1])+" with value "+show_value(value)+" (Logical NOT of "+s_expr[2]+"). "}return show_verbal(s_expr[1])+" = "+show_value(value)+" (Logical NOT "+s_expr[2]+"). "}};sim.ep.behaviors["GET"]={nparameters:4,types:["E","E","S"],operation:function(s_expr){set_value(sim.ep.states[s_expr[1]],get_value(sim.ep.states[s_expr[2]][sim.ep.signals[s_expr[3]].value]))},verbal:function(s_expr){var value=get_value(sim.ep.states[s_expr[2]][sim.ep.signals[s_expr[3]].value]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Set "+show_verbal(s_expr[1])+" with value "+show_value(value)+" (Register File "+s_expr[3]+"). "}return show_verbal(s_expr[1])+" = "+show_value(value)+" (Register File "+s_expr[3]+"). "}};sim.ep.behaviors["SET"]={nparameters:4,types:["E","S","E"],operation:function(s_expr){set_value(sim.ep.states[s_expr[1]][sim.ep.signals[s_expr[2]].value],get_value(sim.ep.states[s_expr[3]]))},verbal:function(s_expr){var value=get_value(sim.ep.states[s_expr[3]]);var o_ref=sim.ep.states[s_expr[1]][sim.ep.signals[s_expr[2]].value];var o_verbal=o_ref.name;if(typeof o_ref.verbal!="undefined")o_verbal=o_ref.verbal;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy to "+o_verbal+" the value "+show_value(value)+". "}return o_verbal+" = "+show_value(value)+". "}};sim.ep.behaviors["AND"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])&get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])&get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU AND with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (AND). "}};sim.ep.behaviors["OR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])|get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])|get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU OR with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (OR). "}};sim.ep.behaviors["NOT"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=~get_value(sim.ep.states[s_expr[2]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=~get_value(sim.ep.states[s_expr[2]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU NOT with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (NOT). "}};sim.ep.behaviors["XOR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])^get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])^get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU XOR with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (XOR). "}};sim.ep.behaviors["SRL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Right Logical with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SRL). "}};sim.ep.behaviors["SRA"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Right Arithmetic with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SRA). "}};sim.ep.behaviors["SL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=result>>>31},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Left with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SL). "}};sim.ep.behaviors["RR"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1|(get_value(sim.ep.states[s_expr[2]])&1)<<31;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1|(get_value(sim.ep.states[s_expr[2]])&1)<<31;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Right Rotation with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (RR). "}};sim.ep.behaviors["RL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1|(get_value(sim.ep.states[s_expr[2]])&2147483648)>>>31;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1|(get_value(sim.ep.states[s_expr[2]])&2147483648)>>>31;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Left Rotation with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (LR). "}};sim.ep.behaviors["ADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a+b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a+b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU ADD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (ADD). "}};sim.ep.behaviors["SUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a-b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a-b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU SUB with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SUB). "}};sim.ep.behaviors["MUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a*b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a*b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MUL with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MUL). "}};sim.ep.behaviors["DIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){return"ALU DIV zero by zero (oops!). "}var result=Math.floor(a/b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU DIV with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (DIV). "}};sim.ep.behaviors["MOD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=a%b;set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){return"ALU MOD zero by zero (oops!). "}var result=a%b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MOD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MOD). "}};sim.ep.behaviors["LUI"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<16;set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<16;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Load Upper Immediate with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (LUI). "}};sim.ep.behaviors["ADDU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a+b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a+b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU ADDU with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (ADDU). "}};sim.ep.behaviors["SUBU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a-b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a-b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU SUBU with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SUBU). "}};sim.ep.behaviors["MULU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a*b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a*b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MULU with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MULU). "}};sim.ep.behaviors["DIVU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;if(0==b){return"ALU DIVU zero by zero (oops!). "}var result=Math.floor(a/b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU DIVU with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (DIVU). "}};sim.ep.behaviors["FADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)+hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)+hex2float(b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FADD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FADD). "}};sim.ep.behaviors["FSUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FSUB with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FSUB). "}};sim.ep.behaviors["FMUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)*hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)*hex2float(b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FMUL with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FMUL). "}};sim.ep.behaviors["FDIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)/hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FDIV with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FDIV). "}};sim.ep.behaviors["FCVT"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]]);var result=a;switch(b){case 1:result=hex2float(result);result=Math.trunc(result);break;case 2:result=hex2float(result);result=Math.round(result);break;case 4:result=result.toFixed(5);result=parseFloat(result);result=float2decimal(result);break;default:break}set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]]);var result=a;switch(b){case 1:result=hex2float(result);result=Math.trunc(result);break;case 2:result=hex2float(result);result=Math.round(result);break;case 4:result=result.toFixed(5);result=parseFloat(result);result=float2decimal(result);break;default:break}var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FCVT with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FCVT). "}};sim.ep.behaviors["FCLASS"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var result=float_class(a);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])>>>0;var result=float_class(a);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FCLASS with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FCLASS). "}};sim.ep.behaviors["PLUS1"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+1;set_value(sim.ep.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy to "+show_verbal(s_expr[1])+" "+show_verbal(s_expr[2])+" plus one with result "+show_value(result)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" + 1"+" ("+show_value(result)+"). "}};sim.ep.behaviors["PLUS4"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+4;set_value(sim.ep.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+4;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy to "+show_verbal(s_expr[1])+" "+show_verbal(s_expr[2])+" plus four with result "+show_value(result)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" + 4"+" ("+show_value(result)+"). "}};sim.ep.behaviors["SET_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a|m;set_value(sim.ep.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.ep.behaviors["RST_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a&~m;set_value(sim.ep.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.ep.behaviors["CHECK_RTD"]={nparameters:1,operation:function(s_expr){var number_active_tri=parseInt(simhw_sim_signal("TD").value)+parseInt(simhw_sim_signal("R").value);update_system_bus_fire(number_active_tri)},verbal:function(s_expr){return""}};sim.ep.behaviors["MBIT"]={nparameters:5,types:["X","X","I","I"],operation:function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);set_value(sim_elto_dst,parseInt(n2,2))},verbal:function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=parseInt(n2,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(n3)+" (copied "+size+" bits from bit "+offset+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(n3)+", "+size+" bits from bit "+offset+"). "}};sim.ep.behaviors["MBIT_SN"]={nparameters:5,types:["S","E","E","I"],operation:function(s_expr){var base=0;var r=s_expr[3].split("/");if(1==r.length)base=get_value(sim.ep.states[s_expr[3]]);else if(typeof sim.ep.states[r[0]].value[r[1]]!="undefined")base=sim.ep.states[r[0]].value[r[1]];else if(typeof sim.ep.signals[r[1]].default_value!="undefined")base=sim.ep.signals[r[1]].default_value;else if(typeof sim.ep.states[r[1]].default_value!="undefined")base=sim.ep.states[r[1]].default_value;else ws_alert("WARN: undefined state/field pair -> "+r[0]+"/"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.ep.states[s_expr[2]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var base=0;var r=s_expr[3].split("/");if(1==r.length)base=get_value(sim.ep.states[s_expr[3]]);else if(typeof sim.ep.states[r[0]].value[r[1]]!="undefined")base=sim.ep.states[r[0]].value[r[1]];else if(typeof sim.ep.signals[r[1]].default_value!="undefined")base=sim.ep.signals[r[1]].default_value;else if(typeof sim.ep.states[r[1]].default_value!="undefined")base=sim.ep.states[r[1]].default_value;else ws_alert("WARN: undefined state/field pair -> "+r[0]+"/"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.ep.states[s_expr[2]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);var from_elto="";if(1==r.length)from_elto=show_verbal(s_expr[3]);else from_elto=show_verbal(s_expr[2])+"["+r[1]+"] ";var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+from_elto+"into "+show_verbal(s_expr[1])+" "+"value "+parseInt(n3,2)+". "}return show_verbal(s_expr[1])+" = "+from_elto+" ("+parseInt(n3,2)+"). "}};sim.ep.behaviors["SBIT_SIGNAL"]={nparameters:4,types:["X","I","I"],operation:function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)},verbal:function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)}};sim.ep.behaviors["UPDATE_FLAG"]={nparameters:4,types:["X","X","I"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value&~(1<>>0)},verbal:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Update "+show_verbal(s_expr[2])+" to value "+sim_elto_org.value+". "}return show_verbal(s_expr[1])+"."+show_verbal(s_expr[3])+" = "+sim_elto_org.value+". "}};sim.ep.behaviors["MBITS"]={nparameters:8,types:["E","I","E","S","S","I","S"],operation:function(s_expr){var offset=parseInt(sim.ep.signals[s_expr[4]].value);var size=parseInt(sim.ep.signals[s_expr[5]].value);var n1=get_value(sim.ep.states[s_expr[3]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;if("1"==sim.ep.signals[s_expr[7]].value&&"1"==n2.substr(0,1)){n3="11111111111111111111111111111111".substring(0,32-n2.length)+n2}set_value(sim.ep.states[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var offset=parseInt(sim.ep.signals[s_expr[4]].value);var size=parseInt(sim.ep.signals[s_expr[5]].value);var n1=get_value(sim.ep.states[s_expr[3]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;if("1"==sim.ep.signals[s_expr[7]].value&&"1"==n2.substr(0,1)){n3="11111111111111111111111111111111".substring(0,32-n2.length)+n2}n1=parseInt(n3,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return" Copy from "+show_verbal(s_expr[3])+" to "+show_verbal(s_expr[1])+" value "+show_value(n1)+" (copied "+size+" bits from bit "+offset+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[3])+" ("+show_value(n1)+", "+size+" bits from bit "+offset+"). "}};sim.ep.behaviors["BSEL"]={nparameters:6,types:["E","I","I","E","I"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var n4="00000000000000000000000000000000".substr(0,posd);n3=n3+n4;set_value(sim.ep.states[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var posd=parseInt(s_expr[2]);var len=parseInt(s_expr[3]);var poso=parseInt(s_expr[5]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var n4="00000000000000000000000000000000".substr(0,posd);n3=n3+n4;var n5=parseInt(n3,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[4])+" to "+show_verbal(s_expr[1])+" value "+show_value(n5)+" (copied "+len+" bits, from bit "+poso+" of "+s_expr[4]+" to bit "+posd+" of "+s_expr[1]+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[4])+" ("+show_value(n5)+", "+len+" bits, from bit "+poso+" of "+s_expr[4]+" to bit "+posd+" of "+s_expr[1]+"). "}};sim.ep.behaviors["EXT_SIG"]={nparameters:3,types:["E","I"],operation:function(s_expr){var n1=get_value(sim.ep.states[s_expr[1]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if("1"==n2[31-s_expr[2]]){n4="11111111111111111111111111111111".substring(0,32-n3.length)+n4}set_value(sim.ep.states[s_expr[1]],parseInt(n4,2))},verbal:function(s_expr){var n1=get_value(sim.ep.states[s_expr[1]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if("1"==n2[31-s_expr[2]]){n4="11111111111111111111111111111111".substring(0,32-n3.length)+n4}var n5=parseInt(n4,2);return"Sign Extension with value "+show_value(n5)+". "}};sim.ep.behaviors["MOVE_BITS"]={nparameters:5,types:["S","I","I","S"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=0;var len=parseInt(s_expr[3]);var n1=sim.ep.signals[s_expr[4]].value.toString(2);n1="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.ep.signals[s_expr[1]].value.toString(2);n2="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.ep.behaviors["MOVE_BITSE"]={nparameters:6,types:["S","I","I","E","I"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);n1="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.ep.signals[s_expr[1]].value.toString(2);n2="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.ep.behaviors["DECO"]={nparameters:1,operation:function(s_expr){sim.ep.states["INEX"].value=0;var oi=decode_instruction(sim.ep.internal_states.FIRMWARE,sim.ep.ctrl_states.ir,get_value(sim.ep.states["REG_IR"]));if(null==oi.oinstruction){ws_alert("ERROR: undefined instruction code in IR ("+"co:"+oi.op_code.toString(2)+", "+"cop:"+oi.cop_code.toString(2)+")");sim.ep.states["ROM_MUXA"].value=0;sim.ep.states["INEX"].value=1;return-1}var rom_addr=oi.op_code<<6;if(typeof oi.oinstruction.cop!="undefined"){rom_addr=rom_addr+oi.cop_code}if(typeof sim.ep.internal_states["ROM"][rom_addr]=="undefined"){ws_alert("ERROR: undefined rom address "+rom_addr+" in firmware");sim.ep.states["ROM_MUXA"].value=0;return-1}sim.ep.states["ROM_MUXA"].value=sim.ep.internal_states["ROM"][rom_addr];var val=get_value(sim.ep.states["DECO_INS"]);set_value(sim.ep.states["DECO_INS"],val+1);var pc=get_value(sim.ep.states["REG_PC"])-4;var decins=get_deco_from_pc(pc);set_value(sim.ep.states["REG_IR_DECO"],decins);show_dbg_ir(get_value(sim.ep.states["REG_IR_DECO"]))},verbal:function(s_expr){return"Decode instruction. "}};sim.ep.behaviors["FIRE"]={nparameters:2,types:["S"],operation:function(s_expr){if(sim.ep.internal_states.fire_stack.indexOf(s_expr[1])!=-1){return}sim.ep.internal_states.fire_stack.push(s_expr[1]);update_draw(sim.ep.signals[s_expr[1]],sim.ep.signals[s_expr[1]].value);if("L"==sim.ep.signals[s_expr[1]].type){update_state(s_expr[1])}sim.ep.internal_states.fire_stack.pop(s_expr[1])},verbal:function(s_expr){return""}};sim.ep.behaviors["FIRE_IFSET"]={nparameters:3,types:["S","I"],operation:function(s_expr){if(get_value(sim.ep.signals[s_expr[1]])!=parseInt(s_expr[2])){return}sim.ep.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.ep.behaviors["FIRE_IFCHANGED"]={nparameters:3,types:["S","X"],operation:function(s_expr){sim_elto=get_reference(s_expr[2]);if(sim_elto.changed==false){return}sim.ep.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.ep.behaviors["RESET_CHANGED"]={nparameters:2,types:["X"],operation:function(s_expr){sim_elto=get_reference(s_expr[1]);sim_elto.changed=false},verbal:function(s_expr){return""}};sim.ep.behaviors["CLOCK"]={nparameters:1,operation:function(s_expr){var new_maddr=null;var mcelto=null;var t0=performance.now();var val=get_value(sim.ep.states["CLK"]);set_value(sim.ep.states["CLK"],val+1);set_value(sim.ep.states["TTCPU"],0);new_maddr=get_value(sim.ep.states["REG_MICROADDR"]);mcelto=sim.ep.internal_states["MC"][new_maddr];if(typeof mcelto!=="undefined"&&false==mcelto.is_native){for(var i=0;i>>0},set_value:function(elto,value){var origin="";var r_value=main_memory_get_program_counter();if(r_value!=null){origin="PC=0x"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.ep.internal_states.MP,elto,melto);show_main_memory(sim.ep.internal_states.MP,elto,typeof valref==="undefined",true);return value}};sim.ep.internal_states.segments={};sim.ep.internal_states.MP_wc=0;sim.ep.internal_states.MP={};sim.ep.internal_states.CM_cfg=[];sim.ep.internal_states.CM=[];sim.ep.signals.MRDY={name:"MRDY",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE_IFCHANGED MRDY C","FIRE_IFCHANGED MRDY C"],fire_name:["svg_p:tspan3916","svg_p:text3909"],draw_data:[[],["svg_p:path3895","svg_p:path3541"]],draw_name:[[],[]]};sim.ep.signals.R={name:"R",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; CHECK_RTD","MEM_READ BUS_AB BUS_DB BWA MRDY CLK; FIRE MRDY; CHECK_RTD"],fire_name:["svg_p:text3533-5-2","svg_p:text3713"],draw_data:[[],["svg_p:path3557","svg_p:path3571"]],draw_name:[[],[]]};sim.ep.signals.W={name:"W",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MEM_WRITE BUS_AB BUS_DB BWA MRDY CLK; FIRE MRDY"],fire_name:["svg_p:text3533-5-08","svg_p:text3527","svg_p:text3431-7"],draw_data:[[],["svg_p:path3559","svg_p:path3575","svg_p:path3447-7"]],draw_name:[[],[]]};sim.ep.behaviors.MEM_READ={nparameters:6,types:["E","E","S","S","E"],operation:function(s_expr){var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);sim.ep.signals[s_expr[4]].value=0;var remain=get_value(sim.ep.internal_states.MP_wc);if(typeof sim.ep.events.mem[clk-1]!="undefined"&&sim.ep.events.mem[clk-1]>0){remain=sim.ep.events.mem[clk-1]-1}var first_time=typeof sim.ep.events.mem[clk]=="undefined";sim.ep.events.mem[clk]=remain;if(remain>0){return}address=address&4294967292;var value=main_memory_getvalue(sim.ep.internal_states.MP,address);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}dbvalue=main_memory_fusionvalues(dbvalue,value,bw);sim.ep.states[s_expr[2]].value=dbvalue>>>0;sim.ep.signals[s_expr[4]].value=1;show_main_memory(sim.ep.internal_states.MP,address,full_redraw,false);if(first_time&&sim.ep.internal_states.CM.length>0){cache_memory_access(sim.ep.internal_states.CM[0],address,"read",clk)}},verbal:function(s_expr){var verbal="";var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);var bw_type="word";if(0==(bw&12))bw_type="byte";else if(1==(bw&12))bw_type="half";var value=main_memory_getvalue(sim.ep.internal_states.MP,address);if(typeof value==="undefined")value=0;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){verbal="Try to read a "+bw_type+" from memory "+"at address 0x"+address.toString(16)+" with value 0x"+value.toString(16)+". "}verbal="Memory output = 0x"+value.toString(16)+" (Read a "+bw_type+" from 0x"+address.toString(16)+"). ";return verbal}};sim.ep.behaviors.MEM_WRITE={nparameters:6,types:["E","E","S","S","E"],operation:function(s_expr){var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);sim.ep.signals[s_expr[4]].value=0;var remain=get_value(sim.ep.internal_states.MP_wc);if(typeof sim.ep.events.mem[clk-1]!="undefined"&&sim.ep.events.mem[clk-1]>0){remain=sim.ep.events.mem[clk-1]-1}var first_time=typeof sim.ep.events.mem[clk]=="undefined";sim.ep.events.mem[clk]=remain;if(remain>0){return}address=address&4294967292;var value=main_memory_getvalue(sim.ep.internal_states.MP,address);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}value=main_memory_fusionvalues(value,dbvalue,bw);var origin="";var r_value=main_memory_get_program_counter();if(r_value!=null){origin="PC=0x"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.ep.internal_states.MP,address,melto);sim.ep.signals[s_expr[4]].value=1;show_main_memory(sim.ep.internal_states.MP,address,full_redraw,true);if(first_time&&sim.ep.internal_states.CM.length>0){cache_memory_access(sim.ep.internal_states.CM[0],address,"write",clk)}},verbal:function(s_expr){var verbal="";var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);var bw_type="word";if(0==(bw&12))bw_type="byte";else if(1==(bw&12))bw_type="half";var value=main_memory_getvalue(sim.ep.internal_states.MP,address);if(typeof value==="undefined")value=0;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){verbal="Try to write a "+bw_type+" to memory "+"at address 0x"+address.toString(16)+" with value "+value.toString(16)+". "}verbal="Memory[0x"+address.toString(16)+"] = "+"0x"+value.toString(16)+" (Write a "+bw_type+" to 0x"+address.toString(16)+"). ";return verbal}};sim.ep.behaviors.MEMORY_RESET={nparameters:1,operation:function(s_expr){sim.ep.events.mem={}},verbal:function(s_expr){return"Reset main memory (all values will be zeroes). "}};sim.ep.elements.memory={name:"Main memory",description:"Main memory subsystem",type:"subcomponent",belongs:"MEMORY",states:{addr:{ref:"BUS_AB"},data:{ref:"BUS_DB"},mrdy:{ref:"MRDY"}},signals:{be:{ref:"BWA"},r:{ref:"R"},w:{ref:"W"}},states_inputs:["addr","data"],states_outputs:["mrdy","data"],signals_inputs:["be","r","w"],signals_output:[]};sim.ep.components.IO={name:"IO",version:"1",abilities:["IO_TIMER"],details_name:["IO_STATS","IO_CONFIG"],details_fire:[["svg_p:text3775"],[]],write_state:function(vec){return vec},read_state:function(o,check){return false},get_state:function(reg){return null},get_value:function(elto){var associated_state=simhw_internalState_get("io_hash",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("IOR"),1);compute_behavior("FIRE IOR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("IOW"),1);compute_behavior("FIRE IOW");return value}};sim.ep.internal_states.io_int_factory=[];sim.ep.internal_states.io_int_factory[0]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[1]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[2]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[3]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[4]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[5]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[6]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[7]={period:0,probability:.5,accumulated:0,active:false};var IOSR_ID=4352;var IOCR_ID=4356;var IODR_ID=4360;sim.ep.internal_states.io_hash[IOSR_ID]="IOSR";sim.ep.internal_states.io_hash[IOCR_ID]="IOCR";sim.ep.internal_states.io_hash[IODR_ID]="IODR";sim.ep.states.IOSR={name:"IOSR",verbal:"IO State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.IOCR={name:"IOCR",verbal:"IO Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.IODR={name:"IODR",verbal:"IO Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.signals.INT={name:"INT",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE C","FIRE C"],fire_name:["svg_p:tspan4199"],draw_data:[[],["svg_p:path3809"]],draw_name:[[],[]]};sim.ep.signals.IORDY={name:"IORDY",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE_IFCHANGED IORDY C","FIRE_IFCHANGED IORDY C"],fire_name:["svg_p:tspan4089","svg_p:path3793","svg_p:text3911"],draw_data:[[],["svg_p:path3897"]],draw_name:[[],[]]};sim.ep.signals.IO_IOR={name:"IO_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","IO_IOR BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE SBWA"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.signals.IO_IOW={name:"IO_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","IO_IOW BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE SBWA"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.signals.IO_IE={name:"IO_IE",visible:true,type:"L",value:1,default_value:1,nbits:"1",behavior:["NOP","IO_CHK_I CLK INT INTV; FIRE C"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals.INTA={name:"INTA",visible:true,type:"L",value:1,default_value:0,nbits:"1",behavior:["NOP","INTA CLK INT INTA BUS_DB INTV; FIRE BW; FIRE C"],fire_name:["svg_p:text3785-0-6-0-5-5-1-1"],draw_data:[[],["svg_p:path3807","svg_p:path3737"]],draw_name:[[],[]]};sim.ep.behaviors.IO_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==IOSR_ID)set_value(sim.ep.states[s_expr[2]],iosr);if(bus_ab==IOCR_ID)set_value(sim.ep.states[s_expr[2]],iocr);if(bus_ab==IODR_ID)set_value(sim.ep.states[s_expr[2]],iodr)},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==IOSR_ID)verbal="I/O device read at IOSR of value "+iosr+". ";if(bus_ab==IOCR_ID)verbal="I/O device read at IOCR of value "+iocr+". ";if(bus_ab==IODR_ID)verbal="I/O device read at IODR of value "+iodr+". ";return verbal}};sim.ep.behaviors.IO_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab!=IOSR_ID&&bus_ab!=IOCR_ID&&bus_ab!=IODR_ID){return}if(bus_ab==IOSR_ID)set_value(sim.ep.states[s_expr[3]],bus_db);if(bus_ab==IOCR_ID)set_value(sim.ep.states[s_expr[4]],bus_db);if(bus_ab==IODR_ID)set_value(sim.ep.states[s_expr[5]],bus_db);var iocr_id=get_value(sim.ep.states[s_expr[4]]);var iodr_id=get_value(sim.ep.states[s_expr[5]]);if(iocr_id<0||iocr_id>7)return;set_var(sim.ep.internal_states.io_int_factory[iocr_id].period,iodr_id);set_var(sim.ep.internal_states.io_int_factory[iocr_id].probability,1);if(0==iodr_id){set_var(sim.ep.internal_states.io_int_factory[iocr_id].probability,0)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab==IOSR_ID)verbal="I/O device write at IOSR with value "+bus_db+". ";if(bus_ab==IOCR_ID)verbal="I/O device write at IOCR with value "+bus_db+". ";if(bus_ab==IODR_ID)verbal="I/O device write at IODR with value "+bus_db+". ";return verbal}};sim.ep.behaviors.IO_CHK_I={nparameters:4,types:["E","S","E"],operation:function(s_expr){var clk=get_value(sim.ep.states[s_expr[1]]);for(var i=sim.ep.internal_states.io_int_factory.length-1;i>=0;i--){if(get_var(sim.ep.internal_states.io_int_factory[i].period)==0)continue;if(get_var(sim.ep.internal_states.io_int_factory[i].active)==true){set_value(sim.ep.signals[s_expr[2]],1);set_value(sim.ep.states[s_expr[3]],i)}if(clk%get_var(sim.ep.internal_states.io_int_factory[i].period)==0){if(Math.random()>get_var(sim.ep.internal_states.io_int_factory[i].probability))continue;var acc=get_var(sim.ep.internal_states.io_int_factory[i].accumulated);set_var(sim.ep.internal_states.io_int_factory[i].accumulated,acc+1);set_var(sim.ep.internal_states.io_int_factory[i].active,true);if(typeof sim.ep.events.io[clk]=="undefined"){sim.ep.events.io[clk]=[]}sim.ep.events.io[clk].push(i);set_value(sim.ep.signals[s_expr[2]],1);set_value(sim.ep.states[s_expr[3]],i)}}},verbal:function(s_expr){return"Check I/O Interruption. "}};sim.ep.behaviors.INTA={nparameters:6,types:["E","S","S","E","E"],operation:function(s_expr){var clk=get_value(sim.ep.states[s_expr[1]]);if(typeof sim.ep.events.io[clk]!="undefined"){set_value(sim.ep.states[s_expr[4]],sim.ep.events.io[clk][0]);return}set_value(sim.ep.signals[s_expr[2]],0);set_value(sim.ep.states[s_expr[5]],0);for(var i=0;i>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("IOR"),1);compute_behavior("FIRE IOR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("IOW"),1);compute_behavior("FIRE IOW");return value}};sim.ep.internal_states.l3d_dim=4;sim.ep.internal_states.l3d_neltos=Math.pow(sim.ep.internal_states.l3d_dim,3);sim.ep.internal_states.l3d_state=Array.from({length:sim.ep.internal_states.l3d_neltos},(()=>({active:false})));sim.ep.internal_states.l3d_frame="0".repeat(sim.ep.internal_states.l3d_neltos);var L3DSR_ID=8448;var L3DCR_ID=8452;var L3DDR_ID=8456;sim.ep.internal_states.io_hash[L3DSR_ID]="L3DSR";sim.ep.internal_states.io_hash[L3DCR_ID]="L3DCR";sim.ep.internal_states.io_hash[L3DDR_ID]="L3DDR";sim.ep.states.L3DSR={name:"L3DSR",verbal:"L3D State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.L3DCR={name:"L3DCR",verbal:"L3D Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.L3DDR={name:"L3DDR",verbal:"L3D Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.signals.L3D_IOR={name:"L3D_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","L3D_IOR BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE SBWA"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.signals.L3D_IOW={name:"L3D_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","L3D_IOW BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE SBWA; L3D_SYNC"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.behaviors.L3D_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==L3DCR_ID){set_value(sim.ep.states[s_expr[2]],iocr)}if(bus_ab==L3DDR_ID){set_value(sim.ep.states[s_expr[2]],iodr)}if(bus_ab==L3DSR_ID){var x=(iodr&4278190080)>>24;var y=(iodr&16711680)>>16;var z=(iodr&65280)>>8;var p=z*Math.pow(sim.ep.internal_states.l3d_dim,2)+y*sim.ep.internal_states.l3d_dim+x;var s=get_var(sim.ep.internal_states.l3d_state[p].active);set_value(sim.ep.states[s_expr[2]],s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==L3DSR_ID)verbal="I/O device read at L3DSR of value "+iosr+". ";if(bus_ab==L3DCR_ID)verbal="I/O device read at L3DCR of value "+iocr+". ";if(bus_ab==L3DDR_ID)verbal="I/O device read at L3DDR of value "+iodr+". ";return verbal}};sim.ep.behaviors.L3D_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab!=L3DSR_ID&&bus_ab!=L3DCR_ID&&bus_ab!=L3DDR_ID){return}if(bus_ab==L3DSR_ID){set_value(sim.ep.states[s_expr[3]],bus_db)}if(bus_ab==L3DDR_ID){set_value(sim.ep.states[s_expr[5]],bus_db)}if(bus_ab==L3DCR_ID){set_value(sim.ep.states[s_expr[4]],bus_db);var x=(bus_db&4278190080)>>24;var y=(bus_db&16711680)>>16;var z=(bus_db&65280)>>8;var p=z*Math.pow(sim.ep.internal_states.l3d_dim,2)+y*sim.ep.internal_states.l3d_dim+x;var s=(bus_db&255)!=0;set_var(sim.ep.internal_states.l3d_state[p].active,s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab==L3DSR_ID)verbal="I/O device write at L3DSR with value "+bus_db+". ";if(bus_ab==L3DCR_ID)verbal="I/O device write at L3DCR with value "+bus_db+". ";if(bus_ab==L3DDR_ID)verbal="I/O device write at L3DDR with value "+bus_db+". ";return verbal}};sim.ep.behaviors.L3D_RESET={nparameters:1,operation:function(s_expr){sim.ep.events.l3d={};var n=sim.ep.internal_states.l3d_state.length;for(var i=0;i>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("IOR"),1);compute_behavior("FIRE IOR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("IOW"),1);compute_behavior("FIRE IOW");return value}};sim.ep.internal_states.ledm_dim=24;sim.ep.internal_states.ledm_neltos=Math.pow(sim.ep.internal_states.ledm_dim,2);sim.ep.internal_states.ledm_state=Array.from({length:sim.ep.internal_states.ledm_neltos},(()=>({color:0})));sim.ep.internal_states.ledm_colors=colors_clone("");sim.ep.internal_states.ledm_frame="0".repeat(sim.ep.internal_states.ledm_neltos);var LEDMSR_ID=12544;var LEDMCR_ID=12548;var LEDMDR_ID=12552;sim.ep.internal_states.io_hash[LEDMSR_ID]="LEDMSR";sim.ep.internal_states.io_hash[LEDMCR_ID]="LEDMCR";sim.ep.internal_states.io_hash[LEDMDR_ID]="LEDMDR";sim.ep.states.LEDMSR={name:"LEDMSR",verbal:"LEDM State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.LEDMCR={name:"LEDMCR",verbal:"LEDM Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.LEDMDR={name:"LEDMDR",verbal:"LEDM Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.signals.LEDM_IOR={name:"LEDM_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","LEDM_IOR BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE SBWA"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.signals.LEDM_IOW={name:"LEDM_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","LEDM_IOW BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE SBWA; LEDM_SYNC"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.behaviors.LEDM_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==LEDMCR_ID){set_value(sim.ep.states[s_expr[2]],iocr)}if(bus_ab==LEDMDR_ID){set_value(sim.ep.states[s_expr[2]],iodr)}if(bus_ab==LEDMSR_ID){var x=(iodr&4278190080)>>24;var y=(iodr&16711680)>>16;var p=y*sim.ep.internal_states.ledm_dim+x;var s=get_var(sim.ep.internal_states.ledm_state[p].color);set_value(sim.ep.states[s_expr[2]],s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==LEDMSR_ID)verbal="I/O device read at LEDMSR of value "+iosr+". ";if(bus_ab==LEDMCR_ID)verbal="I/O device read at LEDMCR of value "+iocr+". ";if(bus_ab==LEDMDR_ID)verbal="I/O device read at LEDMDR of value "+iodr+". ";return verbal}};sim.ep.behaviors.LEDM_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);switch(bus_ab){case LEDMSR_ID:set_value(sim.ep.states[s_expr[3]],bus_db);break;case LEDMDR_ID:set_value(sim.ep.states[s_expr[5]],bus_db);break;case LEDMCR_ID:set_value(sim.ep.states[s_expr[4]],bus_db);break;default:break}if(LEDMCR_ID==bus_ab){var dr=get_value(sim.ep.states[s_expr[5]]);if(16&bus_db){var x=(dr&4278190080)>>24;var y=(dr&16711680)>>16;var s=dr&255;set_value(sim.ep.states[s_expr[3]],1);if(x>=sim.ep.internal_states.ledm_dim&&y>=sim.ep.internal_states.ledm_dim){set_value(sim.ep.states[s_expr[3]],-1);return}var p=y*sim.ep.internal_states.ledm_dim+x;set_var(sim.ep.internal_states.ledm_state[p].color,s)}if(32&bus_db){set_value(sim.ep.states[s_expr[3]],1);var s=0;var neltos=sim.ep.internal_states.ledm_neltos;for(var p=0;p>0);set_var(sim.ep.internal_states.ledm_state[p+1].color,(s&65280)>>8);set_var(sim.ep.internal_states.ledm_state[p+2].color,(s&16711680)>>16);set_var(sim.ep.internal_states.ledm_state[p+3].color,(s&4278190080)>>24)}}if(64&bus_db){set_value(sim.ep.states[s_expr[3]],1);var s=0;var c="";var neltos=sim.ep.internal_states.ledm_colors.length;for(var p=0;p>>8;s=s.toString(16);c="#"+simcoreui_pack(s,6);sim.ep.internal_states.ledm_colors[p]=c}neltos=sim.ep.internal_states.ledm_neltos;for(var p=0;p>24;var y=(dr&16711680)>>16;var s=dr&255;verbal="I/O device write at LEDMCR with value "+bus_db+" (set pixel x:"+x+", y:"+y+", with color:"+s+"). "}if(64&bus_db){verbal="I/O device write at LEDMCR with value "+bus_db+" (set color palette at:"+bus_db+"). "}break;default:break}return verbal}};sim.ep.behaviors.LEDM_RESET={nparameters:1,operation:function(s_expr){sim.ep.events.ledm={};sim.ep.internal_states.ledm_colors=colors_clone("");for(var i=0;i>>0;if(value!=0){vec.CPU["R"+i]={type:"register",default_value:0,id:"R"+i,op:"=",value:"0x"+value.toString(16)}}}for(var i=0;i>>0;if(value!=0){vec.CPU[internal_reg[i]]={type:"register",default_value:0,id:internal_reg[i],op:"=",value:"0x"+value.toString(16)}}}return vec},read_state:function(vec,check){if(typeof vec.CPU=="undefined")vec.CPU={};var key=check["id"].toUpperCase().trim();var val=parseInt(check["value"]).toString(16);if("REGISTER"==check["type"].toUpperCase().trim()){vec.CPU[key]={type:"register",default_value:0,id:key,op:check["condition"],value:"0x"+val};return true}return false},get_state:function(reg){var r_reg=reg.toUpperCase().trim();if(typeof sim.poc.states["REG_"+r_reg]!="undefined"){var value=get_value(sim.poc.states["REG_"+r_reg])>>>0;return"0x"+value.toString(16)}r_reg=r_reg.replace("R","");var index=parseInt(r_reg);if(typeof sim.poc.states.BR[index]!="undefined"){var value=get_value(sim.poc.states.BR[index])>>>0;return"0x"+value.toString(16)}return null},get_value:function(elto){if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index))return get_value(simhw_sim_state(elto))>>>0;return get_value(simhw_sim_states().BR[index])>>>0},set_value:function(elto,value){var pc_name=simhw_sim_ctrlStates_get().pc.state;if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index)){set_value(simhw_sim_state(elto),value);if(pc_name===elto){show_asmdbg_pc()}return value}return set_value(simhw_sim_states().BR[index],value)}};sim.poc.ctrl_states.pc={name:"PC",state:"REG_PC",is_pointer:true};sim.poc.ctrl_states.sp={name:"SP",state:"BR.29",is_pointer:true};sim.poc.ctrl_states.fp={name:"FP",state:"BR.30",is_pointer:true};sim.poc.ctrl_states.ir={name:"IR",state:"REG_IR",default_eltos:{co:{begin:0,end:5,length:6},cop:{begin:27,end:31,length:5}},is_pointer:false};sim.poc.ctrl_states.mpc={name:"mPC",state:"REG_MICROADDR",is_pointer:false};sim.poc.internal_states.MC={};sim.poc.internal_states.ROM={};sim.poc.internal_states.FIRMWARE=ws_empty_firmware;sim.poc.internal_states.io_hash={};sim.poc.internal_states.fire_stack=[];sim.poc.internal_states.tri_state_names=["T1","T2","T3","T6","T8","T9","T10","T11","T12"];sim.poc.internal_states.fire_visible={databus:false,internalbus:false};sim.poc.internal_states.filter_states=["REG_IR_DECO,col-12","REG_IR,col-auto","REG_PC,col-auto","REG_SR,col-auto","REG_RT1,col-auto","REG_MAR,col-auto","REG_MBR,col-auto","REG_MICROADDR,col-auto"];sim.poc.internal_states.filter_signals=["A0,0","B,0","C,0","SELA,5","SELB,5","SELC,2","SELCOP,0","MRA,0","MRB,0","MRC,0","MC,0","C0,0","C1,0","C2,0","C3,0","C4,0","C7,0","T1,0","T2,0","T3,0","T6,0","T8,0","T9,0","T10,0","T11,0","M1,0","M7,0","MA,0","MB,0","LC,0","SE,0","SIZE,0","OFFSET,0","BW,0","R,0","W,0","TA,0","TD,0","IOR,0","IOW,0","TEST_I,0","TEST_U,0"];sim.poc.internal_states.alu_flags={flag_n:0,flag_z:0,flag_v:0,flag_c:0};sim.poc.states.BR=[];sim.poc.states.BR[0]={name:"R0",verbal:"Register 0",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[1]={name:"R1",verbal:"Register 1",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[2]={name:"R2",verbal:"Register 2",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[3]={name:"R3",verbal:"Register 3",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[4]={name:"R4",verbal:"Register 4",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[5]={name:"R5",verbal:"Register 5",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[6]={name:"R6",verbal:"Register 6",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[7]={name:"R7",verbal:"Register 7",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[8]={name:"R8",verbal:"Register 8",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[9]={name:"R9",verbal:"Register 9",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[10]={name:"R10",verbal:"Register 10",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[11]={name:"R11",verbal:"Register 11",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[12]={name:"R12",verbal:"Register 12",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[13]={name:"R13",verbal:"Register 13",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[14]={name:"R14",verbal:"Register 14",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[15]={name:"R15",verbal:"Register 15",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[16]={name:"R16",verbal:"Register 16",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[17]={name:"R17",verbal:"Register 17",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[18]={name:"R18",verbal:"Register 18",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[19]={name:"R19",verbal:"Register 19",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[20]={name:"R20",verbal:"Register 20",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[21]={name:"R21",verbal:"Register 21",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[22]={name:"R22",verbal:"Register 22",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[23]={name:"R23",verbal:"Register 23",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[24]={name:"R24",verbal:"Register 24",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[25]={name:"R25",verbal:"Register 25",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[26]={name:"R26",verbal:"Register 26",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[27]={name:"R27",verbal:"Register 27",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[28]={name:"R28",verbal:"Register 28",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[29]={name:"R29",verbal:"Register 29",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[30]={name:"R30",verbal:"Register 30",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[31]={name:"R31",verbal:"Register 31",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[32]={name:"R32",verbal:"Register 32",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[33]={name:"R33",verbal:"Register 33",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[34]={name:"R34",verbal:"Register 34",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[35]={name:"R35",verbal:"Register 35",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[36]={name:"R36",verbal:"Register 36",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[37]={name:"R37",verbal:"Register 37",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[38]={name:"R38",verbal:"Register 38",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[39]={name:"R39",verbal:"Register 39",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[40]={name:"R40",verbal:"Register 40",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[41]={name:"R41",verbal:"Register 41",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[42]={name:"R42",verbal:"Register 42",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[43]={name:"R43",verbal:"Register 43",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[44]={name:"R44",verbal:"Register 44",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[45]={name:"R45",verbal:"Register 45",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[46]={name:"R46",verbal:"Register 46",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[47]={name:"R47",verbal:"Register 47",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[48]={name:"R48",verbal:"Register 48",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[49]={name:"R49",verbal:"Register 49",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[50]={name:"R50",verbal:"Register 50",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[51]={name:"R51",verbal:"Register 51",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[52]={name:"R52",verbal:"Register 52",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[53]={name:"R53",verbal:"Register 53",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[54]={name:"R54",verbal:"Register 54",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[55]={name:"R55",verbal:"Register 55",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[56]={name:"R56",verbal:"Register 56",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[57]={name:"R57",verbal:"Register 57",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[58]={name:"R58",verbal:"Register 58",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[59]={name:"R59",verbal:"Register 59",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[60]={name:"R60",verbal:"Register 60",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[61]={name:"R61",verbal:"Register 61",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[62]={name:"R62",verbal:"Register 62",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[63]={name:"R63",verbal:"Register 63",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_PC"]={name:"PC",verbal:"Program Counter Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_MAR"]={name:"MAR",verbal:"Memory Address Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_MBR"]={name:"MBR",verbal:"Memory Data Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_IR"]={name:"IR",verbal:"Instruction Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_SR"]={name:"SR",verbal:"State Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_RT1"]={name:"RT1",verbal:"Temporal Register 1",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BUS_IB"]={name:"I_BUS",verbal:"Internal Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BUS_AB"]={name:"A_BUS",verbal:"Address Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BUS_CB"]={name:"C_BUS",verbal:"Control Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BUS_DB"]={name:"D_BUS",verbal:"Data Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["RA_T9"]={name:"RA_T9",verbal:"Input of T9 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["RB_T10"]={name:"RB_T10",verbal:"Input of T10 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["HPC_T12"]={name:"HPC_T12",verbal:"Input of T12 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["SELEC_T3"]={name:"SELEC_T3",verbal:"Input of T3 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["ALU_T6"]={name:"ALU_T6",verbal:"Input of T6 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["MA_ALU"]={name:"MA_ALU",verbal:"Input ALU via MA",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["MB_ALU"]={name:"MB_ALU",verbal:"Input ALU via MB",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_C"]={name:"FLAG_C",verbal:"Carry Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_V"]={name:"FLAG_V",verbal:"Overflow Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_N"]={name:"FLAG_N",verbal:"Negative Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_Z"]={name:"FLAG_Z",verbal:"Zero Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_I"]={name:"FLAG_I",verbal:"Interruption Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_U"]={name:"FLAG_U",verbal:"User Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_MICROADDR"]={name:"µADDR",verbal:"Microaddress Register",visible:true,nbits:"12",value:0,default_value:0,draw_data:["svg_cu:text4667"]};sim.poc.states["REG_MICROINS"]={name:"µINS",verbal:"Microinstruction Register",visible:true,nbits:"77",value:{},default_value:{},draw_data:[]};sim.poc.states["FETCH"]={name:"FETCH",verbal:"Input Fetch",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.poc.states["ROM_MUXA"]={name:"ROM_MUXA",verbal:"Input ROM",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.poc.states["SUM_ONE"]={name:"SUM_ONE",verbal:"Input next microinstruction",visible:false,nbits:"12",value:1,default_value:1,draw_data:[]};sim.poc.states["MUXA_MICROADDR"]={name:"MUXA_MICROADDR",verbal:"Input microaddress",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.poc.states["MUXC_MUXB"]={name:"MUXC_MUXB",verbal:"Output of MUX C",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["INEX"]={name:"INEX",verbal:"Illegal Instruction Exception",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["BS_M1"]={name:"BS_M1",verbal:"from Memory",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BS_TD"]={name:"BS_TD",verbal:"Memory",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["INTV"]={name:"INTV",verbal:"Interruption Vector",visible:false,nbits:"8",value:0,default_value:0,draw_data:[]};sim.poc.states["M1_C1"]={name:"M1_C1",verbal:"Input of Memory Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["M7_C7"]={name:"M7_C7",verbal:"Input of State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["VAL_ZERO"]={name:"VAL_ZERO",verbal:"Wired Zero",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["VAL_ONE"]={name:"VAL_ONE",verbal:"Wired One",visible:false,nbits:"32",value:1,default_value:1,draw_data:[]};sim.poc.states["VAL_FOUR"]={name:"VAL_FOUR",verbal:"Wired Four",visible:false,nbits:"32",value:4,default_value:4,draw_data:[]};sim.poc.states["REG_IR_DECO"]={name:"IR_DECO",verbal:"Instruction Decoded",visible:true,nbits:"0",value:0,default_value:0,draw_data:[]};sim.poc.states["DECO_INS"]={name:"DECO_INS",verbal:"Instruction decoded in binary",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["CLK"]={name:"CLK",verbal:"Clock",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["ACC_TIME"]={name:"ACC_TIME",verbal:"Accumulated CPU time",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["TTCPU"]={name:"TTCPU",verbal:"Several Tristates to the internal data bus in CPU activated",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["ACC_PWR"]={name:"ACC_PWR",verbal:"Accumulated Energy Consumption",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.signals["C"]={name:"C",visible:true,type:"L",value:0,default_value:0,nbits:"4",behavior:["MV MUXC_MUXB VAL_ZERO; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB INT 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB IORDY 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB MRDY 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 1 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 28 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 29 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 30 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 31 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MV MUXC_MUXB INEX; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB"],fire_name:["svg_cu:text3410"],draw_data:[["svg_cu:path3108"],["svg_cu:path3062"],["svg_cu:path3060"],["svg_cu:path3136"],["svg_cu:path3482"],["svg_cu:path3480"],["svg_cu:path3488"],["svg_cu:path3486"],["svg_cu:path3484"],["svg_cu:path3484-9"],["svg_cu:path3108-3","svg_cu:path3260-3-8-6","svg_cu:path3260-3-8","svg_cu:path3260-3"]],draw_name:[["svg_cu:path3496","svg_cu:path3414","svg_cu:path3194-08"]]};sim.poc.signals["B"]={name:"B",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV A1 MUXC_MUXB; FIRE A1","NOT_ES A1 MUXC_MUXB; FIRE A1"],depends_on:["CLK"],fire_name:["svg_cu:text3408"],draw_data:[["svg_cu:path3094-7"],["svg_cu:path3392","svg_cu:path3372","svg_cu:path3390","svg_cu:path3384","svg_cu:path3108-1","svg_cu:path3100-8-7"]],draw_name:[[],["svg_cu:path3194-0","svg_cu:path3138-8","svg_cu:path3498-6"]]};sim.poc.signals["A0"]={name:"A0",visible:false,type:"L",value:0,default_value:0,nbits:"1",behavior:["SBIT_SIGNAL A0A1 0 1; FIRE A0A1","SBIT_SIGNAL A0A1 1 1; FIRE A0A1"],depends_on:["CLK"],fire_name:["svg_cu:text3406"],draw_data:[["svg_cu:path3096"],["svg_cu:path3096"]],draw_name:[[],["svg_cu:path3138-8-1","svg_cu:path3098-2","svg_cu:path3124-2-5"]]};sim.poc.signals["A1"]={name:"A1",visible:false,type:"L",value:0,default_value:0,nbits:"1",behavior:["SBIT_SIGNAL A0A1 0 0; FIRE A0A1","SBIT_SIGNAL A0A1 1 0; FIRE A0A1"],depends_on:["CLK"],fire_name:[],draw_data:[["svg_cu:path3094"],["svg_cu:path3094"]],draw_name:[[]]};sim.poc.signals["A0A1"]={name:"A0A1",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["PLUS1 MUXA_MICROADDR REG_MICROADDR","CP_FIELD MUXA_MICROADDR REG_MICROINS/MADDR","MV MUXA_MICROADDR ROM_MUXA","MV MUXA_MICROADDR FETCH"],depends_on:["CLK"],fire_name:[],draw_data:[["svg_cu:path3102","svg_cu:path3100","svg_cu:path3098","svg_cu:path3100-9","svg_cu:path3088"],["svg_cu:path3104","svg_cu:path3134","svg_cu:path3500","svg_cu:path3416"],["svg_cu:path3504","svg_cu:path3100-8","svg_cu:path3234-9"],["svg_cu:path3124"]],draw_name:[[]]};sim.poc.signals["C0"]={name:"C0",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_MAR BUS_IB"],fire_name:["svg_p:text3077"],draw_data:[["svg_p:path3081"]],draw_name:[["svg_p:path3075"]]};sim.poc.signals["C1"]={name:"C1",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_MBR M1_C1"],fire_name:["svg_p:text3079"],draw_data:[["svg_p:path3055"]],draw_name:[["svg_p:path3073"]]};sim.poc.signals["C2"]={name:"C2",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_PC BUS_IB; UPDATEDPC"],fire_name:["svg_p:text3179"],draw_data:[["svg_p:path3217"]],draw_name:[["svg_p:path3177"]]};sim.poc.signals["C3"]={name:"C3",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_IR BUS_IB; DECO; FIRE_IFSET C 10"],fire_name:["svg_p:text3439"],draw_data:[["svg_p:path3339","svg_p:path3913-4"]],draw_name:[["svg_p:path3337"]]};sim.poc.signals["C4"]={name:"C4",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_RT1 BUS_IB"],fire_name:["svg_p:tspan482"],draw_data:[["svg_p:path3339-4"]],draw_name:[["svg_p:path3337-0"]]};sim.poc.signals["C7"]={name:"C7",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_SR M7_C7"],fire_name:["svg_p:text3655"],draw_data:[["svg_p:path3651-9"]],draw_name:[["svg_p:path3681"]]};sim.poc.signals["TA"]={name:"TA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MV BUS_AB REG_MAR"],fire_name:["svg_p:text3091"],draw_data:[["svg_p:path3083","svg_p:path3089","svg_p:path3597","svg_p:path3513","svg_p:path3601","svg_p:path3601-2","svg_p:path3187","svg_p:path3087","svg_p:path2995","svg_p:path3535"]],draw_name:[["svg_p:path3085"]]};sim.poc.signals["TD"]={name:"TD",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; CHECK_RTD","MV BUS_DB REG_MBR; FIRE R; FIRE W; CHECK_RTD"],fire_name:["svg_p:text3103"],draw_data:[["svg_p:path3093","svg_p:path3101","svg_p:path3587","svg_p:path3419-8","svg_p:path3071","svg_p:path3099","svg_p:path3097","svg_p:path3559-5","svg_p:path3419-1-0","svg_p:path3583","svg_p:path3419-1","svg_p:path3491","svg_p:path3641","svg_p:path3541"]],draw_name:[["svg_p:path3095"]]};sim.poc.signals["T1"]={name:"T1",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 0","MV BUS_IB REG_MBR; FIRE M7; FIRE M1; SET_TT TTCPU 0"],fire_name:["svg_p:text3105"],draw_data:[["svg_p:path3065","svg_p:path3071","svg_p:path3069","svg_p:path3049","svg_p:path3063-9","svg_p:path3071"]],draw_name:[["svg_p:path3067"]]};sim.poc.signals["T2"]={name:"T2",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 1","MV BUS_IB REG_PC; FIRE M7; FIRE M1; SET_TT TTCPU 1"],fire_name:["svg_p:text3449"],draw_data:[["svg_p:path3195","svg_p:path3199","svg_p:path3201","svg_p:path3049"]],draw_name:[["svg_p:path3329"]]};sim.poc.signals["T3"]={name:"T3",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 2","MV BUS_IB SELEC_T3; FIRE M7; FIRE M1; SET_TT TTCPU 2"],fire_name:["svg_p:text3451"],draw_data:[["svg_p:path3347","svg_p:path3349","svg_p:path3931","svg_p:path3345","svg_p:path3049"]],draw_name:[["svg_p:path3351"]]};sim.poc.signals["T6"]={name:"T6",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 3","MV BUS_IB ALU_T6; FIRE M7; FIRE M1; SET_TT TTCPU 3"],fire_name:["svg_p:text3457"],draw_data:[["svg_p:path3315","svg_p:path3589","svg_p:path3317","svg_p:path3163-2","svg_p:path3049","svg_p:path3317-9","svg_p:path3321","svg_p:path3261-8"]],draw_name:[["svg_p:path3319"]]};sim.poc.signals["T8"]={name:"T8",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 4","MV BUS_IB REG_SR; FIRE M7; FIRE M1; SET_TT TTCPU 4"],fire_name:["svg_p:text3657"],draw_data:[["svg_p:path3645","svg_p:path3651","svg_p:path3647","svg_p:path3049"]],draw_name:[["svg_p:path3649"]]};sim.poc.signals["T9"]={name:"T9",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 5","MV BUS_IB RA_T9; FIRE M7; FIRE M1; SET_TT TTCPU 5"],fire_name:["svg_p:text3147"],draw_data:[["svg_p:path3131","svg_p:path3143","svg_p:path3139","svg_p:path3049","svg_p:path3143-9"]],draw_name:[["svg_p:path3133"]]};sim.poc.signals["T10"]={name:"T10",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 6","MV BUS_IB RB_T10; FIRE M7; FIRE M1; SET_TT TTCPU 6"],fire_name:["svg_p:text3149"],draw_data:[["svg_p:path3135","svg_p:path3145","svg_p:path3141","svg_p:path3049","svg_p:path3145-5"]],draw_name:[["svg_p:path3137"]]};sim.poc.signals["T11"]={name:"T11",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 7","CP_FIELD BUS_IB REG_MICROINS/EXCODE; FIRE M7; FIRE M1; SET_TT TTCPU 7"],fire_name:["svg_p:text3147-5","svg_cu:tspan4426"],draw_data:[["svg_p:path3131-3","svg_p:path3081-3","svg_p:path3139-7","svg_p:path3049","svg_cu:path3081-3","svg_cu:path3139-7","svg_cu:path3502"]],draw_name:[["svg_p:path3133-6","svg_cu:path3133-6"]]};sim.poc.signals["T12"]={name:"T12",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 8","MV BUS_IB HPC_T12; FIRE M7; FIRE M1; SET_TT TTCPU 8"],fire_name:["svg_p:text3147-5-0-1-1"],draw_data:[["svg_p:path3131-3-8-4-31","svg_p:path3139-7-1-4-3","svg_cu:path3049"]],draw_name:[["svg_cu:path3133-6-9-7-5"]]};sim.poc.signals["M1"]={name:"M1",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M1_C1 BUS_IB","MV M1_C1 BUS_DB"],depends_on:["C1"],fire_name:["svg_p:text3469"],draw_data:[["svg_p:path3063","svg_p:path3061","svg_p:path3059"],["svg_p:path3057","svg_p:path3641","svg_p:path3419","svg_p:path3583"]],draw_name:[[],["svg_p:path3447"]]};sim.poc.signals["M7"]={name:"M7",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M7_C7 BUS_IB","MV M7_C7 REG_SR; UPDATE_FLAG M7_C7 FLAG_C 31; UPDATE_FLAG M7_C7 FLAG_V 30; UPDATE_FLAG M7_C7 FLAG_N 29; UPDATE_FLAG M7_C7 FLAG_Z 28"],depends_on:["C7"],fire_name:["svg_p:text3673"],draw_data:[["svg_p:path3691","svg_p:path3693","svg_p:path3659"],["svg_p:path3695"]],draw_name:[[],["svg_p:path3667"]]};sim.poc.signals["MA"]={name:"MA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV MA_ALU RA_T9; FIRE COP","MV MA_ALU BUS_IB; FIRE COP"],depends_on:["SELA","SELB"],fire_name:["svg_p:text3463"],draw_data:[["svg_p:path3249","svg_p:path3161","svg_p:path3165"],["svg_p:path3279"]],draw_name:[[],["svg_p:path3423"]]};sim.poc.signals["MB"]={name:"MB",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV MB_ALU RB_T10; FIRE COP","MV MB_ALU REG_PC; FIRE COP"],depends_on:["SELA","SELB"],fire_name:["svg_p:text3465"],draw_data:[["svg_p:path3281","svg_p:path3171","svg_p:path3169"],["svg_p:path3283"]],draw_name:[[],["svg_p:path3425","svg_p:path3427"]]};sim.poc.signals["MH"]={name:"MH",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MV HPC_T12 CLK","MV HPC_T12 ACC_TIME","MV HPC_T12 ACC_PWR","NOP"],fire_name:["svg_p:text3147-5-0-1-8-4"],draw_data:[[],["svg_p:path3081-3-8-5-3"]],draw_name:[[],["svg_p:path3306-8-7-6"]]};sim.poc.signals["COP"]={name:"COP",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["NOP_ALU; UPDATE_NZVC","AND ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","OR ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","NOT ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","XOR ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SRL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SRA ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","RR ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","RL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUB ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","MUL ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","DIV ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","MOD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","LUI ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADDFOUR ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADDONE ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUBFOUR ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUBONE ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FADD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FSUB ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FMUL ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FDIV ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FMOD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU"],depends_on:["SELCOP"],fire_name:["svg_p:text3303"],draw_data:[["svg_p:path3237","svg_p:path3239","svg_p:path3261-8","svg_p:path3321","svg_p:path3901-6","svg_p:path3317-9"]],draw_name:[["svg_p:path3009","svg_p:path3301"]]};sim.poc.signals["SELA"]={name:"SELA",visible:true,type:"L",value:0,default_value:0,nbits:"6",behavior:["FIRE_IFCHANGED MRA SELA; RESET_CHANGED SELA"],depends_on:["RA"],fire_name:["svg_cu:text3164"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["SELB"]={name:"SELB",visible:true,type:"L",value:0,default_value:0,nbits:"6",behavior:["FIRE_IFCHANGED MRB SELB; RESET_CHANGED SELB"],depends_on:["RB"],fire_name:["svg_cu:text3168"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["SELC"]={name:"SELC",visible:true,type:"L",value:0,default_value:0,nbits:"6",behavior:["FIRE_IFCHANGED MRC SELC; RESET_CHANGED SELC"],depends_on:["RC"],fire_name:["svg_cu:text3172"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["SELCOP"]={name:"SELCOP",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE_IFCHANGED MC SELCOP; RESET_CHANGED SELCOP"],depends_on:["COP"],fire_name:["svg_cu:text3312"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["EXCODE"]={name:"EXCODE",visible:true,type:"L",value:0,default_value:0,nbits:"4",behavior:["FIRE T11"],fire_name:["svg_cu:text3312-6"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["RA"]={name:"RA",visible:true,type:"L",value:0,default_value:0,nbits:"6",forbidden:true,behavior:["GET RA_T9 BR RA; FIRE_IFSET T9 1; FIRE_IFSET MA 0"],depends_on:["SELA"],fire_name:["svg_p:text3107"],draw_data:[[]],draw_name:[["svg_p:path3109"]]};sim.poc.signals["RB"]={name:"RB",visible:true,type:"L",value:0,default_value:0,nbits:"6",forbidden:true,behavior:["GET RB_T10 BR RB; FIRE_IFSET T10 1; FIRE_IFSET MB 0"],depends_on:["SELB"],fire_name:["svg_p:text3123"],draw_data:[[]],draw_name:[["svg_p:path3113"]]};sim.poc.signals["RC"]={name:"RC",visible:true,type:"L",value:0,default_value:0,nbits:"6",forbidden:true,behavior:["FIRE LC"],depends_on:["SELC"],fire_name:["svg_p:text3125"],draw_data:[[]],draw_name:[["svg_p:path3117"]]};sim.poc.signals["LC"]={name:"LC",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","SET BR RC BUS_IB"],fire_name:["svg_p:text3127"],draw_data:[["svg_p:path3153","svg_p:path3151","svg_p:path3129"]],draw_name:[["svg_p:path3121"]]};sim.poc.signals["SE"]={name:"SE",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3","MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3593"],draw_data:[[]],draw_name:[["svg_p:path3591","svg_p:path3447-7-7"]]};sim.poc.signals["SIZE"]={name:"SIZE",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3363"],draw_data:[[]],draw_name:[["svg_p:path3355"]]};sim.poc.signals["OFFSET"]={name:"OFFSET",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3707"],draw_data:[[]],draw_name:[["svg_p:path3359"]]};sim.poc.signals["MC"]={name:"MC",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT COP REG_IR 0 5; FIRE_IFCHANGED COP MC","CP_FIELD COP REG_MICROINS/SELCOP; FIRE_IFCHANGED COP MC"],depends_on:["SELCOP"],fire_name:["svg_cu:text3322","svg_cu:text3172-1-5"],draw_data:[["svg_cu:path3320","svg_cu:path3142"],["svg_cu:path3318","svg_cu:path3502-6","svg_cu:path3232-6"]],draw_name:[[],["svg_cu:path3306"]]};sim.poc.signals["MRA"]={name:"MRA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RA REG_IR REG_MICROINS/SELA 5; FIRE RA;","CP_FIELD RA REG_MICROINS/SELA; FIRE RA;"],depends_on:["SELA"],fire_name:["svg_cu:text3222"],draw_data:[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3142b","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3260"],["svg_cu:path3270","svg_cu:path3258","svg_cu:path3260","svg_cu:path3294","svg_cu:path3288","svg_cu:path3280"]],draw_name:[[],["svg_cu:path3220"]]};sim.poc.signals["MRB"]={name:"MRB",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RB REG_IR REG_MICROINS/SELB 5; FIRE RB;","CP_FIELD RB REG_MICROINS/SELB; FIRE RB;"],depends_on:["SELB"],fire_name:["svg_cu:text3242"],draw_data:[["svg_cu:path3196","svg_cu:path3278","svg_cu:path3292"],["svg_cu:path3282","svg_cu:path3258-4","svg_cu:path3278","svg_cu:path3196"]],draw_name:[[],["svg_cu:path3240"]]};sim.poc.signals["MRC"]={name:"MRC",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RC REG_IR REG_MICROINS/SELC 5; FIRE RC;","CP_FIELD RC REG_MICROINS/SELC; FIRE RC;"],depends_on:["SELC"],fire_name:["svg_cu:text3254"],draw_data:[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3142b","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3232","svg_cu:path3292"],["svg_cu:path3300","svg_cu:path3294","svg_cu:path3292","svg_cu:path3288","svg_cu:path3232"]],draw_name:[[],["svg_cu:path3252"]]};sim.poc.signals["IOR"]={name:"IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MOVE_BITS SCR_IOR 0 1 IOR; FIRE SCR_IOR; MOVE_BITS IO_IOR 0 1 IOR; FIRE IO_IOR; MOVE_BITS L3D_IOR 0 1 IOR; FIRE L3D_IOR; MOVE_BITS KBD_IOR 0 1 IOR; FIRE KBD_IOR; MOVE_BITS LEDM_IOR 0 1 IOR; FIRE LEDM_IOR"],fire_name:[],draw_data:[[],["svg_p:path3733","svg_p:path3491","svg_p:text3715"]],draw_name:[[],[]]};sim.poc.signals["IOW"]={name:"IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MOVE_BITS SCR_IOW 0 1 IOW; FIRE SCR_IOW; MOVE_BITS IO_IOW 0 1 IOW; FIRE IO_IOW; MOVE_BITS L3D_IOW 0 1 IOW; FIRE L3D_IOW; MOVE_BITS LEDM_IOW 0 1 IOW; FIRE LEDM_IOW"],fire_name:[],draw_data:[[],["svg_p:path3735","svg_p:path3491","svg_p:text3717"]],draw_name:[[],[]]};sim.poc.signals["TEST_C"]={name:"TEST_C",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_C VAL_ZERO; FIRE M7","MV FLAG_C VAL_ONE; FIRE M7"],depends_on:["SELCOP"],fire_name:["svg_p:text3701-3"],draw_data:[["svg_p:text3701-3"]],draw_name:[[]]};sim.poc.signals["TEST_V"]={name:"TEST_V",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_V VAL_ZERO; FIRE M7","MV FLAG_V VAL_ONE; FIRE M7"],depends_on:["SELCOP"],fire_name:["svg_p:text3701-3-1"],draw_data:[["svg_p:text3701-3-1"]],draw_name:[[]]};sim.poc.signals["TEST_N"]={name:"TEST_N",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_N VAL_ZERO; FIRE M7","MV FLAG_N VAL_ONE; FIRE M7"],depends_on:["SELCOP"],fire_name:["svg_p:text3701-3-2"],draw_data:[["svg_p:text3701-3-2"]],draw_name:[[]]};sim.poc.signals["TEST_Z"]={name:"TEST_Z",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_Z VAL_ZERO; FIRE M7","MV FLAG_Z VAL_ONE; FIRE M7"],depends_on:["SELCOP"],fire_name:["svg_p:text3701-3-5"],draw_data:[["svg_p:text3701-3-5"]],draw_name:[[]]};sim.poc.signals["TEST_I"]={name:"TEST_I",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_I VAL_ZERO; FIRE M7","MV FLAG_I VAL_ONE; FIRE M7"],depends_on:["CLK"],fire_name:["svg_cu:text3440"],draw_data:[["svg_cu:text3440"]],draw_name:[[]]};sim.poc.signals["TEST_U"]={name:"TEST_U",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_U VAL_ZERO; FIRE M7","MV FLAG_U VAL_ONE; FIRE M7"],depends_on:["CLK"],fire_name:["svg_cu:text3442"],draw_data:[["svg_cu:text3442"]],draw_name:[[]]};sim.poc.signals["TEST_INTV"]={name:"TEST_INTV",visible:true,type:"L",value:0,default_value:0,nbits:"8",forbidden:true,behavior:["MBIT INTV TEST_INTV 0 32"],depends_on:["INT"],fire_name:["svg_p:tspan4225"],draw_data:[["svg_p:path3749"]],draw_name:[[]]};sim.poc.behaviors["NOP"]={nparameters:1,operation:function(s_expr){},verbal:function(s_expr){return""}};sim.poc.behaviors["NOP_ALU"]={nparameters:1,operation:function(s_expr){sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){return"Reset ALU flags. "}};sim.poc.behaviors["MV"]={nparameters:3,types:["X","X"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)},verbal:function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg("verbal_verbose");if(verbose!=="short"){return"Copy from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(newval)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(newval)+"). "}};sim.poc.behaviors["LOAD"]={nparameters:3,types:["X","X"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)},verbal:function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Load from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(newval)+". "}return show_verbal(s_expr[1])+" = "+show_value(newval)+" ( "+show_verbal(s_expr[2])+"). "}};sim.poc.behaviors["CP_FIELD"]={nparameters:3,types:["X","X"],operation:function(s_expr){r=s_expr[2].split("/");sim_elto_org=get_reference(r[0]);newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval!="undefined"){sim_elto_dst=get_reference(s_expr[1]);set_value(sim_elto_dst,newval)}},verbal:function(s_expr){var r=s_expr[2].split("/");var sim_elto_org=get_reference(r[0]);var newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval=="undefined")newval="<undefined>";else newval=show_value(newval);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return'Copy from "'+show_verbal(r[0])+'"['+r[1]+"] "+"to "+show_verbal(s_expr[1])+" (value "+newval+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(r[0])+"."+r[1]+" ("+newval+"). "}};sim.poc.behaviors["NOT_ES"]={nparameters:3,types:["S","E"],operation:function(s_expr){set_value(sim.poc.signals[s_expr[1]],Math.abs(get_value(sim.poc.states[s_expr[2]])-1))},verbal:function(s_expr){var value=Math.abs(get_value(sim.poc.states[s_expr[2]])-1);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Set "+show_verbal(s_expr[1])+" with value "+show_value(value)+" (Logical NOT of "+s_expr[2]+"). "}return show_verbal(s_expr[1])+" = "+show_value(value)+" (Logical NOT "+s_expr[2]+"). "}};sim.poc.behaviors["GET"]={nparameters:4,types:["E","E","S"],operation:function(s_expr){set_value(sim.poc.states[s_expr[1]],get_value(sim.poc.states[s_expr[2]][sim.poc.signals[s_expr[3]].value]))},verbal:function(s_expr){var value=get_value(sim.poc.states[s_expr[2]][sim.poc.signals[s_expr[3]].value]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Set "+show_verbal(s_expr[1])+" with value "+show_value(value)+" (Register File "+s_expr[3]+"). "}return show_verbal(s_expr[1])+" = "+show_value(value)+" (Register File "+s_expr[3]+"). "}};sim.poc.behaviors["SET"]={nparameters:4,types:["E","S","E"],operation:function(s_expr){set_value(sim.poc.states[s_expr[1]][sim.poc.signals[s_expr[2]].value],get_value(sim.poc.states[s_expr[3]]))},verbal:function(s_expr){var value=get_value(sim.poc.states[s_expr[3]]);var o_ref=sim.poc.states[s_expr[1]][sim.poc.signals[s_expr[2]].value];var o_verbal=o_ref.name;if(typeof o_ref.verbal!="undefined")o_verbal=o_ref.verbal;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy to "+o_verbal+" the value "+show_value(value)+". "}return o_verbal+" = "+show_value(value)+". "}};sim.poc.behaviors["AND"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])&get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])&get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU AND with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (AND). "}};sim.poc.behaviors["OR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])|get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])|get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU OR with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (OR). "}};sim.poc.behaviors["NOT"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=~get_value(sim.poc.states[s_expr[2]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=~get_value(sim.poc.states[s_expr[2]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU NOT with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (NOT). "}};sim.poc.behaviors["XOR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])^get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])^get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU XOR with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (XOR). "}};sim.poc.behaviors["SRL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Right Logical with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SRL). "}};sim.poc.behaviors["SRA"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Right Arithmetic with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SRA). "}};sim.poc.behaviors["SL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Left with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SL). "}};sim.poc.behaviors["RR"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1|(get_value(sim.poc.states[s_expr[2]])&1)<<31;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1|(get_value(sim.poc.states[s_expr[2]])&1)<<31;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Right Rotation with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (RR). "}};sim.poc.behaviors["RL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1|(get_value(sim.poc.states[s_expr[2]])&2147483648)>>>31;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1|(get_value(sim.poc.states[s_expr[2]])&2147483648)>>>31;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Left Rotation with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (LR). "}};sim.poc.behaviors["ADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a+b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a+b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU ADD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (ADD). "}};sim.poc.behaviors["SUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a-b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a-b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU SUB with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SUB). "}};sim.poc.behaviors["MUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a*b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a*b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MUL with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MUL). "}};sim.poc.behaviors["DIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){return"ALU DIV zero by zero (oops!). "}var result=Math.floor(a/b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU DIV with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (DIV). "}};sim.poc.behaviors["MOD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=a%b;set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){return"ALU MOD zero by zero (oops!). "}var result=a%b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MOD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MOD). "}};sim.poc.behaviors["LUI"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Load Upper Immediate with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (LUI). "}};sim.poc.behaviors["ADDFOUR"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;return"ALU ADD 4 with result "+show_value(result)+". "}};sim.poc.behaviors["ADDONE"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;return"ALU ADD 1 with result "+show_value(result)+". "}};sim.poc.behaviors["SUBFOUR"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-4;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-4;return"ALU SUB 4 with result "+show_value(result)+". "}};sim.poc.behaviors["SUBONE"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-1;return"ALU SUB 1 with result "+show_value(result)+". "}};sim.poc.behaviors["FADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)+b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)+b.toFixed(2);return"ALU Float ADD with result "+result+". "}};sim.poc.behaviors["FSUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)-b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)-b.toFixed(2);return"ALU Float SUB with result "+result+". "}};sim.poc.behaviors["FMUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)*b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)*b.toFixed(2);return"ALU Float MUL with result "+result+". "}};sim.poc.behaviors["FDIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)/b.toFixed(2);return"ALU Float DIV with result "+result+". "}};sim.poc.behaviors["FMOD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=(get_value(sim.poc.states[s_expr[2]])<<0)%(get_value(sim.poc.states[s_expr[3]])<<0);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)%b.toFixed(2);return"ALU Float MOD with result "+result+". "}};sim.poc.behaviors["LUI"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;return"ALU Load Upper Immediate with result "+show_value(result)+". "}};sim.poc.behaviors["PLUS1"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;set_value(sim.poc.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Add one to "+show_verbal(s_expr[2])+" and copy to "+show_verbal(s_expr[1])+" with result "+show_value(result)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" + 1"+" ("+show_value(result)+"). "}};sim.poc.behaviors["PLUS4"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;set_value(sim.poc.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Add four to "+show_verbal(s_expr[2])+" and copy to "+show_verbal(s_expr[1])+" with result "+show_value(result)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" + 4"+" ("+show_value(result)+"). "}};sim.poc.behaviors["SET_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a|m;set_value(sim.poc.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.poc.behaviors["RST_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a&~m;set_value(sim.poc.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.poc.behaviors["CHECK_RTD"]={nparameters:1,operation:function(s_expr){var number_active_tri=parseInt(simhw_sim_signal("TD").value)+parseInt(simhw_sim_signal("R").value);update_system_bus_fire(number_active_tri)},verbal:function(s_expr){return""}};sim.poc.behaviors["MBIT"]={nparameters:5,types:["X","X","I","I"],operation:function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);set_value(sim_elto_dst,parseInt(n2,2))},verbal:function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=parseInt(n2,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(n3)+" (copied "+size+" bits from bit "+offset+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(n3)+", "+size+" bits from bit "+offset+"). "}};sim.poc.behaviors["MBIT_SN"]={nparameters:5,types:["S","E","E","I"],operation:function(s_expr){var base=0;var r=s_expr[3].split("/");if(1==r.length)base=get_value(sim.poc.states[s_expr[3]]);else if(typeof sim.poc.states[r[0]].value[r[1]]!="undefined")base=sim.poc.states[r[0]].value[r[1]];else if(typeof sim.poc.signals[r[1]].default_value!="undefined")base=sim.poc.signals[r[1]].default_value;else if(typeof sim.poc.states[r[1]].default_value!="undefined")base=sim.poc.states[r[1]].default_value;else ws_alert("WARN: undefined state/field pair -> "+r[0]+"/"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.poc.states[s_expr[2]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var base=0;var r=s_expr[3].split("/");if(1==r.length)base=get_value(sim.poc.states[s_expr[3]]);else if(typeof sim.poc.states[r[0]].value[r[1]]!="undefined")base=sim.poc.states[r[0]].value[r[1]];else if(typeof sim.poc.signals[r[1]].default_value!="undefined")base=sim.poc.signals[r[1]].default_value;else if(typeof sim.poc.states[r[1]].default_value!="undefined")base=sim.poc.states[r[1]].default_value;else ws_alert("WARN: undefined state/field pair -> "+r[0]+"/"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.poc.states[s_expr[2]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);var from_elto="";if(1==r.length)from_elto=show_verbal(s_expr[3]);else from_elto='"'+show_verbal(s_expr[2])+'"['+r[1]+"] ";var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+from_elto+"into "+show_verbal(s_expr[1])+" "+"value "+parseInt(n3,2)+". "}return show_verbal(s_expr[1])+" = "+from_elto+" ("+parseInt(n3,2)+"). "}};sim.poc.behaviors["SBIT_SIGNAL"]={nparameters:4,types:["X","I","I"],operation:function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)},verbal:function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)}};sim.poc.behaviors["UPDATE_FLAG"]={nparameters:4,types:["X","X","I"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value&~(1<>>0)},verbal:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Update "+show_verbal(s_expr[2])+" to value "+sim_elto_org.value+". "}return show_verbal(s_expr[1])+"."+show_verbal(s_expr[3])+" = "+sim_elto_org.value+". "}};sim.poc.behaviors["MBITS"]={nparameters:8,types:["E","I","E","S","S","I","S"],operation:function(s_expr){var offset=parseInt(sim.poc.signals[s_expr[4]].value);var size=parseInt(sim.poc.signals[s_expr[5]].value);var n1=get_value(sim.poc.states[s_expr[3]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;if("1"==sim.poc.signals[s_expr[7]].value&&"1"==n2.substr(0,1)){n3="11111111111111111111111111111111".substring(0,32-n2.length)+n2}set_value(sim.poc.states[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var offset=parseInt(sim.poc.signals[s_expr[4]].value);var size=parseInt(sim.poc.signals[s_expr[5]].value);var n1=get_value(sim.poc.states[s_expr[3]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;if("1"==sim.poc.signals[s_expr[7]].value&&"1"==n2.substr(0,1)){n3="11111111111111111111111111111111".substring(0,32-n2.length)+n2}n1=parseInt(n3,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return" Copy from "+show_verbal(s_expr[3])+" to "+show_verbal(s_expr[1])+" value "+show_value(n1)+" (copied "+size+" bits from bit "+offset+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[3])+" ("+show_value(n1)+", "+size+" bits from bit "+offset+"). "}};sim.poc.behaviors["BSEL"]={nparameters:6,types:["E","I","I","E","I"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var n4="00000000000000000000000000000000".substr(0,posd);n3=n3+n4;set_value(sim.poc.states[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var posd=parseInt(s_expr[2]);var len=parseInt(s_expr[3]);var poso=parseInt(s_expr[5]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var n4="00000000000000000000000000000000".substr(0,posd);n3=n3+n4;var n5=parseInt(n3,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[4])+" to "+show_verbal(s_expr[1])+" value "+show_value(n5)+" (copied "+len+" bits, from bit "+poso+" of "+s_expr[4]+" to bit "+posd+" of "+s_expr[1]+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[4])+" ("+show_value(n5)+", "+len+" bits, from bit "+poso+" of "+s_expr[4]+" to bit "+posd+" of "+s_expr[1]+"). "}};sim.poc.behaviors["EXT_SIG"]={nparameters:3,types:["E","I"],operation:function(s_expr){var n1=get_value(sim.poc.states[s_expr[1]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if("1"==n2[31-s_expr[2]]){n4="11111111111111111111111111111111".substring(0,32-n3.length)+n4}set_value(sim.poc.states[s_expr[1]],parseInt(n4,2))},verbal:function(s_expr){var n1=get_value(sim.poc.states[s_expr[1]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if("1"==n2[31-s_expr[2]]){n4="11111111111111111111111111111111".substring(0,32-n3.length)+n4}var n5=parseInt(n4,2);return"Sign Extension with value "+show_value(n5)+". "}};sim.poc.behaviors["MOVE_BITS"]={nparameters:5,types:["S","I","I","S"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=0;var len=parseInt(s_expr[3]);var n1=sim.poc.signals[s_expr[4]].value.toString(2);n1="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.poc.signals[s_expr[1]].value.toString(2);n2="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.poc.behaviors["MOVE_BITSE"]={nparameters:6,types:["S","I","I","E","I"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);n1="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.poc.signals[s_expr[1]].value.toString(2);n2="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.poc.behaviors["DECO"]={nparameters:1,operation:function(s_expr){sim.poc.states["INEX"].value=0;var oi=decode_instruction(sim.poc.internal_states.FIRMWARE,sim.poc.ctrl_states.ir,get_value(sim.poc.states["REG_IR"]));if(null==oi.oinstruction){ws_alert("ERROR: undefined instruction code in IR ("+"co:"+oi.op_code.toString(2)+", "+"cop:"+oi.cop_code.toString(2)+")");sim.poc.states["ROM_MUXA"].value=0;sim.poc.states["INEX"].value=1;return-1}var rom_addr=oi.op_code<<6;if(typeof oi.oinstruction.cop!="undefined"){rom_addr=rom_addr+oi.cop_code}if(typeof sim.poc.internal_states["ROM"][rom_addr]=="undefined"){ws_alert("ERROR: undefined rom address "+rom_addr+" in firmware");sim.poc.states["ROM_MUXA"].value=0;return-1}sim.poc.states["ROM_MUXA"].value=sim.poc.internal_states["ROM"][rom_addr];var val=get_value(sim.poc.states["DECO_INS"]);set_value(sim.poc.states["DECO_INS"],val+1);var pc=get_value(sim.poc.states["REG_PC"])-4;var decins=get_deco_from_pc(pc);set_value(sim.poc.states["REG_IR_DECO"],decins);show_dbg_ir(get_value(sim.poc.states["REG_IR_DECO"]))},verbal:function(s_expr){return"Decode instruction. "}};sim.poc.behaviors["FIRE"]={nparameters:2,types:["S"],operation:function(s_expr){if(sim.poc.internal_states.fire_stack.indexOf(s_expr[1])!=-1){return}sim.poc.internal_states.fire_stack.push(s_expr[1]);update_draw(sim.poc.signals[s_expr[1]],sim.poc.signals[s_expr[1]].value);if("L"==sim.poc.signals[s_expr[1]].type){update_state(s_expr[1])}sim.poc.internal_states.fire_stack.pop(s_expr[1])},verbal:function(s_expr){return""}};sim.poc.behaviors["FIRE_IFSET"]={nparameters:3,types:["S","I"],operation:function(s_expr){if(get_value(sim.poc.signals[s_expr[1]])!=parseInt(s_expr[2])){return}sim.poc.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.poc.behaviors["FIRE_IFCHANGED"]={nparameters:3,types:["S","X"],operation:function(s_expr){sim_elto=get_reference(s_expr[2]);if(sim_elto.changed==false)return;sim.poc.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.poc.behaviors["RESET_CHANGED"]={nparameters:2,types:["X"],operation:function(s_expr){sim_elto=get_reference(s_expr[1]);sim_elto.changed=false},verbal:function(s_expr){return""}};sim.poc.behaviors["CLOCK"]={nparameters:1,operation:function(s_expr){var new_maddr=null;var mcelto=null;var t0=performance.now();var val=get_value(sim.poc.states["CLK"]);set_value(sim.poc.states["CLK"],val+1);set_value(sim.poc.states["TTCPU"],0);new_maddr=get_value(sim.poc.states["REG_MICROADDR"]);mcelto=sim.poc.internal_states["MC"][new_maddr];if(typeof mcelto!=="undefined"&&false==mcelto.is_native){for(var i=0;i>>0},set_value:function(elto,value){var origin="";var r_value=main_memory_get_program_counter();if(r_value!=null){origin="PC=0x"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.poc.internal_states.MP,elto,melto);show_main_memory(sim.poc.internal_states.MP,elto,typeof valref==="undefined",true);return value}};sim.poc.internal_states.segments={};sim.poc.internal_states.MP={};sim.poc.internal_states.MP_wc=0;sim.poc.internal_states.CM_cfg=[];sim.poc.internal_states.CM=[];sim.poc.signals.MRDY={name:"MRDY",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE_IFCHANGED MRDY C","FIRE_IFCHANGED MRDY C"],fire_name:["svg_p:tspan3916"],draw_data:[[],["svg_p:path3895","svg_p:path3541"]],draw_name:[[],[]]};sim.poc.signals.R={name:"R",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; CHECK_RTD","MEM_READ BUS_AB BUS_DB BW MRDY CLK; FIRE M1; FIRE MRDY; CHECK_RTD"],fire_name:["svg_p:text3533-5-2"],draw_data:[[],["svg_p:path3557","svg_p:path3571"]],draw_name:[[],[]]};sim.poc.signals.W={name:"W",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MEM_WRITE BUS_AB BUS_DB BW MRDY CLK; FIRE M1; FIRE MRDY"],fire_name:["svg_p:text3533-5-08"],draw_data:[[],["svg_p:path3559","svg_p:path3575","svg_p:path3447-7"]],draw_name:[[],[]]};sim.poc.signals.BW={name:"BW",verbal:["Access to one byte from memory. ","Access to two bytes from memory. ","Access to three bytes from memory. ","Access to a word from memory. "],visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["FIRE R; FIRE W","FIRE R; FIRE W","FIRE R; FIRE W","FIRE R; FIRE W"],fire_name:["svg_p:text3533-5-2-8"],draw_data:[["svg_p:path3557-0"]],draw_name:[[],[]]};sim.poc.behaviors.MEM_READ={nparameters:6,types:["E","E","S","S","E"],operation:function(s_expr){var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);sim.poc.signals[s_expr[4]].value=0;var remain=get_value(sim.poc.internal_states.MP_wc);if(typeof sim.poc.events.mem[clk-1]!="undefined"&&sim.poc.events.mem[clk-1]>0){remain=sim.poc.events.mem[clk-1]-1}var first_time=typeof sim.poc.events.mem[clk]=="undefined";sim.poc.events.mem[clk]=remain;if(remain>0){return}var wordress=address&4294967292;var value=main_memory_getvalue(sim.poc.internal_states.MP,wordress);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}dbvalue=main_memory_extractvalues(value,bw,address&3);sim.poc.states[s_expr[2]].value=dbvalue>>>0;sim.poc.signals[s_expr[4]].value=1;show_main_memory(sim.poc.internal_states.MP,wordress,full_redraw,false);if(first_time&&sim.poc.internal_states.CM.length>0){cache_memory_access(sim.poc.internal_states.CM[0],address,"read",clk)}},verbal:function(s_expr){var verbal="";var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);switch(bw){case 0:bw_type="byte";break;case 1:bw_type="half";break;case 2:bw_type="three bytes";break;case 3:bw_type="word";break}var value=main_memory_getvalue(sim.poc.internal_states.MP,address);if(typeof value==="undefined"){value=0}verbal="Try to read a "+bw_type+" from memory "+"at address 0x"+address.toString(16)+" with value "+value.toString(16)+". ";return verbal}};sim.poc.behaviors.MEM_WRITE={nparameters:6,types:["E","E","S","S","E"],operation:function(s_expr){var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);sim.poc.signals[s_expr[4]].value=0;var remain=get_value(sim.poc.internal_states.MP_wc);if(typeof sim.poc.events.mem[clk-1]!="undefined"&&sim.poc.events.mem[clk-1]>0){remain=sim.poc.events.mem[clk-1]-1}var first_time=typeof sim.poc.events.mem[clk]=="undefined";sim.poc.events.mem[clk]=remain;if(remain>0){return}var wordress=address&4294967292;var value=main_memory_getvalue(sim.poc.internal_states.MP,wordress);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}value=main_memory_updatevalues(value,dbvalue,bw,address&3);var origin="";var r_value=main_memory_get_program_counter();if(r_value!=null){origin="PC=0x"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var elto=main_memory_set(sim.poc.internal_states.MP,wordress,melto);sim.poc.signals[s_expr[4]].value=1;show_main_memory(sim.poc.internal_states.MP,wordress,full_redraw,true);if(first_time&&sim.poc.internal_states.CM.length>0){cache_memory_access(sim.poc.internal_states.CM[0],address,"write",clk)}},verbal:function(s_expr){var verbal="";var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);switch(bw){case 0:bw_type="byte";break;case 1:bw_type="half";break;case 2:bw_type="three bytes";break;case 3:bw_type="word";break}var value=main_memory_getvalue(sim.poc.internal_states.MP,address);if(typeof value==="undefined"){value=0}verbal="Try to write a "+bw_type+" to memory "+"at address 0x"+address.toString(16)+" with value "+value.toString(16)+". ";return verbal}};sim.poc.behaviors.MEMORY_RESET={nparameters:1,operation:function(s_expr){sim.poc.events.mem={}},verbal:function(s_expr){return"Reset the memory (all values will be zeroes). "}};sim.poc.elements.memory={name:"Main memory",description:"Main memory subsystem",type:"subcomponent",belongs:"MEMORY",states:{addr:{ref:"BUS_AB"},data:{ref:"BUS_DB"},mrdy:{ref:"MRDY"}},signals:{bw:{ref:"BW"},r:{ref:"R"},w:{ref:"W"}},states_inputs:["addr","data"],states_outputs:["mrdy","data"],signals_inputs:["bw","r","w"],signals_output:[]};sim.poc.components.IO={name:"IO",version:"1",abilities:["IO_TIMER"],details_name:["IO_STATS","IO_CONFIG"],details_fire:[["svg_p:text3775"],[]],write_state:function(vec){return vec},read_state:function(o,check){return false},get_state:function(reg){return null},get_value:function(elto){var associated_state=simhw_internalState_get("io_hash",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("IOR"),1);compute_behavior("FIRE IOR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("IOW"),1);compute_behavior("FIRE IOW");return value}};sim.poc.internal_states.io_int_factory=[];sim.poc.internal_states.io_int_factory[0]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[1]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[2]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[3]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[4]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[5]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[6]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[7]={period:0,probability:.5,accumulated:0,active:false};var IOSR_ID=4352;var IOCR_ID=4356;var IODR_ID=4360;sim.poc.internal_states.io_hash[IOSR_ID]="IOSR";sim.poc.internal_states.io_hash[IOCR_ID]="IOCR";sim.poc.internal_states.io_hash[IODR_ID]="IODR";sim.poc.states.IOSR={name:"IOSR",verbal:"IO State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.IOCR={name:"IOCR",verbal:"IO Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.IODR={name:"IODR",verbal:"IO Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.signals.INT={name:"INT",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE C","FIRE C"],fire_name:["svg_p:tspan4199"],draw_data:[[],["svg_p:path3809"]],draw_name:[[],[]]};sim.poc.signals.IORDY={name:"IORDY",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE_IFCHANGED IORDY C","FIRE_IFCHANGED IORDY C"],fire_name:["svg_p:tspan4089","svg_p:path3793","svg_p:tspan4089"],draw_data:[[],["svg_p:path3897"]],draw_name:[[],[]]};sim.poc.signals.IO_IOR={name:"IO_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","IO_IOR BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE M1"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.signals.IO_IOW={name:"IO_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","IO_IOW BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE M1"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.signals.IO_IE={name:"IO_IE",visible:true,type:"L",value:1,default_value:1,nbits:"1",behavior:["NOP","IO_CHK_I CLK INT INTV; FIRE C"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.poc.signals.INTA={name:"INTA",visible:true,type:"L",value:1,default_value:0,nbits:"1",behavior:["NOP","INTA CLK INT INTA BUS_DB INTV; FIRE M1; FIRE C"],fire_name:["svg_p:text3785-0-6-0-5-5-1-1"],draw_data:[[],["svg_p:path3807","svg_p:path3737"]],draw_name:[[],[]]};sim.poc.behaviors.IO_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==IOSR_ID)set_value(sim.poc.states[s_expr[2]],iosr);if(bus_ab==IOCR_ID)set_value(sim.poc.states[s_expr[2]],iocr);if(bus_ab==IODR_ID)set_value(sim.poc.states[s_expr[2]],iodr)},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==IOSR_ID)verbal="I/O device read at IOSR of value "+iosr+". ";if(bus_ab==IOCR_ID)verbal="I/O device read at IOCR of value "+iocr+". ";if(bus_ab==IODR_ID)verbal="I/O device read at IODR of value "+iodr+". ";return verbal}};sim.poc.behaviors.IO_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab!=IOSR_ID&&bus_ab!=IOCR_ID&&bus_ab!=IODR_ID){return}if(bus_ab==IOSR_ID)set_value(sim.poc.states[s_expr[3]],bus_db);if(bus_ab==IOCR_ID)set_value(sim.poc.states[s_expr[4]],bus_db);if(bus_ab==IODR_ID)set_value(sim.poc.states[s_expr[5]],bus_db);var iocr_id=get_value(sim.poc.states[s_expr[4]]);var iodr_id=get_value(sim.poc.states[s_expr[5]]);if(iocr_id<0||iocr_id>7)return;set_var(sim.poc.internal_states.io_int_factory[iocr_id].period,iodr_id);set_var(sim.poc.internal_states.io_int_factory[iocr_id].probability,1);if(0==iodr_id)set_var(sim.poc.internal_states.io_int_factory[iocr_id].probability,0)},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab==IOSR_ID)verbal="I/O device write at IOSR with value "+bus_db+". ";if(bus_ab==IOCR_ID)verbal="I/O device write at IOCR with value "+bus_db+". ";if(bus_ab==IODR_ID)verbal="I/O device write at IODR with value "+bus_db+". ";return verbal}};sim.poc.behaviors.IO_CHK_I={nparameters:4,types:["E","S","E"],operation:function(s_expr){var clk=get_value(sim.poc.states[s_expr[1]]);for(var i=sim.poc.internal_states.io_int_factory.length-1;i>=0;i--){if(get_var(sim.poc.internal_states.io_int_factory[i].period)==0)continue;if(get_var(sim.poc.internal_states.io_int_factory[i].active)==true){set_value(sim.poc.signals[s_expr[2]],1);set_value(sim.poc.states[s_expr[3]],i)}if(clk%get_var(sim.poc.internal_states.io_int_factory[i].period)==0){if(Math.random()>get_var(sim.poc.internal_states.io_int_factory[i].probability))continue;set_var(sim.poc.internal_states.io_int_factory[i].accumulated,get_var(sim.poc.internal_states.io_int_factory[i].accumulated)+1);set_var(sim.poc.internal_states.io_int_factory[i].active,true);if(typeof sim.poc.events.io[clk]=="undefined")sim.poc.events.io[clk]=[];sim.poc.events.io[clk].push(i);set_value(sim.poc.signals[s_expr[2]],1);set_value(sim.poc.states[s_expr[3]],i)}}},verbal:function(s_expr){return"Check I/O Interruption. "}};sim.poc.behaviors.INTA={nparameters:6,types:["E","S","S","E","E"],operation:function(s_expr){var clk=get_value(sim.poc.states[s_expr[1]]);if(typeof sim.poc.events.io[clk]!="undefined"){set_value(sim.poc.states[s_expr[4]],sim.poc.events.io[clk][0]);return}set_value(sim.poc.signals[s_expr[2]],0);set_value(sim.poc.states[s_expr[5]],0);for(var i=0;i>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("L3DR"),1);compute_behavior("FIRE L3DR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("L3DW"),1);compute_behavior("FIRE L3DW");return value}};sim.poc.internal_states.l3d_dim=4;sim.poc.internal_states.l3d_neltos=Math.pow(sim.poc.internal_states.l3d_dim,3);sim.poc.internal_states.l3d_state=Array.from({length:sim.poc.internal_states.l3d_neltos},(()=>({active:false})));sim.poc.internal_states.l3d_frame="0".repeat(sim.poc.internal_states.l3d_neltos);var L3DSR_ID=8448;var L3DCR_ID=8452;var L3DDR_ID=8456;sim.poc.internal_states.io_hash[L3DSR_ID]="L3DSR";sim.poc.internal_states.io_hash[L3DCR_ID]="L3DCR";sim.poc.internal_states.io_hash[L3DDR_ID]="L3DDR";sim.poc.states.L3DSR={name:"L3DSR",verbal:"L3D State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.L3DCR={name:"L3DCR",verbal:"L3D Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.L3DDR={name:"L3DDR",verbal:"L3D Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.signals.L3D_IOR={name:"L3D_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","L3D_IOR BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE M1"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.signals.L3D_IOW={name:"L3D_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","L3D_IOW BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE M1; L3D_SYNC"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.behaviors.L3D_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==L3DCR_ID){set_value(sim.poc.states[s_expr[2]],iocr)}if(bus_ab==L3DDR_ID){set_value(sim.poc.states[s_expr[2]],iodr)}if(bus_ab==L3DCR_ID){var x=(iodr&4278190080)>>24;var y=(iodr&16711680)>>16;var z=(iodr&65280)>>8;var p=z*Math.pow(sim.poc.internal_states.l3d_dim,2)+y*sim.poc.internal_states.l3d_dim+x;var s=get_var(sim.poc.internal_states.l3d_state[p].active);set_value(sim.poc.states[s_expr[2]],s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==L3DSR_ID)verbal="I/O device read at L3DSR of value "+iosr+". ";if(bus_ab==L3DCR_ID)verbal="I/O device read at L3DCR of value "+iocr+". ";if(bus_ab==L3DDR_ID)verbal="I/O device read at L3DDR of value "+iodr+". ";return verbal}};sim.poc.behaviors.L3D_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab!=L3DSR_ID&&bus_ab!=L3DCR_ID&&bus_ab!=L3DDR_ID){return}if(bus_ab==L3DSR_ID){set_value(sim.poc.states[s_expr[3]],bus_db)}if(bus_ab==L3DDR_ID){set_value(sim.poc.states[s_expr[5]],bus_db)}if(bus_ab==L3DCR_ID){set_value(sim.poc.states[s_expr[4]],bus_db);var x=(bus_db&4278190080)>>24;var y=(bus_db&16711680)>>16;var z=(bus_db&65280)>>8;var p=z*Math.pow(sim.poc.internal_states.l3d_dim,2)+y*sim.poc.internal_states.l3d_dim+x;var s=(bus_db&255)!=0;var l3dstates=sim.poc.internal_states.l3d_state;set_var(l3dstates[p].active,s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab==L3DSR_ID)verbal="I/O device write at L3DSR with value "+bus_db+". ";if(bus_ab==L3DCR_ID)verbal="I/O device write at L3DCR with value "+bus_db+". ";if(bus_ab==L3DDR_ID)verbal="I/O device write at L3DDR with value "+bus_db+". ";return verbal}};sim.poc.behaviors.L3D_RESET={nparameters:1,operation:function(s_expr){sim.poc.events.l3d={};var n=sim.poc.internal_states.l3d_state.length;for(var i=0;i>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("LEDMR"),1);compute_behavior("FIRE LEDMR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("LEDMW"),1);compute_behavior("FIRE LEDMW");return value}};sim.poc.internal_states.ledm_dim=24;sim.poc.internal_states.ledm_neltos=Math.pow(sim.poc.internal_states.ledm_dim,2);sim.poc.internal_states.ledm_state=Array.from({length:sim.poc.internal_states.ledm_neltos},(()=>({color:0})));sim.poc.internal_states.ledm_colors=colors_clone("");sim.poc.internal_states.ledm_frame="0".repeat(sim.poc.internal_states.ledm_neltos);var LEDMSR_ID=12544;var LEDMCR_ID=12548;var LEDMDR_ID=12552;sim.poc.internal_states.io_hash[LEDMSR_ID]="LEDMSR";sim.poc.internal_states.io_hash[LEDMCR_ID]="LEDMCR";sim.poc.internal_states.io_hash[LEDMDR_ID]="LEDMDR";sim.poc.states.LEDMSR={name:"LEDMSR",verbal:"LEDM State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.LEDMCR={name:"LEDMCR",verbal:"LEDM Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.LEDMDR={name:"LEDMDR",verbal:"LEDM Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.signals.LEDM_IOR={name:"LEDM_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","LEDM_IOR BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE M1"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.signals.LEDM_IOW={name:"LEDM_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","LEDM_IOW BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE M1; LEDM_SYNC"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.behaviors.LEDM_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==LEDMCR_ID){set_value(sim.poc.states[s_expr[2]],iocr)}if(bus_ab==LEDMDR_ID){set_value(sim.poc.states[s_expr[2]],iodr)}if(bus_ab==LEDMCR_ID){var x=(iodr&4278190080)>>24;var y=(iodr&16711680)>>16;var p=y*sim.poc.internal_states.ledm_dim+x;var s=get_var(sim.poc.internal_states.ledm_state[p].color);set_value(sim.poc.states[s_expr[2]],s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==LEDMSR_ID)verbal="I/O device read at LEDMSR of value "+iosr+". ";if(bus_ab==LEDMCR_ID)verbal="I/O device read at LEDMCR of value "+iocr+". ";if(bus_ab==LEDMDR_ID)verbal="I/O device read at LEDMDR of value "+iodr+". ";return verbal}};sim.poc.behaviors.LEDM_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);switch(bus_ab){case LEDMSR_ID:set_value(sim.poc.states[s_expr[3]],bus_db);break;case LEDMDR_ID:set_value(sim.poc.states[s_expr[5]],bus_db);break;case LEDMCR_ID:set_value(sim.poc.states[s_expr[4]],bus_db);break;default:break}if(LEDMCR_ID==bus_ab){var dr=get_value(sim.poc.states[s_expr[5]]);if(16&bus_db){var x=(dr&4278190080)>>24;var y=(dr&16711680)>>16;var s=dr&255;set_value(sim.poc.states[s_expr[3]],1);if(x>=sim.poc.internal_states.ledm_dim&&y>=sim.poc.internal_states.ledm_dim){set_value(sim.poc.states[s_expr[3]],-1);return}var p=y*sim.poc.internal_states.ledm_dim+x;set_var(sim.poc.internal_states.ledm_state[p].color,s)}if(32&bus_db){set_value(sim.poc.states[s_expr[3]],1);var s=0;var neltos=sim.poc.internal_states.ledm_neltos;var ldmstates=sim.poc.internal_states.ledm_state;for(var p=0;p>0);set_var(sim.poc.internal_states.ledm_state[p+1].color,(s&65280)>>8);set_var(sim.poc.internal_states.ledm_state[p+2].color,(s&16711680)>>16);set_var(sim.poc.internal_states.ledm_state[p+3].color,(s&4278190080)>>24)}}if(64&bus_db){set_value(sim.poc.states[s_expr[3]],1);var s=0;var c="";var neltos=sim.poc.internal_states.ledm_colors.length;for(var p=0;p>>8;s=s.toString(16);c="#"+simcoreui_pack(s,6);sim.poc.internal_states.ledm_colors[p]=c}neltos=sim.poc.internal_states.ledm_neltos;for(var p=0;p>24;var y=(dr&16711680)>>16;var s=dr&255;verbal="I/O device write at LEDMCR with value "+bus_db+" (set pixel x:"+x+", y:"+y+", with color:"+s+"). "}if(64&bus_db){verbal="I/O device write at LEDMCR with value "+bus_db+" (set color palette at:"+bus_db+"). "}break;default:break}return verbal}};sim.poc.behaviors.LEDM_RESET={nparameters:1,operation:function(s_expr){sim.poc.events.ledm={};sim.poc.internal_states.ledm_colors=colors_clone("");for(var i=0;i0)line2=context.newlines[context.newlines.length-1]+1;var line1=0;if(context.newlines.length>1)line1=context.newlines[context.newlines.length-2]+1;var lowI=line1;var highI=Math.min(context.t-1,line2+32);for(;typeof context.text[highI+1]!="undefined"&&context.text[highI+1]!="\n";highI++);var line3=highI+2;highI++;for(;typeof context.text[highI+1]!="undefined"&&context.text[highI+1]!="\n";highI++);highI++;context.error="
"+"
"+"...\n";for(var i=lowI;i"+"(*) "+i18n_get_TagFor("compiler","PROBLEM AROUND LINE")+" "+context.line+": 
"+msgError+".
";simcore_ga("compile","compile.error","compile.error."+msgError);return context}function frm_getLabelContext(context){return{t:context.t,line:context.line,newlines:context.newlines.slice()}}function frm_setLabelContext(context,labelContext){context.t=labelContext.t;context.line=labelContext.line;context.newlines=labelContext.newlines}function frm_getComments(context){return context.comments.join("\n")}function frm_resetComments(context){context.comments=[]}function frm_nextNative(context){var first=context.t;var last=context.t;var braces=1;while(context.t=Math.pow(2,simhw_sim_signal(nombre_tok).nbits)){return frm_langError(context,i18n_get_TagFor("compiler","OUT OF RANGE")+"'"+frm_getToken(context)+"'")}frm_nextToken(context)}if(frm_isToken(context,",")){frm_nextToken(context)}}var acc_cmt=frm_getComments(context);microcomments.push(acc_cmt);frm_resetComments(context);microprograma.push(microInstruccionAux);context.contadorMC++;frm_nextToken(context);if(frm_isToken(context,","))frm_nextToken(context)}if(microprograma.length===0){return frm_langError(context,i18n_get_TagFor("compiler","EMPTY MICROCODE"))}frm_nextToken(context);return{NATIVE:"",microprograma:microprograma,microcomments:microcomments}}function read_native(context){var microprograma=[];var microcomments=[];if(!frm_isToken(context,"{")){return frm_langError(context,i18n_get_TagFor("compiler","OPEN BRACE NOT FOUND"))}frm_nextNative(context);var native_code=frm_getToken(context);microprograma.push({});microcomments.push("");frm_nextToken(context);return{NATIVE:native_code,microprograma:microprograma,microcomments:microcomments}}function firm_begin_read(context){var instruccionAux={};instruccionAux.name=frm_getToken(context);instruccionAux["mc-start"]=context.contadorMC;instruccionAux["is_native"]=false;frm_nextToken(context);if(frm_isToken(context,",")){frm_nextToken(context)}if(frm_isToken(context,"native")){instruccionAux["is_native"]=true;frm_nextToken(context);if(frm_isToken(context,",")){frm_nextToken(context)}context.etiquetas[context.contadorMC]="fetch"}if(true==instruccionAux.is_native)ret=read_native(context);else ret=firm_mcode_signals_read(context);if(typeof ret.error!="undefined"){return ret}instruccionAux.signature="begin";instruccionAux.signatureGlobal="begin";instruccionAux.signatureUser="begin";instruccionAux.signatureRaw="begin";instruccionAux.NATIVE=ret.NATIVE;instruccionAux.microcode=ret.microprograma;instruccionAux.microcomments=ret.microcomments;context.instrucciones.push(instruccionAux);context.contadorMC=context.contadorMC+9;return{}}function firm_pseudoinstructions_read(context){frm_nextToken(context);if(!frm_isToken(context,"{")){return frm_langError(context,i18n_get_TagFor("compiler","OPEN BRACE NOT FOUND"))}frm_nextToken(context);while(!frm_isToken(context,"}")){var pseudoInstructionAux={};var pseudoInitial={};pseudoInitial.signature="";pseudoInitial.name="";pseudoInitial.fields=[];pseudoInitial.name=frm_getToken(context);pseudoInitial.signature=pseudoInitial.signature+frm_getToken(context)+",";frm_nextToken(context);while(!frm_isToken(context,"{")){var pseudoFieldAux={};pseudoFieldAux.name="";pseudoFieldAux.type="";pseudoFieldAux.indirect=false;if(frm_isToken(context,"(")){frm_nextToken(context);pseudoFieldAux.name+=frm_getToken(context);frm_nextToken(context);if(!frm_isToken(context,")")){return frm_langError(context,i18n_get_TagFor("compiler","CLOSE PAREN. NOT FOUND"))}frm_nextToken(context);pseudoFieldAux.indirect=true}else{pseudoFieldAux.name+=frm_getToken(context);frm_nextToken(context)}if(!frm_isToken(context,"=")){return frm_langError(context,i18n_get_TagFor("compiler","EQUAL NOT FOUND")+" (for name=type)")}frm_nextToken(context);pseudoFieldAux.type+=frm_getToken(context).replace("num","inm");switch(pseudoFieldAux.type){case"reg":case"inm":case"addr":case"address":break;default:return frm_langError(context,i18n_get_TagFor("compiler","INVALID PARAMETER")+pseudoFieldAux.type+"."+i18n_get_TagFor("compiler","ALLOWED PARAMETER"))}pseudoInitial.fields.push(pseudoFieldAux);if(pseudoFieldAux.indirect==true)pseudoInitial.signature+="("+frm_getToken(context)+"),";else pseudoInitial.signature+=frm_getToken(context)+",";frm_nextToken(context);if(frm_isToken(context,",")){frm_nextToken(context)}}frm_nextToken(context);pseudoInitial.signature=pseudoInitial.signature.substr(0,pseudoInitial.signature.length-1).replace(/num/g,"inm");pseudoInstructionAux.initial=pseudoInitial;var contPseudoFinish=0;var pseudoFinishAux={};pseudoFinishAux.signature="";var inStart=0;var cont=false;while(!frm_isToken(context,"}")){if(inStart==0){for(i=0;i32*parseInt(instruccionAux.nwords)-1){return frm_langError(context,i18n_get_TagFor("compiler","STARTBIT OoR")+"'"+frm_getToken(context)+"'")}frm_nextToken(context);if(!frm_isToken(context,",")){return frm_langError(context,i18n_get_TagFor("compiler","COMMA NOT FOUND"))}frm_nextToken(context);instruccionAux.fields[camposInsertados].stopbit=frm_getToken(context);var stop=parseInt(instruccionAux.fields[camposInsertados].stopbit);if(stop>32*parseInt(instruccionAux.nwords)){return frm_langError(context,i18n_get_TagFor("compiler","STOPBIT OoR")+"'"+frm_getToken(context)+"'")}for(i=stop;i<=start;i++){if(typeof instruccionAux.overlapping[i]!="undefined"){return frm_langError(context,i18n_get_TagFor("compiler","OVERLAPPING FIELD")+instruccionAux.fields[camposInsertados].name)}instruccionAux.overlapping[i]=1}frm_nextToken(context);if(!frm_isToken(context,")")){return frm_langError(context,i18n_get_TagFor("compiler","CLOSE PAREN. NOT FOUND"))}frm_nextToken(context);if(instruccionAux.fields[camposInsertados].type=="address"){if(frm_getToken(context)!="abs"&&frm_getToken(context)!="rel"){return frm_langError(context,i18n_get_TagFor("compiler","INCORRECT ADDRESSING"))}instruccionAux.fields[camposInsertados].address_type=frm_getToken(context);frm_nextToken(context)}if(frm_isToken(context,",")){frm_nextToken(context)}return{}}function firm_instruction_read_fixed_fields(context,instruccionAux,xr_info,all_ones_co){var ret={};frm_nextToken(context);if(!frm_isToken(context,"co")){return frm_langError(context,i18n_get_TagFor("compiler","NO CO FIELD"))}ret=firm_instruction_co_read(context,instruccionAux,xr_info,all_ones_co);if(typeof ret.error!="undefined"){return ret}if(frm_isToken(context,"cop")){ret=firm_instruction_cop_read(context,instruccionAux);if(typeof ret.error!="undefined"){return ret}}if(frm_isToken(context,"nwords")){ret=firm_instruction_nword_read(context,instruccionAux);if(typeof ret.error!="undefined"){return ret}}var campos=instruccionAux.fields;var firma=instruccionAux.signature;var firmaUsuario=instruccionAux.signatureUser;var firmaGlobal=instruccionAux.signatureGlobal;var camposInsertados=0;while(camposInsertados32*parseInt(instruccionAux.nwords)-1){return frm_langError(context,i18n_get_TagFor("compiler","STARTBIT OoR")+"'"+frm_getToken(context)+"'")}frm_nextToken(context);if(!frm_isToken(context,":")){return frm_langError(context,i18n_get_TagFor("compiler","COLON NOT FOUND"))}frm_nextToken(context);tmp_fields.stopbit=frm_getToken(context);var stop=parseInt(tmp_fields.stopbit);if(stop>32*parseInt(instruccionAux.nwords)){return frm_langError(context,i18n_get_TagFor("compiler","STOPBIT OoR")+"'"+frm_getToken(context)+"'")}frm_nextToken(context);if(!frm_isToken(context,")")){return frm_langError(context,i18n_get_TagFor("compiler","CLOSE PAREN. NOT FOUND"))}frm_nextToken(context);if(!frm_isToken(context,"=")){return frm_langError(context,i18n_get_TagFor("compiler","EQUAL NOT FOUND"))}frm_nextToken(context);var tmp_name=frm_getToken(context);if(["oc","cop","funct"].includes(tmp_fields.type)){tmp_fields.value=tmp_name}else{tmp_fields.name=tmp_name;var index_name=-1;for(var i=0;i100){return frm_langError(context,i18n_get_TagFor("compiler","MORE 100 FIELDS"))}if(auxValue=="co"){return frm_langError(context,i18n_get_TagFor("compiler","CO AS FIELD NAME"))}if(auxValue=="nwords"){return frm_langError(context,i18n_get_TagFor("compiler","NW AS FIELD NAME"))}}if(frm_isToken(context,"(")){firma=firma+",(";if(plus_found)firmaUsuario=firmaUsuario+"+(";else firmaUsuario=firmaUsuario+" (";frm_nextToken(context);if(!frm_isToken(context,",")&&!frm_isToken(context,"(")&&!frm_isToken(context,")")){var campoAux={};campoAux.name=frm_getToken(context);instruccionAux.fields.push(campoAux);instruccionAux.numeroCampos++;firma=firma+frm_getToken(context);firmaUsuario=firmaUsuario+frm_getToken(context);frm_nextToken(context)}else{return frm_langError(context,i18n_get_TagFor("compiler","MISSING TOKEN ON")+"'"+context.co_cop[instruccionAux.co].signature+"'")}if(frm_isToken(context,")")){firma=firma+")";firmaUsuario=firmaUsuario+")";frm_nextToken(context)}else{return frm_langError(context,i18n_get_TagFor("compiler","MISSING ) ON")+"'"+context.co_cop[instruccionAux.co].signature+"'")}}firma=firma+",";firmaUsuario=firmaUsuario+" "}firma=firma.substr(0,firma.length-1);firma=firma.replace(/,,/g,",");firmaUsuario=firmaUsuario.substr(0,firmaUsuario.length-1);firmaUsuario=firmaUsuario.replace(/ /g," ");instruccionAux.signature=firma;instruccionAux.signatureGlobal=firma;instruccionAux.signatureUser=firmaUsuario;instruccionAux.signatureRaw=firmaUsuario;if(2==context.version){ret=firm_instruction_read_fields_v2(context,instruccionAux,xr_info,all_ones_co)}else{ret=firm_instruction_read_fixed_fields(context,instruccionAux,xr_info,all_ones_co)}if(typeof ret.error!="undefined"){return ret}ret={};if(true==instruccionAux.is_native)ret=read_native(context);else ret=firm_mcode_signals_read(context);if(typeof ret.error!="undefined")return ret;instruccionAux.NATIVE=ret.NATIVE;instruccionAux.microcode=ret.microprograma;instruccionAux.microcomments=ret.microcomments;context.instrucciones.push(instruccionAux);context.contadorMC=context.contadorMC+9;if(!frm_isToken(context,"}")){return frm_langError(context,i18n_get_TagFor("compiler","CLOSE BRACE NOT FOUND"))}frm_nextToken(context);return{}}function simlang_native_adapt_replaceSyscall(icode){var rc="";var me="";var ff="capi_print_char|capi_print_int|capi_print_float|capi_print_double|capi_print_string|"+"capi_read_char|capi_read_int|capi_read_float|capi_read_double|capi_read_string|"+"capi_sbrk|capi_exit";var re=new RegExp("("+ff+")\\(([^)]*)\\)","g");var match=re.exec(icode);while(match!==null){var f=match[1].trim();var p=match[2].trim().split(",");switch(f){case"capi_print_char":rc="// "+f+" \n"+"\tvar tmp1 = 0x000000FF & "+p[0]+" ;\n"+"\tset_screen_content(tmp1.toString()) ;\n";break;case"capi_print_int":rc="// "+f+" \n"+"\tset_screen_content("+p[0]+".toString()) ;\n";break;case"capi_print_float":rc="// "+f+" \n"+"\tvar tmp1 = hex2float("+p[0]+") ;\n"+"\tset_screen_content(tmp1.toString()) ;\n";break;case"capi_print_double":rc="// "+f+" \n"+"\tvar tmp1 = hex2float("+p[0]+") ;\n"+"\tset_screen_content(tmp1.toString()) ;\n";break;case"capi_print_string":rc="// "+f+" \n"+'\tvar tmp1 = "" ;\n'+'\tvar tmp2 = simcore_native_get_value("MEMORY", '+p[0]+") ;\n"+"\tfor (var k="+p[0]+"+1; (tmp2 !== 0) && (k<8*1024); k++) {\n"+"\t tmp1 += tmp2.toString() ;\n"+'\t tmp2 = simcore_native_get_value("MEMORY", k) ;\n'+"\t} ;\n"+"\tset_screen_content(tmp1) ;\n";break;case"capi_read_char":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tvar "+p[0]+" = 0x000000FF & parseInt(tmp1) ;\n";break;case"capi_read_int":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tvar "+p[0]+" = parseInt(tmp1) ;\n";break;case"capi_read_float":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tvar "+p[0]+" = parseFloat(tmp1) ;\n";break;case"capi_read_double":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tvar "+p[0]+" = parseFloat(tmp1) ;\n";break;case"capi_read_string":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tfor (var k=0; k<"+p[1]+"; k++) {\n"+'\t simcore_native_set_value("MEMORY", '+p[0]+"+k, tmp1[k]) ;\n"+"\t} ;\n";break;case"capi_sbrk":rc="// "+f+" \n"+"// TODO: _sbrk_("+p[0]+", "+p[1]+");\n";break;case"capi_exit":rc="// "+f+" \n"+"// exit by setting P.C. register outside text segment\n"+"\tvar pc_name = simhw_sim_ctrlStates_get().pc.state ;\n"+'\tsimcore_native_set_value("CPU", pc_name, 0x00000000) ;\n';break;default:rc="// "+f+" \n"+"// unknown syscall\n";break}me=new RegExp(f+"\\(([^)]*)\\)","g");icode=icode.replace(me,rc);match=re.exec(icode)}return icode}function simlang_native_adapt_provideRegister(icode,reg_log,rf_phy,reg_phy){var re=new RegExp(reg_log,"g");if(icode.search(re)!=-1){icode="var "+reg_log+" = simcore_native_get_value('"+rf_phy+"', "+reg_phy+") ;\n"+icode+"\n"+"simcore_native_set_value('"+rf_phy+"', "+reg_phy+", "+reg_log+") ;\n"}return icode}function simlang_native_adapt_providePC(icode){var re=/PC/g;if(icode.search(re)!=-1){icode="var pc_name = simhw_sim_ctrlStates_get().pc.state ;\n"+"var PC = simcore_native_get_value('CPU', pc_name) ;\n"+icode+"simcore_native_set_value('CPU', pc_name, PC) ;\n"}return icode}function simlang_native_adapt_replaceIf(icode){var re=new RegExp("[iI][fF]\\s*\\(([^\\\\)]*)\\)\\s*{([^\\\\}]*)}\\s*[eE][lL][sS][eE]{[^}]*}\\s*","g");if(icode.search(re)!=-1){var match=re.exec(icode);try{icode=icode.replace(re,"\n")}catch(e){console.log("Syntax error that cause a run-time error: "+e.toString());console.log(match)}}return icode}function simlang_native_adapt_addInitialTabTab(lines_code){var code_lines;code_lines=lines_code.split("\n");code_lines=code_lines.map((function(x){return"\t\t"+x}));return code_lines.join("\n")}function simlang_native_adapt_instructionDefinition(lines_code){var code_lines=lines_code.split(";");if(code_lines.length===1&&!lines_code.trim().startsWith("if")){lines_code=lines_code+";\n"}lines_code=simlang_native_adapt_replaceSyscall(lines_code);lines_code=simlang_native_adapt_provideRegister(lines_code,"HI","CPU","'REG_RT2'");lines_code=simlang_native_adapt_provideRegister(lines_code,"LO","CPU","'REG_RT1'");lines_code=simlang_native_adapt_provideRegister(lines_code,"ra","BR","31");lines_code=simlang_native_adapt_providePC(lines_code);lines_code=simlang_native_adapt_addInitialTabTab(lines_code);return lines_code}function simlang_native_adapt_getField(j,rf,reg){return"\t\t"+"var f_"+reg+" = "+"simcore_native_get_field_from_ir(fields, "+j+") ;\n"+"\t\t"+"var "+reg+" = "+"simcore_native_get_value('"+rf+"', f_"+reg+") ;\n"}function simlang_native_adapt_setField(j,rf,reg){return"\t\t"+"simcore_native_set_value('"+rf+"', f_"+reg+", "+reg+");\n"}function simlang_native_adapt_headerField(fname,tname,start,stop){return"\t"+tname+"("+start+":"+stop+")="+fname+",\n"}function simlang_native_beginMicrocode(){var o="";o+="\n"+"#\n"+"# WepSIM (https://wepsim.github.io/wepsim/)\n"+"#\n"+"\n"+"firmware_version = 2\n"+"\n"+"##\n"+"## Microcode Section\n"+"##\n"+"\n"+"begin,\n"+"native\n"+"{\n"+" // (once) initialize BR2 as FP register file\n"+' if (typeof BR2 === "undefined")\n'+" {\n"+" BR2 = [] ;\n"+" FCSR = 0 ;\n"+" for (var i=0; i<32; i++)\n"+" {\n"+" BR2[i] = {\n"+' name:"R"+i,\n'+' verbal:"Register "+i,\n'+" visible:true,\n"+' nbits:"32",\n'+" value:0,\n"+" default_value:0,\n"+" draw_data:[]\n"+" } ;\n"+" }\n"+" }\n"+"\n"+" // fetch\n"+' var addr = simcore_native_get_value("CPU", "REG_PC") ;\n'+' var value = simcore_native_get_value("MEMORY", addr) ;\n'+"\n"+' simcore_native_set_value("CPU", "REG_IR", value) ;\n'+' simcore_native_set_value("CPU", "REG_PC", addr + 4) ;\n'+"\n"+" simcore_native_deco() ;\n"+" simcore_native_go_opcode() ;\n"+"}\n";return o}function simlang_native_adapt_instructionSet(instruction_list){var o="";var gfields=[];var sfields=[];var hfields=[];var io={};var line_signature="";var signature_names="";var signature_order="";for(var i=0;i> 32);\n"+"\t\t "+io.fields[j].name+"2 = "+io.fields[j].name+" >> 32;\n"+"\t\t"+"simcore_native_set_value('BR2', "+"f_"+io.fields[j].name+"+0, "+io.fields[j].name+"1);\n"+"\t\t"+"simcore_native_set_value('BR2', "+"f_"+io.fields[j].name+"+1, "+io.fields[j].name+"2);\n";break;case"inm":hfields[k]=simlang_native_adapt_headerField(io.fields[j].name,"inm",io.fields[j].startbit,io.fields[j].stopbit);gfields[k]="\t\t"+"var "+io.fields[j].name+" = "+"simcore_native_get_field_from_ir(fields, "+(k-1)+") ;\n\t";break}}var co_cop="\t"+"co=111111,"+"\n";var lines_code=simlang_native_adapt_instructionDefinition(io.definition);if(lines_code.trim()!==""){lines_code="\t\t"+"// instruction specific code"+"\n"+lines_code+"\n"}var gfields_str=gfields.join("");if(gfields_str.trim()!==""){gfields_str="\t\t"+"// get fields values..."+"\n"+gfields_str+"\n"}var sfields_str=sfields.join("");if(sfields_str.trim()!==""){sfields_str="\t\t"+"// set fields values..."+"\n"+sfields_str+"\n"}o+="\n"+line_signature+" {"+"\n"+co_cop+"\t"+"nwords="+io.nwords+","+"\n"+hfields.join("")+"\t"+"native,"+"\n"+"\t"+"{\n"+gfields_str+"\n"+lines_code+"\n"+sfields_str+"\n"+"\t\t"+"// go fetch"+"\n"+"\t\t"+"simcore_native_go_maddr(0);"+"\n"+"\t"+"}"+"\n"+"}\n"}return o}function simlang_native_registerSection(register_list){var o="";var d="";var index=0;for(index=0;index=last_co){return frm_langError(context,i18n_get_TagFor("compiler","NO CO CODES"))}first_co=parseInt(r.label_co,2);curr_instruction.co=r.label_co;context.co_cop[r.label_co].signature=curr_instruction.signature;if(r.label_cop!==""){curr_instruction.cop=r.label_cop;context.co_cop[r.label_co].cop[r.label_cop]=curr_instruction.signature;context.co_cop[r.label_co].withcop=true}}var labelsFounded=0;if(context.labelsNotFound.length>0){for(i=0;i0){for(var j=0;j0){file+="registers"+"\n{\n";for(i=0;i0)line2=context.newlines[context.newlines.length-1]+1;var line1=0;if(context.newlines.length>1)line1=context.newlines[context.newlines.length-2]+1;var lowI=line1;var highI=Math.min(context.t-1,line2+32);for(;typeof context.text[highI+1]!="undefined"&&context.text[highI+1]!="\n";highI++);var line3=highI+2;highI++;for(;typeof context.text[highI+1]!="undefined"&&context.text[highI+1]!="\n";highI++);highI++;context.error="
"+"
"+"...\n";for(var i=lowI;i"+"(*) "+i18n_get_TagFor("compiler","PROBLEM AROUND LINE")+" "+context.line+": 
"+msgError+".
";simcore_ga("compile","compile.error","compile.error."+msgError);return context}function asm_getLabelContext(context){return{t:context.t,line:context.line,newlines:context.newlines.slice()}}function asm_setLabelContext(context,labelContext){context.t=labelContext.t;context.line=labelContext.line;context.newlines=labelContext.newlines}function asm_getComments(context){return context.comments.join("\n")}function asm_resetComments(context){context.comments=[]}sim_segments={".kdata":{name:".kdata",begin:0,end:255,color:"#FF99CC",kindof:"data"},".ktext":{name:".ktext",begin:256,end:4095,color:"#A9D0F5",kindof:"text"},".data":{name:".data",begin:4096,end:32767,color:"#FACC2E",kindof:"data"},".text":{name:".text",begin:32768,end:131071,color:"#BEF781",kindof:"text"},".stack":{name:".stack",begin:131071,end:1048576,color:"#F1F2A3",kindof:"stack"}};function segments_addr_within_text(address){return address>=sim_segments[".text"].begin&&address<=sim_segments[".text"].end||address>=sim_segments[".ktext"].begin&&address<=sim_segments[".ktext"].end}function segments_addr_within_data(address){return address>=sim_segments[".data"].begin&&address<=sim_segments[".data"].end||address>=sim_segments[".kdata"].begin&&address<=sim_segments[".kdata"].end}BYTE_LENGTH=8;WORD_BYTES=4;WORD_LENGTH=WORD_BYTES*BYTE_LENGTH;function isDecimal(n){var ret={number:0,isDecimal:false};if(n.length>1&&n[0]=="0"){return ret}if(typeof n==="string"&&n.includes(".")){return ret}if(!isNaN(parseFloat(n))&&isFinite(n)){ret.isDecimal=true;ret.number=parseInt(n);return ret}return ret}function isOctal(n){var ret={number:0,isDecimal:false};if(n.substring(0,1)=="0"){var octal=n.substring(1).replace(/\b0+/g,"");ret.number=parseInt(octal,8);ret.isDecimal=ret.number.toString(8)===octal;return ret}return ret}function isHex(n){var ret={number:0,isDecimal:false};if(n.substring(0,2).toLowerCase()=="0x"){var hex=n.substring(2).toLowerCase().replace(/\b0+/g,"");if(hex==""){hex="0"}ret.number=parseInt(hex,16);ret.isDecimal=ret.number.toString(16)===hex;return ret}return ret}function isChar(n){var ret={number:0,isDecimal:false};var ret1=treatControlSequences(n);if(true==ret1.error){return ret}var possible_value=ret1.string;if(possible_value[0]=="'"&&possible_value[2]=="'"||possible_value[0]=='"'&&possible_value[2]=='"'){ret.number=possible_value.charCodeAt(1);ret.isDecimal=true;return ret}return ret}function isFloat(n){var ret={number:0,isFloat:false};var non_float=/[a-df-zA-DF-Z]+/;if(non_float.test(n)===true){return ret}ret.number=parseFloat(n);ret.isFloat=!isNaN(ret.number);return ret}function get_decimal_value(possible_value){var ret={number:0,isDecimal:true};ret=isOctal(possible_value);if(ret.isDecimal===false){ret=isHex(possible_value)}if(ret.isDecimal===false){ret=isDecimal(possible_value)}if(ret.isDecimal===false){ret=isChar(possible_value)}return ret}function decimal2binary(number,size){var num_bits=number.toString(2);if(num_bits.length>WORD_LENGTH){return[num_bits,size-num_bits.length]}num_bits=(number>>>0).toString(2);if(number>=0){return[num_bits,size-num_bits.length]}num_bits="1"+num_bits.replace(/^[1]+/g,"");if(num_bits.length>size){return[num_bits,size-num_bits.length]}num_bits="1".repeat(size-num_bits.length)+num_bits;return[num_bits,size-num_bits.length]}function get_inm_value(value){var ret1={};var ret={number:0,isDecimal:false,isFloat:false};ret1=get_decimal_value(value);if(ret1.isDecimal==true){ret1.isFloat=false;return ret1}ret1=isFloat(value);if(ret1.isFloat==true){ret1.isDecimal=false;return ret1}return ret}directives={".kdata":{name:".kdata",kindof:"segment",size:0},".ktext":{name:".ktext",kindof:"segment",size:0},".data":{name:".data",kindof:"segment",size:0},".text":{name:".text",kindof:"segment",size:0},".byte":{name:".byte",kindof:"datatype",size:1},".half":{name:".half",kindof:"datatype",size:2},".word":{name:".word",kindof:"datatype",size:4},".float":{name:".float",kindof:"datatype",size:4},".double":{name:".double",kindof:"datatype",size:8},".ascii":{name:".ascii",kindof:"datatype",size:1},".asciiz":{name:".asciiz",kindof:"datatype",size:1},".space":{name:".space",kindof:"datatype",size:1},".string":{name:".string",kindof:"datatype",size:1},".zero":{name:".zero",kindof:"datatype",size:1},".align":{name:".align",kindof:"datatype",size:0}};function get_datatype_size(datatype){if(typeof directives[datatype]==="undefined"){console.log("ERROR: not defined datatype: "+datatype+"\n");return 0}return directives[datatype].size}function is_directive_kindof(text,kindof){if(typeof directives[text]==="undefined"){return false}return directives[text].kindof==kindof}function is_directive(text){return typeof directives[text]!=="undefined"}function is_directive_segment(text){return is_directive_kindof(text,"segment")}function is_directive_datatype(text){return is_directive_kindof(text,"datatype")}function isValidTag(tag){if(tag.trim()==""){return false}var ret=isDecimal(tag[0]);if(ret.isDecimal==true){return false}var myRegEx=/[^a-z,_\d]/i;return!myRegEx.test(tag)}function sum_array(a){return a.reduce((function(a,b){return a+b}),0)}function get_candidate(advance,instruction){var candidate=false;var candidates={};var signatures={};for(i=0;icandidates[i]){min=candidates[i];candidate=i}}}return candidate?parseInt(candidate):candidate}function reset_assembly(nwords){return"0".repeat(WORD_LENGTH*nwords)}function assembly_replacement(machineCode,num_bits,startbit,stopbit,free_space){var machineCodeAux=machineCode.substring(0,machineCode.length-startbit+free_space);machineCode=machineCodeAux+num_bits+machineCode.substring(machineCode.length-stopbit);return machineCode}function assembly_co_cop(machineCode,co,cop){var xr_info=simhw_sim_ctrlStates_get();if(co!==false)machineCode=assembly_replacement(machineCode,co,WORD_LENGTH,WORD_LENGTH-6,0);if(cop!==false)machineCode=assembly_replacement(machineCode,cop,xr_info.ir.default_eltos.cop.length,0,0);return machineCode}function writememory_and_reset(mp,gen,nwords){if(gen.byteWord>=WORD_BYTES){var melto={value:gen.machineCode,source_tracking:gen.track_source,comments:gen.comments};main_memory_set(mp,"0x"+gen.seg_ptr.toString(16),melto);gen.seg_ptr=gen.seg_ptr+WORD_BYTES;gen.byteWord=0;gen.track_source=[];gen.comments=[];gen.machineCode=reset_assembly(nwords)}}function is_end_of_file(context){return""===asm_getToken(context)&&context.t>=context.text.length}function read_data(context,datosCU,ret){var seg_name=asm_getToken(context);var gen={};gen.byteWord=0;gen.track_source=[];gen.comments=[];gen.machineCode=reset_assembly(1);gen.seg_ptr=ret.seg[seg_name].begin;asm_nextToken(context);while(!is_directive_segment(asm_getToken(context))&&!is_end_of_file(context)){var possible_tag="";while(!is_directive_datatype(asm_getToken(context))&&!is_end_of_file(context)){possible_tag=asm_getToken(context);if("TAG"!=asm_getTokenType(context)){if(""==possible_tag){possible_tag="[empty]"}return asm_langError(context,i18n_get_TagFor("compiler","NO TAG OR DIRECTIVE")+"'"+possible_tag+"'")}var tag=possible_tag.substring(0,possible_tag.length-1);if(!isValidTag(tag)){return asm_langError(context,i18n_get_TagFor("compiler","INVALID TAG FORMAT")+"'"+tag+"'")}if(context.firmware[tag]){return asm_langError(context,i18n_get_TagFor("compiler","TAG OR INSTRUCTION")+"'"+tag+"'")}if(ret.labels2[tag]){return asm_langError(context,i18n_get_TagFor("compiler","REPEATED TAG")+"'"+tag+"'")}ret.labels2[tag]="0x"+(gen.seg_ptr+gen.byteWord).toString(16);asm_nextToken(context)}if(is_end_of_file(context)){break}var possible_datatype=asm_getToken(context);if(".word"==possible_datatype||".half"==possible_datatype||".byte"==possible_datatype||".float"==possible_datatype||".double"==possible_datatype){var size=get_datatype_size(possible_datatype);asm_nextToken(context);var possible_value=asm_getToken(context);while(!is_directive(asm_getToken(context))&&!is_end_of_file(context)){var label_found=false;var ret1=get_inm_value(possible_value);var number=ret1.number;if(ret1.isDecimal==false&&ret1.isFloat==false){if(".word"!==possible_datatype){return asm_langError(context,i18n_get_TagFor("compiler","NO NUMERIC DATATYPE")+"'"+possible_value+"'")}if(!isValidTag(possible_value)){return asm_langError(context,i18n_get_TagFor("compiler","INVALID TAG FORMAT")+"'"+possible_value+"'")}if(context.firmware[possible_value]){return asm_langError(context,i18n_get_TagFor("compiler","TAG OR INSTRUCTION")+"'"+possible_value+"'")}number=0;label_found=true}if(ret1.isDecimal==true)a=decimal2binary(number,size*BYTE_LENGTH);else a=float2binary(number,size*BYTE_LENGTH);num_bits=a[0];free_space=a[1];if(free_space<0){return asm_langError(context,i18n_get_TagFor("compiler","EXPECTED VALUE")+possible_datatype+"' ("+size*BYTE_LENGTH+" bits), "+i18n_get_TagFor("compiler","BUT INSERTED")+possible_value+"' ("+num_bits.length+" bits) "+i18n_get_TagFor("compiler","INSTEAD"))}writememory_and_reset(ret.mp,gen,1);while((gen.seg_ptr+gen.byteWord)%size!=0){gen.byteWord++;writememory_and_reset(ret.mp,gen,1)}if(""!=possible_tag){ret.labels2[possible_tag.substring(0,possible_tag.length-1)]="0x"+(gen.seg_ptr+gen.byteWord).toString(16);possible_tag=""}if(label_found){ret.labels["0x"+gen.seg_ptr.toString(16)]={name:possible_value,addr:gen.seg_ptr,startbit:31,stopbit:0,rel:undefined,nwords:1,labelContext:asm_getLabelContext(context)}}gen.machineCode=assembly_replacement(gen.machineCode,num_bits,BYTE_LENGTH*(size+gen.byteWord),BYTE_LENGTH*gen.byteWord,free_space);gen.byteWord+=size;gen.track_source.push(possible_value);asm_nextToken(context);if(","==asm_getToken(context)){asm_nextToken(context)}if(is_directive(asm_getToken(context))||"TAG"==asm_getTokenType(context)||"."==asm_getToken(context)[0]){break}possible_value=asm_getToken(context)}}else if(".space"==possible_datatype||".zero"==possible_datatype){asm_nextToken(context);var possible_value=asm_getToken(context);var ret1=isDecimal(possible_value);possible_value=ret1.number;if(ret1.isDecimal==false){return asm_langError(context,i18n_get_TagFor("compiler","NO NUMBER OF BYTES")+"'"+possible_value+"'")}if(possible_value<0){return asm_langError(context,i18n_get_TagFor("compiler","NO POSITIVE NUMBER")+"'"+possible_value+"'")}for(i=0;i=0){return asm_langError(context,i18n_get_TagFor("compiler","INVALID ALIGN VALUE")+"'"+possible_value+"'. "+i18n_get_TagFor("compiler","REMEMBER ALIGN VAL"))}writememory_and_reset(ret.mp,gen,1);var align_offset=Math.pow(2,parseInt(possible_value));switch(align_offset){case 1:break;case 2:if(gen.byteWord&1==1)gen.byteWord++;break;default:writememory_and_reset(ret.mp,gen,1);while(gen.seg_ptr%align_offset!=0||gen.byteWord!=0){gen.byteWord++;writememory_and_reset(ret.mp,gen,1)}}asm_nextToken(context)}else if(".ascii"==possible_datatype||".asciiz"==possible_datatype||".string"==possible_datatype){asm_nextToken(context);var possible_value=asm_getToken(context);var ret1=treatControlSequences(possible_value);if(true==ret1.error){return asm_langError(context,ret1.string)}possible_value=ret1.string;while(!is_directive(asm_getToken(context))&&!is_end_of_file(context)){writememory_and_reset(ret.mp,gen,1);if('"'!==possible_value[0]){return asm_langError(context,i18n_get_TagFor("compiler","NO QUOTATION MARKS")+"'"+possible_value+"'")}if('"'!==possible_value[possible_value.length-1]){return asm_langError(context,i18n_get_TagFor("compiler","NOT CLOSED STRING"))}if(""==possible_value){return asm_langError(context,i18n_get_TagFor("compiler","NOT CLOSED STRING"))}if("STRING"!=asm_getTokenType(context)){return asm_langError(context,i18n_get_TagFor("compiler","NO QUOTATION MARKS")+"'"+possible_value+"'")}for(i=0;i0){var melto={value:gen.machineCode,source_tracking:gen.track_source,comments:gen.comments};main_memory_set(ret.mp,"0x"+gen.seg_ptr.toString(16),melto);gen.seg_ptr=gen.seg_ptr+WORD_BYTES}ret.seg[seg_name].end=gen.seg_ptr}function read_text(context,datosCU,ret){var seg_name=asm_getToken(context);var seg_ptr=ret.seg[seg_name].begin;var firmware=context.firmware;var pseudoInstructions=context.pseudoInstructions;var finish=[];var isPseudo=false;var pfinish=[];var npseudoInstructions=0;var pseudo_fields={};var counter=-1;var candidate;var error="";var registers={};for(i=0;i=signature_fields[j].length){if("TAG"!=asm_getTokenType(context)&&!firmware[value]&&!is_end_of_file(context)){advance[j]=0}continue}var field=firmware[instruction][j].fields[i];var size=field.startbit-field.stopbit+1;var label_found=false;var sel_found=false;switch(field.type){case"address":case"inm":if(isPseudo&&"sel"==value){counter++;var start=pfinish[counter++];var stop=pfinish[counter++];var value=pseudo_fields[pfinish[counter++]];counter++;sel_found=true}var ret1=get_inm_value(value);converted=ret1.number;if(ret1.isDecimal==false&&ret1.isFloat==false){error=i18n_get_TagFor("compiler","NO NUMERIC DATATYPE")+"'"+value+"'";if(value[0]=="'"){advance[j]=0;break}if(!isValidTag(value)){advance[j]=0;break}if(firmware[value]){error=i18n_get_TagFor("compiler","TAG OR INSTRUCTION")+"'"+value+"'";advance[j]=0;break}label_found=true}if(sel_found){if(ret1.isDecimal==true)res=decimal2binary(converted,WORD_LENGTH);else res=float2binary(converted,WORD_LENGTH);if(res[1]<0){return asm_langError(context,"'"+value+"' "+i18n_get_TagFor("compiler","BIGGER THAN")+WORD_LENGTH+" "+i18n_get_TagFor("compiler","BITS"))}if(label_found){s[i+1]=value}else{converted="0".repeat(res[1])+res[0];converted=converted.substring(WORD_LENGTH-start-1,WORD_LENGTH-stop);converted=parseInt(converted,2);s[i+1]="0x"+converted.toString(16)}}if(!label_found){if(ret1.isDecimal==true)var res=decimal2binary(converted,size);else var res=float2binary(converted,size);if(field.type=="address"&&"rel"==field.address_type){res=decimal2binary(converted,size)}}break;case"reg":if(typeof value==="undefined"){error=i18n_get_TagFor("compiler","INS. MISSING FIELD");advance[j]=0;break}var aux=false;if(value.startsWith("(")){if("(reg)"!=signature_fields[j][i]){error=i18n_get_TagFor("compiler","UNEXPECTED (REG)");advance[j]=0;break}if(counter==-1){asm_nextToken(context);value=asm_getToken(context)}else{value=pseudo_fields[pfinish[counter++]]}aux=true}else{if("(reg)"==signature_fields[j][i]){error=i18n_get_TagFor("compiler","EXPECTED (REG)")+"'"+value+"'";advance[j]=0;break}}if(typeof registers[value]==="undefined"){error=i18n_get_TagFor("compiler","EXPECTED REG")+"'"+value+"'";advance[j]=0;break}if(aux){s[i+1]="("+value+")";if(counter==-1){asm_nextToken(context);aux=asm_getToken(context)}else{aux=pfinish[counter++]}if(")"!=aux){error=i18n_get_TagFor("compiler","CLOSE PAREN. NOT FOUND");advance[j]=0;break}}var ret1=isDecimal(registers[value]);converted=ret1.number;var res=decimal2binary(converted,size);value=s[i+1];break;default:return asm_langError(context,i18n_get_TagFor("compiler","UNKNOWN 1")+"'"+field.type+"'")}if(advance[j]==1&&!label_found){if(res[1]<0){if(field.type=="address"&&"rel"==field.address_type){error="Relative value ("+(converted-seg_ptr-WORD_BYTES)+" in decimal)"+i18n_get_TagFor("compiler","NEEDS")+res[0].length+i18n_get_TagFor("compiler","SPACE FOR # BITS")+size+" "+i18n_get_TagFor("compiler","BITS")}else{error="'"+value+"'"+i18n_get_TagFor("compiler","NEEDS")+res[0].length+i18n_get_TagFor("compiler","SPACE FOR # BITS")+size+" "+i18n_get_TagFor("compiler","BITS")}advance[j]=0}}if(advance[j]==1&&!(isPseudo&&counter==-1)){binaryAux[j][i]={num_bits:label_found?false:res[0],free_space:label_found?false:res[1],startbit:field.startbit,stopbit:field.stopbit,rel:label_found?field.address_type:false,islabel:label_found,field_name:value,issel:sel_found,sel_start:start,sel_stop:stop}}}if(sum_array(advance)==0){break}if("TAG"==asm_getTokenType(context)||firmware[value]){break}}for(i=0;i0&&i0&&i==firmware[instruction].length-1){format+=" or "}format+="'"+firmware[instruction][i].signatureUser+"'"}if(format==""){format="'"+instruction+"' "+i18n_get_TagFor("compiler","UNKNOWN MC FORMAT")}var sum_res=sum_array(advance);if(sum_res==0){if(advance.length===1){return asm_langError(context,error+".
"+i18n_get_TagFor("compiler","REMEMBER I. FORMAT")+format)}return asm_langError(context,i18n_get_TagFor("compiler","NOT MATCH MICRO")+"
"+i18n_get_TagFor("compiler","REMEMBER I. FORMAT")+format+". "+i18n_get_TagFor("compiler","CHECK MICROCODE"))}if(sum_res>1){candidate=get_candidate(advance,firmware[instruction]);if(candidate===false){return asm_langError(context,i18n_get_TagFor("compiler","SEVERAL CANDIDATES")+format)}}if(isPseudo){if(counter==-1){var s_ori=s.join(" ");s_ori=s_ori.trim();var key="";var val="";pseudo_fields={};for(i=0;i1){s_ori=" "}if(pfinish[counter]=="\n"){counter++}}var machineCode=reset_assembly(firmware[instruction][candidate].nwords);machineCode=assembly_co_cop(machineCode,firmware[instruction][candidate].co,firmware[instruction][candidate].cop);var l_addr="";for(i=0;i=0;i--){if(icontext.text.length){break}}ret.seg[seg_name].end=seg_ptr}function simlang_compile_v1(text,datosCU){var context={};context.line=1;context.error=null;context.i=0;context.contadorMC=0;context.etiquetas={};context.labelsNotFound=[];context.instrucciones=[];context.co_cop={};context.registers=[];context.text=text;context.tokens=[];context.token_types=[];context.t=0;context.newlines=[];context.pseudoInstructions=[];context.stackRegister=null;context.firmware={};context.comments=[];for(i=0;i=0;j--){var melto={value:machineCode.substring(j*WORD_LENGTH,(j+1)*WORD_LENGTH),source_tracking:null,comments:null};main_memory_set(ret.mp,"0x"+auxAddr.toString(16),melto);auxAddr+=WORD_BYTES}}if(text_found){if(typeof ret.labels2["main"]==="undefined"&&typeof ret.labels2["kmain"]==="undefined"){return asm_langError(context,i18n_get_TagFor("compiler","NO MAIN OR KMAIN"))}}for(var key in ret.labels2){ret.revlabels2[ret.labels2[key]]=key}for(var skey in ret.seg){ret.revseg.push({begin:parseInt(ret.seg[skey].begin),name:skey})}return ret}function simlang_compile(text,datosCU){return simlang_compile_v1(text,datosCU)} \ No newline at end of file +var WSCFG={};function get_cfg(field){return WSCFG[field].value}function set_cfg(field,value){WSCFG[field].value=value}function update_cfg(field,value){WSCFG[field].value=value;simcore_record_append_new("Set configuration option "+field+" to "+value,'update_cfg("'+field+'","'+value+'");\n');simcore_ga("config","config."+WSCFG.version.value,"config."+WSCFG.version.value+"."+field+"."+value);save_cfg()}function is_cfg_empty(){return Object.keys(WSCFG).length===0}function save_cfg(){try{for(var item in WSCFG){localStorage.setItem("wepsim_"+item,get_cfg(item))}}catch(err){console.log("WepSIM can not save the configuration in a persistent way on this web browser,\n"+"found following error: \n"+err.message)}set_secondary_cfg()}function restore_cfg(){WSCFG=get_primary_cfg();set_secondary_cfg();if(localStorage===null){return}var default_value=null;var saved_value=null;for(var item in WSCFG){if(item==="version"){continue}default_value=get_cfg(item);set_cfg(item,localStorage.getItem("wepsim_"+item));if(WSCFG[item].type!="string"){try{saved_value=JSON.parse(get_cfg(item));set_cfg(item,saved_value)}catch(e){saved_value=null}}if(saved_value===null){set_cfg(item,default_value)}}set_secondary_cfg()}function reset_cfg(){WSCFG=get_primary_cfg();set_secondary_cfg();save_cfg()}function reset_cfg_values(){WSCFG=get_primary_cfg();set_secondary_cfg()}function upgrade_cfg(){var wscfg=get_primary_cfg();var item=null;for(item in wscfg){if(typeof WSCFG[item]==="undefined"){WSCFG[item]=wscfg[item]}if(WSCFG[item].value===null||WSCFG[item].value==="null"){WSCFG[item].value=wscfg[item].value}}if(wscfg.build.value!=WSCFG.build.value){for(item in wscfg){if(wscfg[item].upgrade){WSCFG[item]=wscfg[item]}}}set_secondary_cfg();save_cfg()}function is_mobile(){if(typeof navigator==="undefined"){return false}if(typeof navigator.userAgentData=="undefined"){return false}return navigator.userAgentData.mobile}function is_cordova(){return document.URL.indexOf("http://")===-1&&document.URL.indexOf("https://")===-1}function get_primary_cfg(){var wscfg={version:{upgrade:false,type:"string",value:"2.3.0"},build:{upgrade:true,type:"string",value:"2.3.0.20230415A"},color_data_active:{upgrade:false,type:"string",value:"#0066FF"},color_data_inactive:{upgrade:false,type:"string",value:"#000000"},color_name_active:{upgrade:false,type:"string",value:"#FF0000"},color_name_inactive:{upgrade:false,type:"string",value:"#000000"},size_active:{upgrade:false,type:"float",value:3},size_inactive:{upgrade:false,type:"float",value:1},is_byvalue:{upgrade:false,type:"boolean",value:false},CPUCU_show_graph:{upgrade:true,type:"boolean",value:true},RF_display_format:{upgrade:false,type:"string",value:"unsigned_16_fill"},RF_display_name:{upgrade:false,type:"string",value:"numerical"},MEM_display_format:{upgrade:true,type:"string",value:"unsigned_16_nofill"},MEM_show_segments:{upgrade:true,type:"boolean",value:false},MEM_show_source:{upgrade:true,type:"boolean",value:false},MEM_display_direction:{upgrade:true,type:"string",value:"h2l"},is_editable:{upgrade:false,type:"boolean",value:true},DBG_delay:{upgrade:false,type:"int",value:5},DBG_level:{upgrade:false,type:"string",value:"microinstruction"},DBG_limitins:{upgrade:false,type:"int",value:1e4},DBG_limitick:{upgrade:false,type:"int",value:1e3},DBG_skip_notifycolon:{upgrade:true,type:"boolean",value:false},ICON_theme:{upgrade:false,type:"string",value:"classic"},AS_enable:{upgrade:true,type:"boolean",value:true},AS_delay:{upgrade:true,type:"int",value:500},NOTIF_delay:{upgrade:false,type:"int",value:1e3},CPUCU_size:{upgrade:true,type:"int",value:7},C1C2_size:{upgrade:true,type:"int",value:8},SHOWCODE_label:{upgrade:false,type:"boolean",value:true},SHOWCODE_addr:{upgrade:false,type:"boolean",value:true},SHOWCODE_hex:{upgrade:false,type:"boolean",value:true},SHOWCODE_ins:{upgrade:false,type:"boolean",value:true},SHOWCODE_pins:{upgrade:false,type:"boolean",value:true},ws_mode:{upgrade:false,type:"string",value:"newbie"},ws_action:{upgrade:false,type:"string",value:"checkpoint"},is_interactive:{upgrade:false,type:"boolean",value:true},is_quick_interactive:{upgrade:false,type:"boolean",value:false},ws_idiom:{upgrade:false,type:"string",value:"en"},use_voice:{upgrade:false,type:"boolean",value:false},ws_skin_ui:{upgrade:false,type:"string",value:"classic"},ws_skin_user:{upgrade:false,type:"string",value:"only_asm:of:only_frequent:of"},ws_skin_dark_mode:{upgrade:false,type:"boolean",value:false},editor_theme:{upgrade:false,type:"string",value:"default"},editor_mode:{upgrade:false,type:"string",value:"default"},base_url:{upgrade:true,type:"string",value:"https://acaldero.github.io/wepsim/ws_dist/"},cfg_url:{upgrade:true,type:"string",value:"examples/configuration/default.json"},example_url:{upgrade:true,type:"string",value:"examples/examples_set/default.json"},hw_url:{upgrade:true,type:"string",value:"examples/hardware/hw.json"},max_json_size:{upgrade:true,type:"int",value:1*1024*1024},verbal_verbose:{upgrade:false,type:"string",value:"math"},extended_ui:{upgrade:false,type:"boolean",value:false},use_ga:{upgrade:false,type:"boolean",value:true}};if(is_mobile()){wscfg.NOTIF_delay.value=2e3;wscfg.ICON_theme.value="cat1";wscfg.CPUCU_size.value=7;wscfg.C1C2_size.value=14;wscfg.ws_skin_ui.value="compact"}return wscfg}function set_secondary_cfg(){var dbg_delay=get_cfg("DBG_delay");if(dbg_delay<5){cfg_show_rf_delay=350;cfg_show_eltos_delay=350;cfg_show_main_memory_delay=450;cfg_show_control_memory_delay=360;cfg_show_dbg_ir_delay=300;cfg_show_rf_refresh_delay=120}else{cfg_show_rf_delay=100;cfg_show_eltos_delay=100;cfg_show_main_memory_delay=150;cfg_show_control_memory_delay=120;cfg_show_dbg_ir_delay=100;cfg_show_rf_refresh_delay=30}cfg_show_asmdbg_pc_delay=50;if(dbg_delay<3)cfg_show_asmdbg_pc_delay=150}var ws_cfg_hash={};var ws_cfg_set=[];function cfgset_init(){var url_list=get_cfg("cfg_url");ws_cfg_set=wepsim_url_getJSON(url_list);for(var i=0;i"+index+"/"+ws_records.length+" "+msg)}if(ws_record_pb_obj!==null){var next_pbval=100*index/ws_records.length;ws_record_pb_obj.css("width",next_pbval+"%").attr("aria-valuenow",next_pbval)}}function simcore_record_playAt(index_current,index_last){if(ws_is_playing===false){simcore_record_showMsg(ws_last_played,"Stopped by user.");return}ws_last_played=index_current;if(index_current>=index_last){simcore_record_showMsg(index_last,"Done.");return}if(ws_records[index_current].description==="_pending event_"){simcore_record_playAt(index_current+1,index_last);return}eval(ws_records[index_current].element);var index_next=index_current+1;simcore_record_showMsg(index_next,ws_records[index_current].description);var wait_time=500;if(index_next0&&ws_records[ws_records.length-1].description==="_pending event_"){distance=ws_glowing_time}simcore_record_pushElto("_pending event_",";",distance)}}function simcore_record_resolve_pending(description,elto){if(ws_is_recording===true){var last_pending=ws_records.length;while(last_pending>0){last_pending--;if(ws_records[last_pending].description==="_pending event_"){break}}if(last_pending===0){simcore_record_setTimeBeforeNow(0);simcore_record_append_new(description,elto);return}ws_records[last_pending].description=description;ws_records[last_pending].element=elto;simcore_record_showMsg(0,"Recording...")}}function simcore_record_setTimeBeforeNow(distance){ws_last_time=Date.now()-distance}function simcore_record_addTimeAfterLast(distance){ws_last_time=ws_last_time+distance}function array_includes(arr,val){if(typeof arr.includes!="undefined"){return arr.includes(val)}for(var i=0;i0){e=i;n=n+1}}if(n>0){var tri_state_names=simhw_internalState("tri_state_names");var tri_name=tri_state_names[e];update_draw(simhw_sim_signal(tri_name),1)}if(n>1){update_bus_visibility("internalbus_fire","visible");simhw_internalState_set("fire_visible","internalbus",true);simhw_sim_state("BUS_IB").value=4294967295}else{update_bus_visibility("internalbus_fire","hidden");simhw_internalState_set("fire_visible","internalbus",false)}return n}function update_system_bus_fire(number_active_tri){if(simhw_internalState_get("fire_visible","databus")==true){update_bus_visibility("databus_fire","hidden");simhw_internalState_set("fire_visible","databus",false)}if(number_active_tri>1){update_bus_visibility("databus_fire","visible");simhw_internalState_set("fire_visible","databus",true);simhw_sim_state("BUS_DB").value=4294967295}return number_active_tri}function fn_updateE_now(key){if("E"==simhw_sim_signal(key).type){update_state(key)}}function fn_updateE_future(key){if(jit_fire_ndep[key]<1)fn_updateE_now(key);else return new Promise((function(resolve,reject){fn_updateE_now(key)}))}function fn_updateL_now(key){update_draw(simhw_sim_signal(key),simhw_sim_signal(key).value);if("L"==simhw_sim_signal(key).type){update_state(key)}}function fn_updateL_future(key){if(jit_fire_ndep[key]<1)fn_updateL_now(key);else return new Promise((function(resolve,reject){fn_updateL_now(key)}))}function update_state(key){var index_behavior=0;switch(simhw_sim_signal(key).behavior.length){case 0:return;break;case 1:index_behavior=0;break;default:index_behavior=simhw_sim_signal(key).value;if(simhw_sim_signal(key).behavior.lengthreg_maddr){break}assoc_i=i}if(-1==assoc_i){ws_alert("A new 'unknown' instruction is inserted,\n"+"please edit it (co, nwords, etc.) in the firmware textarea.");var new_ins=new Object;new_ins["name"]="unknown";new_ins["signature"]="unknown";new_ins["signatureGlobal"]="unknown";new_ins["co"]=0;new_ins["nwords"]=0;new_ins["mc-start"]=0;new_ins["fields"]=new Array;new_ins["microcode"]=new Array;new_ins["microcomments"]=new Array;SIMWARE["firmware"].push(new_ins);assoc_i=SIMWARE["firmware"].length-1}var pos=reg_maddr-parseInt(SIMWARE["firmware"][assoc_i]["mc-start"]);if(typeof SIMWARE["firmware"][assoc_i]["microcode"][pos]=="undefined"){SIMWARE["firmware"][assoc_i]["microcode"][pos]=new Object;SIMWARE["firmware"][assoc_i]["microcomments"][pos]=""}SIMWARE["firmware"][assoc_i]["microcode"][pos][key]=simhw_sim_signal(key).value;if(simhw_sim_signal(key).default_value==simhw_sim_signal(key).value){delete SIMWARE["firmware"][assoc_i]["microcode"][pos][key]}var bits=get_value(simhw_sim_state("REG_IR")).toString(2);bits="00000000000000000000000000000000".substring(0,32-bits.length)+bits;show_memories_values()}function propage_signal_update(key){if(true===get_cfg("is_interactive")){if(simhw_sim_signal(key).value!=simhw_sim_signal(key).default_value)simhw_sim_state("REG_MICROINS").value[key]=simhw_sim_signal(key).value;else delete simhw_sim_state("REG_MICROINS").value[key];var maddr_name=simhw_sim_ctrlStates_get().mpc.state;var curr_maddr=get_value(simhw_sim_state(maddr_name));var mc_obj=simhw_internalState("MC");var mcelto=control_memory_get(mc_obj,curr_maddr);if(typeof mcelto==="undefined"){mcelto={value:{},comments:null}}mcelto.value[key]=simhw_sim_signal(key).value;mcelto.comments=[];control_memory_set(mc_obj,curr_maddr,mcelto);update_signal_firmware(key);var SIMWARE=get_simware();document.getElementById("inputFirmware").value=saveFirmware(SIMWARE)}compute_behavior("FIRE "+key)}function update_memories(preSIMWARE){var i=0;set_simware(preSIMWARE);var SIMWARE=get_simware();simhw_internalState_reset("MC",{});var mc_obj=simhw_internalState("MC");var mcelto=null;for(i=0;i>23&255)-127;var mantissa=1+(hexvalue&8388607)/8388608;var valuef=sign*mantissa*Math.pow(2,exponent);if(-127===exponent)if(1===mantissa)valuef=sign===1?"+0":"-0";else valuef=sign*((hexvalue&8388607)/8388607)*Math.pow(2,-126);if(128===exponent)if(1===mantissa)valuef=sign===1?"+Inf":"-Inf";else valuef="NaN";return valuef}function uint_to_float32(value){var buf=new ArrayBuffer(4);new Uint32Array(buf)[0]=value;return new Float32Array(buf)[0]}function float32_to_uint(value){var buf=new ArrayBuffer(4);new Float32Array(buf)[0]=value;return new Uint32Array(buf)[0]}function float_class(a){var s=a&2147483648;s=s>>31;var e=a&2139095040;e=e>>23;var m=a&8388607;let rd=0;if(!m&&!e){rd=s?3:4}else if(!e){rd=s?2:6}else if(!(e^255)){if(m)rd=s?8:9;else rd=s?0:7}else{rd=s?1:5}return rd}function float_class_power2(a){var s=a&2147483648;s=s>>31;var e=a&2139095040;e=e>>23;var m=a&8388607;let rd=0;if(!m&&!e){rd=s?1<<3:1<<4}else if(!e){rd=s?1<<2:1<<6}else if(!(e^255)){if(m)rd=s?1<<8:1<<9;else rd=s?1<<0:1<<7}else{rd=s?1<<1:1<<5}return rd}function hex2char8(hexvalue){var valuec=[];valuec[0]=String.fromCharCode((hexvalue&4278190080)>>24);valuec[1]=String.fromCharCode((hexvalue&16711680)>>16);valuec[2]=String.fromCharCode((hexvalue&65280)>>8);valuec[3]=String.fromCharCode((hexvalue&255)>>0);return valuec}function simcoreui_pack(val,pack_size){var base_str="0".repeat(pack_size);return base_str.substring(0,pack_size-val.length)+val}function hex2bin(hexvalue){var valuebin=hexvalue.toString(2);valuebin=simcoreui_pack(valuebin,32);valuebin=valuebin.substring(0,4)+" "+valuebin.substring(4,8)+" "+valuebin.substring(8,12)+" "+valuebin.substring(12,16)+"
"+valuebin.substring(16,20)+" "+valuebin.substring(20,24)+" "+valuebin.substring(24,28)+" "+valuebin.substring(28,32);return valuebin}function value2string(format,value){var fmt_value="";var fmt=format.split("_");switch(fmt[0]){case"unsigned":fmt_value=value.toString(fmt[1]).toUpperCase();break;case"float":fmt_value=hex2float(value);break;case"char":fmt_value="'"+String.fromCharCode(value)+"'";break;default:fmt_value=value.toString()}if(fmt[2]==="fill"){fmt_value=simcoreui_pack(fmt_value,8)}return fmt_value}function show_rf_names(){return simcore_action_ui("CPU",0,"show_rf_names")()}function get_screen_content(){return simcore_action_ui("SCREEN",0,"get_screen_content")()}function set_screen_content(screen){simcore_action_ui("SCREEN",0,"set_screen_content")(screen)}function get_keyboard_content(){return simcore_action_ui("KBD",0,"get_keyboard_content")()}function set_keyboard_content(keystrokes){simcore_action_ui("KBD",0,"set_keyboard_content")(keystrokes)}function show_main_memory(memory,index,redraw,updates){return simcore_action_ui("MEMORY",0,"show_main_memory")(memory,index,redraw,updates)}function show_control_memory(memory,index,redraw){return simcore_action_ui("MEMORY",0,"show_control_memory")(memory,index,redraw)}function show_cache_memory(memory){return simcore_action_ui("MEMORY",0,"show_cache_memory")(memory)}function show_memories_values(){var pc_name=simhw_sim_ctrlStates_get().pc.state;var reg_pc=get_value(simhw_sim_state(pc_name));show_main_memory(simhw_internalState("MP"),reg_pc,true,true);var maddr_name=simhw_sim_ctrlStates_get().mpc.state;var reg_maddr=get_value(simhw_sim_state(maddr_name));show_control_memory(simhw_internalState("MC"),reg_maddr,true);show_cache_memory(simhw_internalState("CM"))}function update_draw(obj,value){return simcore_action_ui("CPU",1,"update_draw")(obj,value)}function update_bus_visibility(bus_name,value){return simcore_action_ui("CPU",1,"update_bus_visibility")(bus_name,value)}function refresh(){for(var key in simhw_sim_signals()){update_draw(simhw_sim_signals()[key],simhw_sim_signals()[key].value)}show_dbg_ir(get_value(simhw_sim_state("REG_IR_DECO")))}function show_dbg_ir(value){return simcore_action_ui("MEMORY",0,"show_dbg_ir")(value)}function show_dbg_mpc(){return simcore_action_ui("MEMORY",0,"show_dbg_mpc")()}function show_asmdbg_pc(){return simcore_action_ui("MEMORY",0,"show_asmdbg_pc")()}function ws_alert(msg){if(typeof document==="undefined"){console.log(msg);return true}alert(msg);return true}function element_scroll_get(list_id){var offset=0;var obj_byid=$(list_id);if(obj_byid.length>0){offset=obj_byid[0].scrollTop}return offset}function element_scroll_set(list_id,offset){var obj_byid=$(list_id);if(obj_byid.length>0){obj_byid[0].scrollTop=offset}}function element_scroll_setRelative(list_id,obj_id,offset){var obj_byid=$(obj_id);if(obj_byid.length>0){var topPos=obj_byid[0].offsetTop;element_scroll_set(list_id,topPos+offset)}}var colors_schemes={color14:["#000000","#FFFFFF","#FF0000","#FF8800","#FFFF00","#88FF00","#00FF00","#00FF88","#00FFFF","#0088FF","#0000FF","#8800FF","#FF00FF","#FF0088"],color16:["#000000","#FFFFFF","#9D9D9D","#BE2633","#E06F8B","#493C2B","#A46422","#EB8931","#F7E26B","#2F484E","#44891A","#A3CE27","#1B2632","#005784","#31A2F2","#B2DCEF"],color256:["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff","#000000","#00005f","#000087","#0000af","#0000d7","#0000ff","#005f00","#005f5f","#005f87","#005faf","#005fd7","#005fff","#008700","#00875f","#008787","#0087af","#0087d7","#0087ff","#00af00","#00af5f","#00af87","#00afaf","#00afd7","#00afff","#00d700","#00d75f","#00d787","#00d7af","#00d7d7","#00d7ff","#00ff00","#00ff5f","#00ff87","#00ffaf","#00ffd7","#00ffff","#5f0000","#5f005f","#5f0087","#5f00af","#5f00d7","#5f00ff","#5f5f00","#5f5f5f","#5f5f87","#5f5faf","#5f5fd7","#5f5fff","#5f8700","#5f875f","#5f8787","#5f87af","#5f87d7","#5f87ff","#5faf00","#5faf5f","#5faf87","#5fafaf","#5fafd7","#5fafff","#5fd700","#5fd75f","#5fd787","#5fd7af","#5fd7d7","#5fd7ff","#5fff00","#5fff5f","#5fff87","#5fffaf","#5fffd7","#5fffff","#870000","#87005f","#870087","#8700af","#8700d7","#8700ff","#875f00","#875f5f","#875f87","#875faf","#875fd7","#875fff","#878700","#87875f","#878787","#8787af","#8787d7","#8787ff","#87af00","#87af5f","#87af87","#87afaf","#87afd7","#87afff","#87d700","#87d75f","#87d787","#87d7af","#87d7d7","#87d7ff","#87ff00","#87ff5f","#87ff87","#87ffaf","#87ffd7","#87ffff","#af0000","#af005f","#af0087","#af00af","#af00d7","#af00ff","#af5f00","#af5f5f","#af5f87","#af5faf","#af5fd7","#af5fff","#af8700","#af875f","#af8787","#af87af","#af87d7","#af87ff","#afaf00","#afaf5f","#afaf87","#afafaf","#afafd7","#afafff","#afd700","#afd75f","#afd787","#afd7af","#afd7d7","#afd7ff","#afff00","#afff5f","#afff87","#afffaf","#afffd7","#afffff","#d70000","#d7005f","#d70087","#d700af","#d700d7","#d700ff","#d75f00","#d75f5f","#d75f87","#d75faf","#d75fd7","#d75fff","#d78700","#d7875f","#d78787","#d787af","#d787d7","#d787ff","#d7af00","#d7af5f","#d7af87","#d7afaf","#d7afd7","#d7afff","#d7d700","#d7d75f","#d7d787","#d7d7af","#d7d7d7","#d7d7ff","#d7ff00","#d7ff5f","#d7ff87","#d7ffaf","#d7ffd7","#d7ffff","#ff0000","#ff005f","#ff0087","#ff00af","#ff00d7","#ff00ff","#ff5f00","#ff5f5f","#ff5f87","#ff5faf","#ff5fd7","#ff5fff","#ff8700","#ff875f","#ff8787","#ff87af","#ff87d7","#ff87ff","#ffaf00","#ffaf5f","#ffaf87","#ffafaf","#ffafd7","#ffafff","#ffd700","#ffd75f","#ffd787","#ffd7af","#ffd7d7","#ffd7ff","#ffff00","#ffff5f","#ffff87","#ffffaf","#ffffd7","#ffffff","#080808","#121212","#1c1c1c","#262626","#303030","#3a3a3a","#444444","#4e4e4e","#585858","#626262","#6c6c6c","#767676","#808080","#8a8a8a","#949494","#9e9e9e","#a8a8a8","#b2b2b2","#bcbcbc","#c6c6c6","#d0d0d0","#dadada","#e4e4e4","#eeeeee"]};function colors_clone(cs){var colors=colors_schemes[cs];if(typeof colors=="undefined"){colors=colors_schemes["color16"]}return colors.map((x=>x))}function simcore_init(with_ui){var ret={};ret.msg="";ret.ok=true;if(with_ui){restore_cfg()}else{reset_cfg_values()}return ret}function simcore_init_hw(simhw_name){var ret={};ret.msg="";ret.ok=true;var hwid=simhw_getIdByName(simhw_name);if(hwid<0){ret.msg="ERROR: unknown hardware: "+simhw_name+".
\n";ret.ok=false;return ret}simhw_setActive(hwid);var ret1=simcore_init_ui({});if(false===ret1.ok){ret.msg=ret.msg;ret.ok=false;return ret}return ret}function simcore_welcome(){var ret={};ret.msg="";ret.ok=true;console.log("");console.log("██╗ ██╗███████╗██████╗ ███████╗██╗███╗ ███╗");console.log("██║ ██║██╔════╝██╔══██╗██╔════╝██║████╗ ████║");console.log("██║ █╗ ██║█████╗ ██████╔╝███████╗██║██╔████╔██║");console.log("██║███╗██║██╔══╝ ██╔═══╝ ╚════██║██║██║╚██╔╝██║");console.log("╚███╔███╔╝███████╗██║ ███████║██║██║ ╚═╝ ██║");console.log(" ╚══╝╚══╝ ╚══════╝╚═╝ ╚══════╝╚═╝╚═╝ ╚═╝");console.log("");console.log("Stable: https://github.com/wepsim/wepsim");console.log("Beta: https://github.com/acaldero/wepsim");console.log("");return ret}function simcore_init_ui(hash_detail2init){var ret={};ret.msg="";ret.ok=true;var detail_id=0;var sim_components=simhw_sim_components();for(var elto in sim_components){sim_components[elto].details_ui=[];for(var index in sim_components[elto].details_name){sim_components[elto].details_ui[index]={};detail_id=sim_components[elto].details_name[index];if(typeof hash_detail2init[detail_id]!=="undefined"){sim_components[elto].details_ui[index]=hash_detail2init[detail_id];sim_components[elto].details_ui[index].init()}}}return ret}function simcore_action_ui(component_name,detail_id,action_name){var sim_components=simhw_sim_components();if(typeof sim_components[component_name].details_ui[detail_id][action_name]==="undefined"){return simcore_do_nothing_handler}return sim_components[component_name].details_ui[detail_id][action_name]}function simcore_init_eventlistener(context,hash_detail2action,hash_signal2action){var context_obj=null;var r=[];var o=null;context_obj=document.getElementById(context).contentDocument;if(null==context_obj){console.log('warning: unreferenced graphic element context named "'+r[0]+'".');return}var sim_signals=simhw_sim_signals();for(var key in sim_signals){if(typeof hash_signal2action[key+"click"]==="undefined"){hash_signal2action[key+"click"]=function(key_value){return function(){hash_signal2action[""](key_value,"click")}}(key)}if(typeof hash_signal2action[key+"dblclick"]==="undefined"){hash_signal2action[key+"dblclick"]=function(key_value){return function(){hash_signal2action[""](key_value,"dblclick")}}(key)}for(var j=0;j\n"+"Please load some assembly code.
";ret.ok=false;return ret}var SIMWARE=get_simware();if(!(typeof curr_segments[".ktext"]!="undefined"&&SIMWARE.labels2.kmain)&&!(typeof curr_segments[".text"]!="undefined"&&SIMWARE.labels2.main)){ret.msg="labels 'kmain' (in .ktext) or 'main' (in .text) do not exist!";ret.ok=false;return ret}return ret}function simcore_packerror_at(reg_maddr,msg){var ret={};var hex_maddr="0x"+parseInt(reg_maddr).toString(16);ret.ok=false;ret.msg=msg+" at maddr="+hex_maddr+".";return ret}function simcore_check_if_can_continue2(reg_maddr,reg_pc){var ret={};ret.ok=true;ret.msg="";var curr_MC=simhw_internalState("MC");var mcelto=control_memory_get(curr_MC,reg_maddr);if(typeof mcelto==="undefined"){return simcore_packerror_at(reg_maddr,"Error: undefined microinstruction")}if(simhw_internalState_get("fire_visible","databus")==true||simhw_internalState_get("fire_visible","internalbus")==true){return simcore_packerror_at(reg_maddr,"Error: two or more tri-states are active")}var curr_segments=simhw_internalState("segments");if(reg_pc=curr_segments[".ktext"].begin){return ret}if(reg_pc=curr_segments[".text"].begin){return ret}if(mcelto.is_native&&0===reg_maddr){if(reg_pc==curr_segments[".ktext"].end||reg_pc==curr_segments[".text"].end){return ret}}if(false==mcelto.is_native&&0!==reg_maddr){if(reg_pc==curr_segments[".ktext"].end||reg_pc==curr_segments[".text"].end){return ret}}ret.ok=false;ret.msg="The program has finished because the PC register points outside .ktext/.text code segments";return ret}function simcore_check_if_can_continue(){var pc_name=simhw_sim_ctrlStates_get().pc.state;var reg_pc=parseInt(get_value(simhw_sim_state(pc_name)));var maddr_name=simhw_sim_ctrlStates_get().mpc.state;var reg_maddr=get_value(simhw_sim_state(maddr_name));return simcore_check_if_can_continue2(reg_maddr,reg_pc)}function simcore_reset(){var ret={};ret.msg="";ret.ok=true;var SIMWARE=get_simware();var curr_firm=simhw_internalState("FIRMWARE");var curr_segments=simhw_internalState("segments");var curr_MC=simhw_internalState("MC");var sim_components=simhw_sim_components();var ctrl_states=simhw_sim_ctrlStates_get();var pc_name=ctrl_states.pc.state;var pc_state=simhw_sim_state(pc_name);var sp_name=ctrl_states.sp.state;var sp_state=simhw_sim_state(sp_name);if(curr_firm.stackRegister!=null){sp_name=curr_firm.stackRegister;sp_state=simhw_sim_states().BR[sp_name];ctrl_states.sp.state="BR."+curr_firm.stackRegister}for(var elto in sim_components){var reset_signal_name=sim_components[elto].name+"_RESET";compute_general_behavior(reset_signal_name)}if(typeof curr_segments[".ktext"]!=="undefined"&&SIMWARE.labels2.kmain){set_value(pc_state,parseInt(SIMWARE.labels2.kmain));show_asmdbg_pc()}else if(typeof curr_segments[".text"]!=="undefined"&&SIMWARE.labels2.main){set_value(pc_state,parseInt(SIMWARE.labels2.main));show_asmdbg_pc()}if(typeof curr_segments[".stack"]!=="undefined"&&typeof sp_state!=="undefined"){set_value(sp_state,parseInt(curr_segments[".stack"].end)&4294967292)}var new_maddr=get_value(simhw_sim_state("MUXA_MICROADDR"));var mcelto=control_memory_get(curr_MC,new_maddr);if(typeof mcelto==="undefined"){mcelto={value:simhw_sim_state("REG_MICROINS").default_value,is_native:false}}var new_mins=get_value(mcelto);if(false==mcelto.is_native){compute_general_behavior("CLOCK")}show_dbg_ir(get_value(simhw_sim_state("REG_IR_DECO")));for(elto in sim_components){for(var index in sim_components[elto].details_name){if(typeof sim_components[elto].details_ui[index].reset!=="undefined"){sim_components[elto].details_ui[index].reset()}}}return ret}function simcore_execute_microinstruction(){var ret=simcore_check_if_can_continue();if(false===ret.ok){return ret}compute_general_behavior("CLOCK");show_dbg_mpc();return ret}function simcore_execute_microinstruction2(reg_maddr,reg_pc){var ret=simcore_check_if_can_continue2(reg_maddr,reg_pc);if(false===ret.ok){return ret}compute_general_behavior("CLOCK");show_dbg_mpc();return ret}function simcore_execute_microprogram(options){var ret=simcore_check_if_can_continue();if(false===ret.ok){return ret}var before_state=null;var after_state=null;var curr_mpc="";var curr_MC=simhw_internalState("MC");var maddr_name=simhw_sim_ctrlStates_get().mpc.state;var maddr_state=simhw_sim_state(maddr_name);if(typeof options.before_microinstruction==="undefined"){options.before_microinstruction=simcore_do_nothing_handler}if(typeof options.after_microinstruction==="undefined"){options.after_microinstruction=simcore_do_nothing_handler}var i_clks=0;var limitless=options.cycles_limit<0;var cur_addr=0;var mcelto=null;var oolimits=false;do{options.before_microinstruction(curr_MC,cur_addr);compute_general_behavior("CLOCK");i_clks++;options.after_microinstruction(curr_MC,cur_addr);if(limitless===false&&i_clks>=options.cycles_limit){ret.msg="Warning: clock cycles limit reached in a single instruction.";ret.ok=false;break}cur_addr=get_value(maddr_state);mcelto=control_memory_get(curr_MC,cur_addr);if(typeof mcelto==="undefined"){ret.msg="Error: undefined microinstruction at "+cur_addr+".";ret.ok=false;break}if(i_clks>=options.cycles_limit&&-1!=options.cycles_limit){oolimits=true}}while(false==oolimits&&0!=cur_addr);if(true==ret.ok&&mcelto.is_native){compute_general_behavior("CLOCK")}if(get_cfg("DBG_level")=="microinstruction"){show_dbg_mpc()}return ret}function simcore_execute_program(options){var ret={};ret.ok=true;ret.msg="";var curr_segments=simhw_internalState("segments");var pc_name=simhw_sim_ctrlStates_get().pc.state;var pc_state=simhw_sim_state(pc_name);var reg_pc=get_value(pc_state);var reg_pc_before=get_value(pc_state)-4;var code_begin=0;if(typeof curr_segments[".text"]!="undefined"&&typeof curr_segments[".text"].begin!="undefined")code_begin=parseInt(curr_segments[".text"].begin);var code_end=0;if(typeof curr_segments[".text"]!="undefined"&&typeof curr_segments[".text"].end!="undefined")code_end=parseInt(curr_segments[".text"].end);var kcode_begin=0;if(typeof curr_segments[".ktext"]!="undefined"&&typeof curr_segments[".ktext"].begin!="undefined")kcode_begin=parseInt(curr_segments[".ktext"].begin);var kcode_end=0;if(typeof curr_segments[".ktext"]!="undefined"&&typeof curr_segments[".ktext"].end!="undefined")kcode_end=parseInt(curr_segments[".ktext"].end);var ret1=null;var before_state=null;var after_state=null;var curr_pc="";var SIMWARE=get_simware();if(typeof options.verbalize!=="undefined"){set_cfg("verbal_verbose",options.verbalize)}if(typeof options.before_instruction==="undefined"){options.before_instruction=simcore_do_nothing_handler}if(typeof options.after_instruction==="undefined"){options.after_instruction=simcore_do_nothing_handler}var ins_executed=0;while(reg_pc=code_begin||reg_pc=kcode_begin){options.before_instruction(SIMWARE,reg_pc);ret1=simcore_execute_microprogram(options);if(false===ret1.ok){return ret1}options.after_instruction(SIMWARE,reg_pc);ins_executed++;if(ins_executed>options.instruction_limit&&-1!=options.instruction_limit){ret.ok=false;ret.msg="more than "+options.instruction_limit+" instructions executed before application ends.";return ret}reg_pc_before=reg_pc;reg_pc=get_value(pc_state)}return ret}function simcore_do_nothing_handler(){return null}function simcore_compile_firmware(textToMCompile){var ret={};ret.msg="";ret.ok=true;if(""==textToMCompile){ret.msg="Empty Firmware";ret.ok=false;return ret}var preSM=null;try{preSM=loadFirmware(textToMCompile);ret.simware=preSM}catch(e){ret.msg="ERROR: at line: "+e.lineNumber+" and column: "+e.columnNumber;ret.ok=false;return ret}if(preSM.error!=null){ret.msg=preSM.error;ret.ok=false;return ret}update_memories(preSM);simcore_reset();return ret}function simcore_compile_assembly(textToCompile){var ret={};ret.msg="";ret.ok=true;var SIMWARE=get_simware();if(SIMWARE.firmware.length===0){ret.msg="Empty microcode, please load the microcode first.";ret.ok=false;return ret}var SIMWAREaddon=simlang_compile(textToCompile,SIMWARE);ret.simware=SIMWAREaddon;if(SIMWAREaddon.error!=null){ret.msg=SIMWAREaddon.error;ret.ok=false;return ret}set_simware(SIMWAREaddon);update_memories(SIMWARE);simcore_reset();return ret}function simcore_hardware_export(hw_name){var ret={};ret.msg="{}";ret.ok=false;var hw_obj=simhw_getObjByName(hw_name);if(null===hw_obj){return ret}ret.ok=true;ret.msg=JSON.stringify(hw_obj,(function(key,value){if(typeof value==="function"){return"/Function("+value.toString()+")/"}return value}));return ret}function simcore_hardware_import(hw_json){var ret={};ret.msg="";ret.ok=true;hw_obj=JSON.parse(hw_json,(function(key,value){if(typeof value==="string"&&value.startsWith("/Function(")&&value.endsWith(")/")){value=value.substring(10,value.length-2);return eval("("+value+")")}return value}));simhw_add(hw_obj);return ret}function simcore_native_get_signal(elto){return get_value(simhw_sim_signal(elto))>>>0}function simcore_native_set_signal(elto,value){set_value(simhw_sim_signal(elto),value);compute_behavior("FIRE "+elto);return value}function simcore_native_get_value(component,elto){var index=0;var sim_components=simhw_sim_components();var compo_index=component;if("BR"===component)compo_index="CPU";if("DEVICE"===component)compo_index="IO";if(typeof sim_components[compo_index].get_value!=="undefined"){return sim_components[compo_index].get_value(elto)}return false}function simcore_native_set_value(component,elto,value){var index=0;var sim_components=simhw_sim_components();var compo_index=component;if("BR"===component)compo_index="CPU";if("DEVICE"===component)compo_index="IO";if(typeof sim_components[compo_index].set_value!=="undefined"){return sim_components[compo_index].set_value(elto,value)}return false}function simcore_native_get_fields(signature_raw){var SIMWARE=get_simware();for(var key in SIMWARE.firmware){if(SIMWARE.firmware[key].signatureRaw===signature_raw){return SIMWARE.firmware[key].fields}}}function simcore_native_get_field_from_ir(fields,index){if(typeof fields[index]==="undefined"){ws_alert("simcore_native_get_field_from_ir: index ("+index+") out of range.");return false}var value=get_value(simhw_sim_state("REG_IR"));var left_shift=31-parseInt(fields[index].startbit);var right_shift=parseInt(fields[index].stopbit);value=value<>>left_shift;value=value>>>right_shift;return value}function simcore_native_deco(){compute_behavior("DECO")}function simcore_native_go_maddr(maddr){set_value(simhw_sim_state("MUXA_MICROADDR"),maddr)}function simcore_native_go_opcode(){var maddr=get_value(simhw_sim_state("ROM_MUXA"));set_value(simhw_sim_state("MUXA_MICROADDR"),maddr)}function simcore_native_go_instruction(signature_raw){var SIMWARE=get_simware();for(var key in SIMWARE.firmware){if(SIMWARE.firmware[key].signatureRaw===signature_raw){var maddr=SIMWARE.firmware[key]["mc-start"];set_value(simhw_sim_state("MUXA_MICROADDR"),maddr);return}}}function simcore_simstate_checklist2state(checklist){var o={};var ret=false;checklist=checklist.replace(/;|==|!=|>=|<=|=|>|v!=""));for(var i=0;i"===expected_result[compo][elto].op)diff.fulfill=parseInt(diff.obtained)>parseInt(diff.expected);else if("<"===expected_result[compo][elto].op)diff.fulfill=parseInt(diff.obtained)="===expected_result[compo][elto].op)diff.fulfill=parseInt(diff.obtained)>=parseInt(diff.expected);else if("<="===expected_result[compo][elto].op)diff.fulfill=parseInt(diff.obtained)<=parseInt(diff.expected);else if("=="===expected_result[compo][elto].op)diff.fulfill=diff.expected==diff.obtained;else if("!="===expected_result[compo][elto].op)diff.fulfill=diff.expected!=diff.obtained;d.result.push(diff);if(diff.fulfill===false)d.errors++}}if(newones_too&&typeof obtained_result[compo]!="undefined"){for(elto in obtained_result[compo]){d.neltos_obtained++;if(typeof expected_result[compo]!="undefined"&&typeof expected_result[compo][elto]!="undefined"){continue}diff={};diff.expected=obtained_result[compo][elto].default_value;diff.obtained=obtained_result[compo][elto].value;diff.fulfill=diff.expected===diff.obtained;diff.elto_type=compo.toLowerCase();diff.elto_id=obtained_result[compo][elto].id;diff.elto_op="=";d.result.push(diff);if(diff.fulfill===false)d.errors++}}}return d}function simcore_simstate_diff_results(expected_result,obtained_result){return simcore_simstate_check_results(expected_result,obtained_result,true)}function simcore_simstate_diff_states(before_state_obj,after_state_obj){var before_arr=simcore_simstate_state2checklist(before_state_obj,"").split(";");var after_arr=simcore_simstate_state2checklist(after_state_obj,"").split(";");return after_arr.filter((function(elto){return!before_arr.includes(elto)})).join(";").trim()}function simcore_simstate_checkreport2txt(checklist){var o="";for(var i=0;i"+""+""+"Type"+"IdentificationId."+"Values in the clipboard state"+"Values in the selected state"+""+""+"";for(var i=0;i"+""+checklist[i].elto_type+""+""+checklist[i].elto_id+""+""+checklist[i].elto_op+" "+checklist[i].expected+""+""+checklist[i].obtained+""+""}o+=""+"";return o}function simcore_voice_canSpeak(){if(typeof window.speechSynthesis=="undefined"){return false}if(false===get_cfg("use_voice")){return false}return true}function simcore_voice_speak(msg){var ssu=null;if(simcore_voice_canSpeak()){ssu=new SpeechSynthesisUtterance(msg);ssu.lang="es-ES";if("en"==get_cfg("ws_idiom"))ssu.lang="en-US";if("es"==get_cfg("ws_idiom"))ssu.lang="es-EN";window.speechSynthesis.speak(ssu)}}function simcore_voice_stopSpeak(){if(simcore_voice_canSpeak()){window.speechSynthesis.cancel()}}var simcore_rest={};function simcore_rest_reset(){simcore_rest={}}function simcore_rest_add(name,description){simcore_rest[name]={endpoint:description.endpoint,user:description.user,pass:description.pass,last_request:null}}function simcore_rest_list(){return simcore_rest}function simcore_rest_get(name){return simcore_rest[name]}function simcore_rest_call(name,method,uri,data){var rest_info=simcore_rest[name];if(typeof rest_info==="undefined"){return false}var api_endpoint=rest_info.endpoint;if(api_endpoint.value instanceof Vuex.Store){api_endpoint=get_value(api_endpoint)}if(api_endpoint.trim()===""){return false}var basic_auth="Basic "+btoa(rest_info.user+":"+rest_info.pass);var enc_data=JSON.stringify(data);var request={url:api_endpoint+uri,type:method,contentType:"application/json",accepts:"application/json",cache:false,dataType:"json",data:enc_data,beforeSend:function(xhr){if(rest_info.user.trim()!==""){xhr.setRequestHeader("Authorization",basic_auth)}},error:function(jqXHR){console.log("ajax error "+jqXHR.status)}};rest_info.last_request=$.ajax(request);return true}var simcore_notifications=[];function simcore_notifications_get(){return simcore_notifications}function simcore_notifications_reset(){simcore_notifications=[]}function simcore_notifications_add2(ntf){simcore_notifications.push({title:ntf.title,message:ntf.message,type:ntf.type,date:ntf.date})}function simcore_notifications_add(ntf_title,ntf_message,ntf_type,ntf_delay){simcore_notifications.push({title:$("

").html(ntf_title).text(),message:$("

").html(ntf_message).text(),type:ntf_type,date:(new Date).getTime()})}function get_value(sim_obj){if(sim_obj.value instanceof Vuex.Store){return sim_obj.value.state.value}return sim_obj.value}function set_value(sim_obj,value){if(sim_obj.value instanceof Vuex.Store){sim_obj.value.commit("set_value",value);return}var old_value=sim_obj.value;sim_obj.value=value;if(old_value!=value){sim_obj.changed=true}}function reset_value(sim_obj){if(sim_obj.value instanceof Vuex.Store){set_value(sim_obj,sim_obj.default_value);return}if(typeof sim_obj.default_value=="object"){sim_obj.changed=true;sim_obj.value=Object.create(sim_obj.default_value);return}if(sim_obj instanceof Array){sim_obj.changed=true;for(var i=0;i",""":'"',"'":"'"};function treatHTMLSequences(text_with_html){var re=null;var key=null;for(key in html_sequences){re=new RegExp(key,"gi");text_with_html=text_with_html.replace(re,html_sequences[key])}return text_with_html}function control_memory_getkeys(memory){return Object.keys(memory)}function control_memory_get(memory,elto){return memory[elto]}function control_memory_set(memory,elto,melto){if(typeof melto.changed==="undefined")melto.changed=false;if(typeof melto.state==="undefined")melto.state=false;if(typeof melto.breakpoint==="undefined")melto.breakpoint=false;if(typeof melto.notify==="undefined")melto.notify=[];if(typeof melto.is_native==="undefined")melto.is_native=false;var comments_str="";if(null!=melto.comments){comments_str=melto.comments;if(melto.comments instanceof Array)comments_str=melto.comments.join("\n");melto.state=melto.state||comments_str.trim().split("state:").length>1;melto.breakpoint=melto.breakpoint||comments_str.trim().split("break:").length>1;melto.notify=comments_str.trim().split("notify:");for(var k=0;k";if(active_verbal.trim()==="")active_verbal="";return"Activated signals are: "+active_signals+". Associated actions are: "+active_verbal}function main_memory_getkeys(memory){return Object.keys(memory)}function main_memory_get(memory,elto){return memory[elto]}function main_memory_set(memory,elto,melto){if(typeof melto.changed==="undefined")melto.changed=false;if(typeof melto.state==="undefined")melto.state=false;if(typeof melto.breakpoint==="undefined")melto.breakpoint=false;if(typeof melto.notify==="undefined")melto.notify=[];if(typeof melto.is_assembly==="undefined")melto.is_assembly=false;if(typeof melto.source==="undefined")melto.source="";var comments_str="";if(null!=melto.comments){comments_str=melto.comments.join("\n");melto.state=melto.state||comments_str.trim().split("state:").length>1;melto.breakpoint=melto.breakpoint||comments_str.trim().split("break:").length>1;melto.notify=comments_str.trim().split("notify:");for(var k=0;k>8;if(2==filter_elto)dbvalue=(value&16711680)>>16;if(3==filter_elto)dbvalue=(value&4278190080)>>24;break;case 1:if(0==filter_elto)dbvalue=value&65535;if(1==filter_elto)dbvalue=value&65535;if(2==filter_elto)dbvalue=(value&4294901760)>>16;if(3==filter_elto)dbvalue=(value&4294901760)>>16;break;case 2:if(0==filter_elto)dbvalue=value&16777215;if(1==filter_elto)dbvalue=value&4294967040;break;case 3:dbvalue=value;break}return dbvalue}function main_memory_updatevalues(value,dbvalue,filter_size,filter_elto){switch(filter_size){case 0:if(0==filter_elto)value=value&4294967040|dbvalue&255;if(1==filter_elto)value=value&4294902015|(dbvalue&255)<<8;if(2==filter_elto)value=value&4278255615|(dbvalue&255)<<16;if(3==filter_elto)value=value&16777215|(dbvalue&255)<<24;break;case 1:if(0==filter_elto)value=value&4294901760|dbvalue&65535;if(1==filter_elto)value=value&4294901760|dbvalue&65535;if(2==filter_elto)value=value&65535|(dbvalue&65535)<<16;if(3==filter_elto)value=value&65535|(dbvalue&65535)<<16;break;case 2:if(0==filter_elto)value=value&4278190080|dbvalue&16777215;if(1==filter_elto)value=value&255|dbvalue&4294967040;break;case 3:value=dbvalue;break}return value}function main_memory_get_program_counter(){var r_ref=simhw_sim_ctrlStates_get().pc;var r_value=null;if(typeof r_ref!=="undefined"){r_ref=simhw_sim_state(r_ref.state)}if(typeof r_ref!=="undefined"){r_value=get_value(r_ref)}return r_value}function main_memory_get_baseaddr(){var r_ref=simhw_sim_ctrlStates_get();if(typeof r_ref==="undefined"){return null}var parts=null;var r_value=0;var r_ref2=null;var all_baseaddr={};for(var elto in r_ref){if(r_ref[elto].is_pointer==false){continue}parts=r_ref[elto].state.split(".");if(parts[0]=="BR"){r_value=4294967292;r_ref2=simhw_sim_states().BR[parts[1]]}else{r_value=0;r_ref2=simhw_sim_state(r_ref[elto].state)}if(typeof r_ref2!=="undefined"){r_value=get_value(r_ref2)}all_baseaddr[elto]=r_value}return all_baseaddr}function get_deco_from_pc(pc){var mp_obj=simhw_internalState("MP");if(typeof mp_obj==="undefined"||typeof mp_obj[pc]==="undefined"||typeof mp_obj[pc].source==="undefined"){return""}return mp_obj[pc].source}function get_verbal_from_current_pc(){var pc_name=simhw_sim_ctrlStates_get().pc.state;var reg_pc=get_value(simhw_sim_state(pc_name));var pc=parseInt(reg_pc)-4;var decins=get_deco_from_pc(pc);if(""==decins.trim()){decins="not jet defined"}return"Current instruction is: "+decins+" and PC points to "+show_value(pc)+". "}function cache_memory_update_stats(memory,address,parts,r_w,m_h,clock_timestamp){memory.stats.n_access++;memory.stats.last_addr=address;memory.stats.last_parts=parts;memory.stats.last_r_w=r_w;memory.stats.last_h_m=m_h;if(m_h=="miss"){memory.stats.n_misses++}else{memory.stats.n_hits++}memory.sets[parts.set].tags[parts.tag].n_access++;if(r_w=="write"){memory.sets[parts.set].tags[parts.tag].dirty=1}memory.sets[parts.set].tags[parts.tag].timestamp=clock_timestamp}function cache_memory_select_victim(memory,set){var keys=Object.keys(memory.sets[set].tags);var tag_victim=0;if(memory.cfg.replace_pol=="lfu"){tag_victim=keys[0];var tag_naccess=memory.sets[parts.set].tags[tag_victim].n_access;for(var i=1;imemory.sets[parts.set].tags[keys[i]].n_access){tag_victim=keys[i];tag_naccess=memory.sets[parts.set].tags[tag_victim].n_access}}}else if(memory.cfg.replace_pol=="fifo"){tag_victim=keys[0];var tag_stamp=memory.sets[parts.set].tags[tag_victim].timestamp;for(var i=1;imemory.sets[parts.set].tags[keys[i]].timestamp){tag_victim=keys[i];tag_stamp=memory.sets[parts.set].tags[tag_victim].timestamp}}}else if(memory.cfg.replace_pol=="first"){tag_victim=keys[0]}return tag_victim}function cache_memory_init(name,via_size,off_size,set_size,replace_pol,su_pol,next_cache){var c={stats:{},cfg:{},sets:{}};c.cfg.name=name;c.cfg.via_size=via_size;c.cfg.off_size=off_size;c.cfg.set_size=set_size;c.cfg.vps_size=via_size-set_size;c.cfg.tag_size=32-set_size-off_size;c.cfg.mask_tag=Math.pow(2,c.cfg.tag_size)-1>>>0;c.cfg.mask_set=Math.pow(2,c.cfg.set_size)-1>>>0;c.cfg.mask_off=Math.pow(2,c.cfg.off_size)-1>>>0;c.cfg.mask_tag=c.cfg.mask_tag<<32-c.cfg.tag_size>>>0;c.cfg.mask_set=c.cfg.mask_set<>>0;c.cfg.replace_pol=replace_pol;c.cfg.su_pol=su_pol;c.cfg.next_cache=next_cache;c.stats.n_access=0;c.stats.n_hits=0;c.stats.n_misses=0;c.stats.last_addr=0;c.stats.last_parts=cache_memory_split(c,0);c.stats.last_r_w="";c.stats.last_h_m="";return c}function cache_memory_init2(cfg){return cache_memory_init(cfg.name,cfg.via_size,cfg.off_size,cfg.set_size,cfg.replace_pol,cfg.su_pol,cfg.next_cache)}function cache_memory_init3(array_cm_cfg){var array_cm=[];for(var i=0;i>>0;parts.tag=(address&memory.cfg.mask_tag)>>>32-memory.cfg.tag_size;parts.set=(address&memory.cfg.mask_set)>>>memory.cfg.off_size;parts.offset=address&memory.cfg.mask_off;return parts}function cache_memory_access(memory,address,r_w,clock_timestamp){if(memory.cfg.su_pol!="unified"){if("split_i"==memory.cfg.su_pol&&segments_addr_within_text(address)==false){return false}if("split_d"==memory.cfg.su_pol&&segments_addr_within_data(address)==false){return false}}var parts=cache_memory_split(memory,address);if(typeof memory.sets[parts.set]=="undefined"){memory.sets[parts.set]={tags:{},number_tags:0}}if(typeof memory.sets[parts.set].tags[parts.tag]!="undefined"&&memory.sets[parts.set].tags[parts.tag].valid==1){cache_memory_update_stats(memory,address,parts,r_w,"hit",clock_timestamp);return true}if(typeof memory.sets[parts.set].number_tags>3){var tag_victim=cache_memory_select_victim(memory,parts.set);memory.sets[parts.set].tags[tag_victim].valid=0;memory.sets[parts.set].number_tags--}memory.sets[parts.set].tags[parts.tag]={n_access:0,valid:1,dirty:0};memory.sets[parts.set].number_tags++;cache_memory_update_stats(memory,address,parts,r_w,"miss",clock_timestamp);if(memory.cfg.next_cache!=null){cache_memory_access(memory.cfg.next_cache,address,r_w)}return false}var sim={systems:[],active:null,index:0};function simhw_add(newElto){var found=-1;for(var m=0;m=0&&sim.systems.length>=newActive){sim.active=sim.systems[newActive];sim.index=newActive}compile_behaviors();firedep_to_fireorder(jit_fire_dep);compute_references();compile_verbals()}function simhw_getIdByName(short_name){for(var m=0;m>>0).toString(16)}function check_behavior(){if(0==simhw_sim_signals().length){ws_alert("ALERT: empty signals!!!")}if(0==simhw_sim_states().length){ws_alert("ALERT: empty states!!!")}for(var key in simhw_sim_signals()){for(var key2 in simhw_sim_signal(key).behavior){var behaviors=simhw_sim_signal(key).behavior[key2].split(";");for(var i=0;i "+behavior_k[0]+" ("+behavior_i+")");return}if(behavior_k.length!=simhw_syntax_behavior(behavior_k[0]).nparameters){ws_alert("ALERT: Behavior has an incorrect number of elements --\x3e "+behavior_i+"/"+simhw_syntax_behavior(behavior_k[0]).nparameters);return}for(var j=1;j '"+behavior_i);return}else if("S"==t&&typeof simhw_sim_signal(s[0])=="undefined"){ws_alert("ALERT: Behavior has an undefined reference to a signal -> '"+behavior_i);return}else if("X"==t&&typeof simhw_sim_state(s[0])=="undefined"&&typeof simhw_sim_signal(s[0])=="undefined"){ws_alert("ALERT: Behavior has an undefined reference to a object state OR signal -> '"+behavior_i);return}}}}}}var jit_behaviors=false;var jit_verbals=false;var jit_fire_dep=null;var jit_fire_order=null;var jit_dep_network=null;var jit_fire_ndep=null;function firedep_to_fireorder(jit_fire_dep){var allfireto=false;jit_fire_order=[];jit_fire_ndep=[];for(var sig in simhw_sim_signals()){if(typeof jit_fire_dep[sig]=="undefined"){jit_fire_order.push(sig);continue}ndep=0;allfireto=false;for(var sigorg in jit_fire_dep[sig]){ndep++;if(jit_fire_dep[sig][sigorg]==simhw_sim_signal(sigorg).behavior.length){allfireto=true}}jit_fire_ndep[sig]=ndep;if(allfireto==false)jit_fire_order.push(sig)}}function compile_behaviors(){var jit_bes="";jit_fire_dep={};var sig_obj=null;var expr_obj=null;for(var sig in simhw_sim_signals()){jit_bes+="simhw_sim_signal('"+sig+"').behavior_fn = new Array();\n";for(var val in simhw_sim_signal(sig).behavior){var input_behavior=simhw_sim_signal(sig).behavior[val];var jit_be="";var s_exprs=input_behavior.split(";");for(var i=0;i"+v+"";if("Signals"!=enum_name)o+="("+(i+1)+") "+v;else o+="("+(i+1)+") "+hash_eltos[array_eltos[i]].ref+": "+v;if(i!=array_eltos.length-1){o+=str_enditem}}o+=". ";return o}function simhwelto_describe_component_enum(elto_path,array_eltos,hash_eltos,enum_name){var o="";o+=""+i18n_get_TagFor("hw","It has")+""+" "+array_eltos.length+" "+""+i18n_get_TagFor("hw",enum_name)+""+": "+simhwelto_describe_component_enum_aux(elto_path,array_eltos,hash_eltos,enum_name,", ");return o}function simhwelto_describe_component(elto_path,elto,format){var o="";o+=elto.description+".

    "+"
  • "+simhwelto_describe_component_enum(elto_path+":states:",elto.states_inputs,elto.states,"inputs")+"
    "+"
  • "+simhwelto_describe_component_enum(elto_path+":states:",elto.states_outputs,elto.states,"outputs")+"
    "+"
  • "+simhwelto_describe_component_enum(elto_path+":signals:",elto.signals_inputs,elto.signals,"signals")+"
    "+"
";if(format!="html"){o.replace(/<[^>]*>?/gm,"")}return o}var ep_def={sim_name:"Elemental Processor",sim_short_name:"ep",sim_img_processor:"examples/hardware/ep/images/processor.svg",sim_img_controlunit:"examples/hardware/ep/images/controlunit.svg",sim_img_cpu:"examples/hardware/ep/images/cpu.svg",components:{},states:{},signals:{},behaviors:{},elements:{},internal_states:{},ctrl_states:{},events:{}};simhw_add(ep_def);sim.ep.behaviors.PRINT_S={nparameters:2,types:["S"],operation:function(s_expr){console.log(s_expr[1]+": 0x"+sim.ep.signals[s_expr[1]].value.toString(16))},verbal:function(s_expr){return"Print value of signal "+s_expr[1]+": 0x"+sim.ep.signals[s_expr[1]].value.toString(16)+". "}};sim.ep.behaviors.PRINT_E={nparameters:2,types:["E"],operation:function(s_expr){console.log(s_expr[1]+": 0x"+sim.ep.states[s_expr[1]].value.toString(16))},verbal:function(s_expr){return"Print value of state "+s_expr[1]+": 0x"+sim.ep.states[s_expr[1]].value.toString(16)+". "}};sim.ep.components["CPU"]={name:"CPU",version:"1",abilities:["CPU"],details_name:["REGISTER_FILE","CONTROL_MEMORY","CLOCK","CPU_STATS"],details_fire:[["svg_p:text3029","svg_p:text3031"],["svg_cu:text3010"],["svg_p:text3459-7","svg_cu:text4138","svg_cu:text4138-7"],["svg_p:text3495"]],write_state:function(vec){if(typeof vec.CPU=="undefined"){vec.CPU={}}var internal_reg=["PC","SR"];var value=0;for(var i=0;i>>0;if(value!=0){vec.CPU["R"+i]={type:"register",default_value:0,id:"R"+i,op:"=",value:"0x"+value.toString(16)}}}for(i=0;i>>0;if(value!=0){vec.CPU[internal_reg[i]]={type:"register",default_value:0,id:internal_reg[i],op:"=",value:"0x"+value.toString(16)}}}return vec},read_state:function(vec,check){if(typeof vec.CPU=="undefined"){vec.CPU={}}var key=check["id"].toUpperCase().trim();var val=parseInt(check["value"]).toString(16);if("REGISTER"==check["type"].toUpperCase().trim()){vec.CPU[key]={type:"register",default_value:0,id:key,op:check["condition"],value:"0x"+val};return true}return false},get_state:function(reg){var value=0;var r_reg=reg.toUpperCase().trim();if(typeof sim.ep.states["REG_"+r_reg]!="undefined"){value=get_value(sim.ep.states["REG_"+r_reg])>>>0;return"0x"+value.toString(16)}r_reg=r_reg.replace("R","");var index=parseInt(r_reg);if(typeof sim.ep.states.BR[index]!="undefined"){value=get_value(sim.ep.states.BR[index])>>>0;return"0x"+value.toString(16)}return null},get_value:function(elto){if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index))return get_value(simhw_sim_state(elto))>>>0;return get_value(simhw_sim_states().BR[index])>>>0},set_value:function(elto,value){var pc_name=simhw_sim_ctrlStates_get().pc.state;if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index)){set_value(simhw_sim_state(elto),value);if(pc_name===elto){show_asmdbg_pc()}return value}return set_value(simhw_sim_states().BR[index],value)}};sim.ep.ctrl_states.pc={name:"PC",state:"REG_PC",is_pointer:true};sim.ep.ctrl_states.sp={name:"SP",state:"BR.29",is_pointer:true};sim.ep.ctrl_states.fp={name:"FP",state:"BR.30",is_pointer:true};sim.ep.ctrl_states.ir={name:"IR",state:"REG_IR",default_eltos:{co:{begin:0,end:5,length:6},cop:{begin:28,end:31,length:4}},is_pointer:false};sim.ep.ctrl_states.mpc={name:"mPC",state:"REG_MICROADDR",is_pointer:false};sim.ep.internal_states.MC={};sim.ep.internal_states.ROM={};sim.ep.internal_states.FIRMWARE=ws_empty_firmware;sim.ep.internal_states.io_hash={};sim.ep.internal_states.fire_stack=[];sim.ep.internal_states.tri_state_names=["T1","T2","T3","T4","T5","T6","T7","T8","T9","T10","T11","T12"];sim.ep.internal_states.fire_visible={databus:false,internalbus:false};sim.ep.internal_states.filter_states=["REG_IR_DECO,col-12","REG_IR,col-auto","REG_PC,col-auto","REG_MAR,col-auto","REG_MBR,col-auto","REG_RT1,col-auto","REG_RT2,col-auto","REG_RT3,col-auto","REG_SR,col-auto","REG_MICROADDR,col-auto"];sim.ep.internal_states.filter_signals=["A0,0","B,0","C,0","SELA,5","SELB,5","SELC,2","SELCOP,0","MR,0","MC,0","C0,0","C1,0","C2,0","C3,0","C4,0","C5,0","C6,0","C7,0","T1,0","T2,0","T3,0","T4,0","T5,0","T6,0","T7,0","T8,0","T9,0","T10,0","T11,0","M1,0","M2,0","M7,0","MA,0","MB,0","SELP,0","LC,0","SE,0","SIZE,0","OFFSET,0","BW,0","R,0","W,0","TA,0","TD,0","IOR,0","IOW,0","TEST_I,0","TEST_U,0"];sim.ep.internal_states.alu_flags={flag_n:0,flag_z:0,flag_v:0,flag_c:0};sim.ep.states.BR=[];sim.ep.states.BR[0]={name:"R0",verbal:"Register 0",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[1]={name:"R1",verbal:"Register 1",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[2]={name:"R2",verbal:"Register 2",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[3]={name:"R3",verbal:"Register 3",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[4]={name:"R4",verbal:"Register 4",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[5]={name:"R5",verbal:"Register 5",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[6]={name:"R6",verbal:"Register 6",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[7]={name:"R7",verbal:"Register 7",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[8]={name:"R8",verbal:"Register 8",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[9]={name:"R9",verbal:"Register 9",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[10]={name:"R10",verbal:"Register 10",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[11]={name:"R11",verbal:"Register 11",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[12]={name:"R12",verbal:"Register 12",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[13]={name:"R13",verbal:"Register 13",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[14]={name:"R14",verbal:"Register 14",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[15]={name:"R15",verbal:"Register 15",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[16]={name:"R16",verbal:"Register 16",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[17]={name:"R17",verbal:"Register 17",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[18]={name:"R18",verbal:"Register 18",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[19]={name:"R19",verbal:"Register 19",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[20]={name:"R20",verbal:"Register 20",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[21]={name:"R21",verbal:"Register 21",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[22]={name:"R22",verbal:"Register 22",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[23]={name:"R23",verbal:"Register 23",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[24]={name:"R24",verbal:"Register 24",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[25]={name:"R25",verbal:"Register 25",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[26]={name:"R26",verbal:"Register 26",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[27]={name:"R27",verbal:"Register 27",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[28]={name:"R28",verbal:"Register 28",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[29]={name:"R29",verbal:"Register 29",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[30]={name:"R30",verbal:"Register 30",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[31]={name:"R31",verbal:"Register 31",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_PC"]={name:"PC",verbal:"Program Counter Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_MAR"]={name:"MAR",verbal:"Memory Address Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_MBR"]={name:"MBR",verbal:"Memory Data Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_IR"]={name:"IR",verbal:"Instruction Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_RT1"]={name:"RT1",verbal:"Temporal 1 Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_RT2"]={name:"RT2",verbal:"Temporal 2 Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_RT3"]={name:"RT3",verbal:"Temporal 3 Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_SR"]={name:"SR",verbal:"State Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BUS_IB"]={name:"I_BUS",verbal:"Internal Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BUS_AB"]={name:"A_BUS",verbal:"Address Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BUS_CB"]={name:"C_BUS",verbal:"Control Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BUS_DB"]={name:"D_BUS",verbal:"Data Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["C2_T2"]={name:"C2_T2",verbal:"Output of PC",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["RA_T9"]={name:"RA_T9",verbal:"Input of T9 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["RB_T10"]={name:"RB_T10",verbal:"Input of T10 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["HPC_T12"]={name:"HPC_T12",verbal:"Input of T12 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["SELEC_T3"]={name:"SELEC_T3",verbal:"Input of T3 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["SELP_M7"]={name:"SELP_M7",verbal:"Output of MUX SelP",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["ALU_C6"]={name:"ALU_C6",verbal:"Input of Temporal 3 Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["MA_ALU"]={name:"MA_ALU",verbal:"Input ALU via MA",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["MB_ALU"]={name:"MB_ALU",verbal:"Input ALU via MB",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_C"]={name:"FLAG_C",verbal:"Carry Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_V"]={name:"FLAG_V",verbal:"Overflow Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_N"]={name:"FLAG_N",verbal:"Negative Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_Z"]={name:"FLAG_Z",verbal:"Zero Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_I"]={name:"FLAG_I",verbal:"Interruption Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_U"]={name:"FLAG_U",verbal:"User Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_MICROADDR"]={name:"µADDR",verbal:"Microaddress Register",visible:true,nbits:"12",value:0,default_value:0,draw_data:["svg_cu:text4667"]};sim.ep.states["REG_MICROINS"]={name:"µINS",verbal:"Microinstruction Register",visible:true,nbits:"77",value:{},default_value:{},draw_data:[]};sim.ep.states["FETCH"]={name:"FETCH",verbal:"Input Fetch",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.ep.states["ROM_MUXA"]={name:"ROM_MUXA",verbal:"Input ROM",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.ep.states["SUM_ONE"]={name:"SUM_ONE",verbal:"Input next microinstruction",visible:false,nbits:"12",value:1,default_value:1,draw_data:[]};sim.ep.states["MUXA_MICROADDR"]={name:"MUXA_MICROADDR",verbal:"Input microaddress",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.ep.states["MUXC_MUXB"]={name:"MUXC_MUXB",verbal:"Output of MUX C",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["INEX"]={name:"INEX",verbal:"Illegal Instruction Exception",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["BS_M1"]={name:"BS_M1",verbal:"from Memory",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BS_TD"]={name:"BS_TD",verbal:"Memory",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["INTV"]={name:"INTV",verbal:"Interruption Vector",visible:false,nbits:"8",value:0,default_value:0,draw_data:[]};sim.ep.states["M2_C2"]={name:"M2_C2",verbal:"Input of Program Counter",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["M1_C1"]={name:"M1_C1",verbal:"Input of Memory Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["M7_C7"]={name:"M7_C7",verbal:"Input of State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["VAL_ZERO"]={name:"VAL_ZERO",verbal:"Wired Zero",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["VAL_ONE"]={name:"VAL_ONE",verbal:"Wired One",visible:false,nbits:"32",value:1,default_value:1,draw_data:[]};sim.ep.states["VAL_FOUR"]={name:"VAL_FOUR",verbal:"Wired Four",visible:false,nbits:"32",value:4,default_value:4,draw_data:[]};sim.ep.states["REG_IR_DECO"]={name:"IR_DECO",verbal:"Instruction Decoded",visible:true,nbits:"0",value:0,default_value:0,draw_data:[]};sim.ep.states["DECO_INS"]={name:"DECO_INS",verbal:"Instruction decoded in binary",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["CLK"]={name:"CLK",verbal:"Clock",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["ACC_TIME"]={name:"ACC_TIME",verbal:"Accumulated CPU time",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["TTCPU"]={name:"TTCPU",verbal:"Several Tristates to the internal data bus in CPU activated",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["ACC_PWR"]={name:"ACC_PWR",verbal:"Accumulated Energy Consumption",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.signals["C"]={name:"C",visible:true,type:"L",value:0,default_value:0,nbits:"4",behavior:["MV MUXC_MUXB VAL_ZERO; FIRE B","MBIT MUXC_MUXB INT 0 1; FIRE B","MBIT MUXC_MUXB IORDY 0 1; FIRE B","MBIT MUXC_MUXB MRDY 0 1; FIRE B","MBIT MUXC_MUXB REG_SR 0 1; FIRE B","MBIT MUXC_MUXB REG_SR 1 1; FIRE B","MBIT MUXC_MUXB REG_SR 28 1; FIRE B","MBIT MUXC_MUXB REG_SR 29 1; FIRE B","MBIT MUXC_MUXB REG_SR 30 1; FIRE B","MBIT MUXC_MUXB REG_SR 31 1; FIRE B","MV MUXC_MUXB INEX; FIRE B"],fire_name:["svg_cu:text3410"],draw_data:[["svg_cu:path3108"],["svg_cu:path3062"],["svg_cu:path3060"],["svg_cu:path3136"],["svg_cu:path3482"],["svg_cu:path3480"],["svg_cu:path3488"],["svg_cu:path3486"],["svg_cu:path3484"],["svg_cu:path3484-9"],["svg_cu:path3108-3","svg_cu:path3260-3-8-6","svg_cu:path3260-3-8","svg_cu:path3260-3"]],draw_name:[["svg_cu:path3496","svg_cu:path3414","svg_cu:path3194-08"]]};sim.ep.signals["B"]={name:"B",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV A1 MUXC_MUXB; FIRE A1","NOT_ES A1 MUXC_MUXB; FIRE A1"],depends_on:["CLK"],fire_name:["svg_cu:text3408"],draw_data:[["svg_cu:path3100-8-7","svg_cu:path3108-1","svg_cu:path3200-1"],["svg_cu:path3392","svg_cu:path3372","svg_cu:path3390","svg_cu:path3384","svg_cu:path3100-8-7","svg_cu:path3386"]],draw_name:[[],["svg_cu:path3194-0","svg_cu:path3138-8","svg_cu:path3498-6"]]};sim.ep.signals["A0"]={name:"A0",visible:false,type:"L",value:0,default_value:0,nbits:"1",behavior:["SBIT_SIGNAL A0A1 0 1; FIRE A0A1","SBIT_SIGNAL A0A1 1 1; FIRE A0A1"],depends_on:["CLK"],fire_name:["svg_cu:text3406"],draw_data:[["svg_cu:path3096"],["svg_cu:path3096"]],draw_name:[[],["svg_cu:path3138-8-1","svg_cu:path3098-2","svg_cu:path3124-2-5"]]};sim.ep.signals["A1"]={name:"A1",visible:false,type:"L",value:0,default_value:0,nbits:"1",behavior:["SBIT_SIGNAL A0A1 0 0; FIRE A0A1","SBIT_SIGNAL A0A1 1 0; FIRE A0A1"],depends_on:["CLK"],fire_name:[],draw_data:[["svg_cu:path3094"],["svg_cu:path3094"]],draw_name:[[]]};sim.ep.signals["A0A1"]={name:"A0A1",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["PLUS1 MUXA_MICROADDR REG_MICROADDR","CP_FIELD MUXA_MICROADDR REG_MICROINS/MADDR","MV MUXA_MICROADDR ROM_MUXA","MV MUXA_MICROADDR FETCH"],depends_on:["CLK"],fire_name:[],draw_data:[["svg_cu:path3102","svg_cu:path3100","svg_cu:path3098","svg_cu:path3100-9","svg_cu:path3088","svg_cu:path3082"],["svg_cu:path3104","svg_cu:path3134","svg_cu:path3500","svg_cu:path3416"],["svg_cu:path3124-2-4","svg_cu:path3124-2","svg_cu:path3504","svg_cu:path3100-8","svg_cu:path3234-9"],["svg_cu:path3124"]],draw_name:[[]]};sim.ep.signals["C0"]={name:"C0",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_MAR BUS_IB"],fire_name:["svg_p:text3077"],draw_data:[["svg_p:path3081"]],draw_name:[["svg_p:path3075"]]};sim.ep.signals["C1"]={name:"C1",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_MBR M1_C1"],fire_name:["svg_p:text3079"],draw_data:[["svg_p:path3055"]],draw_name:[["svg_p:path3073"]]};sim.ep.signals["C2"]={name:"C2",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_PC M2_C2; UPDATEDPC"],fire_name:["svg_p:text3179"],draw_data:[["svg_p:path3485"]],draw_name:[["svg_p:path3177"]]};sim.ep.signals["C3"]={name:"C3",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_IR BUS_IB; DECO; FIRE_IFSET C 10"],fire_name:["svg_p:text3439"],draw_data:[["svg_p:path3339"]],draw_name:[["svg_p:path3337"]]};sim.ep.signals["C4"]={name:"C4",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_RT1 BUS_IB"],fire_name:["svg_p:text3441"],draw_data:[["svg_p:path3263"]],draw_name:[["svg_p:path3255"]]};sim.ep.signals["C5"]={name:"C5",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_RT2 BUS_IB"],fire_name:["svg_p:text3443"],draw_data:[["svg_p:path3277"]],draw_name:[["svg_p:path3269"]]};sim.ep.signals["C6"]={name:"C6",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_RT3 ALU_C6"],fire_name:["svg_p:text3445"],draw_data:[["svg_p:path3325","svg_p:path3323","svg_p:path3321","svg_p:path3261-8","svg_p:path3317-9","svg_p:path3901-6-9"]],draw_name:[["svg_p:path3245"]]};sim.ep.signals["C7"]={name:"C7",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_SR M7_C7"],fire_name:["svg_p:text3655"],draw_data:[["svg_p:path3651-9"]],draw_name:[["svg_p:path3681"]]};sim.ep.signals["TA"]={name:"TA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MV BUS_AB REG_MAR; MOVE_BITSE A1A0 0 2 BUS_AB 0; FIRE_IFCHANGED A1A0 A1A0"],fire_name:["svg_p:text3091"],draw_data:[["svg_p:path3061-2","svg_p:path3083","svg_p:path3089","svg_p:path3597","svg_p:path3513","svg_p:path3601","svg_p:path3601-2","svg_p:path3187","svg_p:path3087","svg_p:path2995","svg_p:path3535"]],draw_name:[["svg_p:path3085"]]};sim.ep.signals["TD"]={name:"TD",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; CHECK_RTD","MV BUS_DB BS_TD; MOVE_BITSE A1A0 0 2 BUS_AB 0; FIRE_IFCHANGED A1A0 A1A0; CHECK_RTD"],fire_name:["svg_p:text3103"],draw_data:[["svg_p:path3545","svg_p:path3093","svg_p:path3101","svg_p:path3587","svg_p:path3515","svg_p:path3071","svg_p:path3419","svg_p:path3099","svg_p:path3097","svg_p:path3559-5","svg_p:path3419-1-0","svg_p:path3583","svg_p:path3419-1","svg_p:path3491","svg_p:path3641","svg_p:path3541"]],draw_name:[["svg_p:path3095"]]};sim.ep.signals["T1"]={name:"T1",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 0","MV BUS_IB REG_MBR; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 0"],fire_name:["svg_p:text3105"],draw_data:[["svg_p:path3071","svg_p:path3065","svg_p:path3071","svg_p:path3049","svg_p:path3063-9","svg_p:path3071","svg_p:path3071","svg_p:path3069"]],draw_name:[["svg_p:path3067"]]};sim.ep.signals["T2"]={name:"T2",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 1","MV BUS_IB REG_PC; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 1"],fire_name:["svg_p:text3449"],draw_data:[["svg_p:path3195","svg_p:path3199","svg_p:path3201","svg_p:path3049"]],draw_name:[["svg_p:path3329"]]};sim.ep.signals["T3"]={name:"T3",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 2","MV BUS_IB SELEC_T3; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 2"],fire_name:["svg_p:text3451"],draw_data:[["svg_p:path3341","svg_p:path3347","svg_p:path3349","svg_p:path3931","svg_p:path3345","svg_p:path3049"]],draw_name:[["svg_p:path3351"]]};sim.ep.signals["T4"]={name:"T4",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 3","MV BUS_IB REG_RT1; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 3"],fire_name:["svg_p:text3453"],draw_data:[["svg_p:path3257","svg_p:path3261","svg_p:path3259","svg_p:path3049"]],draw_name:[["svg_p:path3305"]]};sim.ep.signals["T5"]={name:"T5",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 4","MV BUS_IB REG_RT2; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 4"],fire_name:["svg_p:text3455"],draw_data:[["svg_p:path3271","svg_p:path3275","svg_p:path3273","svg_p:path3049"]],draw_name:[["svg_p:path3307"]]};sim.ep.signals["T6"]={name:"T6",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 5","MV BUS_IB ALU_C6; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 5"],fire_name:["svg_p:text3457"],draw_data:[["svg_p:path3315","svg_p:path3589","svg_p:path3317","svg_p:path3163-2","svg_p:path3049","svg_p:path3321","svg_p:path3261-8","svg_p:path3317-9","svg_p:path3901-6-9"]],draw_name:[["svg_p:path3319"]]};sim.ep.signals["T7"]={name:"T7",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 6","MV BUS_IB REG_RT3; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 6"],fire_name:["svg_p:text3459"],draw_data:[["svg_p:path3309","svg_p:path3327","svg_p:path3311","svg_p:path3049"]],draw_name:[["svg_p:path3313"]]};sim.ep.signals["T8"]={name:"T8",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 7","MV BUS_IB REG_SR; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 7"],fire_name:["svg_p:text3657"],draw_data:[["svg_p:path3645","svg_p:path3651","svg_p:path3647","svg_p:path3049"]],draw_name:[["svg_p:path3649"]]};sim.ep.signals["T9"]={name:"T9",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 8","MV BUS_IB RA_T9; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 8"],fire_name:["svg_p:text3147"],draw_data:[["svg_p:path3131","svg_p:path3143","svg_p:path3139","svg_p:path3049","svg_p:path3143-9"]],draw_name:[["svg_p:path3133"]]};sim.ep.signals["T10"]={name:"T10",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 9","MV BUS_IB RB_T10; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 9"],fire_name:["svg_p:text3149"],draw_data:[["svg_p:path3135","svg_p:path3145","svg_p:path3141","svg_p:path3049","svg_p:path3145-5"]],draw_name:[["svg_p:path3137"]]};sim.ep.signals["T11"]={name:"T11",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 10","CP_FIELD BUS_IB REG_MICROINS/EXCODE; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 10"],fire_name:["svg_p:text3147-5","svg_cu:tspan4426"],draw_data:[["svg_cu:path3131-3","svg_p:path3131-3","svg_p:path3145","svg_p:path3081-3","svg_p:path3139-7","svg_p:path3049","svg_cu:path3081-3","svg_cu:path3139-7"]],draw_name:[["svg_p:path3133-6","svg_cu:path3133-6"]]};sim.ep.signals["T12"]={name:"T12",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 11","MV BUS_IB HPC_T12; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 11"],fire_name:["svg_p:text3147-5-0-1-1"],draw_data:[["svg_p:path3131-3-8-4-31","svg_p:path3139-7-1-4-3","svg_p:path3049","svg_p:path3081-3-8-5-3"]],draw_name:[["svg_p:path3133-6-9-7-5"]]};sim.ep.signals["M1"]={name:"M1",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M1_C1 BUS_IB","MV M1_C1 BS_M1"],depends_on:["C1"],fire_name:["svg_p:text3469"],draw_data:[["svg_p:path3063","svg_p:path3061","svg_p:path3059"],["svg_p:path3057","svg_p:path3641","svg_p:path3419","svg_p:path3583"]],draw_name:[[],["svg_p:path3447"]]};sim.ep.signals["M2"]={name:"M2",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M2_C2 BUS_IB","PLUS4 M2_C2 REG_PC"],depends_on:["C2"],fire_name:["svg_p:text3471"],draw_data:[["svg_p:path3217","svg_p:path3215","svg_p:path3213","svg_p:path3213-9"],["svg_p:path3211","svg_p:path3209","svg_p:path3193","svg_p:path3207","svg_p:path3197","svg_p:path3201"]],draw_name:[[],["svg_p:path3467","svg_p:path3467"]]};sim.ep.signals["M7"]={name:"M7",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M7_C7 BUS_IB","MV M7_C7 SELP_M7"],depends_on:["C7"],fire_name:["svg_p:text3673"],draw_data:[["svg_p:path3691","svg_p:path3693","svg_p:path3659"],["svg_p:path3695"]],draw_name:[[],["svg_p:path3667"]]};sim.ep.signals["MA"]={name:"MA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV MA_ALU RA_T9; FIRE COP","MV MA_ALU REG_RT1; FIRE COP"],depends_on:["SELA","SELB"],fire_name:["svg_p:text3463"],draw_data:[["svg_p:path3249","svg_p:path3161","svg_p:path3165"],["svg_p:path3279"]],draw_name:[[],["svg_p:path3423"]]};sim.ep.signals["MB"]={name:"MB",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MV MB_ALU RB_T10; FIRE COP","MV MB_ALU REG_RT2; FIRE COP","MV MB_ALU VAL_FOUR; FIRE COP","MV MB_ALU VAL_ONE; FIRE COP"],depends_on:["SELA","SELB"],fire_name:["svg_p:text3465"],draw_data:[["svg_p:path3281","svg_p:path3171","svg_p:path3169"],["svg_p:path3283"],["svg_p:path3295","svg_p:path3293"],["svg_p:path3297","svg_p:path3299"]],draw_name:[[],["svg_p:path3425","svg_p:path3427"]]};sim.ep.signals["MH"]={name:"MH",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MV HPC_T12 CLK","MV HPC_T12 ACC_TIME","MV HPC_T12 ACC_PWR","NOP"],fire_name:["svg_p:text3147-5-0-1-8-4"],draw_data:[[],["svg_p:path3081-3-8-5-3"]],draw_name:[[],["svg_p:path3306-8-7-6"]]};sim.ep.signals["COP"]={name:"COP",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["NOP_ALU; UPDATE_NZVC","AND ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","OR ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","NOT ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","XOR ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SRL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SRA ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","RR ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","RL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","ADD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SUB ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MUL ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","DIV ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MOD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","LUI ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FADD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FSUB ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FMUL ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FDIV ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FCVT ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FCLASS ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","ADDU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SUBU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MULU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","DIVU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU"],depends_on:["SELCOP"],fire_name:["svg_p:text3303"],draw_data:[["svg_p:path3237","svg_p:path3239","svg_p:path3261-8","svg_p:path3321","svg_p:path3901-6","svg_p:path3317-9"]],draw_name:[["svg_p:path3009","svg_p:path3301"]]};sim.ep.signals["SELP"]={name:"SELP",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["NOP","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_U 0; FIRE M7","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_I 1; FIRE M7","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_C 31; UPDATE_FLAG SELP_M7 FLAG_V 30; UPDATE_FLAG SELP_M7 FLAG_N 29; UPDATE_FLAG SELP_M7 FLAG_Z 28; FIRE M7"],fire_name:["svg_p:text3703"],draw_data:[[],["svg_p:path3643"],["svg_p:path3705"],["svg_p:path3675","svg_p:path3331"]],draw_name:[[],["svg_p:path3697"]]};sim.ep.signals["SELA"]={name:"SELA",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE MR_RA"],depends_on:["RA"],fire_name:["svg_cu:text3164"],draw_data:[[]],draw_name:[[]]};sim.ep.signals["SELB"]={name:"SELB",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE MR_RB"],depends_on:["RB"],fire_name:["svg_cu:text3168"],draw_data:[[]],draw_name:[[]]};sim.ep.signals["SELC"]={name:"SELC",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE MR_RC"],depends_on:["RC"],fire_name:["svg_cu:text3172"],draw_data:[[]],draw_name:[[]]};sim.ep.signals["SELCOP"]={name:"SELCOP",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE MC"],depends_on:["COP"],fire_name:["svg_cu:text3312"],draw_data:[[]],draw_name:[[]]};sim.ep.signals["EXCODE"]={name:"EXCODE",visible:true,type:"L",value:0,default_value:0,nbits:"4",behavior:["FIRE T11"],fire_name:["svg_cu:text3312-6"],draw_data:[[]],draw_name:[]};sim.ep.signals["RA"]={name:"RA",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["GET RA_T9 BR RA; FIRE_IFSET T9 1; FIRE_IFSET MA 0"],depends_on:["SELA"],fire_name:["svg_p:text3107"],draw_data:[[]],draw_name:[["svg_p:path3109"]]};sim.ep.signals["RB"]={name:"RB",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["GET RB_T10 BR RB; FIRE_IFSET T10 1; FIRE_IFSET MB 0"],depends_on:["SELB"],fire_name:["svg_p:text3123"],draw_data:[[]],draw_name:[["svg_p:path3113"]]};sim.ep.signals["RC"]={name:"RC",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["FIRE LC"],depends_on:["SELC"],fire_name:["svg_p:text3125"],draw_data:[[]],draw_name:[["svg_p:path3117"]]};sim.ep.signals["LC"]={name:"LC",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","SET BR RC BUS_IB"],fire_name:["svg_p:text3127"],draw_data:[["svg_p:path3153","svg_p:path3151","svg_p:path3129"]],draw_name:[["svg_p:path3121"]]};sim.ep.signals["SE"]={name:"SE",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3; MOVE_BITS SBWA 4 1 SE; FIRE_IFCHANGED SBWA SE","MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3; MOVE_BITS SBWA 4 1 SE; FIRE_IFCHANGED SBWA SE"],depends_on:["T3"],fire_name:["svg_p:text3593","svg_p:text3431"],draw_data:[[]],draw_name:[["svg_p:path3591","svg_p:path3447-7-7"]]};sim.ep.signals["SIZE"]={name:"SIZE",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3363"],draw_data:[[]],draw_name:[["svg_p:path3355"]]};sim.ep.signals["OFFSET"]={name:"OFFSET",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3707"],draw_data:[[]],draw_name:[["svg_p:path3359"]]};sim.ep.signals["MC"]={name:"MC",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT COP REG_IR 0 5; FIRE COP;","CP_FIELD COP REG_MICROINS/SELCOP; FIRE COP;"],depends_on:["SELCOP"],fire_name:["svg_cu:text3322","svg_cu:text3172-1-5"],draw_data:[["svg_cu:path3320","svg_cu:path3142"],["svg_cu:path3318","svg_cu:path3502-6"]],draw_name:[[],["svg_cu:path3306"]]};sim.ep.signals["MR"]={name:"MR",verbal:["Copy from IR[SelA], from IR[SelB], and from IR[SelB] into RA, RB, and RC. ","Copy SelA, SelB, and SelB into RA, RB, and RC. "],visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV MR_RA MR; FIRE MR_RA; MV MR_RB MR; FIRE MR_RB; MV MR_RC MR; FIRE MR_RC;","MV MR_RA MR; FIRE MR_RA; MV MR_RB MR; FIRE MR_RB; MV MR_RC MR; FIRE MR_RC;"],depends_on:["SELA","SELB","SELC"],fire_name:["svg_cu:text3222","svg_cu:text3242","svg_cu:text3254","svg_cu:text3172-1"],draw_data:[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3260","svg_cu:path3196","svg_cu:path3278","svg_cu:path3292","svg_cu:path3142","svg_cu:path3258-4","svg_cu:path3390-7","svg_cu:path3258","svg_cu:path3280"],["svg_cu:path3270","svg_cu:path3282","svg_cu:path3300","svg_cu:path3258","svg_cu:path3260","svg_cu:path3258-4","svg_cu:path3278","svg_cu:path3196","svg_cu:path3294","svg_cu:path3292","svg_cu:path3288","svg_cu:path3280","svg_cu:path3258","svg_cu:path3258-4","svg_cu:path3390-7"]],draw_name:[[],["svg_cu:path3220","svg_cu:path3240","svg_cu:path3252"]]};sim.ep.signals["MR_RA"]={name:"MR_RA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RA REG_IR REG_MICROINS/SELA 5; FIRE RA;","CP_FIELD RA REG_MICROINS/SELA; FIRE RA;"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.ep.signals["MR_RB"]={name:"MR_RB",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RB REG_IR REG_MICROINS/SELB 5; FIRE RB;","CP_FIELD RB REG_MICROINS/SELB; FIRE RB;"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.ep.signals["MR_RC"]={name:"MR_RC",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RC REG_IR REG_MICROINS/SELC 5; FIRE RC;","CP_FIELD RC REG_MICROINS/SELC; FIRE RC;"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.ep.signals["BW"]={name:"BW",verbal:["Select one byte (based on A1A0) from Word. ","Select two bytes (one Half Word based on A1A0) from Word. ","","Select the full Word. "],visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW"],fire_name:["svg_p:text3433"],draw_data:[["svg_p:path3061-2-6","svg_p:path3101-8","svg_p:path3535-8"]],draw_name:[[],[]]};sim.ep.signals["A1A0"]={name:"A1A0",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA"],fire_name:["svg_p:text3603"],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["BWA"]={name:"BWA",visible:false,type:"L",value:0,default_value:0,nbits:"4",behavior:["BSEL BS_TD 0 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 8 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 24 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W"],fire_name:["svg_p:text3533-5"],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["SBWA"]={name:"SBWA",visible:false,type:"L",value:0,default_value:0,nbits:"5",behavior:["BSEL BS_M1 0 8 BUS_DB 0; FIRE M1","BSEL BS_M1 0 8 BUS_DB 8; FIRE M1","BSEL BS_M1 0 8 BUS_DB 16; FIRE M1","BSEL BS_M1 0 8 BUS_DB 24; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","BSEL BS_M1 0 8 BUS_DB 0; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 8; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 16; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 24; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["IOR"]={name:"IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MOVE_BITS KBD_IOR 0 1 IOR; MOVE_BITS SCR_IOR 0 1 IOR; MOVE_BITS L3D_IOR 0 1 IOR; MOVE_BITS L3D_IOR 0 1 IOR; FIRE KBD_IOR; FIRE SCR_IOR; FIRE L3D_IOR; FIRE LEDM_IOR"],fire_name:["svg_p:text3715"],draw_data:[[],["svg_p:path3733","svg_p:path3491","svg_p:text3715"]],draw_name:[[],[]]};sim.ep.signals["IOW"]={name:"IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MOVE_BITS SCR_IOW 0 1 IOW; FIRE SCR_IOW; MOVE_BITS IO_IOW 0 1 IOW; FIRE IO_IOW; MOVE_BITS L3D_IOW 0 1 IOW; FIRE L3D_IOW; MOVE_BITS LEDM_IOW 0 1 IOW; FIRE LEDM_IOW"],fire_name:["svg_p:text3717"],draw_data:[[],["svg_p:path3735","svg_p:path3491","svg_p:text3717"]],draw_name:[[],[]]};sim.ep.signals["I"]={name:"I",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_I VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_I VAL_ONE; FIRE_IFSET SELP 2"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["U"]={name:"U",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_U VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_U VAL_ONE; FIRE_IFSET SELP 2"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["TEST_C"]={name:"TEST_C",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_C VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_C VAL_ONE; FIRE_IFSET SELP 3"],depends_on:["SELCOP","COP"],fire_name:["svg_p:text3701-3"],draw_data:[["svg_p:text3701-3"]],draw_name:[[]]};sim.ep.signals["TEST_V"]={name:"TEST_V",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_V VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_V VAL_ONE; FIRE_IFSET SELP 3"],depends_on:["SELCOP","COP"],fire_name:["svg_p:text3701-3-1"],draw_data:[["svg_p:text3701-3-1"]],draw_name:[[]]};sim.ep.signals["TEST_N"]={name:"TEST_N",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_N VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_N VAL_ONE; FIRE_IFSET SELP 3"],depends_on:["SELCOP","COP"],fire_name:["svg_p:text3701-3-2"],draw_data:[["svg_p:text3701-3-2"]],draw_name:[[]]};sim.ep.signals["TEST_Z"]={name:"TEST_Z",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_Z VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_Z VAL_ONE; FIRE_IFSET SELP 3"],depends_on:["SELCOP","COP"],fire_name:["svg_p:text3701-3-5"],draw_data:[["svg_p:text3701-3-5"]],draw_name:[[]]};sim.ep.signals["TEST_I"]={name:"TEST_I",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_I VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_I VAL_ONE; FIRE_IFSET SELP 2"],depends_on:["CLK"],fire_name:["svg_p:text3669"],draw_data:[["svg_p:text3669"]],draw_name:[[]]};sim.ep.signals["TEST_U"]={name:"TEST_U",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_U VAL_ZERO; FIRE_IFSET SELP 1","MV FLAG_U VAL_ONE; FIRE_IFSET SELP 1"],depends_on:["CLK"],fire_name:["svg_p:text3669-1"],draw_data:[["svg_p:text3669-1"]],draw_name:[[]]};sim.ep.signals["TEST_INTV"]={name:"TEST_INTV",visible:true,type:"L",value:0,default_value:0,nbits:"8",forbidden:true,behavior:["MBIT INTV TEST_INTV 0 32"],depends_on:["INT"],fire_name:["svg_p:tspan4225"],draw_data:[["svg_p:path3749"]],draw_name:[[]]};sim.ep.behaviors["NOP"]={nparameters:1,operation:function(s_expr){},verbal:function(s_expr){return""}};sim.ep.behaviors["NOP_ALU"]={nparameters:1,operation:function(s_expr){sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0},verbal:function(s_expr){return""}};sim.ep.behaviors["MV"]={nparameters:3,types:["X","X"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)},verbal:function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(newval)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(newval)+"). "}};sim.ep.behaviors["LOAD"]={nparameters:3,types:["X","X"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)},verbal:function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Load from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(newval)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(newval)+"). "}};sim.ep.behaviors["CP_FIELD"]={nparameters:3,types:["X","X"],operation:function(s_expr){r=s_expr[2].split("/");sim_elto_org=get_reference(r[0]);newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval!="undefined"){sim_elto_dst=get_reference(s_expr[1]);set_value(sim_elto_dst,newval)}},verbal:function(s_expr){var newval=0;var r=s_expr[2].split("/");var sim_elto_org=get_reference(r[0]);var sim_elto_dst=get_reference(r[1]);if(typeof sim_elto_dst=="undefined")sim_elto_dst={};if(typeof sim_elto_org.value[r[1]]!="undefined")newval=sim_elto_org.value[r[1]];else if(typeof sim_elto_dst.default_value!="undefined")newval=sim_elto_dst.default_value;else newval="<undefined>";var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from Field "+r[1]+" of "+show_verbal(r[0])+" to "+show_verbal(s_expr[1])+" value "+newval+". "}return show_verbal(s_expr[1])+" = "+show_verbal(r[0])+"."+r[1]+" ("+newval+"). "}};sim.ep.behaviors["NOT_ES"]={nparameters:3,types:["S","E"],operation:function(s_expr){set_value(sim.ep.signals[s_expr[1]],Math.abs(get_value(sim.ep.states[s_expr[2]])-1))},verbal:function(s_expr){var value=Math.abs(get_value(sim.ep.states[s_expr[2]])-1);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Set "+show_verbal(s_expr[1])+" with value "+show_value(value)+" (Logical NOT of "+s_expr[2]+"). "}return show_verbal(s_expr[1])+" = "+show_value(value)+" (Logical NOT "+s_expr[2]+"). "}};sim.ep.behaviors["GET"]={nparameters:4,types:["E","E","S"],operation:function(s_expr){set_value(sim.ep.states[s_expr[1]],get_value(sim.ep.states[s_expr[2]][sim.ep.signals[s_expr[3]].value]))},verbal:function(s_expr){var value=get_value(sim.ep.states[s_expr[2]][sim.ep.signals[s_expr[3]].value]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Set "+show_verbal(s_expr[1])+" with value "+show_value(value)+" (Register File "+s_expr[3]+"). "}return show_verbal(s_expr[1])+" = "+show_value(value)+" (Register File "+s_expr[3]+"). "}};sim.ep.behaviors["SET"]={nparameters:4,types:["E","S","E"],operation:function(s_expr){set_value(sim.ep.states[s_expr[1]][sim.ep.signals[s_expr[2]].value],get_value(sim.ep.states[s_expr[3]]))},verbal:function(s_expr){var value=get_value(sim.ep.states[s_expr[3]]);var o_ref=sim.ep.states[s_expr[1]][sim.ep.signals[s_expr[2]].value];var o_verbal=o_ref.name;if(typeof o_ref.verbal!="undefined")o_verbal=o_ref.verbal;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy to "+o_verbal+" the value "+show_value(value)+". "}return o_verbal+" = "+show_value(value)+". "}};sim.ep.behaviors["AND"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])&get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])&get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU AND with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (AND). "}};sim.ep.behaviors["OR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])|get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])|get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU OR with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (OR). "}};sim.ep.behaviors["NOT"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=~get_value(sim.ep.states[s_expr[2]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=~get_value(sim.ep.states[s_expr[2]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU NOT with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (NOT). "}};sim.ep.behaviors["XOR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])^get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])^get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU XOR with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (XOR). "}};sim.ep.behaviors["SRL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Right Logical with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SRL). "}};sim.ep.behaviors["SRA"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Right Arithmetic with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SRA). "}};sim.ep.behaviors["SL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=result>>>31},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Left with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SL). "}};sim.ep.behaviors["RR"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1|(get_value(sim.ep.states[s_expr[2]])&1)<<31;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1|(get_value(sim.ep.states[s_expr[2]])&1)<<31;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Right Rotation with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (RR). "}};sim.ep.behaviors["RL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1|(get_value(sim.ep.states[s_expr[2]])&2147483648)>>>31;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1|(get_value(sim.ep.states[s_expr[2]])&2147483648)>>>31;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Left Rotation with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (LR). "}};sim.ep.behaviors["ADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a+b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a+b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU ADD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (ADD). "}};sim.ep.behaviors["SUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a-b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a-b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU SUB with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SUB). "}};sim.ep.behaviors["MUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a*b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a*b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MUL with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MUL). "}};sim.ep.behaviors["DIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){return"ALU DIV zero by zero (oops!). "}var result=Math.floor(a/b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU DIV with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (DIV). "}};sim.ep.behaviors["MOD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=a%b;set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){return"ALU MOD zero by zero (oops!). "}var result=a%b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MOD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MOD). "}};sim.ep.behaviors["LUI"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<16;set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<16;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Load Upper Immediate with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (LUI). "}};sim.ep.behaviors["ADDU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a+b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a+b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU ADDU with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (ADDU). "}};sim.ep.behaviors["SUBU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a-b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a-b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU SUBU with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SUBU). "}};sim.ep.behaviors["MULU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a*b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a*b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MULU with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MULU). "}};sim.ep.behaviors["DIVU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;if(0==b){return"ALU DIVU zero by zero (oops!). "}var result=Math.floor(a/b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU DIVU with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (DIVU). "}};sim.ep.behaviors["FADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)+hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)+hex2float(b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FADD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FADD). "}};sim.ep.behaviors["FSUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FSUB with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FSUB). "}};sim.ep.behaviors["FMUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)*hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)*hex2float(b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FMUL with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FMUL). "}};sim.ep.behaviors["FDIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)/hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FDIV with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FDIV). "}};sim.ep.behaviors["FCVT"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]]);var result=a;switch(b){case 1:result=hex2float(result);result=Math.trunc(result);break;case 2:result=hex2float(result);result=Math.round(result);break;case 4:result=result.toFixed(5);result=parseFloat(result);result=float2decimal(result);break;default:break}set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]]);var result=a;switch(b){case 1:result=hex2float(result);result=Math.trunc(result);break;case 2:result=hex2float(result);result=Math.round(result);break;case 4:result=result.toFixed(5);result=parseFloat(result);result=float2decimal(result);break;default:break}var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FCVT with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FCVT). "}};sim.ep.behaviors["FCLASS"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var result=float_class(a);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])>>>0;var result=float_class(a);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FCLASS with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FCLASS). "}};sim.ep.behaviors["PLUS1"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+1;set_value(sim.ep.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy to "+show_verbal(s_expr[1])+" "+show_verbal(s_expr[2])+" plus one with result "+show_value(result)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" + 1"+" ("+show_value(result)+"). "}};sim.ep.behaviors["PLUS4"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+4;set_value(sim.ep.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+4;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy to "+show_verbal(s_expr[1])+" "+show_verbal(s_expr[2])+" plus four with result "+show_value(result)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" + 4"+" ("+show_value(result)+"). "}};sim.ep.behaviors["SET_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a|m;set_value(sim.ep.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.ep.behaviors["RST_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a&~m;set_value(sim.ep.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.ep.behaviors["CHECK_RTD"]={nparameters:1,operation:function(s_expr){var number_active_tri=parseInt(simhw_sim_signal("TD").value)+parseInt(simhw_sim_signal("R").value);update_system_bus_fire(number_active_tri)},verbal:function(s_expr){return""}};sim.ep.behaviors["MBIT"]={nparameters:5,types:["X","X","I","I"],operation:function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);set_value(sim_elto_dst,parseInt(n2,2))},verbal:function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=parseInt(n2,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(n3)+" (copied "+size+" bits from bit "+offset+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(n3)+", "+size+" bits from bit "+offset+"). "}};sim.ep.behaviors["MBIT_SN"]={nparameters:5,types:["S","E","E","I"],operation:function(s_expr){var base=0;var r=s_expr[3].split("/");if(1==r.length)base=get_value(sim.ep.states[s_expr[3]]);else if(typeof sim.ep.states[r[0]].value[r[1]]!="undefined")base=sim.ep.states[r[0]].value[r[1]];else if(typeof sim.ep.signals[r[1]].default_value!="undefined")base=sim.ep.signals[r[1]].default_value;else if(typeof sim.ep.states[r[1]].default_value!="undefined")base=sim.ep.states[r[1]].default_value;else ws_alert("WARN: undefined state/field pair -> "+r[0]+"/"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.ep.states[s_expr[2]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var base=0;var r=s_expr[3].split("/");if(1==r.length)base=get_value(sim.ep.states[s_expr[3]]);else if(typeof sim.ep.states[r[0]].value[r[1]]!="undefined")base=sim.ep.states[r[0]].value[r[1]];else if(typeof sim.ep.signals[r[1]].default_value!="undefined")base=sim.ep.signals[r[1]].default_value;else if(typeof sim.ep.states[r[1]].default_value!="undefined")base=sim.ep.states[r[1]].default_value;else ws_alert("WARN: undefined state/field pair -> "+r[0]+"/"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.ep.states[s_expr[2]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);var from_elto="";if(1==r.length)from_elto=show_verbal(s_expr[3]);else from_elto=show_verbal(s_expr[2])+"["+r[1]+"] ";var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+from_elto+"into "+show_verbal(s_expr[1])+" "+"value "+parseInt(n3,2)+". "}return show_verbal(s_expr[1])+" = "+from_elto+" ("+parseInt(n3,2)+"). "}};sim.ep.behaviors["SBIT_SIGNAL"]={nparameters:4,types:["X","I","I"],operation:function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)},verbal:function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)}};sim.ep.behaviors["UPDATE_FLAG"]={nparameters:4,types:["X","X","I"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value&~(1<>>0)},verbal:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Update "+show_verbal(s_expr[2])+" to value "+sim_elto_org.value+". "}return show_verbal(s_expr[1])+"."+show_verbal(s_expr[3])+" = "+sim_elto_org.value+". "}};sim.ep.behaviors["MBITS"]={nparameters:8,types:["E","I","E","S","S","I","S"],operation:function(s_expr){var offset=parseInt(sim.ep.signals[s_expr[4]].value);var size=parseInt(sim.ep.signals[s_expr[5]].value);var n1=get_value(sim.ep.states[s_expr[3]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;if("1"==sim.ep.signals[s_expr[7]].value&&"1"==n2.substr(0,1)){n3="11111111111111111111111111111111".substring(0,32-n2.length)+n2}set_value(sim.ep.states[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var offset=parseInt(sim.ep.signals[s_expr[4]].value);var size=parseInt(sim.ep.signals[s_expr[5]].value);var n1=get_value(sim.ep.states[s_expr[3]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;if("1"==sim.ep.signals[s_expr[7]].value&&"1"==n2.substr(0,1)){n3="11111111111111111111111111111111".substring(0,32-n2.length)+n2}n1=parseInt(n3,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return" Copy from "+show_verbal(s_expr[3])+" to "+show_verbal(s_expr[1])+" value "+show_value(n1)+" (copied "+size+" bits from bit "+offset+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[3])+" ("+show_value(n1)+", "+size+" bits from bit "+offset+"). "}};sim.ep.behaviors["BSEL"]={nparameters:6,types:["E","I","I","E","I"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var n4="00000000000000000000000000000000".substr(0,posd);n3=n3+n4;set_value(sim.ep.states[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var posd=parseInt(s_expr[2]);var len=parseInt(s_expr[3]);var poso=parseInt(s_expr[5]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var n4="00000000000000000000000000000000".substr(0,posd);n3=n3+n4;var n5=parseInt(n3,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[4])+" to "+show_verbal(s_expr[1])+" value "+show_value(n5)+" (copied "+len+" bits, from bit "+poso+" of "+s_expr[4]+" to bit "+posd+" of "+s_expr[1]+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[4])+" ("+show_value(n5)+", "+len+" bits, from bit "+poso+" of "+s_expr[4]+" to bit "+posd+" of "+s_expr[1]+"). "}};sim.ep.behaviors["EXT_SIG"]={nparameters:3,types:["E","I"],operation:function(s_expr){var n1=get_value(sim.ep.states[s_expr[1]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if("1"==n2[31-s_expr[2]]){n4="11111111111111111111111111111111".substring(0,32-n3.length)+n4}set_value(sim.ep.states[s_expr[1]],parseInt(n4,2))},verbal:function(s_expr){var n1=get_value(sim.ep.states[s_expr[1]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if("1"==n2[31-s_expr[2]]){n4="11111111111111111111111111111111".substring(0,32-n3.length)+n4}var n5=parseInt(n4,2);return"Sign Extension with value "+show_value(n5)+". "}};sim.ep.behaviors["MOVE_BITS"]={nparameters:5,types:["S","I","I","S"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=0;var len=parseInt(s_expr[3]);var n1=sim.ep.signals[s_expr[4]].value.toString(2);n1="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.ep.signals[s_expr[1]].value.toString(2);n2="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.ep.behaviors["MOVE_BITSE"]={nparameters:6,types:["S","I","I","E","I"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);n1="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.ep.signals[s_expr[1]].value.toString(2);n2="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.ep.behaviors["DECO"]={nparameters:1,operation:function(s_expr){sim.ep.states["INEX"].value=0;var oi=decode_instruction(sim.ep.internal_states.FIRMWARE,sim.ep.ctrl_states.ir,get_value(sim.ep.states["REG_IR"]));if(null==oi.oinstruction){ws_alert("ERROR: undefined instruction code in IR ("+"co:"+oi.op_code.toString(2)+", "+"cop:"+oi.cop_code.toString(2)+")");sim.ep.states["ROM_MUXA"].value=0;sim.ep.states["INEX"].value=1;return-1}var rom_addr=oi.op_code<<6;if(typeof oi.oinstruction.cop!="undefined"){rom_addr=rom_addr+oi.cop_code}if(typeof sim.ep.internal_states["ROM"][rom_addr]=="undefined"){ws_alert("ERROR: undefined rom address "+rom_addr+" in firmware");sim.ep.states["ROM_MUXA"].value=0;return-1}sim.ep.states["ROM_MUXA"].value=sim.ep.internal_states["ROM"][rom_addr];var val=get_value(sim.ep.states["DECO_INS"]);set_value(sim.ep.states["DECO_INS"],val+1);var pc=get_value(sim.ep.states["REG_PC"])-4;var decins=get_deco_from_pc(pc);set_value(sim.ep.states["REG_IR_DECO"],decins);show_dbg_ir(get_value(sim.ep.states["REG_IR_DECO"]))},verbal:function(s_expr){return"Decode instruction. "}};sim.ep.behaviors["FIRE"]={nparameters:2,types:["S"],operation:function(s_expr){if(sim.ep.internal_states.fire_stack.indexOf(s_expr[1])!=-1){return}sim.ep.internal_states.fire_stack.push(s_expr[1]);update_draw(sim.ep.signals[s_expr[1]],sim.ep.signals[s_expr[1]].value);if("L"==sim.ep.signals[s_expr[1]].type){update_state(s_expr[1])}sim.ep.internal_states.fire_stack.pop(s_expr[1])},verbal:function(s_expr){return""}};sim.ep.behaviors["FIRE_IFSET"]={nparameters:3,types:["S","I"],operation:function(s_expr){if(get_value(sim.ep.signals[s_expr[1]])!=parseInt(s_expr[2])){return}sim.ep.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.ep.behaviors["FIRE_IFCHANGED"]={nparameters:3,types:["S","X"],operation:function(s_expr){sim_elto=get_reference(s_expr[2]);if(sim_elto.changed==false){return}sim.ep.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.ep.behaviors["RESET_CHANGED"]={nparameters:2,types:["X"],operation:function(s_expr){sim_elto=get_reference(s_expr[1]);sim_elto.changed=false},verbal:function(s_expr){return""}};sim.ep.behaviors["CLOCK"]={nparameters:1,operation:function(s_expr){var new_maddr=null;var mcelto=null;var t0=performance.now();var val=get_value(sim.ep.states["CLK"]);set_value(sim.ep.states["CLK"],val+1);set_value(sim.ep.states["TTCPU"],0);new_maddr=get_value(sim.ep.states["REG_MICROADDR"]);mcelto=sim.ep.internal_states["MC"][new_maddr];if(typeof mcelto!=="undefined"&&false==mcelto.is_native){for(var i=0;i>>0},set_value:function(elto,value){var origin="";var r_value=main_memory_get_program_counter();if(r_value!=null){origin="PC=0x"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.ep.internal_states.MP,elto,melto);show_main_memory(sim.ep.internal_states.MP,elto,typeof valref==="undefined",true);return value}};sim.ep.internal_states.segments={};sim.ep.internal_states.MP_wc=0;sim.ep.internal_states.MP={};sim.ep.internal_states.CM_cfg=[];sim.ep.internal_states.CM=[];sim.ep.signals.MRDY={name:"MRDY",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE_IFCHANGED MRDY C","FIRE_IFCHANGED MRDY C"],fire_name:["svg_p:tspan3916","svg_p:text3909"],draw_data:[[],["svg_p:path3895","svg_p:path3541"]],draw_name:[[],[]]};sim.ep.signals.R={name:"R",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; CHECK_RTD","MEM_READ BUS_AB BUS_DB BWA MRDY CLK; FIRE MRDY; CHECK_RTD"],fire_name:["svg_p:text3533-5-2","svg_p:text3713"],draw_data:[[],["svg_p:path3557","svg_p:path3571"]],draw_name:[[],[]]};sim.ep.signals.W={name:"W",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MEM_WRITE BUS_AB BUS_DB BWA MRDY CLK; FIRE MRDY"],fire_name:["svg_p:text3533-5-08","svg_p:text3527","svg_p:text3431-7"],draw_data:[[],["svg_p:path3559","svg_p:path3575","svg_p:path3447-7"]],draw_name:[[],[]]};sim.ep.behaviors.MEM_READ={nparameters:6,types:["E","E","S","S","E"],operation:function(s_expr){var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);sim.ep.signals[s_expr[4]].value=0;var remain=get_value(sim.ep.internal_states.MP_wc);if(typeof sim.ep.events.mem[clk-1]!="undefined"&&sim.ep.events.mem[clk-1]>0){remain=sim.ep.events.mem[clk-1]-1}var first_time=typeof sim.ep.events.mem[clk]=="undefined";sim.ep.events.mem[clk]=remain;if(remain>0){return}address=address&4294967292;var value=main_memory_getvalue(sim.ep.internal_states.MP,address);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}dbvalue=main_memory_fusionvalues(dbvalue,value,bw);sim.ep.states[s_expr[2]].value=dbvalue>>>0;sim.ep.signals[s_expr[4]].value=1;show_main_memory(sim.ep.internal_states.MP,address,full_redraw,false);if(first_time&&sim.ep.internal_states.CM.length>0){cache_memory_access(sim.ep.internal_states.CM[0],address,"read",clk)}},verbal:function(s_expr){var verbal="";var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);var bw_type="word";if(0==(bw&12))bw_type="byte";else if(1==(bw&12))bw_type="half";var value=main_memory_getvalue(sim.ep.internal_states.MP,address);if(typeof value==="undefined")value=0;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){verbal="Try to read a "+bw_type+" from memory "+"at address 0x"+address.toString(16)+" with value 0x"+value.toString(16)+". "}verbal="Memory output = 0x"+value.toString(16)+" (Read a "+bw_type+" from 0x"+address.toString(16)+"). ";return verbal}};sim.ep.behaviors.MEM_WRITE={nparameters:6,types:["E","E","S","S","E"],operation:function(s_expr){var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);sim.ep.signals[s_expr[4]].value=0;var remain=get_value(sim.ep.internal_states.MP_wc);if(typeof sim.ep.events.mem[clk-1]!="undefined"&&sim.ep.events.mem[clk-1]>0){remain=sim.ep.events.mem[clk-1]-1}var first_time=typeof sim.ep.events.mem[clk]=="undefined";sim.ep.events.mem[clk]=remain;if(remain>0){return}address=address&4294967292;var value=main_memory_getvalue(sim.ep.internal_states.MP,address);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}value=main_memory_fusionvalues(value,dbvalue,bw);var origin="";var r_value=main_memory_get_program_counter();if(r_value!=null){origin="PC=0x"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.ep.internal_states.MP,address,melto);sim.ep.signals[s_expr[4]].value=1;show_main_memory(sim.ep.internal_states.MP,address,full_redraw,true);if(first_time&&sim.ep.internal_states.CM.length>0){cache_memory_access(sim.ep.internal_states.CM[0],address,"write",clk)}},verbal:function(s_expr){var verbal="";var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);var bw_type="word";if(0==(bw&12))bw_type="byte";else if(1==(bw&12))bw_type="half";var value=main_memory_getvalue(sim.ep.internal_states.MP,address);if(typeof value==="undefined")value=0;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){verbal="Try to write a "+bw_type+" to memory "+"at address 0x"+address.toString(16)+" with value "+value.toString(16)+". "}verbal="Memory[0x"+address.toString(16)+"] = "+"0x"+value.toString(16)+" (Write a "+bw_type+" to 0x"+address.toString(16)+"). ";return verbal}};sim.ep.behaviors.MEMORY_RESET={nparameters:1,operation:function(s_expr){sim.ep.events.mem={}},verbal:function(s_expr){return"Reset main memory (all values will be zeroes). "}};sim.ep.elements.memory={name:"Main memory",description:"Main memory subsystem",type:"subcomponent",belongs:"MEMORY",states:{addr:{ref:"BUS_AB"},data:{ref:"BUS_DB"},mrdy:{ref:"MRDY"}},signals:{be:{ref:"BWA"},r:{ref:"R"},w:{ref:"W"}},states_inputs:["addr","data"],states_outputs:["mrdy","data"],signals_inputs:["be","r","w"],signals_output:[]};sim.ep.components.IO={name:"IO",version:"1",abilities:["IO_TIMER"],details_name:["IO_STATS","IO_CONFIG"],details_fire:[["svg_p:text3775"],[]],write_state:function(vec){return vec},read_state:function(o,check){return false},get_state:function(reg){return null},get_value:function(elto){var associated_state=simhw_internalState_get("io_hash",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("IOR"),1);compute_behavior("FIRE IOR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("IOW"),1);compute_behavior("FIRE IOW");return value}};sim.ep.internal_states.io_int_factory=[];sim.ep.internal_states.io_int_factory[0]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[1]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[2]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[3]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[4]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[5]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[6]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[7]={period:0,probability:.5,accumulated:0,active:false};var IOSR_ID=4352;var IOCR_ID=4356;var IODR_ID=4360;sim.ep.internal_states.io_hash[IOSR_ID]="IOSR";sim.ep.internal_states.io_hash[IOCR_ID]="IOCR";sim.ep.internal_states.io_hash[IODR_ID]="IODR";sim.ep.states.IOSR={name:"IOSR",verbal:"IO State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.IOCR={name:"IOCR",verbal:"IO Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.IODR={name:"IODR",verbal:"IO Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.signals.INT={name:"INT",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE C","FIRE C"],fire_name:["svg_p:tspan4199"],draw_data:[[],["svg_p:path3809"]],draw_name:[[],[]]};sim.ep.signals.IORDY={name:"IORDY",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE_IFCHANGED IORDY C","FIRE_IFCHANGED IORDY C"],fire_name:["svg_p:tspan4089","svg_p:path3793","svg_p:text3911"],draw_data:[[],["svg_p:path3897"]],draw_name:[[],[]]};sim.ep.signals.IO_IOR={name:"IO_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","IO_IOR BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE SBWA"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.signals.IO_IOW={name:"IO_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","IO_IOW BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE SBWA"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.signals.IO_IE={name:"IO_IE",visible:true,type:"L",value:1,default_value:1,nbits:"1",behavior:["NOP","IO_CHK_I CLK INT INTV; FIRE C"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals.INTA={name:"INTA",visible:true,type:"L",value:1,default_value:0,nbits:"1",behavior:["NOP","INTA CLK INT INTA BUS_DB INTV; FIRE BW; FIRE C"],fire_name:["svg_p:text3785-0-6-0-5-5-1-1"],draw_data:[[],["svg_p:path3807","svg_p:path3737"]],draw_name:[[],[]]};sim.ep.behaviors.IO_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==IOSR_ID)set_value(sim.ep.states[s_expr[2]],iosr);if(bus_ab==IOCR_ID)set_value(sim.ep.states[s_expr[2]],iocr);if(bus_ab==IODR_ID)set_value(sim.ep.states[s_expr[2]],iodr)},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==IOSR_ID)verbal="I/O device read at IOSR of value "+iosr+". ";if(bus_ab==IOCR_ID)verbal="I/O device read at IOCR of value "+iocr+". ";if(bus_ab==IODR_ID)verbal="I/O device read at IODR of value "+iodr+". ";return verbal}};sim.ep.behaviors.IO_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab!=IOSR_ID&&bus_ab!=IOCR_ID&&bus_ab!=IODR_ID){return}if(bus_ab==IOSR_ID)set_value(sim.ep.states[s_expr[3]],bus_db);if(bus_ab==IOCR_ID)set_value(sim.ep.states[s_expr[4]],bus_db);if(bus_ab==IODR_ID)set_value(sim.ep.states[s_expr[5]],bus_db);var iocr_id=get_value(sim.ep.states[s_expr[4]]);var iodr_id=get_value(sim.ep.states[s_expr[5]]);if(iocr_id<0||iocr_id>7)return;set_var(sim.ep.internal_states.io_int_factory[iocr_id].period,iodr_id);set_var(sim.ep.internal_states.io_int_factory[iocr_id].probability,1);if(0==iodr_id){set_var(sim.ep.internal_states.io_int_factory[iocr_id].probability,0)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab==IOSR_ID)verbal="I/O device write at IOSR with value "+bus_db+". ";if(bus_ab==IOCR_ID)verbal="I/O device write at IOCR with value "+bus_db+". ";if(bus_ab==IODR_ID)verbal="I/O device write at IODR with value "+bus_db+". ";return verbal}};sim.ep.behaviors.IO_CHK_I={nparameters:4,types:["E","S","E"],operation:function(s_expr){var clk=get_value(sim.ep.states[s_expr[1]]);for(var i=sim.ep.internal_states.io_int_factory.length-1;i>=0;i--){if(get_var(sim.ep.internal_states.io_int_factory[i].period)==0)continue;if(get_var(sim.ep.internal_states.io_int_factory[i].active)==true){set_value(sim.ep.signals[s_expr[2]],1);set_value(sim.ep.states[s_expr[3]],i)}if(clk%get_var(sim.ep.internal_states.io_int_factory[i].period)==0){if(Math.random()>get_var(sim.ep.internal_states.io_int_factory[i].probability))continue;var acc=get_var(sim.ep.internal_states.io_int_factory[i].accumulated);set_var(sim.ep.internal_states.io_int_factory[i].accumulated,acc+1);set_var(sim.ep.internal_states.io_int_factory[i].active,true);if(typeof sim.ep.events.io[clk]=="undefined"){sim.ep.events.io[clk]=[]}sim.ep.events.io[clk].push(i);set_value(sim.ep.signals[s_expr[2]],1);set_value(sim.ep.states[s_expr[3]],i)}}},verbal:function(s_expr){return"Check I/O Interruption. "}};sim.ep.behaviors.INTA={nparameters:6,types:["E","S","S","E","E"],operation:function(s_expr){var clk=get_value(sim.ep.states[s_expr[1]]);if(typeof sim.ep.events.io[clk]!="undefined"){set_value(sim.ep.states[s_expr[4]],sim.ep.events.io[clk][0]);return}set_value(sim.ep.signals[s_expr[2]],0);set_value(sim.ep.states[s_expr[5]],0);for(var i=0;i>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("IOR"),1);compute_behavior("FIRE IOR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("IOW"),1);compute_behavior("FIRE IOW");return value}};sim.ep.internal_states.l3d_dim=4;sim.ep.internal_states.l3d_neltos=Math.pow(sim.ep.internal_states.l3d_dim,3);sim.ep.internal_states.l3d_state=Array.from({length:sim.ep.internal_states.l3d_neltos},(()=>({active:false})));sim.ep.internal_states.l3d_frame="0".repeat(sim.ep.internal_states.l3d_neltos);var L3DSR_ID=8448;var L3DCR_ID=8452;var L3DDR_ID=8456;sim.ep.internal_states.io_hash[L3DSR_ID]="L3DSR";sim.ep.internal_states.io_hash[L3DCR_ID]="L3DCR";sim.ep.internal_states.io_hash[L3DDR_ID]="L3DDR";sim.ep.states.L3DSR={name:"L3DSR",verbal:"L3D State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.L3DCR={name:"L3DCR",verbal:"L3D Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.L3DDR={name:"L3DDR",verbal:"L3D Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.signals.L3D_IOR={name:"L3D_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","L3D_IOR BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE SBWA"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.signals.L3D_IOW={name:"L3D_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","L3D_IOW BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE SBWA; L3D_SYNC"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.behaviors.L3D_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==L3DCR_ID){set_value(sim.ep.states[s_expr[2]],iocr)}if(bus_ab==L3DDR_ID){set_value(sim.ep.states[s_expr[2]],iodr)}if(bus_ab==L3DSR_ID){var x=(iodr&4278190080)>>24;var y=(iodr&16711680)>>16;var z=(iodr&65280)>>8;var p=z*Math.pow(sim.ep.internal_states.l3d_dim,2)+y*sim.ep.internal_states.l3d_dim+x;var s=get_var(sim.ep.internal_states.l3d_state[p].active);set_value(sim.ep.states[s_expr[2]],s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==L3DSR_ID)verbal="I/O device read at L3DSR of value "+iosr+". ";if(bus_ab==L3DCR_ID)verbal="I/O device read at L3DCR of value "+iocr+". ";if(bus_ab==L3DDR_ID)verbal="I/O device read at L3DDR of value "+iodr+". ";return verbal}};sim.ep.behaviors.L3D_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab!=L3DSR_ID&&bus_ab!=L3DCR_ID&&bus_ab!=L3DDR_ID){return}if(bus_ab==L3DSR_ID){set_value(sim.ep.states[s_expr[3]],bus_db)}if(bus_ab==L3DDR_ID){set_value(sim.ep.states[s_expr[5]],bus_db)}if(bus_ab==L3DCR_ID){set_value(sim.ep.states[s_expr[4]],bus_db);var x=(bus_db&4278190080)>>24;var y=(bus_db&16711680)>>16;var z=(bus_db&65280)>>8;var p=z*Math.pow(sim.ep.internal_states.l3d_dim,2)+y*sim.ep.internal_states.l3d_dim+x;var s=(bus_db&255)!=0;set_var(sim.ep.internal_states.l3d_state[p].active,s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab==L3DSR_ID)verbal="I/O device write at L3DSR with value "+bus_db+". ";if(bus_ab==L3DCR_ID)verbal="I/O device write at L3DCR with value "+bus_db+". ";if(bus_ab==L3DDR_ID)verbal="I/O device write at L3DDR with value "+bus_db+". ";return verbal}};sim.ep.behaviors.L3D_RESET={nparameters:1,operation:function(s_expr){sim.ep.events.l3d={};var n=sim.ep.internal_states.l3d_state.length;for(var i=0;i>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("IOR"),1);compute_behavior("FIRE IOR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("IOW"),1);compute_behavior("FIRE IOW");return value}};sim.ep.internal_states.ledm_dim=24;sim.ep.internal_states.ledm_neltos=Math.pow(sim.ep.internal_states.ledm_dim,2);sim.ep.internal_states.ledm_state=Array.from({length:sim.ep.internal_states.ledm_neltos},(()=>({color:0})));sim.ep.internal_states.ledm_colors=colors_clone("");sim.ep.internal_states.ledm_frame="0".repeat(sim.ep.internal_states.ledm_neltos);var LEDMSR_ID=12544;var LEDMCR_ID=12548;var LEDMDR_ID=12552;sim.ep.internal_states.io_hash[LEDMSR_ID]="LEDMSR";sim.ep.internal_states.io_hash[LEDMCR_ID]="LEDMCR";sim.ep.internal_states.io_hash[LEDMDR_ID]="LEDMDR";sim.ep.states.LEDMSR={name:"LEDMSR",verbal:"LEDM State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.LEDMCR={name:"LEDMCR",verbal:"LEDM Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.LEDMDR={name:"LEDMDR",verbal:"LEDM Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.signals.LEDM_IOR={name:"LEDM_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","LEDM_IOR BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE SBWA"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.signals.LEDM_IOW={name:"LEDM_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","LEDM_IOW BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE SBWA; LEDM_SYNC"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.behaviors.LEDM_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==LEDMCR_ID){set_value(sim.ep.states[s_expr[2]],iocr)}if(bus_ab==LEDMDR_ID){set_value(sim.ep.states[s_expr[2]],iodr)}if(bus_ab==LEDMSR_ID){var x=(iodr&4278190080)>>24;var y=(iodr&16711680)>>16;var p=y*sim.ep.internal_states.ledm_dim+x;var s=get_var(sim.ep.internal_states.ledm_state[p].color);set_value(sim.ep.states[s_expr[2]],s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==LEDMSR_ID)verbal="I/O device read at LEDMSR of value "+iosr+". ";if(bus_ab==LEDMCR_ID)verbal="I/O device read at LEDMCR of value "+iocr+". ";if(bus_ab==LEDMDR_ID)verbal="I/O device read at LEDMDR of value "+iodr+". ";return verbal}};sim.ep.behaviors.LEDM_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);switch(bus_ab){case LEDMSR_ID:set_value(sim.ep.states[s_expr[3]],bus_db);break;case LEDMDR_ID:set_value(sim.ep.states[s_expr[5]],bus_db);break;case LEDMCR_ID:set_value(sim.ep.states[s_expr[4]],bus_db);break;default:break}if(LEDMCR_ID==bus_ab){var dr=get_value(sim.ep.states[s_expr[5]]);if(16&bus_db){var x=(dr&4278190080)>>24;var y=(dr&16711680)>>16;var s=dr&255;set_value(sim.ep.states[s_expr[3]],1);if(x>=sim.ep.internal_states.ledm_dim&&y>=sim.ep.internal_states.ledm_dim){set_value(sim.ep.states[s_expr[3]],-1);return}var p=y*sim.ep.internal_states.ledm_dim+x;set_var(sim.ep.internal_states.ledm_state[p].color,s)}if(32&bus_db){set_value(sim.ep.states[s_expr[3]],1);var s=0;var neltos=sim.ep.internal_states.ledm_neltos;for(var p=0;p>0);set_var(sim.ep.internal_states.ledm_state[p+1].color,(s&65280)>>8);set_var(sim.ep.internal_states.ledm_state[p+2].color,(s&16711680)>>16);set_var(sim.ep.internal_states.ledm_state[p+3].color,(s&4278190080)>>24)}}if(64&bus_db){set_value(sim.ep.states[s_expr[3]],1);var s=0;var c="";var neltos=sim.ep.internal_states.ledm_colors.length;for(var p=0;p>>8;s=s.toString(16);c="#"+simcoreui_pack(s,6);sim.ep.internal_states.ledm_colors[p]=c}neltos=sim.ep.internal_states.ledm_neltos;for(var p=0;p>24;var y=(dr&16711680)>>16;var s=dr&255;verbal="I/O device write at LEDMCR with value "+bus_db+" (set pixel x:"+x+", y:"+y+", with color:"+s+"). "}if(64&bus_db){verbal="I/O device write at LEDMCR with value "+bus_db+" (set color palette at:"+bus_db+"). "}break;default:break}return verbal}};sim.ep.behaviors.LEDM_RESET={nparameters:1,operation:function(s_expr){sim.ep.events.ledm={};sim.ep.internal_states.ledm_colors=colors_clone("");for(var i=0;i>>0;if(value!=0){vec.CPU["R"+i]={type:"register",default_value:0,id:"R"+i,op:"=",value:"0x"+value.toString(16)}}}for(var i=0;i>>0;if(value!=0){vec.CPU[internal_reg[i]]={type:"register",default_value:0,id:internal_reg[i],op:"=",value:"0x"+value.toString(16)}}}return vec},read_state:function(vec,check){if(typeof vec.CPU=="undefined")vec.CPU={};var key=check["id"].toUpperCase().trim();var val=parseInt(check["value"]).toString(16);if("REGISTER"==check["type"].toUpperCase().trim()){vec.CPU[key]={type:"register",default_value:0,id:key,op:check["condition"],value:"0x"+val};return true}return false},get_state:function(reg){var r_reg=reg.toUpperCase().trim();if(typeof sim.poc.states["REG_"+r_reg]!="undefined"){var value=get_value(sim.poc.states["REG_"+r_reg])>>>0;return"0x"+value.toString(16)}r_reg=r_reg.replace("R","");var index=parseInt(r_reg);if(typeof sim.poc.states.BR[index]!="undefined"){var value=get_value(sim.poc.states.BR[index])>>>0;return"0x"+value.toString(16)}return null},get_value:function(elto){if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index))return get_value(simhw_sim_state(elto))>>>0;return get_value(simhw_sim_states().BR[index])>>>0},set_value:function(elto,value){var pc_name=simhw_sim_ctrlStates_get().pc.state;if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index)){set_value(simhw_sim_state(elto),value);if(pc_name===elto){show_asmdbg_pc()}return value}return set_value(simhw_sim_states().BR[index],value)}};sim.poc.ctrl_states.pc={name:"PC",state:"REG_PC",is_pointer:true};sim.poc.ctrl_states.sp={name:"SP",state:"BR.29",is_pointer:true};sim.poc.ctrl_states.fp={name:"FP",state:"BR.30",is_pointer:true};sim.poc.ctrl_states.ir={name:"IR",state:"REG_IR",default_eltos:{co:{begin:0,end:5,length:6},cop:{begin:27,end:31,length:5}},is_pointer:false};sim.poc.ctrl_states.mpc={name:"mPC",state:"REG_MICROADDR",is_pointer:false};sim.poc.internal_states.MC={};sim.poc.internal_states.ROM={};sim.poc.internal_states.FIRMWARE=ws_empty_firmware;sim.poc.internal_states.io_hash={};sim.poc.internal_states.fire_stack=[];sim.poc.internal_states.tri_state_names=["T1","T2","T3","T6","T8","T9","T10","T11","T12"];sim.poc.internal_states.fire_visible={databus:false,internalbus:false};sim.poc.internal_states.filter_states=["REG_IR_DECO,col-12","REG_IR,col-auto","REG_PC,col-auto","REG_SR,col-auto","REG_RT1,col-auto","REG_MAR,col-auto","REG_MBR,col-auto","REG_MICROADDR,col-auto"];sim.poc.internal_states.filter_signals=["A0,0","B,0","C,0","SELA,5","SELB,5","SELC,2","SELCOP,0","MRA,0","MRB,0","MRC,0","MC,0","C0,0","C1,0","C2,0","C3,0","C4,0","C7,0","T1,0","T2,0","T3,0","T6,0","T8,0","T9,0","T10,0","T11,0","M1,0","M7,0","MA,0","MB,0","LC,0","SE,0","SIZE,0","OFFSET,0","BW,0","R,0","W,0","TA,0","TD,0","IOR,0","IOW,0","TEST_I,0","TEST_U,0"];sim.poc.internal_states.alu_flags={flag_n:0,flag_z:0,flag_v:0,flag_c:0};sim.poc.states.BR=[];sim.poc.states.BR[0]={name:"R0",verbal:"Register 0",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[1]={name:"R1",verbal:"Register 1",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[2]={name:"R2",verbal:"Register 2",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[3]={name:"R3",verbal:"Register 3",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[4]={name:"R4",verbal:"Register 4",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[5]={name:"R5",verbal:"Register 5",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[6]={name:"R6",verbal:"Register 6",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[7]={name:"R7",verbal:"Register 7",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[8]={name:"R8",verbal:"Register 8",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[9]={name:"R9",verbal:"Register 9",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[10]={name:"R10",verbal:"Register 10",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[11]={name:"R11",verbal:"Register 11",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[12]={name:"R12",verbal:"Register 12",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[13]={name:"R13",verbal:"Register 13",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[14]={name:"R14",verbal:"Register 14",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[15]={name:"R15",verbal:"Register 15",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[16]={name:"R16",verbal:"Register 16",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[17]={name:"R17",verbal:"Register 17",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[18]={name:"R18",verbal:"Register 18",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[19]={name:"R19",verbal:"Register 19",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[20]={name:"R20",verbal:"Register 20",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[21]={name:"R21",verbal:"Register 21",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[22]={name:"R22",verbal:"Register 22",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[23]={name:"R23",verbal:"Register 23",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[24]={name:"R24",verbal:"Register 24",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[25]={name:"R25",verbal:"Register 25",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[26]={name:"R26",verbal:"Register 26",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[27]={name:"R27",verbal:"Register 27",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[28]={name:"R28",verbal:"Register 28",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[29]={name:"R29",verbal:"Register 29",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[30]={name:"R30",verbal:"Register 30",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[31]={name:"R31",verbal:"Register 31",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[32]={name:"R32",verbal:"Register 32",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[33]={name:"R33",verbal:"Register 33",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[34]={name:"R34",verbal:"Register 34",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[35]={name:"R35",verbal:"Register 35",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[36]={name:"R36",verbal:"Register 36",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[37]={name:"R37",verbal:"Register 37",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[38]={name:"R38",verbal:"Register 38",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[39]={name:"R39",verbal:"Register 39",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[40]={name:"R40",verbal:"Register 40",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[41]={name:"R41",verbal:"Register 41",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[42]={name:"R42",verbal:"Register 42",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[43]={name:"R43",verbal:"Register 43",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[44]={name:"R44",verbal:"Register 44",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[45]={name:"R45",verbal:"Register 45",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[46]={name:"R46",verbal:"Register 46",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[47]={name:"R47",verbal:"Register 47",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[48]={name:"R48",verbal:"Register 48",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[49]={name:"R49",verbal:"Register 49",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[50]={name:"R50",verbal:"Register 50",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[51]={name:"R51",verbal:"Register 51",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[52]={name:"R52",verbal:"Register 52",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[53]={name:"R53",verbal:"Register 53",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[54]={name:"R54",verbal:"Register 54",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[55]={name:"R55",verbal:"Register 55",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[56]={name:"R56",verbal:"Register 56",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[57]={name:"R57",verbal:"Register 57",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[58]={name:"R58",verbal:"Register 58",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[59]={name:"R59",verbal:"Register 59",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[60]={name:"R60",verbal:"Register 60",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[61]={name:"R61",verbal:"Register 61",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[62]={name:"R62",verbal:"Register 62",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[63]={name:"R63",verbal:"Register 63",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_PC"]={name:"PC",verbal:"Program Counter Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_MAR"]={name:"MAR",verbal:"Memory Address Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_MBR"]={name:"MBR",verbal:"Memory Data Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_IR"]={name:"IR",verbal:"Instruction Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_SR"]={name:"SR",verbal:"State Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_RT1"]={name:"RT1",verbal:"Temporal Register 1",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BUS_IB"]={name:"I_BUS",verbal:"Internal Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BUS_AB"]={name:"A_BUS",verbal:"Address Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BUS_CB"]={name:"C_BUS",verbal:"Control Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BUS_DB"]={name:"D_BUS",verbal:"Data Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["RA_T9"]={name:"RA_T9",verbal:"Input of T9 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["RB_T10"]={name:"RB_T10",verbal:"Input of T10 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["HPC_T12"]={name:"HPC_T12",verbal:"Input of T12 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["SELEC_T3"]={name:"SELEC_T3",verbal:"Input of T3 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["ALU_T6"]={name:"ALU_T6",verbal:"Input of T6 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["MA_ALU"]={name:"MA_ALU",verbal:"Input ALU via MA",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["MB_ALU"]={name:"MB_ALU",verbal:"Input ALU via MB",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_C"]={name:"FLAG_C",verbal:"Carry Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_V"]={name:"FLAG_V",verbal:"Overflow Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_N"]={name:"FLAG_N",verbal:"Negative Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_Z"]={name:"FLAG_Z",verbal:"Zero Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_I"]={name:"FLAG_I",verbal:"Interruption Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_U"]={name:"FLAG_U",verbal:"User Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_MICROADDR"]={name:"µADDR",verbal:"Microaddress Register",visible:true,nbits:"12",value:0,default_value:0,draw_data:["svg_cu:text4667"]};sim.poc.states["REG_MICROINS"]={name:"µINS",verbal:"Microinstruction Register",visible:true,nbits:"77",value:{},default_value:{},draw_data:[]};sim.poc.states["FETCH"]={name:"FETCH",verbal:"Input Fetch",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.poc.states["ROM_MUXA"]={name:"ROM_MUXA",verbal:"Input ROM",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.poc.states["SUM_ONE"]={name:"SUM_ONE",verbal:"Input next microinstruction",visible:false,nbits:"12",value:1,default_value:1,draw_data:[]};sim.poc.states["MUXA_MICROADDR"]={name:"MUXA_MICROADDR",verbal:"Input microaddress",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.poc.states["MUXC_MUXB"]={name:"MUXC_MUXB",verbal:"Output of MUX C",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["INEX"]={name:"INEX",verbal:"Illegal Instruction Exception",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["BS_M1"]={name:"BS_M1",verbal:"from Memory",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BS_TD"]={name:"BS_TD",verbal:"Memory",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["INTV"]={name:"INTV",verbal:"Interruption Vector",visible:false,nbits:"8",value:0,default_value:0,draw_data:[]};sim.poc.states["M1_C1"]={name:"M1_C1",verbal:"Input of Memory Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["M7_C7"]={name:"M7_C7",verbal:"Input of State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["VAL_ZERO"]={name:"VAL_ZERO",verbal:"Wired Zero",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["VAL_ONE"]={name:"VAL_ONE",verbal:"Wired One",visible:false,nbits:"32",value:1,default_value:1,draw_data:[]};sim.poc.states["VAL_FOUR"]={name:"VAL_FOUR",verbal:"Wired Four",visible:false,nbits:"32",value:4,default_value:4,draw_data:[]};sim.poc.states["REG_IR_DECO"]={name:"IR_DECO",verbal:"Instruction Decoded",visible:true,nbits:"0",value:0,default_value:0,draw_data:[]};sim.poc.states["DECO_INS"]={name:"DECO_INS",verbal:"Instruction decoded in binary",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["CLK"]={name:"CLK",verbal:"Clock",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["ACC_TIME"]={name:"ACC_TIME",verbal:"Accumulated CPU time",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["TTCPU"]={name:"TTCPU",verbal:"Several Tristates to the internal data bus in CPU activated",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["ACC_PWR"]={name:"ACC_PWR",verbal:"Accumulated Energy Consumption",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.signals["C"]={name:"C",visible:true,type:"L",value:0,default_value:0,nbits:"4",behavior:["MV MUXC_MUXB VAL_ZERO; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB INT 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB IORDY 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB MRDY 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 1 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 28 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 29 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 30 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 31 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MV MUXC_MUXB INEX; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB"],fire_name:["svg_cu:text3410"],draw_data:[["svg_cu:path3108"],["svg_cu:path3062"],["svg_cu:path3060"],["svg_cu:path3136"],["svg_cu:path3482"],["svg_cu:path3480"],["svg_cu:path3488"],["svg_cu:path3486"],["svg_cu:path3484"],["svg_cu:path3484-9"],["svg_cu:path3108-3","svg_cu:path3260-3-8-6","svg_cu:path3260-3-8","svg_cu:path3260-3"]],draw_name:[["svg_cu:path3496","svg_cu:path3414","svg_cu:path3194-08"]]};sim.poc.signals["B"]={name:"B",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV A1 MUXC_MUXB; FIRE A1","NOT_ES A1 MUXC_MUXB; FIRE A1"],depends_on:["CLK"],fire_name:["svg_cu:text3408"],draw_data:[["svg_cu:path3094-7","svg_cu:path3100-8-7","svg_cu:path3198-7","svg_cu:path3200-1"],["svg_cu:path3392","svg_cu:path3372","svg_cu:path3390","svg_cu:path3384","svg_cu:path3108-1","svg_cu:path3100-8-7","svg_cu:path3200-1","svg_cu:path3386"]],draw_name:[[],["svg_cu:path3194-0","svg_cu:path3138-8","svg_cu:path3498-6"]]};sim.poc.signals["A0"]={name:"A0",visible:false,type:"L",value:0,default_value:0,nbits:"1",behavior:["SBIT_SIGNAL A0A1 0 1; FIRE A0A1","SBIT_SIGNAL A0A1 1 1; FIRE A0A1"],depends_on:["CLK"],fire_name:["svg_cu:text3406"],draw_data:[["svg_cu:path3096"],["svg_cu:path3096"]],draw_name:[[],["svg_cu:path3138-8-1","svg_cu:path3098-2","svg_cu:path3124-2-5"]]};sim.poc.signals["A1"]={name:"A1",visible:false,type:"L",value:0,default_value:0,nbits:"1",behavior:["SBIT_SIGNAL A0A1 0 0; FIRE A0A1","SBIT_SIGNAL A0A1 1 0; FIRE A0A1"],depends_on:["CLK"],fire_name:[],draw_data:[["svg_cu:path3094"],["svg_cu:path3094"]],draw_name:[[]]};sim.poc.signals["A0A1"]={name:"A0A1",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["PLUS1 MUXA_MICROADDR REG_MICROADDR","CP_FIELD MUXA_MICROADDR REG_MICROINS/MADDR","MV MUXA_MICROADDR ROM_MUXA","MV MUXA_MICROADDR FETCH"],depends_on:["CLK"],fire_name:[],draw_data:[["svg_cu:path3102","svg_cu:path3100","svg_cu:path3098","svg_cu:path3100-9","svg_cu:path3088","svg_cu:path3082"],["svg_cu:path3104","svg_cu:path3134","svg_cu:path3500","svg_cu:path3416","svg_cu:path3124-2-4","svg_cu:path3124-2"],["svg_cu:path3504","svg_cu:path3100-8","svg_cu:path3234-9"],["svg_cu:path3124"]],draw_name:[[]]};sim.poc.signals["C0"]={name:"C0",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_MAR BUS_IB"],fire_name:["svg_p:text3077"],draw_data:[["svg_p:path3081"]],draw_name:[["svg_p:path3075"]]};sim.poc.signals["C1"]={name:"C1",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_MBR M1_C1"],fire_name:["svg_p:text3079"],draw_data:[["svg_p:path3055"]],draw_name:[["svg_p:path3073"]]};sim.poc.signals["C2"]={name:"C2",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_PC BUS_IB; UPDATEDPC"],fire_name:["svg_p:text3179"],draw_data:[["svg_p:path3217"]],draw_name:[["svg_p:path3177"]]};sim.poc.signals["C3"]={name:"C3",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_IR BUS_IB; DECO; FIRE_IFSET C 10"],fire_name:["svg_p:text3439"],draw_data:[["svg_p:path3339","svg_p:path3913-4"]],draw_name:[["svg_p:path3337"]]};sim.poc.signals["C4"]={name:"C4",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_RT1 BUS_IB"],fire_name:["svg_p:tspan482"],draw_data:[["svg_p:path3339-4"]],draw_name:[["svg_p:path3337-0"]]};sim.poc.signals["C7"]={name:"C7",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_SR M7_C7"],fire_name:["svg_p:text3655"],draw_data:[["svg_p:path3651-9"]],draw_name:[["svg_p:path3681"]]};sim.poc.signals["TA"]={name:"TA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MV BUS_AB REG_MAR"],fire_name:["svg_p:text3091"],draw_data:[["svg_p:path3083","svg_p:path3089","svg_p:path3597","svg_p:path3513","svg_p:path3601","svg_p:path3601-2","svg_p:path3187","svg_p:path3087","svg_p:path2995","svg_p:path3535"]],draw_name:[["svg_p:path3085"]]};sim.poc.signals["TD"]={name:"TD",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; CHECK_RTD","MV BUS_DB REG_MBR; FIRE R; FIRE W; CHECK_RTD"],fire_name:["svg_p:text3103"],draw_data:[["svg_p:path3093","svg_p:path3101","svg_p:path3587","svg_p:path3419-8","svg_p:path3071","svg_p:path3099","svg_p:path3097","svg_p:path3559-5","svg_p:path3419-1-0","svg_p:path3583","svg_p:path3419-1","svg_p:path3491","svg_p:path3641","svg_p:path3541"]],draw_name:[["svg_p:path3095"]]};sim.poc.signals["T1"]={name:"T1",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 0","MV BUS_IB REG_MBR; FIRE M7; FIRE M1; SET_TT TTCPU 0"],fire_name:["svg_p:text3105"],draw_data:[["svg_p:path3065","svg_p:path3071","svg_p:path3069","svg_p:path3049","svg_p:path3063-9","svg_p:path3071"]],draw_name:[["svg_p:path3067"]]};sim.poc.signals["T2"]={name:"T2",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 1","MV BUS_IB REG_PC; FIRE M7; FIRE M1; SET_TT TTCPU 1"],fire_name:["svg_p:text3449"],draw_data:[["svg_p:path3195","svg_p:path3199","svg_p:path3201","svg_p:path3049"]],draw_name:[["svg_p:path3329"]]};sim.poc.signals["T3"]={name:"T3",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 2","MV BUS_IB SELEC_T3; FIRE M7; FIRE M1; SET_TT TTCPU 2"],fire_name:["svg_p:text3451"],draw_data:[["svg_p:path3347","svg_p:path3349","svg_p:path3931","svg_p:path3345","svg_p:path3049"]],draw_name:[["svg_p:path3351"]]};sim.poc.signals["T6"]={name:"T6",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 3","MV BUS_IB ALU_T6; FIRE M7; FIRE M1; SET_TT TTCPU 3"],fire_name:["svg_p:text3457"],draw_data:[["svg_p:path3315","svg_p:path3589","svg_p:path3317","svg_p:path3163-2","svg_p:path3049","svg_p:path3317-9","svg_p:path3321","svg_p:path3261-8"]],draw_name:[["svg_p:path3319"]]};sim.poc.signals["T8"]={name:"T8",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 4","MV BUS_IB REG_SR; FIRE M7; FIRE M1; SET_TT TTCPU 4"],fire_name:["svg_p:text3657"],draw_data:[["svg_p:path3645","svg_p:path3651","svg_p:path3647","svg_p:path3049"]],draw_name:[["svg_p:path3649"]]};sim.poc.signals["T9"]={name:"T9",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 5","MV BUS_IB RA_T9; FIRE M7; FIRE M1; SET_TT TTCPU 5"],fire_name:["svg_p:text3147"],draw_data:[["svg_p:path3131","svg_p:path3143","svg_p:path3139","svg_p:path3049","svg_p:path3143-9"]],draw_name:[["svg_p:path3133"]]};sim.poc.signals["T10"]={name:"T10",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 6","MV BUS_IB RB_T10; FIRE M7; FIRE M1; SET_TT TTCPU 6"],fire_name:["svg_p:text3149"],draw_data:[["svg_p:path3135","svg_p:path3145","svg_p:path3141","svg_p:path3049","svg_p:path3145-5"]],draw_name:[["svg_p:path3137"]]};sim.poc.signals["T11"]={name:"T11",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 7","CP_FIELD BUS_IB REG_MICROINS/EXCODE; FIRE M7; FIRE M1; SET_TT TTCPU 7"],fire_name:["svg_p:text3147-5","svg_cu:tspan4426"],draw_data:[["svg_p:path3131-3","svg_p:path3081-3","svg_p:path3139-7","svg_p:path3049","svg_cu:path3081-3","svg_cu:path3139-7","svg_cu:path3502"]],draw_name:[["svg_p:path3133-6","svg_cu:path3133-6"]]};sim.poc.signals["T12"]={name:"T12",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 8","MV BUS_IB HPC_T12; FIRE M7; FIRE M1; SET_TT TTCPU 8"],fire_name:["svg_p:text3147-5-0-1-1"],draw_data:[["svg_p:path3131-3-8-4-31","svg_p:path3139-7-1-4-3","svg_cu:path3049"]],draw_name:[["svg_cu:path3133-6-9-7-5"]]};sim.poc.signals["M1"]={name:"M1",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M1_C1 BUS_IB","MV M1_C1 BUS_DB"],depends_on:["C1"],fire_name:["svg_p:text3469"],draw_data:[["svg_p:path3063","svg_p:path3061","svg_p:path3059"],["svg_p:path3057","svg_p:path3641","svg_p:path3419","svg_p:path3583"]],draw_name:[[],["svg_p:path3447"]]};sim.poc.signals["M7"]={name:"M7",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M7_C7 BUS_IB","MV M7_C7 REG_SR; UPDATE_FLAG M7_C7 FLAG_C 31; UPDATE_FLAG M7_C7 FLAG_V 30; UPDATE_FLAG M7_C7 FLAG_N 29; UPDATE_FLAG M7_C7 FLAG_Z 28"],depends_on:["C7"],fire_name:["svg_p:text3673"],draw_data:[["svg_p:path3691","svg_p:path3693","svg_p:path3659"],["svg_p:path3695"]],draw_name:[[],["svg_p:path3667"]]};sim.poc.signals["MA"]={name:"MA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV MA_ALU RA_T9; FIRE COP","MV MA_ALU BUS_IB; FIRE COP"],depends_on:["SELA","SELB"],fire_name:["svg_p:text3463"],draw_data:[["svg_p:path3249","svg_p:path3161","svg_p:path3165"],["svg_p:path3279"]],draw_name:[[],["svg_p:path3423"]]};sim.poc.signals["MB"]={name:"MB",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV MB_ALU RB_T10; FIRE COP","MV MB_ALU REG_PC; FIRE COP"],depends_on:["SELA","SELB"],fire_name:["svg_p:text3465"],draw_data:[["svg_p:path3281","svg_p:path3171","svg_p:path3169"],["svg_p:path3283"]],draw_name:[[],["svg_p:path3425","svg_p:path3427"]]};sim.poc.signals["MH"]={name:"MH",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MV HPC_T12 CLK","MV HPC_T12 ACC_TIME","MV HPC_T12 ACC_PWR","NOP"],fire_name:["svg_p:text3147-5-0-1-8-4"],draw_data:[[],["svg_p:path3081-3-8-5-3"]],draw_name:[[],["svg_p:path3306-8-7-6"]]};sim.poc.signals["COP"]={name:"COP",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["NOP_ALU; UPDATE_NZVC","AND ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","OR ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","NOT ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","XOR ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SRL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SRA ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","RR ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","RL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUB ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","MUL ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","DIV ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","MOD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","LUI ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADDFOUR ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADDONE ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUBFOUR ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUBONE ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FADD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FSUB ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FMUL ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FDIV ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FMOD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU"],depends_on:["SELCOP"],fire_name:["svg_p:text3303"],draw_data:[["svg_p:path3237","svg_p:path3239","svg_p:path3261-8","svg_p:path3321","svg_p:path3901-6","svg_p:path3317-9"]],draw_name:[["svg_p:path3009","svg_p:path3301"]]};sim.poc.signals["SELA"]={name:"SELA",visible:true,type:"L",value:0,default_value:0,nbits:"6",behavior:["FIRE_IFCHANGED MRA SELA; RESET_CHANGED SELA"],depends_on:["RA"],fire_name:["svg_cu:text3164"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["SELB"]={name:"SELB",visible:true,type:"L",value:0,default_value:0,nbits:"6",behavior:["FIRE_IFCHANGED MRB SELB; RESET_CHANGED SELB"],depends_on:["RB"],fire_name:["svg_cu:text3168"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["SELC"]={name:"SELC",visible:true,type:"L",value:0,default_value:0,nbits:"6",behavior:["FIRE_IFCHANGED MRC SELC; RESET_CHANGED SELC"],depends_on:["RC"],fire_name:["svg_cu:text3172"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["SELCOP"]={name:"SELCOP",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE_IFCHANGED MC SELCOP; RESET_CHANGED SELCOP"],depends_on:["COP"],fire_name:["svg_cu:text3312"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["EXCODE"]={name:"EXCODE",visible:true,type:"L",value:0,default_value:0,nbits:"4",behavior:["FIRE T11"],fire_name:["svg_cu:text3312-6"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["RA"]={name:"RA",visible:true,type:"L",value:0,default_value:0,nbits:"6",forbidden:true,behavior:["GET RA_T9 BR RA; FIRE_IFSET T9 1; FIRE_IFSET MA 0"],depends_on:["SELA"],fire_name:["svg_p:text3107"],draw_data:[[]],draw_name:[["svg_p:path3109"]]};sim.poc.signals["RB"]={name:"RB",visible:true,type:"L",value:0,default_value:0,nbits:"6",forbidden:true,behavior:["GET RB_T10 BR RB; FIRE_IFSET T10 1; FIRE_IFSET MB 0"],depends_on:["SELB"],fire_name:["svg_p:text3123"],draw_data:[[]],draw_name:[["svg_p:path3113"]]};sim.poc.signals["RC"]={name:"RC",visible:true,type:"L",value:0,default_value:0,nbits:"6",forbidden:true,behavior:["FIRE LC"],depends_on:["SELC"],fire_name:["svg_p:text3125"],draw_data:[[]],draw_name:[["svg_p:path3117"]]};sim.poc.signals["LC"]={name:"LC",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","SET BR RC BUS_IB"],fire_name:["svg_p:text3127"],draw_data:[["svg_p:path3153","svg_p:path3151","svg_p:path3129"]],draw_name:[["svg_p:path3121"]]};sim.poc.signals["SE"]={name:"SE",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3","MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3593"],draw_data:[[]],draw_name:[["svg_p:path3591","svg_p:path3447-7-7"]]};sim.poc.signals["SIZE"]={name:"SIZE",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3363"],draw_data:[[]],draw_name:[["svg_p:path3355"]]};sim.poc.signals["OFFSET"]={name:"OFFSET",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3707"],draw_data:[[]],draw_name:[["svg_p:path3359"]]};sim.poc.signals["MC"]={name:"MC",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT COP REG_IR 0 5; FIRE_IFCHANGED COP MC","CP_FIELD COP REG_MICROINS/SELCOP; FIRE_IFCHANGED COP MC"],depends_on:["SELCOP"],fire_name:["svg_cu:text3322","svg_cu:text3172-1-5"],draw_data:[["svg_cu:path3320","svg_cu:path3142"],["svg_cu:path3318","svg_cu:path3502-6","svg_cu:path3232-6"]],draw_name:[[],["svg_cu:path3306"]]};sim.poc.signals["MRA"]={name:"MRA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RA REG_IR REG_MICROINS/SELA 5; FIRE RA;","CP_FIELD RA REG_MICROINS/SELA; FIRE RA;"],depends_on:["SELA"],fire_name:["svg_cu:text3222"],draw_data:[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3142b","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3260"],["svg_cu:path3270","svg_cu:path3258","svg_cu:path3260","svg_cu:path3294","svg_cu:path3288","svg_cu:path3280"]],draw_name:[[],["svg_cu:path3220"]]};sim.poc.signals["MRB"]={name:"MRB",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RB REG_IR REG_MICROINS/SELB 5; FIRE RB;","CP_FIELD RB REG_MICROINS/SELB; FIRE RB;"],depends_on:["SELB"],fire_name:["svg_cu:text3242"],draw_data:[["svg_cu:path3196","svg_cu:path3278","svg_cu:path3292"],["svg_cu:path3282","svg_cu:path3258-4","svg_cu:path3278","svg_cu:path3196"]],draw_name:[[],["svg_cu:path3240"]]};sim.poc.signals["MRC"]={name:"MRC",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RC REG_IR REG_MICROINS/SELC 5; FIRE RC;","CP_FIELD RC REG_MICROINS/SELC; FIRE RC;"],depends_on:["SELC"],fire_name:["svg_cu:text3254"],draw_data:[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3142b","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3232","svg_cu:path3292"],["svg_cu:path3300","svg_cu:path3294","svg_cu:path3292","svg_cu:path3288","svg_cu:path3232"]],draw_name:[[],["svg_cu:path3252"]]};sim.poc.signals["IOR"]={name:"IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MOVE_BITS SCR_IOR 0 1 IOR; FIRE SCR_IOR; MOVE_BITS IO_IOR 0 1 IOR; FIRE IO_IOR; MOVE_BITS L3D_IOR 0 1 IOR; FIRE L3D_IOR; MOVE_BITS KBD_IOR 0 1 IOR; FIRE KBD_IOR; MOVE_BITS LEDM_IOR 0 1 IOR; FIRE LEDM_IOR"],fire_name:[],draw_data:[[],["svg_p:path3733","svg_p:path3491","svg_p:text3715"]],draw_name:[[],[]]};sim.poc.signals["IOW"]={name:"IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MOVE_BITS SCR_IOW 0 1 IOW; FIRE SCR_IOW; MOVE_BITS IO_IOW 0 1 IOW; FIRE IO_IOW; MOVE_BITS L3D_IOW 0 1 IOW; FIRE L3D_IOW; MOVE_BITS LEDM_IOW 0 1 IOW; FIRE LEDM_IOW"],fire_name:[],draw_data:[[],["svg_p:path3735","svg_p:path3491","svg_p:text3717"]],draw_name:[[],[]]};sim.poc.signals["TEST_C"]={name:"TEST_C",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_C VAL_ZERO; FIRE M7","MV FLAG_C VAL_ONE; FIRE M7"],depends_on:["SELCOP"],fire_name:["svg_p:text3701-3"],draw_data:[["svg_p:text3701-3"]],draw_name:[[]]};sim.poc.signals["TEST_V"]={name:"TEST_V",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_V VAL_ZERO; FIRE M7","MV FLAG_V VAL_ONE; FIRE M7"],depends_on:["SELCOP"],fire_name:["svg_p:text3701-3-1"],draw_data:[["svg_p:text3701-3-1"]],draw_name:[[]]};sim.poc.signals["TEST_N"]={name:"TEST_N",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_N VAL_ZERO; FIRE M7","MV FLAG_N VAL_ONE; FIRE M7"],depends_on:["SELCOP"],fire_name:["svg_p:text3701-3-2"],draw_data:[["svg_p:text3701-3-2"]],draw_name:[[]]};sim.poc.signals["TEST_Z"]={name:"TEST_Z",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_Z VAL_ZERO; FIRE M7","MV FLAG_Z VAL_ONE; FIRE M7"],depends_on:["SELCOP"],fire_name:["svg_p:text3701-3-5"],draw_data:[["svg_p:text3701-3-5"]],draw_name:[[]]};sim.poc.signals["TEST_I"]={name:"TEST_I",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_I VAL_ZERO; FIRE M7","MV FLAG_I VAL_ONE; FIRE M7"],depends_on:["CLK"],fire_name:["svg_cu:text3440"],draw_data:[["svg_cu:text3440"]],draw_name:[[]]};sim.poc.signals["TEST_U"]={name:"TEST_U",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_U VAL_ZERO; FIRE M7","MV FLAG_U VAL_ONE; FIRE M7"],depends_on:["CLK"],fire_name:["svg_cu:text3442"],draw_data:[["svg_cu:text3442"]],draw_name:[[]]};sim.poc.signals["TEST_INTV"]={name:"TEST_INTV",visible:true,type:"L",value:0,default_value:0,nbits:"8",forbidden:true,behavior:["MBIT INTV TEST_INTV 0 32"],depends_on:["INT"],fire_name:["svg_p:tspan4225"],draw_data:[["svg_p:path3749"]],draw_name:[[]]};sim.poc.behaviors["NOP"]={nparameters:1,operation:function(s_expr){},verbal:function(s_expr){return""}};sim.poc.behaviors["NOP_ALU"]={nparameters:1,operation:function(s_expr){sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){return"Reset ALU flags. "}};sim.poc.behaviors["MV"]={nparameters:3,types:["X","X"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)},verbal:function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg("verbal_verbose");if(verbose!=="short"){return"Copy from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(newval)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(newval)+"). "}};sim.poc.behaviors["LOAD"]={nparameters:3,types:["X","X"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)},verbal:function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Load from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(newval)+". "}return show_verbal(s_expr[1])+" = "+show_value(newval)+" ( "+show_verbal(s_expr[2])+"). "}};sim.poc.behaviors["CP_FIELD"]={nparameters:3,types:["X","X"],operation:function(s_expr){r=s_expr[2].split("/");sim_elto_org=get_reference(r[0]);newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval!="undefined"){sim_elto_dst=get_reference(s_expr[1]);set_value(sim_elto_dst,newval)}},verbal:function(s_expr){var r=s_expr[2].split("/");var sim_elto_org=get_reference(r[0]);var newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval=="undefined")newval="<undefined>";else newval=show_value(newval);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return'Copy from "'+show_verbal(r[0])+'"['+r[1]+"] "+"to "+show_verbal(s_expr[1])+" (value "+newval+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(r[0])+"."+r[1]+" ("+newval+"). "}};sim.poc.behaviors["NOT_ES"]={nparameters:3,types:["S","E"],operation:function(s_expr){set_value(sim.poc.signals[s_expr[1]],Math.abs(get_value(sim.poc.states[s_expr[2]])-1))},verbal:function(s_expr){var value=Math.abs(get_value(sim.poc.states[s_expr[2]])-1);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Set "+show_verbal(s_expr[1])+" with value "+show_value(value)+" (Logical NOT of "+s_expr[2]+"). "}return show_verbal(s_expr[1])+" = "+show_value(value)+" (Logical NOT "+s_expr[2]+"). "}};sim.poc.behaviors["GET"]={nparameters:4,types:["E","E","S"],operation:function(s_expr){set_value(sim.poc.states[s_expr[1]],get_value(sim.poc.states[s_expr[2]][sim.poc.signals[s_expr[3]].value]))},verbal:function(s_expr){var value=get_value(sim.poc.states[s_expr[2]][sim.poc.signals[s_expr[3]].value]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Set "+show_verbal(s_expr[1])+" with value "+show_value(value)+" (Register File "+s_expr[3]+"). "}return show_verbal(s_expr[1])+" = "+show_value(value)+" (Register File "+s_expr[3]+"). "}};sim.poc.behaviors["SET"]={nparameters:4,types:["E","S","E"],operation:function(s_expr){set_value(sim.poc.states[s_expr[1]][sim.poc.signals[s_expr[2]].value],get_value(sim.poc.states[s_expr[3]]))},verbal:function(s_expr){var value=get_value(sim.poc.states[s_expr[3]]);var o_ref=sim.poc.states[s_expr[1]][sim.poc.signals[s_expr[2]].value];var o_verbal=o_ref.name;if(typeof o_ref.verbal!="undefined")o_verbal=o_ref.verbal;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy to "+o_verbal+" the value "+show_value(value)+". "}return o_verbal+" = "+show_value(value)+". "}};sim.poc.behaviors["AND"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])&get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])&get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU AND with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (AND). "}};sim.poc.behaviors["OR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])|get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])|get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU OR with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (OR). "}};sim.poc.behaviors["NOT"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=~get_value(sim.poc.states[s_expr[2]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=~get_value(sim.poc.states[s_expr[2]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU NOT with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (NOT). "}};sim.poc.behaviors["XOR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])^get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])^get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU XOR with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (XOR). "}};sim.poc.behaviors["SRL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Right Logical with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SRL). "}};sim.poc.behaviors["SRA"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Right Arithmetic with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SRA). "}};sim.poc.behaviors["SL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Left with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SL). "}};sim.poc.behaviors["RR"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1|(get_value(sim.poc.states[s_expr[2]])&1)<<31;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1|(get_value(sim.poc.states[s_expr[2]])&1)<<31;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Right Rotation with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (RR). "}};sim.poc.behaviors["RL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1|(get_value(sim.poc.states[s_expr[2]])&2147483648)>>>31;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1|(get_value(sim.poc.states[s_expr[2]])&2147483648)>>>31;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Left Rotation with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (LR). "}};sim.poc.behaviors["ADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a+b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a+b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU ADD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (ADD). "}};sim.poc.behaviors["SUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a-b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a-b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU SUB with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SUB). "}};sim.poc.behaviors["MUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a*b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a*b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MUL with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MUL). "}};sim.poc.behaviors["DIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){return"ALU DIV zero by zero (oops!). "}var result=Math.floor(a/b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU DIV with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (DIV). "}};sim.poc.behaviors["MOD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=a%b;set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){return"ALU MOD zero by zero (oops!). "}var result=a%b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MOD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MOD). "}};sim.poc.behaviors["LUI"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Load Upper Immediate with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (LUI). "}};sim.poc.behaviors["ADDFOUR"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;return"ALU ADD 4 with result "+show_value(result)+". "}};sim.poc.behaviors["ADDONE"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;return"ALU ADD 1 with result "+show_value(result)+". "}};sim.poc.behaviors["SUBFOUR"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-4;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-4;return"ALU SUB 4 with result "+show_value(result)+". "}};sim.poc.behaviors["SUBONE"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-1;return"ALU SUB 1 with result "+show_value(result)+". "}};sim.poc.behaviors["FADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)+b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)+b.toFixed(2);return"ALU Float ADD with result "+result+". "}};sim.poc.behaviors["FSUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)-b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)-b.toFixed(2);return"ALU Float SUB with result "+result+". "}};sim.poc.behaviors["FMUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)*b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)*b.toFixed(2);return"ALU Float MUL with result "+result+". "}};sim.poc.behaviors["FDIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)/b.toFixed(2);return"ALU Float DIV with result "+result+". "}};sim.poc.behaviors["FMOD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=(get_value(sim.poc.states[s_expr[2]])<<0)%(get_value(sim.poc.states[s_expr[3]])<<0);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)%b.toFixed(2);return"ALU Float MOD with result "+result+". "}};sim.poc.behaviors["LUI"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;return"ALU Load Upper Immediate with result "+show_value(result)+". "}};sim.poc.behaviors["PLUS1"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;set_value(sim.poc.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Add one to "+show_verbal(s_expr[2])+" and copy to "+show_verbal(s_expr[1])+" with result "+show_value(result)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" + 1"+" ("+show_value(result)+"). "}};sim.poc.behaviors["PLUS4"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;set_value(sim.poc.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Add four to "+show_verbal(s_expr[2])+" and copy to "+show_verbal(s_expr[1])+" with result "+show_value(result)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" + 4"+" ("+show_value(result)+"). "}};sim.poc.behaviors["SET_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a|m;set_value(sim.poc.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.poc.behaviors["RST_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a&~m;set_value(sim.poc.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.poc.behaviors["CHECK_RTD"]={nparameters:1,operation:function(s_expr){var number_active_tri=parseInt(simhw_sim_signal("TD").value)+parseInt(simhw_sim_signal("R").value);update_system_bus_fire(number_active_tri)},verbal:function(s_expr){return""}};sim.poc.behaviors["MBIT"]={nparameters:5,types:["X","X","I","I"],operation:function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);set_value(sim_elto_dst,parseInt(n2,2))},verbal:function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=parseInt(n2,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(n3)+" (copied "+size+" bits from bit "+offset+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(n3)+", "+size+" bits from bit "+offset+"). "}};sim.poc.behaviors["MBIT_SN"]={nparameters:5,types:["S","E","E","I"],operation:function(s_expr){var base=0;var r=s_expr[3].split("/");if(1==r.length)base=get_value(sim.poc.states[s_expr[3]]);else if(typeof sim.poc.states[r[0]].value[r[1]]!="undefined")base=sim.poc.states[r[0]].value[r[1]];else if(typeof sim.poc.signals[r[1]].default_value!="undefined")base=sim.poc.signals[r[1]].default_value;else if(typeof sim.poc.states[r[1]].default_value!="undefined")base=sim.poc.states[r[1]].default_value;else ws_alert("WARN: undefined state/field pair -> "+r[0]+"/"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.poc.states[s_expr[2]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var base=0;var r=s_expr[3].split("/");if(1==r.length)base=get_value(sim.poc.states[s_expr[3]]);else if(typeof sim.poc.states[r[0]].value[r[1]]!="undefined")base=sim.poc.states[r[0]].value[r[1]];else if(typeof sim.poc.signals[r[1]].default_value!="undefined")base=sim.poc.signals[r[1]].default_value;else if(typeof sim.poc.states[r[1]].default_value!="undefined")base=sim.poc.states[r[1]].default_value;else ws_alert("WARN: undefined state/field pair -> "+r[0]+"/"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.poc.states[s_expr[2]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);var from_elto="";if(1==r.length)from_elto=show_verbal(s_expr[3]);else from_elto='"'+show_verbal(s_expr[2])+'"['+r[1]+"] ";var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+from_elto+"into "+show_verbal(s_expr[1])+" "+"value "+parseInt(n3,2)+". "}return show_verbal(s_expr[1])+" = "+from_elto+" ("+parseInt(n3,2)+"). "}};sim.poc.behaviors["SBIT_SIGNAL"]={nparameters:4,types:["X","I","I"],operation:function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)},verbal:function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)}};sim.poc.behaviors["UPDATE_FLAG"]={nparameters:4,types:["X","X","I"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value&~(1<>>0)},verbal:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Update "+show_verbal(s_expr[2])+" to value "+sim_elto_org.value+". "}return show_verbal(s_expr[1])+"."+show_verbal(s_expr[3])+" = "+sim_elto_org.value+". "}};sim.poc.behaviors["MBITS"]={nparameters:8,types:["E","I","E","S","S","I","S"],operation:function(s_expr){var offset=parseInt(sim.poc.signals[s_expr[4]].value);var size=parseInt(sim.poc.signals[s_expr[5]].value);var n1=get_value(sim.poc.states[s_expr[3]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;if("1"==sim.poc.signals[s_expr[7]].value&&"1"==n2.substr(0,1)){n3="11111111111111111111111111111111".substring(0,32-n2.length)+n2}set_value(sim.poc.states[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var offset=parseInt(sim.poc.signals[s_expr[4]].value);var size=parseInt(sim.poc.signals[s_expr[5]].value);var n1=get_value(sim.poc.states[s_expr[3]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;if("1"==sim.poc.signals[s_expr[7]].value&&"1"==n2.substr(0,1)){n3="11111111111111111111111111111111".substring(0,32-n2.length)+n2}n1=parseInt(n3,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return" Copy from "+show_verbal(s_expr[3])+" to "+show_verbal(s_expr[1])+" value "+show_value(n1)+" (copied "+size+" bits from bit "+offset+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[3])+" ("+show_value(n1)+", "+size+" bits from bit "+offset+"). "}};sim.poc.behaviors["BSEL"]={nparameters:6,types:["E","I","I","E","I"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var n4="00000000000000000000000000000000".substr(0,posd);n3=n3+n4;set_value(sim.poc.states[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var posd=parseInt(s_expr[2]);var len=parseInt(s_expr[3]);var poso=parseInt(s_expr[5]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var n4="00000000000000000000000000000000".substr(0,posd);n3=n3+n4;var n5=parseInt(n3,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[4])+" to "+show_verbal(s_expr[1])+" value "+show_value(n5)+" (copied "+len+" bits, from bit "+poso+" of "+s_expr[4]+" to bit "+posd+" of "+s_expr[1]+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[4])+" ("+show_value(n5)+", "+len+" bits, from bit "+poso+" of "+s_expr[4]+" to bit "+posd+" of "+s_expr[1]+"). "}};sim.poc.behaviors["EXT_SIG"]={nparameters:3,types:["E","I"],operation:function(s_expr){var n1=get_value(sim.poc.states[s_expr[1]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if("1"==n2[31-s_expr[2]]){n4="11111111111111111111111111111111".substring(0,32-n3.length)+n4}set_value(sim.poc.states[s_expr[1]],parseInt(n4,2))},verbal:function(s_expr){var n1=get_value(sim.poc.states[s_expr[1]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if("1"==n2[31-s_expr[2]]){n4="11111111111111111111111111111111".substring(0,32-n3.length)+n4}var n5=parseInt(n4,2);return"Sign Extension with value "+show_value(n5)+". "}};sim.poc.behaviors["MOVE_BITS"]={nparameters:5,types:["S","I","I","S"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=0;var len=parseInt(s_expr[3]);var n1=sim.poc.signals[s_expr[4]].value.toString(2);n1="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.poc.signals[s_expr[1]].value.toString(2);n2="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.poc.behaviors["MOVE_BITSE"]={nparameters:6,types:["S","I","I","E","I"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);n1="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.poc.signals[s_expr[1]].value.toString(2);n2="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.poc.behaviors["DECO"]={nparameters:1,operation:function(s_expr){sim.poc.states["INEX"].value=0;var oi=decode_instruction(sim.poc.internal_states.FIRMWARE,sim.poc.ctrl_states.ir,get_value(sim.poc.states["REG_IR"]));if(null==oi.oinstruction){ws_alert("ERROR: undefined instruction code in IR ("+"co:"+oi.op_code.toString(2)+", "+"cop:"+oi.cop_code.toString(2)+")");sim.poc.states["ROM_MUXA"].value=0;sim.poc.states["INEX"].value=1;return-1}var rom_addr=oi.op_code<<6;if(typeof oi.oinstruction.cop!="undefined"){rom_addr=rom_addr+oi.cop_code}if(typeof sim.poc.internal_states["ROM"][rom_addr]=="undefined"){ws_alert("ERROR: undefined rom address "+rom_addr+" in firmware");sim.poc.states["ROM_MUXA"].value=0;return-1}sim.poc.states["ROM_MUXA"].value=sim.poc.internal_states["ROM"][rom_addr];var val=get_value(sim.poc.states["DECO_INS"]);set_value(sim.poc.states["DECO_INS"],val+1);var pc=get_value(sim.poc.states["REG_PC"])-4;var decins=get_deco_from_pc(pc);set_value(sim.poc.states["REG_IR_DECO"],decins);show_dbg_ir(get_value(sim.poc.states["REG_IR_DECO"]))},verbal:function(s_expr){return"Decode instruction. "}};sim.poc.behaviors["FIRE"]={nparameters:2,types:["S"],operation:function(s_expr){if(sim.poc.internal_states.fire_stack.indexOf(s_expr[1])!=-1){return}sim.poc.internal_states.fire_stack.push(s_expr[1]);update_draw(sim.poc.signals[s_expr[1]],sim.poc.signals[s_expr[1]].value);if("L"==sim.poc.signals[s_expr[1]].type){update_state(s_expr[1])}sim.poc.internal_states.fire_stack.pop(s_expr[1])},verbal:function(s_expr){return""}};sim.poc.behaviors["FIRE_IFSET"]={nparameters:3,types:["S","I"],operation:function(s_expr){if(get_value(sim.poc.signals[s_expr[1]])!=parseInt(s_expr[2])){return}sim.poc.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.poc.behaviors["FIRE_IFCHANGED"]={nparameters:3,types:["S","X"],operation:function(s_expr){sim_elto=get_reference(s_expr[2]);if(sim_elto.changed==false)return;sim.poc.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.poc.behaviors["RESET_CHANGED"]={nparameters:2,types:["X"],operation:function(s_expr){sim_elto=get_reference(s_expr[1]);sim_elto.changed=false},verbal:function(s_expr){return""}};sim.poc.behaviors["CLOCK"]={nparameters:1,operation:function(s_expr){var new_maddr=null;var mcelto=null;var t0=performance.now();var val=get_value(sim.poc.states["CLK"]);set_value(sim.poc.states["CLK"],val+1);set_value(sim.poc.states["TTCPU"],0);new_maddr=get_value(sim.poc.states["REG_MICROADDR"]);mcelto=sim.poc.internal_states["MC"][new_maddr];if(typeof mcelto!=="undefined"&&false==mcelto.is_native){for(var i=0;i>>0},set_value:function(elto,value){var origin="";var r_value=main_memory_get_program_counter();if(r_value!=null){origin="PC=0x"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.poc.internal_states.MP,elto,melto);show_main_memory(sim.poc.internal_states.MP,elto,typeof valref==="undefined",true);return value}};sim.poc.internal_states.segments={};sim.poc.internal_states.MP={};sim.poc.internal_states.MP_wc=0;sim.poc.internal_states.CM_cfg=[];sim.poc.internal_states.CM=[];sim.poc.signals.MRDY={name:"MRDY",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE_IFCHANGED MRDY C","FIRE_IFCHANGED MRDY C"],fire_name:["svg_p:tspan3916"],draw_data:[[],["svg_p:path3895","svg_p:path3541"]],draw_name:[[],[]]};sim.poc.signals.R={name:"R",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; CHECK_RTD","MEM_READ BUS_AB BUS_DB BW MRDY CLK; FIRE M1; FIRE MRDY; CHECK_RTD"],fire_name:["svg_p:text3533-5-2"],draw_data:[[],["svg_p:path3557","svg_p:path3571"]],draw_name:[[],[]]};sim.poc.signals.W={name:"W",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MEM_WRITE BUS_AB BUS_DB BW MRDY CLK; FIRE M1; FIRE MRDY"],fire_name:["svg_p:text3533-5-08"],draw_data:[[],["svg_p:path3559","svg_p:path3575","svg_p:path3447-7"]],draw_name:[[],[]]};sim.poc.signals.BW={name:"BW",verbal:["Access to one byte from memory. ","Access to two bytes from memory. ","Access to three bytes from memory. ","Access to a word from memory. "],visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["FIRE R; FIRE W","FIRE R; FIRE W","FIRE R; FIRE W","FIRE R; FIRE W"],fire_name:["svg_p:text3533-5-2-8"],draw_data:[["svg_p:path3557-0"]],draw_name:[[],[]]};sim.poc.behaviors.MEM_READ={nparameters:6,types:["E","E","S","S","E"],operation:function(s_expr){var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);sim.poc.signals[s_expr[4]].value=0;var remain=get_value(sim.poc.internal_states.MP_wc);if(typeof sim.poc.events.mem[clk-1]!="undefined"&&sim.poc.events.mem[clk-1]>0){remain=sim.poc.events.mem[clk-1]-1}var first_time=typeof sim.poc.events.mem[clk]=="undefined";sim.poc.events.mem[clk]=remain;if(remain>0){return}var wordress=address&4294967292;var value=main_memory_getvalue(sim.poc.internal_states.MP,wordress);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}dbvalue=main_memory_extractvalues(value,bw,address&3);sim.poc.states[s_expr[2]].value=dbvalue>>>0;sim.poc.signals[s_expr[4]].value=1;show_main_memory(sim.poc.internal_states.MP,wordress,full_redraw,false);if(first_time&&sim.poc.internal_states.CM.length>0){cache_memory_access(sim.poc.internal_states.CM[0],address,"read",clk)}},verbal:function(s_expr){var verbal="";var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);switch(bw){case 0:bw_type="byte";break;case 1:bw_type="half";break;case 2:bw_type="three bytes";break;case 3:bw_type="word";break}var value=main_memory_getvalue(sim.poc.internal_states.MP,address);if(typeof value==="undefined"){value=0}verbal="Try to read a "+bw_type+" from memory "+"at address 0x"+address.toString(16)+" with value "+value.toString(16)+". ";return verbal}};sim.poc.behaviors.MEM_WRITE={nparameters:6,types:["E","E","S","S","E"],operation:function(s_expr){var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);sim.poc.signals[s_expr[4]].value=0;var remain=get_value(sim.poc.internal_states.MP_wc);if(typeof sim.poc.events.mem[clk-1]!="undefined"&&sim.poc.events.mem[clk-1]>0){remain=sim.poc.events.mem[clk-1]-1}var first_time=typeof sim.poc.events.mem[clk]=="undefined";sim.poc.events.mem[clk]=remain;if(remain>0){return}var wordress=address&4294967292;var value=main_memory_getvalue(sim.poc.internal_states.MP,wordress);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}value=main_memory_updatevalues(value,dbvalue,bw,address&3);var origin="";var r_value=main_memory_get_program_counter();if(r_value!=null){origin="PC=0x"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var elto=main_memory_set(sim.poc.internal_states.MP,wordress,melto);sim.poc.signals[s_expr[4]].value=1;show_main_memory(sim.poc.internal_states.MP,wordress,full_redraw,true);if(first_time&&sim.poc.internal_states.CM.length>0){cache_memory_access(sim.poc.internal_states.CM[0],address,"write",clk)}},verbal:function(s_expr){var verbal="";var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);switch(bw){case 0:bw_type="byte";break;case 1:bw_type="half";break;case 2:bw_type="three bytes";break;case 3:bw_type="word";break}var value=main_memory_getvalue(sim.poc.internal_states.MP,address);if(typeof value==="undefined"){value=0}verbal="Try to write a "+bw_type+" to memory "+"at address 0x"+address.toString(16)+" with value "+value.toString(16)+". ";return verbal}};sim.poc.behaviors.MEMORY_RESET={nparameters:1,operation:function(s_expr){sim.poc.events.mem={}},verbal:function(s_expr){return"Reset the memory (all values will be zeroes). "}};sim.poc.elements.memory={name:"Main memory",description:"Main memory subsystem",type:"subcomponent",belongs:"MEMORY",states:{addr:{ref:"BUS_AB"},data:{ref:"BUS_DB"},mrdy:{ref:"MRDY"}},signals:{bw:{ref:"BW"},r:{ref:"R"},w:{ref:"W"}},states_inputs:["addr","data"],states_outputs:["mrdy","data"],signals_inputs:["bw","r","w"],signals_output:[]};sim.poc.components.IO={name:"IO",version:"1",abilities:["IO_TIMER"],details_name:["IO_STATS","IO_CONFIG"],details_fire:[["svg_p:text3775"],[]],write_state:function(vec){return vec},read_state:function(o,check){return false},get_state:function(reg){return null},get_value:function(elto){var associated_state=simhw_internalState_get("io_hash",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("IOR"),1);compute_behavior("FIRE IOR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("IOW"),1);compute_behavior("FIRE IOW");return value}};sim.poc.internal_states.io_int_factory=[];sim.poc.internal_states.io_int_factory[0]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[1]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[2]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[3]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[4]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[5]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[6]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[7]={period:0,probability:.5,accumulated:0,active:false};var IOSR_ID=4352;var IOCR_ID=4356;var IODR_ID=4360;sim.poc.internal_states.io_hash[IOSR_ID]="IOSR";sim.poc.internal_states.io_hash[IOCR_ID]="IOCR";sim.poc.internal_states.io_hash[IODR_ID]="IODR";sim.poc.states.IOSR={name:"IOSR",verbal:"IO State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.IOCR={name:"IOCR",verbal:"IO Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.IODR={name:"IODR",verbal:"IO Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.signals.INT={name:"INT",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE C","FIRE C"],fire_name:["svg_p:tspan4199"],draw_data:[[],["svg_p:path3809"]],draw_name:[[],[]]};sim.poc.signals.IORDY={name:"IORDY",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE_IFCHANGED IORDY C","FIRE_IFCHANGED IORDY C"],fire_name:["svg_p:tspan4089","svg_p:path3793","svg_p:tspan4089"],draw_data:[[],["svg_p:path3897"]],draw_name:[[],[]]};sim.poc.signals.IO_IOR={name:"IO_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","IO_IOR BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE M1"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.signals.IO_IOW={name:"IO_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","IO_IOW BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE M1"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.signals.IO_IE={name:"IO_IE",visible:true,type:"L",value:1,default_value:1,nbits:"1",behavior:["NOP","IO_CHK_I CLK INT INTV; FIRE C"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.poc.signals.INTA={name:"INTA",visible:true,type:"L",value:1,default_value:0,nbits:"1",behavior:["NOP","INTA CLK INT INTA BUS_DB INTV; FIRE M1; FIRE C"],fire_name:["svg_p:text3785-0-6-0-5-5-1-1"],draw_data:[[],["svg_p:path3807","svg_p:path3737"]],draw_name:[[],[]]};sim.poc.behaviors.IO_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==IOSR_ID)set_value(sim.poc.states[s_expr[2]],iosr);if(bus_ab==IOCR_ID)set_value(sim.poc.states[s_expr[2]],iocr);if(bus_ab==IODR_ID)set_value(sim.poc.states[s_expr[2]],iodr)},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==IOSR_ID)verbal="I/O device read at IOSR of value "+iosr+". ";if(bus_ab==IOCR_ID)verbal="I/O device read at IOCR of value "+iocr+". ";if(bus_ab==IODR_ID)verbal="I/O device read at IODR of value "+iodr+". ";return verbal}};sim.poc.behaviors.IO_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab!=IOSR_ID&&bus_ab!=IOCR_ID&&bus_ab!=IODR_ID){return}if(bus_ab==IOSR_ID)set_value(sim.poc.states[s_expr[3]],bus_db);if(bus_ab==IOCR_ID)set_value(sim.poc.states[s_expr[4]],bus_db);if(bus_ab==IODR_ID)set_value(sim.poc.states[s_expr[5]],bus_db);var iocr_id=get_value(sim.poc.states[s_expr[4]]);var iodr_id=get_value(sim.poc.states[s_expr[5]]);if(iocr_id<0||iocr_id>7)return;set_var(sim.poc.internal_states.io_int_factory[iocr_id].period,iodr_id);set_var(sim.poc.internal_states.io_int_factory[iocr_id].probability,1);if(0==iodr_id)set_var(sim.poc.internal_states.io_int_factory[iocr_id].probability,0)},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab==IOSR_ID)verbal="I/O device write at IOSR with value "+bus_db+". ";if(bus_ab==IOCR_ID)verbal="I/O device write at IOCR with value "+bus_db+". ";if(bus_ab==IODR_ID)verbal="I/O device write at IODR with value "+bus_db+". ";return verbal}};sim.poc.behaviors.IO_CHK_I={nparameters:4,types:["E","S","E"],operation:function(s_expr){var clk=get_value(sim.poc.states[s_expr[1]]);for(var i=sim.poc.internal_states.io_int_factory.length-1;i>=0;i--){if(get_var(sim.poc.internal_states.io_int_factory[i].period)==0)continue;if(get_var(sim.poc.internal_states.io_int_factory[i].active)==true){set_value(sim.poc.signals[s_expr[2]],1);set_value(sim.poc.states[s_expr[3]],i)}if(clk%get_var(sim.poc.internal_states.io_int_factory[i].period)==0){if(Math.random()>get_var(sim.poc.internal_states.io_int_factory[i].probability))continue;set_var(sim.poc.internal_states.io_int_factory[i].accumulated,get_var(sim.poc.internal_states.io_int_factory[i].accumulated)+1);set_var(sim.poc.internal_states.io_int_factory[i].active,true);if(typeof sim.poc.events.io[clk]=="undefined")sim.poc.events.io[clk]=[];sim.poc.events.io[clk].push(i);set_value(sim.poc.signals[s_expr[2]],1);set_value(sim.poc.states[s_expr[3]],i)}}},verbal:function(s_expr){return"Check I/O Interruption. "}};sim.poc.behaviors.INTA={nparameters:6,types:["E","S","S","E","E"],operation:function(s_expr){var clk=get_value(sim.poc.states[s_expr[1]]);if(typeof sim.poc.events.io[clk]!="undefined"){set_value(sim.poc.states[s_expr[4]],sim.poc.events.io[clk][0]);return}set_value(sim.poc.signals[s_expr[2]],0);set_value(sim.poc.states[s_expr[5]],0);for(var i=0;i>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("L3DR"),1);compute_behavior("FIRE L3DR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("L3DW"),1);compute_behavior("FIRE L3DW");return value}};sim.poc.internal_states.l3d_dim=4;sim.poc.internal_states.l3d_neltos=Math.pow(sim.poc.internal_states.l3d_dim,3);sim.poc.internal_states.l3d_state=Array.from({length:sim.poc.internal_states.l3d_neltos},(()=>({active:false})));sim.poc.internal_states.l3d_frame="0".repeat(sim.poc.internal_states.l3d_neltos);var L3DSR_ID=8448;var L3DCR_ID=8452;var L3DDR_ID=8456;sim.poc.internal_states.io_hash[L3DSR_ID]="L3DSR";sim.poc.internal_states.io_hash[L3DCR_ID]="L3DCR";sim.poc.internal_states.io_hash[L3DDR_ID]="L3DDR";sim.poc.states.L3DSR={name:"L3DSR",verbal:"L3D State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.L3DCR={name:"L3DCR",verbal:"L3D Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.L3DDR={name:"L3DDR",verbal:"L3D Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.signals.L3D_IOR={name:"L3D_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","L3D_IOR BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE M1"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.signals.L3D_IOW={name:"L3D_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","L3D_IOW BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE M1; L3D_SYNC"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.behaviors.L3D_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==L3DCR_ID){set_value(sim.poc.states[s_expr[2]],iocr)}if(bus_ab==L3DDR_ID){set_value(sim.poc.states[s_expr[2]],iodr)}if(bus_ab==L3DCR_ID){var x=(iodr&4278190080)>>24;var y=(iodr&16711680)>>16;var z=(iodr&65280)>>8;var p=z*Math.pow(sim.poc.internal_states.l3d_dim,2)+y*sim.poc.internal_states.l3d_dim+x;var s=get_var(sim.poc.internal_states.l3d_state[p].active);set_value(sim.poc.states[s_expr[2]],s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==L3DSR_ID)verbal="I/O device read at L3DSR of value "+iosr+". ";if(bus_ab==L3DCR_ID)verbal="I/O device read at L3DCR of value "+iocr+". ";if(bus_ab==L3DDR_ID)verbal="I/O device read at L3DDR of value "+iodr+". ";return verbal}};sim.poc.behaviors.L3D_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab!=L3DSR_ID&&bus_ab!=L3DCR_ID&&bus_ab!=L3DDR_ID){return}if(bus_ab==L3DSR_ID){set_value(sim.poc.states[s_expr[3]],bus_db)}if(bus_ab==L3DDR_ID){set_value(sim.poc.states[s_expr[5]],bus_db)}if(bus_ab==L3DCR_ID){set_value(sim.poc.states[s_expr[4]],bus_db);var x=(bus_db&4278190080)>>24;var y=(bus_db&16711680)>>16;var z=(bus_db&65280)>>8;var p=z*Math.pow(sim.poc.internal_states.l3d_dim,2)+y*sim.poc.internal_states.l3d_dim+x;var s=(bus_db&255)!=0;var l3dstates=sim.poc.internal_states.l3d_state;set_var(l3dstates[p].active,s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab==L3DSR_ID)verbal="I/O device write at L3DSR with value "+bus_db+". ";if(bus_ab==L3DCR_ID)verbal="I/O device write at L3DCR with value "+bus_db+". ";if(bus_ab==L3DDR_ID)verbal="I/O device write at L3DDR with value "+bus_db+". ";return verbal}};sim.poc.behaviors.L3D_RESET={nparameters:1,operation:function(s_expr){sim.poc.events.l3d={};var n=sim.poc.internal_states.l3d_state.length;for(var i=0;i>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("LEDMR"),1);compute_behavior("FIRE LEDMR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("LEDMW"),1);compute_behavior("FIRE LEDMW");return value}};sim.poc.internal_states.ledm_dim=24;sim.poc.internal_states.ledm_neltos=Math.pow(sim.poc.internal_states.ledm_dim,2);sim.poc.internal_states.ledm_state=Array.from({length:sim.poc.internal_states.ledm_neltos},(()=>({color:0})));sim.poc.internal_states.ledm_colors=colors_clone("");sim.poc.internal_states.ledm_frame="0".repeat(sim.poc.internal_states.ledm_neltos);var LEDMSR_ID=12544;var LEDMCR_ID=12548;var LEDMDR_ID=12552;sim.poc.internal_states.io_hash[LEDMSR_ID]="LEDMSR";sim.poc.internal_states.io_hash[LEDMCR_ID]="LEDMCR";sim.poc.internal_states.io_hash[LEDMDR_ID]="LEDMDR";sim.poc.states.LEDMSR={name:"LEDMSR",verbal:"LEDM State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.LEDMCR={name:"LEDMCR",verbal:"LEDM Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.LEDMDR={name:"LEDMDR",verbal:"LEDM Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.signals.LEDM_IOR={name:"LEDM_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","LEDM_IOR BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE M1"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.signals.LEDM_IOW={name:"LEDM_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","LEDM_IOW BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE M1; LEDM_SYNC"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.behaviors.LEDM_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==LEDMCR_ID){set_value(sim.poc.states[s_expr[2]],iocr)}if(bus_ab==LEDMDR_ID){set_value(sim.poc.states[s_expr[2]],iodr)}if(bus_ab==LEDMCR_ID){var x=(iodr&4278190080)>>24;var y=(iodr&16711680)>>16;var p=y*sim.poc.internal_states.ledm_dim+x;var s=get_var(sim.poc.internal_states.ledm_state[p].color);set_value(sim.poc.states[s_expr[2]],s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==LEDMSR_ID)verbal="I/O device read at LEDMSR of value "+iosr+". ";if(bus_ab==LEDMCR_ID)verbal="I/O device read at LEDMCR of value "+iocr+". ";if(bus_ab==LEDMDR_ID)verbal="I/O device read at LEDMDR of value "+iodr+". ";return verbal}};sim.poc.behaviors.LEDM_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);switch(bus_ab){case LEDMSR_ID:set_value(sim.poc.states[s_expr[3]],bus_db);break;case LEDMDR_ID:set_value(sim.poc.states[s_expr[5]],bus_db);break;case LEDMCR_ID:set_value(sim.poc.states[s_expr[4]],bus_db);break;default:break}if(LEDMCR_ID==bus_ab){var dr=get_value(sim.poc.states[s_expr[5]]);if(16&bus_db){var x=(dr&4278190080)>>24;var y=(dr&16711680)>>16;var s=dr&255;set_value(sim.poc.states[s_expr[3]],1);if(x>=sim.poc.internal_states.ledm_dim&&y>=sim.poc.internal_states.ledm_dim){set_value(sim.poc.states[s_expr[3]],-1);return}var p=y*sim.poc.internal_states.ledm_dim+x;set_var(sim.poc.internal_states.ledm_state[p].color,s)}if(32&bus_db){set_value(sim.poc.states[s_expr[3]],1);var s=0;var neltos=sim.poc.internal_states.ledm_neltos;var ldmstates=sim.poc.internal_states.ledm_state;for(var p=0;p>0);set_var(sim.poc.internal_states.ledm_state[p+1].color,(s&65280)>>8);set_var(sim.poc.internal_states.ledm_state[p+2].color,(s&16711680)>>16);set_var(sim.poc.internal_states.ledm_state[p+3].color,(s&4278190080)>>24)}}if(64&bus_db){set_value(sim.poc.states[s_expr[3]],1);var s=0;var c="";var neltos=sim.poc.internal_states.ledm_colors.length;for(var p=0;p>>8;s=s.toString(16);c="#"+simcoreui_pack(s,6);sim.poc.internal_states.ledm_colors[p]=c}neltos=sim.poc.internal_states.ledm_neltos;for(var p=0;p>24;var y=(dr&16711680)>>16;var s=dr&255;verbal="I/O device write at LEDMCR with value "+bus_db+" (set pixel x:"+x+", y:"+y+", with color:"+s+"). "}if(64&bus_db){verbal="I/O device write at LEDMCR with value "+bus_db+" (set color palette at:"+bus_db+"). "}break;default:break}return verbal}};sim.poc.behaviors.LEDM_RESET={nparameters:1,operation:function(s_expr){sim.poc.events.ledm={};sim.poc.internal_states.ledm_colors=colors_clone("");for(var i=0;i0)line2=context.newlines[context.newlines.length-1]+1;var line1=0;if(context.newlines.length>1)line1=context.newlines[context.newlines.length-2]+1;var lowI=line1;var highI=Math.min(context.t-1,line2+32);for(;typeof context.text[highI+1]!="undefined"&&context.text[highI+1]!="\n";highI++);var line3=highI+2;highI++;for(;typeof context.text[highI+1]!="undefined"&&context.text[highI+1]!="\n";highI++);highI++;context.error="
"+"
"+"...\n";for(var i=lowI;i"+"(*) "+i18n_get_TagFor("compiler","PROBLEM AROUND LINE")+" "+context.line+": 
"+msgError+".
";simcore_ga("compile","compile.error","compile.error."+msgError);return context}function frm_getLabelContext(context){return{t:context.t,line:context.line,newlines:context.newlines.slice()}}function frm_setLabelContext(context,labelContext){context.t=labelContext.t;context.line=labelContext.line;context.newlines=labelContext.newlines}function frm_getComments(context){return context.comments.join("\n")}function frm_resetComments(context){context.comments=[]}function frm_nextNative(context){var first=context.t;var last=context.t;var braces=1;while(context.t=Math.pow(2,simhw_sim_signal(nombre_tok).nbits)){return frm_langError(context,i18n_get_TagFor("compiler","OUT OF RANGE")+"'"+frm_getToken(context)+"'")}frm_nextToken(context)}if(frm_isToken(context,",")){frm_nextToken(context)}}var acc_cmt=frm_getComments(context);microcomments.push(acc_cmt);frm_resetComments(context);microprograma.push(microInstruccionAux);context.contadorMC++;frm_nextToken(context);if(frm_isToken(context,","))frm_nextToken(context)}if(microprograma.length===0){return frm_langError(context,i18n_get_TagFor("compiler","EMPTY MICROCODE"))}frm_nextToken(context);return{NATIVE:"",microprograma:microprograma,microcomments:microcomments}}function read_native(context){var microprograma=[];var microcomments=[];if(!frm_isToken(context,"{")){return frm_langError(context,i18n_get_TagFor("compiler","OPEN BRACE NOT FOUND"))}frm_nextNative(context);var native_code=frm_getToken(context);microprograma.push({});microcomments.push("");frm_nextToken(context);return{NATIVE:native_code,microprograma:microprograma,microcomments:microcomments}}function firm_begin_read(context){var instruccionAux={};instruccionAux.name=frm_getToken(context);instruccionAux["mc-start"]=context.contadorMC;instruccionAux["is_native"]=false;frm_nextToken(context);if(frm_isToken(context,",")){frm_nextToken(context)}if(frm_isToken(context,"native")){instruccionAux["is_native"]=true;frm_nextToken(context);if(frm_isToken(context,",")){frm_nextToken(context)}context.etiquetas[context.contadorMC]="fetch"}if(true==instruccionAux.is_native)ret=read_native(context);else ret=firm_mcode_signals_read(context);if(typeof ret.error!="undefined"){return ret}instruccionAux.signature="begin";instruccionAux.signatureGlobal="begin";instruccionAux.signatureUser="begin";instruccionAux.signatureRaw="begin";instruccionAux.NATIVE=ret.NATIVE;instruccionAux.microcode=ret.microprograma;instruccionAux.microcomments=ret.microcomments;context.instrucciones.push(instruccionAux);context.contadorMC=context.contadorMC+9;return{}}function firm_pseudoinstructions_read(context){frm_nextToken(context);if(!frm_isToken(context,"{")){return frm_langError(context,i18n_get_TagFor("compiler","OPEN BRACE NOT FOUND"))}frm_nextToken(context);while(!frm_isToken(context,"}")){var pseudoInstructionAux={};var pseudoInitial={};pseudoInitial.signature="";pseudoInitial.name="";pseudoInitial.fields=[];pseudoInitial.name=frm_getToken(context);pseudoInitial.signature=pseudoInitial.signature+frm_getToken(context)+",";frm_nextToken(context);while(!frm_isToken(context,"{")){var pseudoFieldAux={};pseudoFieldAux.name="";pseudoFieldAux.type="";pseudoFieldAux.indirect=false;if(frm_isToken(context,"(")){frm_nextToken(context);pseudoFieldAux.name+=frm_getToken(context);frm_nextToken(context);if(!frm_isToken(context,")")){return frm_langError(context,i18n_get_TagFor("compiler","CLOSE PAREN. NOT FOUND"))}frm_nextToken(context);pseudoFieldAux.indirect=true}else{pseudoFieldAux.name+=frm_getToken(context);frm_nextToken(context)}if(!frm_isToken(context,"=")){return frm_langError(context,i18n_get_TagFor("compiler","EQUAL NOT FOUND")+" (for name=type)")}frm_nextToken(context);pseudoFieldAux.type+=frm_getToken(context).replace("num","inm");switch(pseudoFieldAux.type){case"reg":case"inm":case"addr":case"address":break;default:return frm_langError(context,i18n_get_TagFor("compiler","INVALID PARAMETER")+pseudoFieldAux.type+"."+i18n_get_TagFor("compiler","ALLOWED PARAMETER"))}pseudoInitial.fields.push(pseudoFieldAux);if(pseudoFieldAux.indirect==true)pseudoInitial.signature+="("+frm_getToken(context)+"),";else pseudoInitial.signature+=frm_getToken(context)+",";frm_nextToken(context);if(frm_isToken(context,",")){frm_nextToken(context)}}frm_nextToken(context);pseudoInitial.signature=pseudoInitial.signature.substr(0,pseudoInitial.signature.length-1).replace(/num/g,"inm");pseudoInstructionAux.initial=pseudoInitial;var contPseudoFinish=0;var pseudoFinishAux={};pseudoFinishAux.signature="";var inStart=0;var cont=false;while(!frm_isToken(context,"}")){if(inStart==0){for(i=0;i32*parseInt(instruccionAux.nwords)-1){return frm_langError(context,i18n_get_TagFor("compiler","STARTBIT OoR")+"'"+frm_getToken(context)+"'")}frm_nextToken(context);if(!frm_isToken(context,",")){return frm_langError(context,i18n_get_TagFor("compiler","COMMA NOT FOUND"))}frm_nextToken(context);instruccionAux.fields[camposInsertados].stopbit=frm_getToken(context);var stop=parseInt(instruccionAux.fields[camposInsertados].stopbit);if(stop>32*parseInt(instruccionAux.nwords)){return frm_langError(context,i18n_get_TagFor("compiler","STOPBIT OoR")+"'"+frm_getToken(context)+"'")}for(i=stop;i<=start;i++){if(typeof instruccionAux.overlapping[i]!="undefined"){return frm_langError(context,i18n_get_TagFor("compiler","OVERLAPPING FIELD")+instruccionAux.fields[camposInsertados].name)}instruccionAux.overlapping[i]=1}frm_nextToken(context);if(!frm_isToken(context,")")){return frm_langError(context,i18n_get_TagFor("compiler","CLOSE PAREN. NOT FOUND"))}frm_nextToken(context);if(instruccionAux.fields[camposInsertados].type=="address"){if(frm_getToken(context)!="abs"&&frm_getToken(context)!="rel"){return frm_langError(context,i18n_get_TagFor("compiler","INCORRECT ADDRESSING"))}instruccionAux.fields[camposInsertados].address_type=frm_getToken(context);frm_nextToken(context)}if(frm_isToken(context,",")){frm_nextToken(context)}return{}}function firm_instruction_read_fixed_fields(context,instruccionAux,xr_info,all_ones_co){var ret={};frm_nextToken(context);if(!frm_isToken(context,"co")){return frm_langError(context,i18n_get_TagFor("compiler","NO CO FIELD"))}ret=firm_instruction_co_read(context,instruccionAux,xr_info,all_ones_co);if(typeof ret.error!="undefined"){return ret}if(frm_isToken(context,"cop")){ret=firm_instruction_cop_read(context,instruccionAux);if(typeof ret.error!="undefined"){return ret}}if(frm_isToken(context,"nwords")){ret=firm_instruction_nword_read(context,instruccionAux);if(typeof ret.error!="undefined"){return ret}}var campos=instruccionAux.fields;var firma=instruccionAux.signature;var firmaUsuario=instruccionAux.signatureUser;var firmaGlobal=instruccionAux.signatureGlobal;var camposInsertados=0;while(camposInsertados32*parseInt(instruccionAux.nwords)-1){return frm_langError(context,i18n_get_TagFor("compiler","STARTBIT OoR")+"'"+frm_getToken(context)+"'")}frm_nextToken(context);if(!frm_isToken(context,":")){return frm_langError(context,i18n_get_TagFor("compiler","COLON NOT FOUND"))}frm_nextToken(context);tmp_fields.stopbit=frm_getToken(context);var stop=parseInt(tmp_fields.stopbit);if(stop>32*parseInt(instruccionAux.nwords)){return frm_langError(context,i18n_get_TagFor("compiler","STOPBIT OoR")+"'"+frm_getToken(context)+"'")}frm_nextToken(context);if(!frm_isToken(context,")")){return frm_langError(context,i18n_get_TagFor("compiler","CLOSE PAREN. NOT FOUND"))}frm_nextToken(context);if(!frm_isToken(context,"=")){return frm_langError(context,i18n_get_TagFor("compiler","EQUAL NOT FOUND"))}frm_nextToken(context);var tmp_name=frm_getToken(context);if(["oc","cop","funct"].includes(tmp_fields.type)){tmp_fields.value=tmp_name}else{tmp_fields.name=tmp_name;var index_name=-1;for(var i=0;i100){return frm_langError(context,i18n_get_TagFor("compiler","MORE 100 FIELDS"))}if(auxValue=="co"){return frm_langError(context,i18n_get_TagFor("compiler","CO AS FIELD NAME"))}if(auxValue=="nwords"){return frm_langError(context,i18n_get_TagFor("compiler","NW AS FIELD NAME"))}}if(frm_isToken(context,"(")){firma=firma+",(";if(plus_found)firmaUsuario=firmaUsuario+"+(";else firmaUsuario=firmaUsuario+" (";frm_nextToken(context);if(!frm_isToken(context,",")&&!frm_isToken(context,"(")&&!frm_isToken(context,")")){var campoAux={};campoAux.name=frm_getToken(context);instruccionAux.fields.push(campoAux);instruccionAux.numeroCampos++;firma=firma+frm_getToken(context);firmaUsuario=firmaUsuario+frm_getToken(context);frm_nextToken(context)}else{return frm_langError(context,i18n_get_TagFor("compiler","MISSING TOKEN ON")+"'"+context.co_cop[instruccionAux.co].signature+"'")}if(frm_isToken(context,")")){firma=firma+")";firmaUsuario=firmaUsuario+")";frm_nextToken(context)}else{return frm_langError(context,i18n_get_TagFor("compiler","MISSING ) ON")+"'"+context.co_cop[instruccionAux.co].signature+"'")}}firma=firma+",";firmaUsuario=firmaUsuario+" "}firma=firma.substr(0,firma.length-1);firma=firma.replace(/,,/g,",");firmaUsuario=firmaUsuario.substr(0,firmaUsuario.length-1);firmaUsuario=firmaUsuario.replace(/ /g," ");instruccionAux.signature=firma;instruccionAux.signatureGlobal=firma;instruccionAux.signatureUser=firmaUsuario;instruccionAux.signatureRaw=firmaUsuario;if(2==context.version){ret=firm_instruction_read_fields_v2(context,instruccionAux,xr_info,all_ones_co)}else{ret=firm_instruction_read_fixed_fields(context,instruccionAux,xr_info,all_ones_co)}if(typeof ret.error!="undefined"){return ret}ret={};if(true==instruccionAux.is_native)ret=read_native(context);else ret=firm_mcode_signals_read(context);if(typeof ret.error!="undefined")return ret;instruccionAux.NATIVE=ret.NATIVE;instruccionAux.microcode=ret.microprograma;instruccionAux.microcomments=ret.microcomments;context.instrucciones.push(instruccionAux);context.contadorMC=context.contadorMC+9;if(!frm_isToken(context,"}")){return frm_langError(context,i18n_get_TagFor("compiler","CLOSE BRACE NOT FOUND"))}frm_nextToken(context);return{}}function simlang_native_adapt_replaceSyscall(icode){var rc="";var me="";var ff="capi_print_char|capi_print_int|capi_print_float|capi_print_double|capi_print_string|"+"capi_read_char|capi_read_int|capi_read_float|capi_read_double|capi_read_string|"+"capi_sbrk|capi_exit";var re=new RegExp("("+ff+")\\(([^)]*)\\)","g");var match=re.exec(icode);while(match!==null){var f=match[1].trim();var p=match[2].trim().split(",");switch(f){case"capi_print_char":rc="// "+f+" \n"+"\tvar tmp1 = 0x000000FF & "+p[0]+" ;\n"+"\tset_screen_content(tmp1.toString()) ;\n";break;case"capi_print_int":rc="// "+f+" \n"+"\tset_screen_content("+p[0]+".toString()) ;\n";break;case"capi_print_float":rc="// "+f+" \n"+"\tvar tmp1 = hex2float("+p[0]+") ;\n"+"\tset_screen_content(tmp1.toString()) ;\n";break;case"capi_print_double":rc="// "+f+" \n"+"\tvar tmp1 = hex2float("+p[0]+") ;\n"+"\tset_screen_content(tmp1.toString()) ;\n";break;case"capi_print_string":rc="// "+f+" \n"+'\tvar tmp1 = "" ;\n'+'\tvar tmp2 = simcore_native_get_value("MEMORY", '+p[0]+") ;\n"+"\tfor (var k="+p[0]+"+1; (tmp2 !== 0) && (k<8*1024); k++) {\n"+"\t tmp1 += tmp2.toString() ;\n"+'\t tmp2 = simcore_native_get_value("MEMORY", k) ;\n'+"\t} ;\n"+"\tset_screen_content(tmp1) ;\n";break;case"capi_read_char":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tvar "+p[0]+" = 0x000000FF & parseInt(tmp1) ;\n";break;case"capi_read_int":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tvar "+p[0]+" = parseInt(tmp1) ;\n";break;case"capi_read_float":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tvar "+p[0]+" = parseFloat(tmp1) ;\n";break;case"capi_read_double":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tvar "+p[0]+" = parseFloat(tmp1) ;\n";break;case"capi_read_string":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tfor (var k=0; k<"+p[1]+"; k++) {\n"+'\t simcore_native_set_value("MEMORY", '+p[0]+"+k, tmp1[k]) ;\n"+"\t} ;\n";break;case"capi_sbrk":rc="// "+f+" \n"+"// TODO: _sbrk_("+p[0]+", "+p[1]+");\n";break;case"capi_exit":rc="// "+f+" \n"+"// exit by setting P.C. register outside text segment\n"+"\tvar pc_name = simhw_sim_ctrlStates_get().pc.state ;\n"+'\tsimcore_native_set_value("CPU", pc_name, 0x00000000) ;\n';break;default:rc="// "+f+" \n"+"// unknown syscall\n";break}me=new RegExp(f+"\\(([^)]*)\\)","g");icode=icode.replace(me,rc);match=re.exec(icode)}return icode}function simlang_native_adapt_provideRegister(icode,reg_log,rf_phy,reg_phy){var re=new RegExp(reg_log,"g");if(icode.search(re)!=-1){icode="var "+reg_log+" = simcore_native_get_value('"+rf_phy+"', "+reg_phy+") ;\n"+icode+"\n"+"simcore_native_set_value('"+rf_phy+"', "+reg_phy+", "+reg_log+") ;\n"}return icode}function simlang_native_adapt_providePC(icode){var re=/PC/g;if(icode.search(re)!=-1){icode="var pc_name = simhw_sim_ctrlStates_get().pc.state ;\n"+"var PC = simcore_native_get_value('CPU', pc_name) ;\n"+icode+"simcore_native_set_value('CPU', pc_name, PC) ;\n"}return icode}function simlang_native_adapt_replaceIf(icode){var re=new RegExp("[iI][fF]\\s*\\(([^\\\\)]*)\\)\\s*{([^\\\\}]*)}\\s*[eE][lL][sS][eE]{[^}]*}\\s*","g");if(icode.search(re)!=-1){var match=re.exec(icode);try{icode=icode.replace(re,"\n")}catch(e){console.log("Syntax error that cause a run-time error: "+e.toString());console.log(match)}}return icode}function simlang_native_adapt_addInitialTabTab(lines_code){var code_lines;code_lines=lines_code.split("\n");code_lines=code_lines.map((function(x){return"\t\t"+x}));return code_lines.join("\n")}function simlang_native_adapt_instructionDefinition(lines_code){var code_lines=lines_code.split(";");if(code_lines.length===1&&!lines_code.trim().startsWith("if")){lines_code=lines_code+";\n"}lines_code=simlang_native_adapt_replaceSyscall(lines_code);lines_code=simlang_native_adapt_provideRegister(lines_code,"HI","CPU","'REG_RT2'");lines_code=simlang_native_adapt_provideRegister(lines_code,"LO","CPU","'REG_RT1'");lines_code=simlang_native_adapt_provideRegister(lines_code,"ra","BR","31");lines_code=simlang_native_adapt_providePC(lines_code);lines_code=simlang_native_adapt_addInitialTabTab(lines_code);return lines_code}function simlang_native_adapt_getField(j,rf,reg){return"\t\t"+"var f_"+reg+" = "+"simcore_native_get_field_from_ir(fields, "+j+") ;\n"+"\t\t"+"var "+reg+" = "+"simcore_native_get_value('"+rf+"', f_"+reg+") ;\n"}function simlang_native_adapt_setField(j,rf,reg){return"\t\t"+"simcore_native_set_value('"+rf+"', f_"+reg+", "+reg+");\n"}function simlang_native_adapt_headerField(fname,tname,start,stop){return"\t"+tname+"("+start+":"+stop+")="+fname+",\n"}function simlang_native_beginMicrocode(){var o="";o+="\n"+"#\n"+"# WepSIM (https://wepsim.github.io/wepsim/)\n"+"#\n"+"\n"+"firmware_version = 2\n"+"\n"+"##\n"+"## Microcode Section\n"+"##\n"+"\n"+"begin,\n"+"native\n"+"{\n"+" // (once) initialize BR2 as FP register file\n"+' if (typeof BR2 === "undefined")\n'+" {\n"+" BR2 = [] ;\n"+" FCSR = 0 ;\n"+" for (var i=0; i<32; i++)\n"+" {\n"+" BR2[i] = {\n"+' name:"R"+i,\n'+' verbal:"Register "+i,\n'+" visible:true,\n"+' nbits:"32",\n'+" value:0,\n"+" default_value:0,\n"+" draw_data:[]\n"+" } ;\n"+" }\n"+" }\n"+"\n"+" // fetch\n"+' var addr = simcore_native_get_value("CPU", "REG_PC") ;\n'+' var value = simcore_native_get_value("MEMORY", addr) ;\n'+"\n"+' simcore_native_set_value("CPU", "REG_IR", value) ;\n'+' simcore_native_set_value("CPU", "REG_PC", addr + 4) ;\n'+"\n"+" simcore_native_deco() ;\n"+" simcore_native_go_opcode() ;\n"+"}\n";return o}function simlang_native_adapt_instructionSet(instruction_list){var o="";var gfields=[];var sfields=[];var hfields=[];var io={};var line_signature="";var signature_names="";var signature_order="";for(var i=0;i> 32);\n"+"\t\t "+io.fields[j].name+"2 = "+io.fields[j].name+" >> 32;\n"+"\t\t"+"simcore_native_set_value('BR2', "+"f_"+io.fields[j].name+"+0, "+io.fields[j].name+"1);\n"+"\t\t"+"simcore_native_set_value('BR2', "+"f_"+io.fields[j].name+"+1, "+io.fields[j].name+"2);\n";break;case"inm":hfields[k]=simlang_native_adapt_headerField(io.fields[j].name,"inm",io.fields[j].startbit,io.fields[j].stopbit);gfields[k]="\t\t"+"var "+io.fields[j].name+" = "+"simcore_native_get_field_from_ir(fields, "+(k-1)+") ;\n\t";break}}var co_cop="\t"+"co=111111,"+"\n";var lines_code=simlang_native_adapt_instructionDefinition(io.definition);if(lines_code.trim()!==""){lines_code="\t\t"+"// instruction specific code"+"\n"+lines_code+"\n"}var gfields_str=gfields.join("");if(gfields_str.trim()!==""){gfields_str="\t\t"+"// get fields values..."+"\n"+gfields_str+"\n"}var sfields_str=sfields.join("");if(sfields_str.trim()!==""){sfields_str="\t\t"+"// set fields values..."+"\n"+sfields_str+"\n"}o+="\n"+line_signature+" {"+"\n"+co_cop+"\t"+"nwords="+io.nwords+","+"\n"+hfields.join("")+"\t"+"native,"+"\n"+"\t"+"{\n"+gfields_str+"\n"+lines_code+"\n"+sfields_str+"\n"+"\t\t"+"// go fetch"+"\n"+"\t\t"+"simcore_native_go_maddr(0);"+"\n"+"\t"+"}"+"\n"+"}\n"}return o}function simlang_native_registerSection(register_list){var o="";var d="";var index=0;for(index=0;index=last_co){return frm_langError(context,i18n_get_TagFor("compiler","NO CO CODES"))}first_co=parseInt(r.label_co,2);curr_instruction.co=r.label_co;context.co_cop[r.label_co].signature=curr_instruction.signature;if(r.label_cop!==""){curr_instruction.cop=r.label_cop;context.co_cop[r.label_co].cop[r.label_cop]=curr_instruction.signature;context.co_cop[r.label_co].withcop=true}}var labelsFounded=0;if(context.labelsNotFound.length>0){for(i=0;i0){for(var j=0;j0){file+="registers"+"\n{\n";for(i=0;i0)line2=context.newlines[context.newlines.length-1]+1;var line1=0;if(context.newlines.length>1)line1=context.newlines[context.newlines.length-2]+1;var lowI=line1;var highI=Math.min(context.t-1,line2+32);for(;typeof context.text[highI+1]!="undefined"&&context.text[highI+1]!="\n";highI++);var line3=highI+2;highI++;for(;typeof context.text[highI+1]!="undefined"&&context.text[highI+1]!="\n";highI++);highI++;context.error="
"+"
"+"...\n";for(var i=lowI;i"+"(*) "+i18n_get_TagFor("compiler","PROBLEM AROUND LINE")+" "+context.line+": 
"+msgError+".
";simcore_ga("compile","compile.error","compile.error."+msgError);return context}function asm_getLabelContext(context){return{t:context.t,line:context.line,newlines:context.newlines.slice()}}function asm_setLabelContext(context,labelContext){context.t=labelContext.t;context.line=labelContext.line;context.newlines=labelContext.newlines}function asm_getComments(context){return context.comments.join("\n")}function asm_resetComments(context){context.comments=[]}sim_segments={".kdata":{name:".kdata",begin:0,end:255,color:"#FF99CC",kindof:"data"},".ktext":{name:".ktext",begin:256,end:4095,color:"#A9D0F5",kindof:"text"},".data":{name:".data",begin:4096,end:32767,color:"#FACC2E",kindof:"data"},".text":{name:".text",begin:32768,end:131071,color:"#BEF781",kindof:"text"},".stack":{name:".stack",begin:131071,end:1048576,color:"#F1F2A3",kindof:"stack"}};function segments_addr_within_text(address){return address>=sim_segments[".text"].begin&&address<=sim_segments[".text"].end||address>=sim_segments[".ktext"].begin&&address<=sim_segments[".ktext"].end}function segments_addr_within_data(address){return address>=sim_segments[".data"].begin&&address<=sim_segments[".data"].end||address>=sim_segments[".kdata"].begin&&address<=sim_segments[".kdata"].end}BYTE_LENGTH=8;WORD_BYTES=4;WORD_LENGTH=WORD_BYTES*BYTE_LENGTH;function isDecimal(n){var ret={number:0,isDecimal:false};if(n.length>1&&n[0]=="0"){return ret}if(typeof n==="string"&&n.includes(".")){return ret}if(!isNaN(parseFloat(n))&&isFinite(n)){ret.isDecimal=true;ret.number=parseInt(n);return ret}return ret}function isOctal(n){var ret={number:0,isDecimal:false};if(n.substring(0,1)=="0"){var octal=n.substring(1).replace(/\b0+/g,"");ret.number=parseInt(octal,8);ret.isDecimal=ret.number.toString(8)===octal;return ret}return ret}function isHex(n){var ret={number:0,isDecimal:false};if(n.substring(0,2).toLowerCase()=="0x"){var hex=n.substring(2).toLowerCase().replace(/\b0+/g,"");if(hex==""){hex="0"}ret.number=parseInt(hex,16);ret.isDecimal=ret.number.toString(16)===hex;return ret}return ret}function isChar(n){var ret={number:0,isDecimal:false};var ret1=treatControlSequences(n);if(true==ret1.error){return ret}var possible_value=ret1.string;if(possible_value[0]=="'"&&possible_value[2]=="'"||possible_value[0]=='"'&&possible_value[2]=='"'){ret.number=possible_value.charCodeAt(1);ret.isDecimal=true;return ret}return ret}function isFloat(n){var ret={number:0,isFloat:false};var non_float=/[a-df-zA-DF-Z]+/;if(non_float.test(n)===true){return ret}ret.number=parseFloat(n);ret.isFloat=!isNaN(ret.number);return ret}function get_decimal_value(possible_value){var ret={number:0,isDecimal:true};ret=isOctal(possible_value);if(ret.isDecimal===false){ret=isHex(possible_value)}if(ret.isDecimal===false){ret=isDecimal(possible_value)}if(ret.isDecimal===false){ret=isChar(possible_value)}return ret}function decimal2binary(number,size){var num_bits=number.toString(2);if(num_bits.length>WORD_LENGTH){return[num_bits,size-num_bits.length]}num_bits=(number>>>0).toString(2);if(number>=0){return[num_bits,size-num_bits.length]}num_bits="1"+num_bits.replace(/^[1]+/g,"");if(num_bits.length>size){return[num_bits,size-num_bits.length]}num_bits="1".repeat(size-num_bits.length)+num_bits;return[num_bits,size-num_bits.length]}function get_inm_value(value){var ret1={};var ret={number:0,isDecimal:false,isFloat:false};ret1=get_decimal_value(value);if(ret1.isDecimal==true){ret1.isFloat=false;return ret1}ret1=isFloat(value);if(ret1.isFloat==true){ret1.isDecimal=false;return ret1}return ret}directives={".kdata":{name:".kdata",kindof:"segment",size:0},".ktext":{name:".ktext",kindof:"segment",size:0},".data":{name:".data",kindof:"segment",size:0},".text":{name:".text",kindof:"segment",size:0},".byte":{name:".byte",kindof:"datatype",size:1},".half":{name:".half",kindof:"datatype",size:2},".word":{name:".word",kindof:"datatype",size:4},".float":{name:".float",kindof:"datatype",size:4},".double":{name:".double",kindof:"datatype",size:8},".ascii":{name:".ascii",kindof:"datatype",size:1},".asciiz":{name:".asciiz",kindof:"datatype",size:1},".space":{name:".space",kindof:"datatype",size:1},".string":{name:".string",kindof:"datatype",size:1},".zero":{name:".zero",kindof:"datatype",size:1},".align":{name:".align",kindof:"datatype",size:0}};function get_datatype_size(datatype){if(typeof directives[datatype]==="undefined"){console.log("ERROR: not defined datatype: "+datatype+"\n");return 0}return directives[datatype].size}function is_directive_kindof(text,kindof){if(typeof directives[text]==="undefined"){return false}return directives[text].kindof==kindof}function is_directive(text){return typeof directives[text]!=="undefined"}function is_directive_segment(text){return is_directive_kindof(text,"segment")}function is_directive_datatype(text){return is_directive_kindof(text,"datatype")}function isValidTag(tag){if(tag.trim()==""){return false}var ret=isDecimal(tag[0]);if(ret.isDecimal==true){return false}var myRegEx=/[^a-z,_\d]/i;return!myRegEx.test(tag)}function sum_array(a){return a.reduce((function(a,b){return a+b}),0)}function get_candidate(advance,instruction){var candidate=false;var candidates={};var signatures={};for(i=0;icandidates[i]){min=candidates[i];candidate=i}}}return candidate?parseInt(candidate):candidate}function reset_assembly(nwords){return"0".repeat(WORD_LENGTH*nwords)}function assembly_replacement(machineCode,num_bits,startbit,stopbit,free_space){var machineCodeAux=machineCode.substring(0,machineCode.length-startbit+free_space);machineCode=machineCodeAux+num_bits+machineCode.substring(machineCode.length-stopbit);return machineCode}function assembly_co_cop(machineCode,co,cop){var xr_info=simhw_sim_ctrlStates_get();if(co!==false)machineCode=assembly_replacement(machineCode,co,WORD_LENGTH,WORD_LENGTH-6,0);if(cop!==false)machineCode=assembly_replacement(machineCode,cop,xr_info.ir.default_eltos.cop.length,0,0);return machineCode}function writememory_and_reset(mp,gen,nwords){if(gen.byteWord>=WORD_BYTES){var melto={value:gen.machineCode,source_tracking:gen.track_source,comments:gen.comments};main_memory_set(mp,"0x"+gen.seg_ptr.toString(16),melto);gen.seg_ptr=gen.seg_ptr+WORD_BYTES;gen.byteWord=0;gen.track_source=[];gen.comments=[];gen.machineCode=reset_assembly(nwords)}}function is_end_of_file(context){return""===asm_getToken(context)&&context.t>=context.text.length}function read_data(context,datosCU,ret){var seg_name=asm_getToken(context);var gen={};gen.byteWord=0;gen.track_source=[];gen.comments=[];gen.machineCode=reset_assembly(1);gen.seg_ptr=ret.seg[seg_name].begin;asm_nextToken(context);while(!is_directive_segment(asm_getToken(context))&&!is_end_of_file(context)){var possible_tag="";while(!is_directive_datatype(asm_getToken(context))&&!is_end_of_file(context)){possible_tag=asm_getToken(context);if("TAG"!=asm_getTokenType(context)){if(""==possible_tag){possible_tag="[empty]"}return asm_langError(context,i18n_get_TagFor("compiler","NO TAG OR DIRECTIVE")+"'"+possible_tag+"'")}var tag=possible_tag.substring(0,possible_tag.length-1);if(!isValidTag(tag)){return asm_langError(context,i18n_get_TagFor("compiler","INVALID TAG FORMAT")+"'"+tag+"'")}if(context.firmware[tag]){return asm_langError(context,i18n_get_TagFor("compiler","TAG OR INSTRUCTION")+"'"+tag+"'")}if(ret.labels2[tag]){return asm_langError(context,i18n_get_TagFor("compiler","REPEATED TAG")+"'"+tag+"'")}ret.labels2[tag]="0x"+(gen.seg_ptr+gen.byteWord).toString(16);asm_nextToken(context)}if(is_end_of_file(context)){break}var possible_datatype=asm_getToken(context);if(".word"==possible_datatype||".half"==possible_datatype||".byte"==possible_datatype||".float"==possible_datatype||".double"==possible_datatype){var size=get_datatype_size(possible_datatype);asm_nextToken(context);var possible_value=asm_getToken(context);while(!is_directive(asm_getToken(context))&&!is_end_of_file(context)){var label_found=false;var ret1=get_inm_value(possible_value);var number=ret1.number;if(ret1.isDecimal==false&&ret1.isFloat==false){if(".word"!==possible_datatype){return asm_langError(context,i18n_get_TagFor("compiler","NO NUMERIC DATATYPE")+"'"+possible_value+"'")}if(!isValidTag(possible_value)){return asm_langError(context,i18n_get_TagFor("compiler","INVALID TAG FORMAT")+"'"+possible_value+"'")}if(context.firmware[possible_value]){return asm_langError(context,i18n_get_TagFor("compiler","TAG OR INSTRUCTION")+"'"+possible_value+"'")}number=0;label_found=true}if(ret1.isDecimal==true)a=decimal2binary(number,size*BYTE_LENGTH);else a=float2binary(number,size*BYTE_LENGTH);num_bits=a[0];free_space=a[1];if(free_space<0){return asm_langError(context,i18n_get_TagFor("compiler","EXPECTED VALUE")+possible_datatype+"' ("+size*BYTE_LENGTH+" bits), "+i18n_get_TagFor("compiler","BUT INSERTED")+possible_value+"' ("+num_bits.length+" bits) "+i18n_get_TagFor("compiler","INSTEAD"))}writememory_and_reset(ret.mp,gen,1);while((gen.seg_ptr+gen.byteWord)%size!=0){gen.byteWord++;writememory_and_reset(ret.mp,gen,1)}if(""!=possible_tag){ret.labels2[possible_tag.substring(0,possible_tag.length-1)]="0x"+(gen.seg_ptr+gen.byteWord).toString(16);possible_tag=""}if(label_found){ret.labels["0x"+gen.seg_ptr.toString(16)]={name:possible_value,addr:gen.seg_ptr,startbit:31,stopbit:0,rel:undefined,nwords:1,labelContext:asm_getLabelContext(context)}}gen.machineCode=assembly_replacement(gen.machineCode,num_bits,BYTE_LENGTH*(size+gen.byteWord),BYTE_LENGTH*gen.byteWord,free_space);gen.byteWord+=size;gen.track_source.push(possible_value);asm_nextToken(context);if(","==asm_getToken(context)){asm_nextToken(context)}if(is_directive(asm_getToken(context))||"TAG"==asm_getTokenType(context)||"."==asm_getToken(context)[0]){break}possible_value=asm_getToken(context)}}else if(".space"==possible_datatype||".zero"==possible_datatype){asm_nextToken(context);var possible_value=asm_getToken(context);var ret1=isDecimal(possible_value);possible_value=ret1.number;if(ret1.isDecimal==false){return asm_langError(context,i18n_get_TagFor("compiler","NO NUMBER OF BYTES")+"'"+possible_value+"'")}if(possible_value<0){return asm_langError(context,i18n_get_TagFor("compiler","NO POSITIVE NUMBER")+"'"+possible_value+"'")}for(i=0;i=0){return asm_langError(context,i18n_get_TagFor("compiler","INVALID ALIGN VALUE")+"'"+possible_value+"'. "+i18n_get_TagFor("compiler","REMEMBER ALIGN VAL"))}writememory_and_reset(ret.mp,gen,1);var align_offset=Math.pow(2,parseInt(possible_value));switch(align_offset){case 1:break;case 2:if(gen.byteWord&1==1)gen.byteWord++;break;default:writememory_and_reset(ret.mp,gen,1);while(gen.seg_ptr%align_offset!=0||gen.byteWord!=0){gen.byteWord++;writememory_and_reset(ret.mp,gen,1)}}asm_nextToken(context)}else if(".ascii"==possible_datatype||".asciiz"==possible_datatype||".string"==possible_datatype){asm_nextToken(context);var possible_value=asm_getToken(context);var ret1=treatControlSequences(possible_value);if(true==ret1.error){return asm_langError(context,ret1.string)}possible_value=ret1.string;while(!is_directive(asm_getToken(context))&&!is_end_of_file(context)){writememory_and_reset(ret.mp,gen,1);if('"'!==possible_value[0]){return asm_langError(context,i18n_get_TagFor("compiler","NO QUOTATION MARKS")+"'"+possible_value+"'")}if('"'!==possible_value[possible_value.length-1]){return asm_langError(context,i18n_get_TagFor("compiler","NOT CLOSED STRING"))}if(""==possible_value){return asm_langError(context,i18n_get_TagFor("compiler","NOT CLOSED STRING"))}if("STRING"!=asm_getTokenType(context)){return asm_langError(context,i18n_get_TagFor("compiler","NO QUOTATION MARKS")+"'"+possible_value+"'")}for(i=0;i0){var melto={value:gen.machineCode,source_tracking:gen.track_source,comments:gen.comments};main_memory_set(ret.mp,"0x"+gen.seg_ptr.toString(16),melto);gen.seg_ptr=gen.seg_ptr+WORD_BYTES}ret.seg[seg_name].end=gen.seg_ptr}function read_text(context,datosCU,ret){var seg_name=asm_getToken(context);var seg_ptr=ret.seg[seg_name].begin;var firmware=context.firmware;var pseudoInstructions=context.pseudoInstructions;var finish=[];var isPseudo=false;var pfinish=[];var npseudoInstructions=0;var pseudo_fields={};var counter=-1;var candidate;var error="";var registers={};for(i=0;i=signature_fields[j].length){if("TAG"!=asm_getTokenType(context)&&!firmware[value]&&!is_end_of_file(context)){advance[j]=0}continue}var field=firmware[instruction][j].fields[i];var size=field.startbit-field.stopbit+1;var label_found=false;var sel_found=false;switch(field.type){case"address":case"inm":if(isPseudo&&"sel"==value){counter++;var start=pfinish[counter++];var stop=pfinish[counter++];var value=pseudo_fields[pfinish[counter++]];counter++;sel_found=true}var ret1=get_inm_value(value);converted=ret1.number;if(ret1.isDecimal==false&&ret1.isFloat==false){error=i18n_get_TagFor("compiler","NO NUMERIC DATATYPE")+"'"+value+"'";if(value[0]=="'"){advance[j]=0;break}if(!isValidTag(value)){advance[j]=0;break}if(firmware[value]){error=i18n_get_TagFor("compiler","TAG OR INSTRUCTION")+"'"+value+"'";advance[j]=0;break}label_found=true}if(sel_found){if(ret1.isDecimal==true)res=decimal2binary(converted,WORD_LENGTH);else res=float2binary(converted,WORD_LENGTH);if(res[1]<0){return asm_langError(context,"'"+value+"' "+i18n_get_TagFor("compiler","BIGGER THAN")+WORD_LENGTH+" "+i18n_get_TagFor("compiler","BITS"))}if(label_found){s[i+1]=value}else{converted="0".repeat(res[1])+res[0];converted=converted.substring(WORD_LENGTH-start-1,WORD_LENGTH-stop);converted=parseInt(converted,2);s[i+1]="0x"+converted.toString(16)}}if(!label_found){if(ret1.isDecimal==true)var res=decimal2binary(converted,size);else var res=float2binary(converted,size);if(field.type=="address"&&"rel"==field.address_type){res=decimal2binary(converted,size)}}break;case"reg":if(typeof value==="undefined"){error=i18n_get_TagFor("compiler","INS. MISSING FIELD");advance[j]=0;break}var aux=false;if(value.startsWith("(")){if("(reg)"!=signature_fields[j][i]){error=i18n_get_TagFor("compiler","UNEXPECTED (REG)");advance[j]=0;break}if(counter==-1){asm_nextToken(context);value=asm_getToken(context)}else{value=pseudo_fields[pfinish[counter++]]}aux=true}else{if("(reg)"==signature_fields[j][i]){error=i18n_get_TagFor("compiler","EXPECTED (REG)")+"'"+value+"'";advance[j]=0;break}}if(typeof registers[value]==="undefined"){error=i18n_get_TagFor("compiler","EXPECTED REG")+"'"+value+"'";advance[j]=0;break}if(aux){s[i+1]="("+value+")";if(counter==-1){asm_nextToken(context);aux=asm_getToken(context)}else{aux=pfinish[counter++]}if(")"!=aux){error=i18n_get_TagFor("compiler","CLOSE PAREN. NOT FOUND");advance[j]=0;break}}var ret1=isDecimal(registers[value]);converted=ret1.number;var res=decimal2binary(converted,size);value=s[i+1];break;default:return asm_langError(context,i18n_get_TagFor("compiler","UNKNOWN 1")+"'"+field.type+"'")}if(advance[j]==1&&!label_found){if(res[1]<0){if(field.type=="address"&&"rel"==field.address_type){error="Relative value ("+(converted-seg_ptr-WORD_BYTES)+" in decimal)"+i18n_get_TagFor("compiler","NEEDS")+res[0].length+i18n_get_TagFor("compiler","SPACE FOR # BITS")+size+" "+i18n_get_TagFor("compiler","BITS")}else{error="'"+value+"'"+i18n_get_TagFor("compiler","NEEDS")+res[0].length+i18n_get_TagFor("compiler","SPACE FOR # BITS")+size+" "+i18n_get_TagFor("compiler","BITS")}advance[j]=0}}if(advance[j]==1&&!(isPseudo&&counter==-1)){binaryAux[j][i]={num_bits:label_found?false:res[0],free_space:label_found?false:res[1],startbit:field.startbit,stopbit:field.stopbit,rel:label_found?field.address_type:false,islabel:label_found,field_name:value,issel:sel_found,sel_start:start,sel_stop:stop}}}if(sum_array(advance)==0){break}if("TAG"==asm_getTokenType(context)||firmware[value]){break}}for(i=0;i0&&i0&&i==firmware[instruction].length-1){format+=" or "}format+="'"+firmware[instruction][i].signatureUser+"'"}if(format==""){format="'"+instruction+"' "+i18n_get_TagFor("compiler","UNKNOWN MC FORMAT")}var sum_res=sum_array(advance);if(sum_res==0){if(advance.length===1){return asm_langError(context,error+".
"+i18n_get_TagFor("compiler","REMEMBER I. FORMAT")+format)}return asm_langError(context,i18n_get_TagFor("compiler","NOT MATCH MICRO")+"
"+i18n_get_TagFor("compiler","REMEMBER I. FORMAT")+format+". "+i18n_get_TagFor("compiler","CHECK MICROCODE"))}if(sum_res>1){candidate=get_candidate(advance,firmware[instruction]);if(candidate===false){return asm_langError(context,i18n_get_TagFor("compiler","SEVERAL CANDIDATES")+format)}}if(isPseudo){if(counter==-1){var s_ori=s.join(" ");s_ori=s_ori.trim();var key="";var val="";pseudo_fields={};for(i=0;i1){s_ori=" "}if(pfinish[counter]=="\n"){counter++}}var machineCode=reset_assembly(firmware[instruction][candidate].nwords);machineCode=assembly_co_cop(machineCode,firmware[instruction][candidate].co,firmware[instruction][candidate].cop);var l_addr="";for(i=0;i=0;i--){if(icontext.text.length){break}}ret.seg[seg_name].end=seg_ptr}function simlang_compile_v1(text,datosCU){var context={};context.line=1;context.error=null;context.i=0;context.contadorMC=0;context.etiquetas={};context.labelsNotFound=[];context.instrucciones=[];context.co_cop={};context.registers=[];context.text=text;context.tokens=[];context.token_types=[];context.t=0;context.newlines=[];context.pseudoInstructions=[];context.stackRegister=null;context.firmware={};context.comments=[];for(i=0;i=0;j--){var melto={value:machineCode.substring(j*WORD_LENGTH,(j+1)*WORD_LENGTH),source_tracking:null,comments:null};main_memory_set(ret.mp,"0x"+auxAddr.toString(16),melto);auxAddr+=WORD_BYTES}}if(text_found){if(typeof ret.labels2["main"]==="undefined"&&typeof ret.labels2["kmain"]==="undefined"){return asm_langError(context,i18n_get_TagFor("compiler","NO MAIN OR KMAIN"))}}for(var key in ret.labels2){ret.revlabels2[ret.labels2[key]]=key}for(var skey in ret.seg){ret.revseg.push({begin:parseInt(ret.seg[skey].begin),name:skey})}return ret}function simlang_compile(text,datosCU){return simlang_compile_v1(text,datosCU)} \ No newline at end of file diff --git a/ws_dist/min.wepsim_node.js b/ws_dist/min.wepsim_node.js index 6404e0be7..97409c9e2 100644 --- a/ws_dist/min.wepsim_node.js +++ b/ws_dist/min.wepsim_node.js @@ -35,7 +35,7 @@ Vuex.Store = class { } ; -var WSCFG={};function get_cfg(field){return WSCFG[field].value}function set_cfg(field,value){WSCFG[field].value=value}function update_cfg(field,value){WSCFG[field].value=value;simcore_record_append_new("Set configuration option "+field+" to "+value,'update_cfg("'+field+'","'+value+'");\n');simcore_ga("config","config."+WSCFG.version.value,"config."+WSCFG.version.value+"."+field+"."+value);save_cfg()}function is_cfg_empty(){return Object.keys(WSCFG).length===0}function save_cfg(){try{for(var item in WSCFG){localStorage.setItem("wepsim_"+item,get_cfg(item))}}catch(err){console.log("WepSIM can not save the configuration in a persistent way on this web browser,\n"+"found following error: \n"+err.message)}set_secondary_cfg()}function restore_cfg(){WSCFG=get_primary_cfg();set_secondary_cfg();if(localStorage===null){return}var default_value=null;var saved_value=null;for(var item in WSCFG){if(item==="version"){continue}default_value=get_cfg(item);set_cfg(item,localStorage.getItem("wepsim_"+item));if(WSCFG[item].type!="string"){try{saved_value=JSON.parse(get_cfg(item));set_cfg(item,saved_value)}catch(e){saved_value=null}}if(saved_value===null){set_cfg(item,default_value)}}set_secondary_cfg()}function reset_cfg(){WSCFG=get_primary_cfg();set_secondary_cfg();save_cfg()}function reset_cfg_values(){WSCFG=get_primary_cfg();set_secondary_cfg()}function upgrade_cfg(){var wscfg=get_primary_cfg();var item=null;for(item in wscfg){if(typeof WSCFG[item]==="undefined"){WSCFG[item]=wscfg[item]}if(WSCFG[item].value===null||WSCFG[item].value==="null"){WSCFG[item].value=wscfg[item].value}}if(wscfg.build.value!=WSCFG.build.value){for(item in wscfg){if(wscfg[item].upgrade){WSCFG[item]=wscfg[item]}}}set_secondary_cfg();save_cfg()}function is_mobile(){if(typeof navigator==="undefined"){return false}if(typeof navigator.userAgentData=="undefined"){return false}return navigator.userAgentData.mobile}function is_cordova(){return document.URL.indexOf("http://")===-1&&document.URL.indexOf("https://")===-1}function get_primary_cfg(){var wscfg={version:{upgrade:false,type:"string",value:"2.3.0"},build:{upgrade:true,type:"string",value:"2.3.0.20230415A"},color_data_active:{upgrade:false,type:"string",value:"#0066FF"},color_data_inactive:{upgrade:false,type:"string",value:"#000000"},color_name_active:{upgrade:false,type:"string",value:"#FF0000"},color_name_inactive:{upgrade:false,type:"string",value:"#000000"},size_active:{upgrade:false,type:"float",value:3},size_inactive:{upgrade:false,type:"float",value:1},is_byvalue:{upgrade:false,type:"boolean",value:false},CPUCU_show_graph:{upgrade:true,type:"boolean",value:true},RF_display_format:{upgrade:false,type:"string",value:"unsigned_16_fill"},RF_display_name:{upgrade:false,type:"string",value:"numerical"},MEM_display_format:{upgrade:true,type:"string",value:"unsigned_16_nofill"},MEM_show_segments:{upgrade:true,type:"boolean",value:false},MEM_show_source:{upgrade:true,type:"boolean",value:false},MEM_display_direction:{upgrade:true,type:"string",value:"h2l"},is_editable:{upgrade:false,type:"boolean",value:true},DBG_delay:{upgrade:false,type:"int",value:5},DBG_level:{upgrade:false,type:"string",value:"microinstruction"},DBG_limitins:{upgrade:false,type:"int",value:1e4},DBG_limitick:{upgrade:false,type:"int",value:1e3},DBG_skip_notifycolon:{upgrade:true,type:"boolean",value:false},ICON_theme:{upgrade:false,type:"string",value:"classic"},AS_enable:{upgrade:true,type:"boolean",value:true},AS_delay:{upgrade:true,type:"int",value:500},NOTIF_delay:{upgrade:false,type:"int",value:1e3},CPUCU_size:{upgrade:true,type:"int",value:7},C1C2_size:{upgrade:true,type:"int",value:8},SHOWCODE_label:{upgrade:false,type:"boolean",value:true},SHOWCODE_addr:{upgrade:false,type:"boolean",value:true},SHOWCODE_hex:{upgrade:false,type:"boolean",value:true},SHOWCODE_ins:{upgrade:false,type:"boolean",value:true},SHOWCODE_pins:{upgrade:false,type:"boolean",value:true},ws_mode:{upgrade:false,type:"string",value:"newbie"},ws_action:{upgrade:false,type:"string",value:"checkpoint"},is_interactive:{upgrade:false,type:"boolean",value:true},is_quick_interactive:{upgrade:false,type:"boolean",value:false},ws_idiom:{upgrade:false,type:"string",value:"en"},use_voice:{upgrade:false,type:"boolean",value:false},ws_skin_ui:{upgrade:false,type:"string",value:"classic"},ws_skin_user:{upgrade:false,type:"string",value:"only_asm:of:only_frequent:of"},ws_skin_dark_mode:{upgrade:false,type:"boolean",value:false},editor_theme:{upgrade:false,type:"string",value:"default"},editor_mode:{upgrade:false,type:"string",value:"default"},base_url:{upgrade:true,type:"string",value:"https://acaldero.github.io/wepsim/ws_dist/"},cfg_url:{upgrade:true,type:"string",value:"examples/configuration/default.json"},example_url:{upgrade:true,type:"string",value:"examples/examples_set/default.json"},hw_url:{upgrade:true,type:"string",value:"examples/hardware/hw.json"},max_json_size:{upgrade:true,type:"int",value:1*1024*1024},verbal_verbose:{upgrade:false,type:"string",value:"math"},extended_ui:{upgrade:false,type:"boolean",value:false},use_ga:{upgrade:false,type:"boolean",value:true}};if(is_mobile()){wscfg.NOTIF_delay.value=2e3;wscfg.ICON_theme.value="cat1";wscfg.CPUCU_size.value=7;wscfg.C1C2_size.value=14;wscfg.ws_skin_ui.value="compact"}return wscfg}function set_secondary_cfg(){var dbg_delay=get_cfg("DBG_delay");if(dbg_delay<5){cfg_show_rf_delay=350;cfg_show_eltos_delay=350;cfg_show_main_memory_delay=450;cfg_show_control_memory_delay=360;cfg_show_dbg_ir_delay=300;cfg_show_rf_refresh_delay=120}else{cfg_show_rf_delay=100;cfg_show_eltos_delay=100;cfg_show_main_memory_delay=150;cfg_show_control_memory_delay=120;cfg_show_dbg_ir_delay=100;cfg_show_rf_refresh_delay=30}cfg_show_asmdbg_pc_delay=50;if(dbg_delay<3)cfg_show_asmdbg_pc_delay=150}var ws_cfg_hash={};var ws_cfg_set=[];function cfgset_init(){var url_list=get_cfg("cfg_url");ws_cfg_set=wepsim_url_getJSON(url_list);for(var i=0;i"+index+"/"+ws_records.length+" "+msg)}if(ws_record_pb_obj!==null){var next_pbval=100*index/ws_records.length;ws_record_pb_obj.css("width",next_pbval+"%").attr("aria-valuenow",next_pbval)}}function simcore_record_playAt(index_current,index_last){if(ws_is_playing===false){simcore_record_showMsg(ws_last_played,"Stopped by user.");return}ws_last_played=index_current;if(index_current>=index_last){simcore_record_showMsg(index_last,"Done.");return}if(ws_records[index_current].description==="_pending event_"){simcore_record_playAt(index_current+1,index_last);return}eval(ws_records[index_current].element);var index_next=index_current+1;simcore_record_showMsg(index_next,ws_records[index_current].description);var wait_time=500;if(index_next0&&ws_records[ws_records.length-1].description==="_pending event_"){distance=ws_glowing_time}simcore_record_pushElto("_pending event_",";",distance)}}function simcore_record_resolve_pending(description,elto){if(ws_is_recording===true){var last_pending=ws_records.length;while(last_pending>0){last_pending--;if(ws_records[last_pending].description==="_pending event_"){break}}if(last_pending===0){simcore_record_setTimeBeforeNow(0);simcore_record_append_new(description,elto);return}ws_records[last_pending].description=description;ws_records[last_pending].element=elto;simcore_record_showMsg(0,"Recording...")}}function simcore_record_setTimeBeforeNow(distance){ws_last_time=Date.now()-distance}function simcore_record_addTimeAfterLast(distance){ws_last_time=ws_last_time+distance}function array_includes(arr,val){if(typeof arr.includes!="undefined"){return arr.includes(val)}for(var i=0;i0){e=i;n=n+1}}if(n>0){var tri_state_names=simhw_internalState("tri_state_names");var tri_name=tri_state_names[e];update_draw(simhw_sim_signal(tri_name),1)}if(n>1){update_bus_visibility("internalbus_fire","visible");simhw_internalState_set("fire_visible","internalbus",true);simhw_sim_state("BUS_IB").value=4294967295}else{update_bus_visibility("internalbus_fire","hidden");simhw_internalState_set("fire_visible","internalbus",false)}return n}function update_system_bus_fire(number_active_tri){if(simhw_internalState_get("fire_visible","databus")==true){update_bus_visibility("databus_fire","hidden");simhw_internalState_set("fire_visible","databus",false)}if(number_active_tri>1){update_bus_visibility("databus_fire","visible");simhw_internalState_set("fire_visible","databus",true);simhw_sim_state("BUS_DB").value=4294967295}return number_active_tri}function fn_updateE_now(key){if("E"==simhw_sim_signal(key).type){update_state(key)}}function fn_updateE_future(key){if(jit_fire_ndep[key]<1)fn_updateE_now(key);else return new Promise((function(resolve,reject){fn_updateE_now(key)}))}function fn_updateL_now(key){update_draw(simhw_sim_signal(key),simhw_sim_signal(key).value);if("L"==simhw_sim_signal(key).type){update_state(key)}}function fn_updateL_future(key){if(jit_fire_ndep[key]<1)fn_updateL_now(key);else return new Promise((function(resolve,reject){fn_updateL_now(key)}))}function update_state(key){var index_behavior=0;switch(simhw_sim_signal(key).behavior.length){case 0:return;break;case 1:index_behavior=0;break;default:index_behavior=simhw_sim_signal(key).value;if(simhw_sim_signal(key).behavior.lengthreg_maddr){break}assoc_i=i}if(-1==assoc_i){ws_alert("A new 'unknown' instruction is inserted,\n"+"please edit it (co, nwords, etc.) in the firmware textarea.");var new_ins=new Object;new_ins["name"]="unknown";new_ins["signature"]="unknown";new_ins["signatureGlobal"]="unknown";new_ins["co"]=0;new_ins["nwords"]=0;new_ins["mc-start"]=0;new_ins["fields"]=new Array;new_ins["microcode"]=new Array;new_ins["microcomments"]=new Array;SIMWARE["firmware"].push(new_ins);assoc_i=SIMWARE["firmware"].length-1}var pos=reg_maddr-parseInt(SIMWARE["firmware"][assoc_i]["mc-start"]);if(typeof SIMWARE["firmware"][assoc_i]["microcode"][pos]=="undefined"){SIMWARE["firmware"][assoc_i]["microcode"][pos]=new Object;SIMWARE["firmware"][assoc_i]["microcomments"][pos]=""}SIMWARE["firmware"][assoc_i]["microcode"][pos][key]=simhw_sim_signal(key).value;if(simhw_sim_signal(key).default_value==simhw_sim_signal(key).value){delete SIMWARE["firmware"][assoc_i]["microcode"][pos][key]}var bits=get_value(simhw_sim_state("REG_IR")).toString(2);bits="00000000000000000000000000000000".substring(0,32-bits.length)+bits;show_memories_values()}function propage_signal_update(key){if(true===get_cfg("is_interactive")){if(simhw_sim_signal(key).value!=simhw_sim_signal(key).default_value)simhw_sim_state("REG_MICROINS").value[key]=simhw_sim_signal(key).value;else delete simhw_sim_state("REG_MICROINS").value[key];var maddr_name=simhw_sim_ctrlStates_get().mpc.state;var curr_maddr=get_value(simhw_sim_state(maddr_name));var mc_obj=simhw_internalState("MC");var mcelto=control_memory_get(mc_obj,curr_maddr);if(typeof mcelto==="undefined"){mcelto={value:{},comments:null}}mcelto.value[key]=simhw_sim_signal(key).value;mcelto.comments=[];control_memory_set(mc_obj,curr_maddr,mcelto);update_signal_firmware(key);var SIMWARE=get_simware();document.getElementById("inputFirmware").value=saveFirmware(SIMWARE)}compute_behavior("FIRE "+key)}function update_memories(preSIMWARE){var i=0;set_simware(preSIMWARE);var SIMWARE=get_simware();simhw_internalState_reset("MC",{});var mc_obj=simhw_internalState("MC");var mcelto=null;for(i=0;i>23&255)-127;var mantissa=1+(hexvalue&8388607)/8388608;var valuef=sign*mantissa*Math.pow(2,exponent);if(-127===exponent)if(1===mantissa)valuef=sign===1?"+0":"-0";else valuef=sign*((hexvalue&8388607)/8388607)*Math.pow(2,-126);if(128===exponent)if(1===mantissa)valuef=sign===1?"+Inf":"-Inf";else valuef="NaN";return valuef}function uint_to_float32(value){var buf=new ArrayBuffer(4);new Uint32Array(buf)[0]=value;return new Float32Array(buf)[0]}function float32_to_uint(value){var buf=new ArrayBuffer(4);new Float32Array(buf)[0]=value;return new Uint32Array(buf)[0]}function float_class(a){var s=a&2147483648;s=s>>31;var e=a&2139095040;e=e>>23;var m=a&8388607;let rd=0;if(!m&&!e){rd=s?3:4}else if(!e){rd=s?2:6}else if(!(e^255)){if(m)rd=s?8:9;else rd=s?0:7}else{rd=s?1:5}return rd}function float_class_power2(a){var s=a&2147483648;s=s>>31;var e=a&2139095040;e=e>>23;var m=a&8388607;let rd=0;if(!m&&!e){rd=s?1<<3:1<<4}else if(!e){rd=s?1<<2:1<<6}else if(!(e^255)){if(m)rd=s?1<<8:1<<9;else rd=s?1<<0:1<<7}else{rd=s?1<<1:1<<5}return rd}function hex2char8(hexvalue){var valuec=[];valuec[0]=String.fromCharCode((hexvalue&4278190080)>>24);valuec[1]=String.fromCharCode((hexvalue&16711680)>>16);valuec[2]=String.fromCharCode((hexvalue&65280)>>8);valuec[3]=String.fromCharCode((hexvalue&255)>>0);return valuec}function simcoreui_pack(val,pack_size){var base_str="0".repeat(pack_size);return base_str.substring(0,pack_size-val.length)+val}function hex2bin(hexvalue){var valuebin=hexvalue.toString(2);valuebin=simcoreui_pack(valuebin,32);valuebin=valuebin.substring(0,4)+" "+valuebin.substring(4,8)+" "+valuebin.substring(8,12)+" "+valuebin.substring(12,16)+"
"+valuebin.substring(16,20)+" "+valuebin.substring(20,24)+" "+valuebin.substring(24,28)+" "+valuebin.substring(28,32);return valuebin}function value2string(format,value){var fmt_value="";var fmt=format.split("_");switch(fmt[0]){case"unsigned":fmt_value=value.toString(fmt[1]).toUpperCase();break;case"float":fmt_value=hex2float(value);break;case"char":fmt_value="'"+String.fromCharCode(value)+"'";break;default:fmt_value=value.toString()}if(fmt[2]==="fill"){fmt_value=simcoreui_pack(fmt_value,8)}return fmt_value}function show_rf_names(){return simcore_action_ui("CPU",0,"show_rf_names")()}function get_screen_content(){return simcore_action_ui("SCREEN",0,"get_screen_content")()}function set_screen_content(screen){simcore_action_ui("SCREEN",0,"set_screen_content")(screen)}function get_keyboard_content(){return simcore_action_ui("KBD",0,"get_keyboard_content")()}function set_keyboard_content(keystrokes){simcore_action_ui("KBD",0,"set_keyboard_content")(keystrokes)}function show_main_memory(memory,index,redraw,updates){return simcore_action_ui("MEMORY",0,"show_main_memory")(memory,index,redraw,updates)}function show_control_memory(memory,index,redraw){return simcore_action_ui("MEMORY",0,"show_control_memory")(memory,index,redraw)}function show_cache_memory(memory){return simcore_action_ui("MEMORY",0,"show_cache_memory")(memory)}function show_memories_values(){var pc_name=simhw_sim_ctrlStates_get().pc.state;var reg_pc=get_value(simhw_sim_state(pc_name));show_main_memory(simhw_internalState("MP"),reg_pc,true,true);var maddr_name=simhw_sim_ctrlStates_get().mpc.state;var reg_maddr=get_value(simhw_sim_state(maddr_name));show_control_memory(simhw_internalState("MC"),reg_maddr,true);show_cache_memory(simhw_internalState("CM"))}function update_draw(obj,value){return simcore_action_ui("CPU",1,"update_draw")(obj,value)}function update_bus_visibility(bus_name,value){return simcore_action_ui("CPU",1,"update_bus_visibility")(bus_name,value)}function refresh(){for(var key in simhw_sim_signals()){update_draw(simhw_sim_signals()[key],simhw_sim_signals()[key].value)}show_dbg_ir(get_value(simhw_sim_state("REG_IR_DECO")))}function show_dbg_ir(value){return simcore_action_ui("MEMORY",0,"show_dbg_ir")(value)}function show_dbg_mpc(){return simcore_action_ui("MEMORY",0,"show_dbg_mpc")()}function show_asmdbg_pc(){return simcore_action_ui("MEMORY",0,"show_asmdbg_pc")()}function ws_alert(msg){if(typeof document==="undefined"){console.log(msg);return true}alert(msg);return true}function element_scroll_get(list_id){var offset=0;var obj_byid=$(list_id);if(obj_byid.length>0){offset=obj_byid[0].scrollTop}return offset}function element_scroll_set(list_id,offset){var obj_byid=$(list_id);if(obj_byid.length>0){obj_byid[0].scrollTop=offset}}function element_scroll_setRelative(list_id,obj_id,offset){var obj_byid=$(obj_id);if(obj_byid.length>0){var topPos=obj_byid[0].offsetTop;element_scroll_set(list_id,topPos+offset)}}var colors_schemes={color14:["#000000","#FFFFFF","#FF0000","#FF8800","#FFFF00","#88FF00","#00FF00","#00FF88","#00FFFF","#0088FF","#0000FF","#8800FF","#FF00FF","#FF0088"],color16:["#000000","#FFFFFF","#9D9D9D","#BE2633","#E06F8B","#493C2B","#A46422","#EB8931","#F7E26B","#2F484E","#44891A","#A3CE27","#1B2632","#005784","#31A2F2","#B2DCEF"],color256:["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff","#000000","#00005f","#000087","#0000af","#0000d7","#0000ff","#005f00","#005f5f","#005f87","#005faf","#005fd7","#005fff","#008700","#00875f","#008787","#0087af","#0087d7","#0087ff","#00af00","#00af5f","#00af87","#00afaf","#00afd7","#00afff","#00d700","#00d75f","#00d787","#00d7af","#00d7d7","#00d7ff","#00ff00","#00ff5f","#00ff87","#00ffaf","#00ffd7","#00ffff","#5f0000","#5f005f","#5f0087","#5f00af","#5f00d7","#5f00ff","#5f5f00","#5f5f5f","#5f5f87","#5f5faf","#5f5fd7","#5f5fff","#5f8700","#5f875f","#5f8787","#5f87af","#5f87d7","#5f87ff","#5faf00","#5faf5f","#5faf87","#5fafaf","#5fafd7","#5fafff","#5fd700","#5fd75f","#5fd787","#5fd7af","#5fd7d7","#5fd7ff","#5fff00","#5fff5f","#5fff87","#5fffaf","#5fffd7","#5fffff","#870000","#87005f","#870087","#8700af","#8700d7","#8700ff","#875f00","#875f5f","#875f87","#875faf","#875fd7","#875fff","#878700","#87875f","#878787","#8787af","#8787d7","#8787ff","#87af00","#87af5f","#87af87","#87afaf","#87afd7","#87afff","#87d700","#87d75f","#87d787","#87d7af","#87d7d7","#87d7ff","#87ff00","#87ff5f","#87ff87","#87ffaf","#87ffd7","#87ffff","#af0000","#af005f","#af0087","#af00af","#af00d7","#af00ff","#af5f00","#af5f5f","#af5f87","#af5faf","#af5fd7","#af5fff","#af8700","#af875f","#af8787","#af87af","#af87d7","#af87ff","#afaf00","#afaf5f","#afaf87","#afafaf","#afafd7","#afafff","#afd700","#afd75f","#afd787","#afd7af","#afd7d7","#afd7ff","#afff00","#afff5f","#afff87","#afffaf","#afffd7","#afffff","#d70000","#d7005f","#d70087","#d700af","#d700d7","#d700ff","#d75f00","#d75f5f","#d75f87","#d75faf","#d75fd7","#d75fff","#d78700","#d7875f","#d78787","#d787af","#d787d7","#d787ff","#d7af00","#d7af5f","#d7af87","#d7afaf","#d7afd7","#d7afff","#d7d700","#d7d75f","#d7d787","#d7d7af","#d7d7d7","#d7d7ff","#d7ff00","#d7ff5f","#d7ff87","#d7ffaf","#d7ffd7","#d7ffff","#ff0000","#ff005f","#ff0087","#ff00af","#ff00d7","#ff00ff","#ff5f00","#ff5f5f","#ff5f87","#ff5faf","#ff5fd7","#ff5fff","#ff8700","#ff875f","#ff8787","#ff87af","#ff87d7","#ff87ff","#ffaf00","#ffaf5f","#ffaf87","#ffafaf","#ffafd7","#ffafff","#ffd700","#ffd75f","#ffd787","#ffd7af","#ffd7d7","#ffd7ff","#ffff00","#ffff5f","#ffff87","#ffffaf","#ffffd7","#ffffff","#080808","#121212","#1c1c1c","#262626","#303030","#3a3a3a","#444444","#4e4e4e","#585858","#626262","#6c6c6c","#767676","#808080","#8a8a8a","#949494","#9e9e9e","#a8a8a8","#b2b2b2","#bcbcbc","#c6c6c6","#d0d0d0","#dadada","#e4e4e4","#eeeeee"]};function colors_clone(cs){var colors=colors_schemes[cs];if(typeof colors=="undefined"){colors=colors_schemes["color16"]}return colors.map((x=>x))}function simcore_init(with_ui){var ret={};ret.msg="";ret.ok=true;if(with_ui){restore_cfg()}else{reset_cfg_values()}return ret}function simcore_init_hw(simhw_name){var ret={};ret.msg="";ret.ok=true;var hwid=simhw_getIdByName(simhw_name);if(hwid<0){ret.msg="ERROR: unknown hardware: "+simhw_name+".
\n";ret.ok=false;return ret}simhw_setActive(hwid);var ret1=simcore_init_ui({});if(false===ret1.ok){ret.msg=ret.msg;ret.ok=false;return ret}return ret}function simcore_welcome(){var ret={};ret.msg="";ret.ok=true;console.log("");console.log("██╗ ██╗███████╗██████╗ ███████╗██╗███╗ ███╗");console.log("██║ ██║██╔════╝██╔══██╗██╔════╝██║████╗ ████║");console.log("██║ █╗ ██║█████╗ ██████╔╝███████╗██║██╔████╔██║");console.log("██║███╗██║██╔══╝ ██╔═══╝ ╚════██║██║██║╚██╔╝██║");console.log("╚███╔███╔╝███████╗██║ ███████║██║██║ ╚═╝ ██║");console.log(" ╚══╝╚══╝ ╚══════╝╚═╝ ╚══════╝╚═╝╚═╝ ╚═╝");console.log("");console.log("Stable: https://github.com/wepsim/wepsim");console.log("Beta: https://github.com/acaldero/wepsim");console.log("");return ret}function simcore_init_ui(hash_detail2init){var ret={};ret.msg="";ret.ok=true;var detail_id=0;var sim_components=simhw_sim_components();for(var elto in sim_components){sim_components[elto].details_ui=[];for(var index in sim_components[elto].details_name){sim_components[elto].details_ui[index]={};detail_id=sim_components[elto].details_name[index];if(typeof hash_detail2init[detail_id]!=="undefined"){sim_components[elto].details_ui[index]=hash_detail2init[detail_id];sim_components[elto].details_ui[index].init()}}}return ret}function simcore_action_ui(component_name,detail_id,action_name){var sim_components=simhw_sim_components();if(typeof sim_components[component_name].details_ui[detail_id][action_name]==="undefined"){return simcore_do_nothing_handler}return sim_components[component_name].details_ui[detail_id][action_name]}function simcore_init_eventlistener(context,hash_detail2action,hash_signal2action){var context_obj=null;var r=[];var o=null;context_obj=document.getElementById(context).contentDocument;if(null==context_obj){console.log('warning: unreferenced graphic element context named "'+r[0]+'".');return}var sim_signals=simhw_sim_signals();for(var key in sim_signals){if(typeof hash_signal2action[key+"click"]==="undefined"){hash_signal2action[key+"click"]=function(key_value){return function(){hash_signal2action[""](key_value,"click")}}(key)}if(typeof hash_signal2action[key+"dblclick"]==="undefined"){hash_signal2action[key+"dblclick"]=function(key_value){return function(){hash_signal2action[""](key_value,"dblclick")}}(key)}for(var j=0;j\n"+"Please load some assembly code.
";ret.ok=false;return ret}var SIMWARE=get_simware();if(!(typeof curr_segments[".ktext"]!="undefined"&&SIMWARE.labels2.kmain)&&!(typeof curr_segments[".text"]!="undefined"&&SIMWARE.labels2.main)){ret.msg="labels 'kmain' (in .ktext) or 'main' (in .text) do not exist!";ret.ok=false;return ret}return ret}function simcore_packerror_at(reg_maddr,msg){var ret={};var hex_maddr="0x"+parseInt(reg_maddr).toString(16);ret.ok=false;ret.msg=msg+" at maddr="+hex_maddr+".";return ret}function simcore_check_if_can_continue2(reg_maddr,reg_pc){var ret={};ret.ok=true;ret.msg="";var curr_MC=simhw_internalState("MC");var mcelto=control_memory_get(curr_MC,reg_maddr);if(typeof mcelto==="undefined"){return simcore_packerror_at(reg_maddr,"Error: undefined microinstruction")}if(simhw_internalState_get("fire_visible","databus")==true||simhw_internalState_get("fire_visible","internalbus")==true){return simcore_packerror_at(reg_maddr,"Error: two or more tri-states are active")}var curr_segments=simhw_internalState("segments");if(reg_pc=curr_segments[".ktext"].begin){return ret}if(reg_pc=curr_segments[".text"].begin){return ret}if(mcelto.is_native&&0===reg_maddr){if(reg_pc==curr_segments[".ktext"].end||reg_pc==curr_segments[".text"].end){return ret}}if(false==mcelto.is_native&&0!==reg_maddr){if(reg_pc==curr_segments[".ktext"].end||reg_pc==curr_segments[".text"].end){return ret}}ret.ok=false;ret.msg="The program has finished because the PC register points outside .ktext/.text code segments";return ret}function simcore_check_if_can_continue(){var pc_name=simhw_sim_ctrlStates_get().pc.state;var reg_pc=parseInt(get_value(simhw_sim_state(pc_name)));var maddr_name=simhw_sim_ctrlStates_get().mpc.state;var reg_maddr=get_value(simhw_sim_state(maddr_name));return simcore_check_if_can_continue2(reg_maddr,reg_pc)}function simcore_reset(){var ret={};ret.msg="";ret.ok=true;var SIMWARE=get_simware();var curr_firm=simhw_internalState("FIRMWARE");var curr_segments=simhw_internalState("segments");var curr_MC=simhw_internalState("MC");var sim_components=simhw_sim_components();var ctrl_states=simhw_sim_ctrlStates_get();var pc_name=ctrl_states.pc.state;var pc_state=simhw_sim_state(pc_name);var sp_name=ctrl_states.sp.state;var sp_state=simhw_sim_state(sp_name);if(curr_firm.stackRegister!=null){sp_name=curr_firm.stackRegister;sp_state=simhw_sim_states().BR[sp_name];ctrl_states.sp.state="BR."+curr_firm.stackRegister}for(var elto in sim_components){var reset_signal_name=sim_components[elto].name+"_RESET";compute_general_behavior(reset_signal_name)}if(typeof curr_segments[".ktext"]!=="undefined"&&SIMWARE.labels2.kmain){set_value(pc_state,parseInt(SIMWARE.labels2.kmain));show_asmdbg_pc()}else if(typeof curr_segments[".text"]!=="undefined"&&SIMWARE.labels2.main){set_value(pc_state,parseInt(SIMWARE.labels2.main));show_asmdbg_pc()}if(typeof curr_segments[".stack"]!=="undefined"&&typeof sp_state!=="undefined"){set_value(sp_state,parseInt(curr_segments[".stack"].end)&4294967292)}var new_maddr=get_value(simhw_sim_state("MUXA_MICROADDR"));var mcelto=control_memory_get(curr_MC,new_maddr);if(typeof mcelto==="undefined"){mcelto={value:simhw_sim_state("REG_MICROINS").default_value,is_native:false}}var new_mins=get_value(mcelto);if(false==mcelto.is_native){compute_general_behavior("CLOCK")}show_dbg_ir(get_value(simhw_sim_state("REG_IR_DECO")));for(elto in sim_components){for(var index in sim_components[elto].details_name){if(typeof sim_components[elto].details_ui[index].reset!=="undefined"){sim_components[elto].details_ui[index].reset()}}}return ret}function simcore_execute_microinstruction(){var ret=simcore_check_if_can_continue();if(false===ret.ok){return ret}compute_general_behavior("CLOCK");show_dbg_mpc();return ret}function simcore_execute_microinstruction2(reg_maddr,reg_pc){var ret=simcore_check_if_can_continue2(reg_maddr,reg_pc);if(false===ret.ok){return ret}compute_general_behavior("CLOCK");show_dbg_mpc();return ret}function simcore_execute_microprogram(options){var ret=simcore_check_if_can_continue();if(false===ret.ok){return ret}var before_state=null;var after_state=null;var curr_mpc="";var curr_MC=simhw_internalState("MC");var maddr_name=simhw_sim_ctrlStates_get().mpc.state;var maddr_state=simhw_sim_state(maddr_name);if(typeof options.before_microinstruction==="undefined"){options.before_microinstruction=simcore_do_nothing_handler}if(typeof options.after_microinstruction==="undefined"){options.after_microinstruction=simcore_do_nothing_handler}var i_clks=0;var limitless=options.cycles_limit<0;var cur_addr=0;var mcelto=null;var oolimits=false;do{options.before_microinstruction(curr_MC,cur_addr);compute_general_behavior("CLOCK");i_clks++;options.after_microinstruction(curr_MC,cur_addr);if(limitless===false&&i_clks>=options.cycles_limit){ret.msg="Warning: clock cycles limit reached in a single instruction.";ret.ok=false;break}cur_addr=get_value(maddr_state);mcelto=control_memory_get(curr_MC,cur_addr);if(typeof mcelto==="undefined"){ret.msg="Error: undefined microinstruction at "+cur_addr+".";ret.ok=false;break}if(i_clks>=options.cycles_limit&&-1!=options.cycles_limit){oolimits=true}}while(false==oolimits&&0!=cur_addr);if(true==ret.ok&&mcelto.is_native){compute_general_behavior("CLOCK")}if(get_cfg("DBG_level")=="microinstruction"){show_dbg_mpc()}return ret}function simcore_execute_program(options){var ret={};ret.ok=true;ret.msg="";var curr_segments=simhw_internalState("segments");var pc_name=simhw_sim_ctrlStates_get().pc.state;var pc_state=simhw_sim_state(pc_name);var reg_pc=get_value(pc_state);var reg_pc_before=get_value(pc_state)-4;var code_begin=0;if(typeof curr_segments[".text"]!="undefined"&&typeof curr_segments[".text"].begin!="undefined")code_begin=parseInt(curr_segments[".text"].begin);var code_end=0;if(typeof curr_segments[".text"]!="undefined"&&typeof curr_segments[".text"].end!="undefined")code_end=parseInt(curr_segments[".text"].end);var kcode_begin=0;if(typeof curr_segments[".ktext"]!="undefined"&&typeof curr_segments[".ktext"].begin!="undefined")kcode_begin=parseInt(curr_segments[".ktext"].begin);var kcode_end=0;if(typeof curr_segments[".ktext"]!="undefined"&&typeof curr_segments[".ktext"].end!="undefined")kcode_end=parseInt(curr_segments[".ktext"].end);var ret1=null;var before_state=null;var after_state=null;var curr_pc="";var SIMWARE=get_simware();if(typeof options.verbalize!=="undefined"){set_cfg("verbal_verbose",options.verbalize)}if(typeof options.before_instruction==="undefined"){options.before_instruction=simcore_do_nothing_handler}if(typeof options.after_instruction==="undefined"){options.after_instruction=simcore_do_nothing_handler}var ins_executed=0;while(reg_pc=code_begin||reg_pc=kcode_begin){options.before_instruction(SIMWARE,reg_pc);ret1=simcore_execute_microprogram(options);if(false===ret1.ok){return ret1}options.after_instruction(SIMWARE,reg_pc);ins_executed++;if(ins_executed>options.instruction_limit&&-1!=options.instruction_limit){ret.ok=false;ret.msg="more than "+options.instruction_limit+" instructions executed before application ends.";return ret}reg_pc_before=reg_pc;reg_pc=get_value(pc_state)}return ret}function simcore_do_nothing_handler(){return null}function simcore_compile_firmware(textToMCompile){var ret={};ret.msg="";ret.ok=true;if(""==textToMCompile){ret.msg="Empty Firmware";ret.ok=false;return ret}var preSM=null;try{preSM=loadFirmware(textToMCompile);ret.simware=preSM}catch(e){ret.msg="ERROR: at line: "+e.lineNumber+" and column: "+e.columnNumber;ret.ok=false;return ret}if(preSM.error!=null){ret.msg=preSM.error;ret.ok=false;return ret}update_memories(preSM);simcore_reset();return ret}function simcore_compile_assembly(textToCompile){var ret={};ret.msg="";ret.ok=true;var SIMWARE=get_simware();if(SIMWARE.firmware.length===0){ret.msg="Empty microcode, please load the microcode first.";ret.ok=false;return ret}var SIMWAREaddon=simlang_compile(textToCompile,SIMWARE);ret.simware=SIMWAREaddon;if(SIMWAREaddon.error!=null){ret.msg=SIMWAREaddon.error;ret.ok=false;return ret}set_simware(SIMWAREaddon);update_memories(SIMWARE);simcore_reset();return ret}function simcore_hardware_export(hw_name){var ret={};ret.msg="{}";ret.ok=false;var hw_obj=simhw_getObjByName(hw_name);if(null===hw_obj){return ret}ret.ok=true;ret.msg=JSON.stringify(hw_obj,(function(key,value){if(typeof value==="function"){return"/Function("+value.toString()+")/"}return value}));return ret}function simcore_hardware_import(hw_json){var ret={};ret.msg="";ret.ok=true;hw_obj=JSON.parse(hw_json,(function(key,value){if(typeof value==="string"&&value.startsWith("/Function(")&&value.endsWith(")/")){value=value.substring(10,value.length-2);return eval("("+value+")")}return value}));simhw_add(hw_obj);return ret}function simcore_native_get_signal(elto){return get_value(simhw_sim_signal(elto))>>>0}function simcore_native_set_signal(elto,value){set_value(simhw_sim_signal(elto),value);compute_behavior("FIRE "+elto);return value}function simcore_native_get_value(component,elto){var index=0;var sim_components=simhw_sim_components();var compo_index=component;if("BR"===component)compo_index="CPU";if("DEVICE"===component)compo_index="IO";if(typeof sim_components[compo_index].get_value!=="undefined"){return sim_components[compo_index].get_value(elto)}return false}function simcore_native_set_value(component,elto,value){var index=0;var sim_components=simhw_sim_components();var compo_index=component;if("BR"===component)compo_index="CPU";if("DEVICE"===component)compo_index="IO";if(typeof sim_components[compo_index].set_value!=="undefined"){return sim_components[compo_index].set_value(elto,value)}return false}function simcore_native_get_fields(signature_raw){var SIMWARE=get_simware();for(var key in SIMWARE.firmware){if(SIMWARE.firmware[key].signatureRaw===signature_raw){return SIMWARE.firmware[key].fields}}}function simcore_native_get_field_from_ir(fields,index){if(typeof fields[index]==="undefined"){ws_alert("simcore_native_get_field_from_ir: index ("+index+") out of range.");return false}var value=get_value(simhw_sim_state("REG_IR"));var left_shift=31-parseInt(fields[index].startbit);var right_shift=parseInt(fields[index].stopbit);value=value<>>left_shift;value=value>>>right_shift;return value}function simcore_native_deco(){compute_behavior("DECO")}function simcore_native_go_maddr(maddr){set_value(simhw_sim_state("MUXA_MICROADDR"),maddr)}function simcore_native_go_opcode(){var maddr=get_value(simhw_sim_state("ROM_MUXA"));set_value(simhw_sim_state("MUXA_MICROADDR"),maddr)}function simcore_native_go_instruction(signature_raw){var SIMWARE=get_simware();for(var key in SIMWARE.firmware){if(SIMWARE.firmware[key].signatureRaw===signature_raw){var maddr=SIMWARE.firmware[key]["mc-start"];set_value(simhw_sim_state("MUXA_MICROADDR"),maddr);return}}}function simcore_simstate_checklist2state(checklist){var o={};var ret=false;checklist=checklist.replace(/;|==|!=|>=|<=|=|>|v!=""));for(var i=0;i"===expected_result[compo][elto].op)diff.fulfill=parseInt(diff.obtained)>parseInt(diff.expected);else if("<"===expected_result[compo][elto].op)diff.fulfill=parseInt(diff.obtained)="===expected_result[compo][elto].op)diff.fulfill=parseInt(diff.obtained)>=parseInt(diff.expected);else if("<="===expected_result[compo][elto].op)diff.fulfill=parseInt(diff.obtained)<=parseInt(diff.expected);else if("=="===expected_result[compo][elto].op)diff.fulfill=diff.expected==diff.obtained;else if("!="===expected_result[compo][elto].op)diff.fulfill=diff.expected!=diff.obtained;d.result.push(diff);if(diff.fulfill===false)d.errors++}}if(newones_too&&typeof obtained_result[compo]!="undefined"){for(elto in obtained_result[compo]){d.neltos_obtained++;if(typeof expected_result[compo]!="undefined"&&typeof expected_result[compo][elto]!="undefined"){continue}diff={};diff.expected=obtained_result[compo][elto].default_value;diff.obtained=obtained_result[compo][elto].value;diff.fulfill=diff.expected===diff.obtained;diff.elto_type=compo.toLowerCase();diff.elto_id=obtained_result[compo][elto].id;diff.elto_op="=";d.result.push(diff);if(diff.fulfill===false)d.errors++}}}return d}function simcore_simstate_diff_results(expected_result,obtained_result){return simcore_simstate_check_results(expected_result,obtained_result,true)}function simcore_simstate_diff_states(before_state_obj,after_state_obj){var before_arr=simcore_simstate_state2checklist(before_state_obj,"").split(";");var after_arr=simcore_simstate_state2checklist(after_state_obj,"").split(";");return after_arr.filter((function(elto){return!before_arr.includes(elto)})).join(";").trim()}function simcore_simstate_checkreport2txt(checklist){var o="";for(var i=0;i"+""+""+"Type"+"IdentificationId."+"Values in the clipboard state"+"Values in the selected state"+""+""+"";for(var i=0;i"+""+checklist[i].elto_type+""+""+checklist[i].elto_id+""+""+checklist[i].elto_op+" "+checklist[i].expected+""+""+checklist[i].obtained+""+""}o+=""+"";return o}function simcore_voice_canSpeak(){if(typeof window.speechSynthesis=="undefined"){return false}if(false===get_cfg("use_voice")){return false}return true}function simcore_voice_speak(msg){var ssu=null;if(simcore_voice_canSpeak()){ssu=new SpeechSynthesisUtterance(msg);ssu.lang="es-ES";if("en"==get_cfg("ws_idiom"))ssu.lang="en-US";if("es"==get_cfg("ws_idiom"))ssu.lang="es-EN";window.speechSynthesis.speak(ssu)}}function simcore_voice_stopSpeak(){if(simcore_voice_canSpeak()){window.speechSynthesis.cancel()}}var simcore_rest={};function simcore_rest_reset(){simcore_rest={}}function simcore_rest_add(name,description){simcore_rest[name]={endpoint:description.endpoint,user:description.user,pass:description.pass,last_request:null}}function simcore_rest_list(){return simcore_rest}function simcore_rest_get(name){return simcore_rest[name]}function simcore_rest_call(name,method,uri,data){var rest_info=simcore_rest[name];if(typeof rest_info==="undefined"){return false}var api_endpoint=rest_info.endpoint;if(api_endpoint.value instanceof Vuex.Store){api_endpoint=get_value(api_endpoint)}if(api_endpoint.trim()===""){return false}var basic_auth="Basic "+btoa(rest_info.user+":"+rest_info.pass);var enc_data=JSON.stringify(data);var request={url:api_endpoint+uri,type:method,contentType:"application/json",accepts:"application/json",cache:false,dataType:"json",data:enc_data,beforeSend:function(xhr){if(rest_info.user.trim()!==""){xhr.setRequestHeader("Authorization",basic_auth)}},error:function(jqXHR){console.log("ajax error "+jqXHR.status)}};rest_info.last_request=$.ajax(request);return true}var simcore_notifications=[];function simcore_notifications_get(){return simcore_notifications}function simcore_notifications_reset(){simcore_notifications=[]}function simcore_notifications_add2(ntf){simcore_notifications.push({title:ntf.title,message:ntf.message,type:ntf.type,date:ntf.date})}function simcore_notifications_add(ntf_title,ntf_message,ntf_type,ntf_delay){simcore_notifications.push({title:$("

").html(ntf_title).text(),message:$("

").html(ntf_message).text(),type:ntf_type,date:(new Date).getTime()})}function get_value(sim_obj){if(sim_obj.value instanceof Vuex.Store){return sim_obj.value.state.value}return sim_obj.value}function set_value(sim_obj,value){if(sim_obj.value instanceof Vuex.Store){sim_obj.value.commit("set_value",value);return}var old_value=sim_obj.value;sim_obj.value=value;if(old_value!=value){sim_obj.changed=true}}function reset_value(sim_obj){if(sim_obj.value instanceof Vuex.Store){set_value(sim_obj,sim_obj.default_value);return}if(typeof sim_obj.default_value=="object"){sim_obj.changed=true;sim_obj.value=Object.create(sim_obj.default_value);return}if(sim_obj instanceof Array){sim_obj.changed=true;for(var i=0;i",""":'"',"'":"'"};function treatHTMLSequences(text_with_html){var re=null;var key=null;for(key in html_sequences){re=new RegExp(key,"gi");text_with_html=text_with_html.replace(re,html_sequences[key])}return text_with_html}function control_memory_getkeys(memory){return Object.keys(memory)}function control_memory_get(memory,elto){return memory[elto]}function control_memory_set(memory,elto,melto){if(typeof melto.changed==="undefined")melto.changed=false;if(typeof melto.state==="undefined")melto.state=false;if(typeof melto.breakpoint==="undefined")melto.breakpoint=false;if(typeof melto.notify==="undefined")melto.notify=[];if(typeof melto.is_native==="undefined")melto.is_native=false;var comments_str="";if(null!=melto.comments){comments_str=melto.comments;if(melto.comments instanceof Array)comments_str=melto.comments.join("\n");melto.state=melto.state||comments_str.trim().split("state:").length>1;melto.breakpoint=melto.breakpoint||comments_str.trim().split("break:").length>1;melto.notify=comments_str.trim().split("notify:");for(var k=0;k";if(active_verbal.trim()==="")active_verbal="";return"Activated signals are: "+active_signals+". Associated actions are: "+active_verbal}function main_memory_getkeys(memory){return Object.keys(memory)}function main_memory_get(memory,elto){return memory[elto]}function main_memory_set(memory,elto,melto){if(typeof melto.changed==="undefined")melto.changed=false;if(typeof melto.state==="undefined")melto.state=false;if(typeof melto.breakpoint==="undefined")melto.breakpoint=false;if(typeof melto.notify==="undefined")melto.notify=[];if(typeof melto.is_assembly==="undefined")melto.is_assembly=false;if(typeof melto.source==="undefined")melto.source="";var comments_str="";if(null!=melto.comments){comments_str=melto.comments.join("\n");melto.state=melto.state||comments_str.trim().split("state:").length>1;melto.breakpoint=melto.breakpoint||comments_str.trim().split("break:").length>1;melto.notify=comments_str.trim().split("notify:");for(var k=0;k>8;if(2==filter_elto)dbvalue=(value&16711680)>>16;if(3==filter_elto)dbvalue=(value&4278190080)>>24;break;case 1:if(0==filter_elto)dbvalue=value&65535;if(1==filter_elto)dbvalue=value&65535;if(2==filter_elto)dbvalue=(value&4294901760)>>16;if(3==filter_elto)dbvalue=(value&4294901760)>>16;break;case 2:if(0==filter_elto)dbvalue=value&16777215;if(1==filter_elto)dbvalue=value&4294967040;break;case 3:dbvalue=value;break}return dbvalue}function main_memory_updatevalues(value,dbvalue,filter_size,filter_elto){switch(filter_size){case 0:if(0==filter_elto)value=value&4294967040|dbvalue&255;if(1==filter_elto)value=value&4294902015|(dbvalue&255)<<8;if(2==filter_elto)value=value&4278255615|(dbvalue&255)<<16;if(3==filter_elto)value=value&16777215|(dbvalue&255)<<24;break;case 1:if(0==filter_elto)value=value&4294901760|dbvalue&65535;if(1==filter_elto)value=value&4294901760|dbvalue&65535;if(2==filter_elto)value=value&65535|(dbvalue&65535)<<16;if(3==filter_elto)value=value&65535|(dbvalue&65535)<<16;break;case 2:if(0==filter_elto)value=value&4278190080|dbvalue&16777215;if(1==filter_elto)value=value&255|dbvalue&4294967040;break;case 3:value=dbvalue;break}return value}function main_memory_get_program_counter(){var r_ref=simhw_sim_ctrlStates_get().pc;var r_value=null;if(typeof r_ref!=="undefined"){r_ref=simhw_sim_state(r_ref.state)}if(typeof r_ref!=="undefined"){r_value=get_value(r_ref)}return r_value}function main_memory_get_baseaddr(){var r_ref=simhw_sim_ctrlStates_get();if(typeof r_ref==="undefined"){return null}var parts=null;var r_value=0;var r_ref2=null;var all_baseaddr={};for(var elto in r_ref){if(r_ref[elto].is_pointer==false){continue}parts=r_ref[elto].state.split(".");if(parts[0]=="BR"){r_value=4294967292;r_ref2=simhw_sim_states().BR[parts[1]]}else{r_value=0;r_ref2=simhw_sim_state(r_ref[elto].state)}if(typeof r_ref2!=="undefined"){r_value=get_value(r_ref2)}all_baseaddr[elto]=r_value}return all_baseaddr}function get_deco_from_pc(pc){var mp_obj=simhw_internalState("MP");if(typeof mp_obj==="undefined"||typeof mp_obj[pc]==="undefined"||typeof mp_obj[pc].source==="undefined"){return""}return mp_obj[pc].source}function get_verbal_from_current_pc(){var pc_name=simhw_sim_ctrlStates_get().pc.state;var reg_pc=get_value(simhw_sim_state(pc_name));var pc=parseInt(reg_pc)-4;var decins=get_deco_from_pc(pc);if(""==decins.trim()){decins="not jet defined"}return"Current instruction is: "+decins+" and PC points to "+show_value(pc)+". "}function cache_memory_update_stats(memory,address,parts,r_w,m_h,clock_timestamp){memory.stats.n_access++;memory.stats.last_addr=address;memory.stats.last_parts=parts;memory.stats.last_r_w=r_w;memory.stats.last_h_m=m_h;if(m_h=="miss"){memory.stats.n_misses++}else{memory.stats.n_hits++}memory.sets[parts.set].tags[parts.tag].n_access++;if(r_w=="write"){memory.sets[parts.set].tags[parts.tag].dirty=1}memory.sets[parts.set].tags[parts.tag].timestamp=clock_timestamp}function cache_memory_select_victim(memory,set){var keys=Object.keys(memory.sets[set].tags);var tag_victim=0;if(memory.cfg.replace_pol=="lfu"){tag_victim=keys[0];var tag_naccess=memory.sets[parts.set].tags[tag_victim].n_access;for(var i=1;imemory.sets[parts.set].tags[keys[i]].n_access){tag_victim=keys[i];tag_naccess=memory.sets[parts.set].tags[tag_victim].n_access}}}else if(memory.cfg.replace_pol=="fifo"){tag_victim=keys[0];var tag_stamp=memory.sets[parts.set].tags[tag_victim].timestamp;for(var i=1;imemory.sets[parts.set].tags[keys[i]].timestamp){tag_victim=keys[i];tag_stamp=memory.sets[parts.set].tags[tag_victim].timestamp}}}else if(memory.cfg.replace_pol=="first"){tag_victim=keys[0]}return tag_victim}function cache_memory_init(name,via_size,off_size,set_size,replace_pol,su_pol,next_cache){var c={stats:{},cfg:{},sets:{}};c.cfg.name=name;c.cfg.via_size=via_size;c.cfg.off_size=off_size;c.cfg.set_size=set_size;c.cfg.vps_size=via_size-set_size;c.cfg.tag_size=32-set_size-off_size;c.cfg.mask_tag=Math.pow(2,c.cfg.tag_size)-1>>>0;c.cfg.mask_set=Math.pow(2,c.cfg.set_size)-1>>>0;c.cfg.mask_off=Math.pow(2,c.cfg.off_size)-1>>>0;c.cfg.mask_tag=c.cfg.mask_tag<<32-c.cfg.tag_size>>>0;c.cfg.mask_set=c.cfg.mask_set<>>0;c.cfg.replace_pol=replace_pol;c.cfg.su_pol=su_pol;c.cfg.next_cache=next_cache;c.stats.n_access=0;c.stats.n_hits=0;c.stats.n_misses=0;c.stats.last_addr=0;c.stats.last_parts=cache_memory_split(c,0);c.stats.last_r_w="";c.stats.last_h_m="";return c}function cache_memory_init2(cfg){return cache_memory_init(cfg.name,cfg.via_size,cfg.off_size,cfg.set_size,cfg.replace_pol,cfg.su_pol,cfg.next_cache)}function cache_memory_init3(array_cm_cfg){var array_cm=[];for(var i=0;i>>0;parts.tag=(address&memory.cfg.mask_tag)>>>32-memory.cfg.tag_size;parts.set=(address&memory.cfg.mask_set)>>>memory.cfg.off_size;parts.offset=address&memory.cfg.mask_off;return parts}function cache_memory_access(memory,address,r_w,clock_timestamp){if(memory.cfg.su_pol!="unified"){if("split_i"==memory.cfg.su_pol&&segments_addr_within_text(address)==false){return false}if("split_d"==memory.cfg.su_pol&&segments_addr_within_data(address)==false){return false}}var parts=cache_memory_split(memory,address);if(typeof memory.sets[parts.set]=="undefined"){memory.sets[parts.set]={tags:{},number_tags:0}}if(typeof memory.sets[parts.set].tags[parts.tag]!="undefined"&&memory.sets[parts.set].tags[parts.tag].valid==1){cache_memory_update_stats(memory,address,parts,r_w,"hit",clock_timestamp);return true}if(typeof memory.sets[parts.set].number_tags>3){var tag_victim=cache_memory_select_victim(memory,parts.set);memory.sets[parts.set].tags[tag_victim].valid=0;memory.sets[parts.set].number_tags--}memory.sets[parts.set].tags[parts.tag]={n_access:0,valid:1,dirty:0};memory.sets[parts.set].number_tags++;cache_memory_update_stats(memory,address,parts,r_w,"miss",clock_timestamp);if(memory.cfg.next_cache!=null){cache_memory_access(memory.cfg.next_cache,address,r_w)}return false}var sim={systems:[],active:null,index:0};function simhw_add(newElto){var found=-1;for(var m=0;m=0&&sim.systems.length>=newActive){sim.active=sim.systems[newActive];sim.index=newActive}compile_behaviors();firedep_to_fireorder(jit_fire_dep);compute_references();compile_verbals()}function simhw_getIdByName(short_name){for(var m=0;m>>0).toString(16)}function check_behavior(){if(0==simhw_sim_signals().length){ws_alert("ALERT: empty signals!!!")}if(0==simhw_sim_states().length){ws_alert("ALERT: empty states!!!")}for(var key in simhw_sim_signals()){for(var key2 in simhw_sim_signal(key).behavior){var behaviors=simhw_sim_signal(key).behavior[key2].split(";");for(var i=0;i "+behavior_k[0]+" ("+behavior_i+")");return}if(behavior_k.length!=simhw_syntax_behavior(behavior_k[0]).nparameters){ws_alert("ALERT: Behavior has an incorrect number of elements --\x3e "+behavior_i+"/"+simhw_syntax_behavior(behavior_k[0]).nparameters);return}for(var j=1;j '"+behavior_i);return}else if("S"==t&&typeof simhw_sim_signal(s[0])=="undefined"){ws_alert("ALERT: Behavior has an undefined reference to a signal -> '"+behavior_i);return}else if("X"==t&&typeof simhw_sim_state(s[0])=="undefined"&&typeof simhw_sim_signal(s[0])=="undefined"){ws_alert("ALERT: Behavior has an undefined reference to a object state OR signal -> '"+behavior_i);return}}}}}}var jit_behaviors=false;var jit_verbals=false;var jit_fire_dep=null;var jit_fire_order=null;var jit_dep_network=null;var jit_fire_ndep=null;function firedep_to_fireorder(jit_fire_dep){var allfireto=false;jit_fire_order=[];jit_fire_ndep=[];for(var sig in simhw_sim_signals()){if(typeof jit_fire_dep[sig]=="undefined"){jit_fire_order.push(sig);continue}ndep=0;allfireto=false;for(var sigorg in jit_fire_dep[sig]){ndep++;if(jit_fire_dep[sig][sigorg]==simhw_sim_signal(sigorg).behavior.length){allfireto=true}}jit_fire_ndep[sig]=ndep;if(allfireto==false)jit_fire_order.push(sig)}}function compile_behaviors(){var jit_bes="";jit_fire_dep={};var sig_obj=null;var expr_obj=null;for(var sig in simhw_sim_signals()){jit_bes+="simhw_sim_signal('"+sig+"').behavior_fn = new Array();\n";for(var val in simhw_sim_signal(sig).behavior){var input_behavior=simhw_sim_signal(sig).behavior[val];var jit_be="";var s_exprs=input_behavior.split(";");for(var i=0;i"+v+"";if("Signals"!=enum_name)o+="("+(i+1)+") "+v;else o+="("+(i+1)+") "+hash_eltos[array_eltos[i]].ref+": "+v;if(i!=array_eltos.length-1){o+=str_enditem}}o+=". ";return o}function simhwelto_describe_component_enum(elto_path,array_eltos,hash_eltos,enum_name){var o="";o+=""+i18n_get_TagFor("hw","It has")+""+" "+array_eltos.length+" "+""+i18n_get_TagFor("hw",enum_name)+""+": "+simhwelto_describe_component_enum_aux(elto_path,array_eltos,hash_eltos,enum_name,", ");return o}function simhwelto_describe_component(elto_path,elto,format){var o="";o+=elto.description+".

    "+"
  • "+simhwelto_describe_component_enum(elto_path+":states:",elto.states_inputs,elto.states,"inputs")+"
    "+"
  • "+simhwelto_describe_component_enum(elto_path+":states:",elto.states_outputs,elto.states,"outputs")+"
    "+"
  • "+simhwelto_describe_component_enum(elto_path+":signals:",elto.signals_inputs,elto.signals,"signals")+"
    "+"
";if(format!="html"){o.replace(/<[^>]*>?/gm,"")}return o}var ep_def={sim_name:"Elemental Processor",sim_short_name:"ep",sim_img_processor:"examples/hardware/ep/images/processor.svg",sim_img_controlunit:"examples/hardware/ep/images/controlunit.svg",sim_img_cpu:"examples/hardware/ep/images/cpu.svg",components:{},states:{},signals:{},behaviors:{},elements:{},internal_states:{},ctrl_states:{},events:{}};simhw_add(ep_def);sim.ep.behaviors.PRINT_S={nparameters:2,types:["S"],operation:function(s_expr){console.log(s_expr[1]+": 0x"+sim.ep.signals[s_expr[1]].value.toString(16))},verbal:function(s_expr){return"Print value of signal "+s_expr[1]+": 0x"+sim.ep.signals[s_expr[1]].value.toString(16)+". "}};sim.ep.behaviors.PRINT_E={nparameters:2,types:["E"],operation:function(s_expr){console.log(s_expr[1]+": 0x"+sim.ep.states[s_expr[1]].value.toString(16))},verbal:function(s_expr){return"Print value of state "+s_expr[1]+": 0x"+sim.ep.states[s_expr[1]].value.toString(16)+". "}};sim.ep.components["CPU"]={name:"CPU",version:"1",abilities:["CPU"],details_name:["REGISTER_FILE","CONTROL_MEMORY","CLOCK","CPU_STATS"],details_fire:[["svg_p:text3029","svg_p:text3031"],["svg_cu:text3010"],["svg_p:text3459-7","svg_cu:text4138","svg_cu:text4138-7"],["svg_p:text3495"]],write_state:function(vec){if(typeof vec.CPU=="undefined"){vec.CPU={}}var internal_reg=["PC","SR"];var value=0;for(var i=0;i>>0;if(value!=0){vec.CPU["R"+i]={type:"register",default_value:0,id:"R"+i,op:"=",value:"0x"+value.toString(16)}}}for(i=0;i>>0;if(value!=0){vec.CPU[internal_reg[i]]={type:"register",default_value:0,id:internal_reg[i],op:"=",value:"0x"+value.toString(16)}}}return vec},read_state:function(vec,check){if(typeof vec.CPU=="undefined"){vec.CPU={}}var key=check["id"].toUpperCase().trim();var val=parseInt(check["value"]).toString(16);if("REGISTER"==check["type"].toUpperCase().trim()){vec.CPU[key]={type:"register",default_value:0,id:key,op:check["condition"],value:"0x"+val};return true}return false},get_state:function(reg){var value=0;var r_reg=reg.toUpperCase().trim();if(typeof sim.ep.states["REG_"+r_reg]!="undefined"){value=get_value(sim.ep.states["REG_"+r_reg])>>>0;return"0x"+value.toString(16)}r_reg=r_reg.replace("R","");var index=parseInt(r_reg);if(typeof sim.ep.states.BR[index]!="undefined"){value=get_value(sim.ep.states.BR[index])>>>0;return"0x"+value.toString(16)}return null},get_value:function(elto){if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index))return get_value(simhw_sim_state(elto))>>>0;return get_value(simhw_sim_states().BR[index])>>>0},set_value:function(elto,value){var pc_name=simhw_sim_ctrlStates_get().pc.state;if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index)){set_value(simhw_sim_state(elto),value);if(pc_name===elto){show_asmdbg_pc()}return value}return set_value(simhw_sim_states().BR[index],value)}};sim.ep.ctrl_states.pc={name:"PC",state:"REG_PC",is_pointer:true};sim.ep.ctrl_states.sp={name:"SP",state:"BR.29",is_pointer:true};sim.ep.ctrl_states.fp={name:"FP",state:"BR.30",is_pointer:true};sim.ep.ctrl_states.ir={name:"IR",state:"REG_IR",default_eltos:{co:{begin:0,end:5,length:6},cop:{begin:28,end:31,length:4}},is_pointer:false};sim.ep.ctrl_states.mpc={name:"mPC",state:"REG_MICROADDR",is_pointer:false};sim.ep.internal_states.MC={};sim.ep.internal_states.ROM={};sim.ep.internal_states.FIRMWARE=ws_empty_firmware;sim.ep.internal_states.io_hash={};sim.ep.internal_states.fire_stack=[];sim.ep.internal_states.tri_state_names=["T1","T2","T3","T4","T5","T6","T7","T8","T9","T10","T11","T12"];sim.ep.internal_states.fire_visible={databus:false,internalbus:false};sim.ep.internal_states.filter_states=["REG_IR_DECO,col-12","REG_IR,col-auto","REG_PC,col-auto","REG_MAR,col-auto","REG_MBR,col-auto","REG_RT1,col-auto","REG_RT2,col-auto","REG_RT3,col-auto","REG_SR,col-auto","REG_MICROADDR,col-auto"];sim.ep.internal_states.filter_signals=["A0,0","B,0","C,0","SELA,5","SELB,5","SELC,2","SELCOP,0","MR,0","MC,0","C0,0","C1,0","C2,0","C3,0","C4,0","C5,0","C6,0","C7,0","T1,0","T2,0","T3,0","T4,0","T5,0","T6,0","T7,0","T8,0","T9,0","T10,0","T11,0","M1,0","M2,0","M7,0","MA,0","MB,0","SELP,0","LC,0","SE,0","SIZE,0","OFFSET,0","BW,0","R,0","W,0","TA,0","TD,0","IOR,0","IOW,0","TEST_I,0","TEST_U,0"];sim.ep.internal_states.alu_flags={flag_n:0,flag_z:0,flag_v:0,flag_c:0};sim.ep.states.BR=[];sim.ep.states.BR[0]={name:"R0",verbal:"Register 0",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[1]={name:"R1",verbal:"Register 1",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[2]={name:"R2",verbal:"Register 2",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[3]={name:"R3",verbal:"Register 3",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[4]={name:"R4",verbal:"Register 4",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[5]={name:"R5",verbal:"Register 5",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[6]={name:"R6",verbal:"Register 6",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[7]={name:"R7",verbal:"Register 7",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[8]={name:"R8",verbal:"Register 8",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[9]={name:"R9",verbal:"Register 9",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[10]={name:"R10",verbal:"Register 10",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[11]={name:"R11",verbal:"Register 11",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[12]={name:"R12",verbal:"Register 12",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[13]={name:"R13",verbal:"Register 13",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[14]={name:"R14",verbal:"Register 14",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[15]={name:"R15",verbal:"Register 15",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[16]={name:"R16",verbal:"Register 16",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[17]={name:"R17",verbal:"Register 17",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[18]={name:"R18",verbal:"Register 18",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[19]={name:"R19",verbal:"Register 19",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[20]={name:"R20",verbal:"Register 20",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[21]={name:"R21",verbal:"Register 21",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[22]={name:"R22",verbal:"Register 22",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[23]={name:"R23",verbal:"Register 23",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[24]={name:"R24",verbal:"Register 24",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[25]={name:"R25",verbal:"Register 25",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[26]={name:"R26",verbal:"Register 26",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[27]={name:"R27",verbal:"Register 27",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[28]={name:"R28",verbal:"Register 28",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[29]={name:"R29",verbal:"Register 29",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[30]={name:"R30",verbal:"Register 30",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.BR[31]={name:"R31",verbal:"Register 31",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_PC"]={name:"PC",verbal:"Program Counter Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_MAR"]={name:"MAR",verbal:"Memory Address Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_MBR"]={name:"MBR",verbal:"Memory Data Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_IR"]={name:"IR",verbal:"Instruction Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_RT1"]={name:"RT1",verbal:"Temporal 1 Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_RT2"]={name:"RT2",verbal:"Temporal 2 Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_RT3"]={name:"RT3",verbal:"Temporal 3 Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_SR"]={name:"SR",verbal:"State Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BUS_IB"]={name:"I_BUS",verbal:"Internal Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BUS_AB"]={name:"A_BUS",verbal:"Address Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BUS_CB"]={name:"C_BUS",verbal:"Control Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BUS_DB"]={name:"D_BUS",verbal:"Data Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["C2_T2"]={name:"C2_T2",verbal:"Output of PC",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["RA_T9"]={name:"RA_T9",verbal:"Input of T9 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["RB_T10"]={name:"RB_T10",verbal:"Input of T10 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["HPC_T12"]={name:"HPC_T12",verbal:"Input of T12 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["SELEC_T3"]={name:"SELEC_T3",verbal:"Input of T3 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["SELP_M7"]={name:"SELP_M7",verbal:"Output of MUX SelP",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["ALU_C6"]={name:"ALU_C6",verbal:"Input of Temporal 3 Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["MA_ALU"]={name:"MA_ALU",verbal:"Input ALU via MA",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["MB_ALU"]={name:"MB_ALU",verbal:"Input ALU via MB",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_C"]={name:"FLAG_C",verbal:"Carry Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_V"]={name:"FLAG_V",verbal:"Overflow Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_N"]={name:"FLAG_N",verbal:"Negative Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_Z"]={name:"FLAG_Z",verbal:"Zero Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_I"]={name:"FLAG_I",verbal:"Interruption Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["FLAG_U"]={name:"FLAG_U",verbal:"User Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["REG_MICROADDR"]={name:"µADDR",verbal:"Microaddress Register",visible:true,nbits:"12",value:0,default_value:0,draw_data:["svg_cu:text4667"]};sim.ep.states["REG_MICROINS"]={name:"µINS",verbal:"Microinstruction Register",visible:true,nbits:"77",value:{},default_value:{},draw_data:[]};sim.ep.states["FETCH"]={name:"FETCH",verbal:"Input Fetch",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.ep.states["ROM_MUXA"]={name:"ROM_MUXA",verbal:"Input ROM",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.ep.states["SUM_ONE"]={name:"SUM_ONE",verbal:"Input next microinstruction",visible:false,nbits:"12",value:1,default_value:1,draw_data:[]};sim.ep.states["MUXA_MICROADDR"]={name:"MUXA_MICROADDR",verbal:"Input microaddress",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.ep.states["MUXC_MUXB"]={name:"MUXC_MUXB",verbal:"Output of MUX C",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["INEX"]={name:"INEX",verbal:"Illegal Instruction Exception",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["BS_M1"]={name:"BS_M1",verbal:"from Memory",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["BS_TD"]={name:"BS_TD",verbal:"Memory",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["INTV"]={name:"INTV",verbal:"Interruption Vector",visible:false,nbits:"8",value:0,default_value:0,draw_data:[]};sim.ep.states["M2_C2"]={name:"M2_C2",verbal:"Input of Program Counter",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["M1_C1"]={name:"M1_C1",verbal:"Input of Memory Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["M7_C7"]={name:"M7_C7",verbal:"Input of State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["VAL_ZERO"]={name:"VAL_ZERO",verbal:"Wired Zero",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.ep.states["VAL_ONE"]={name:"VAL_ONE",verbal:"Wired One",visible:false,nbits:"32",value:1,default_value:1,draw_data:[]};sim.ep.states["VAL_FOUR"]={name:"VAL_FOUR",verbal:"Wired Four",visible:false,nbits:"32",value:4,default_value:4,draw_data:[]};sim.ep.states["REG_IR_DECO"]={name:"IR_DECO",verbal:"Instruction Decoded",visible:true,nbits:"0",value:0,default_value:0,draw_data:[]};sim.ep.states["DECO_INS"]={name:"DECO_INS",verbal:"Instruction decoded in binary",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["CLK"]={name:"CLK",verbal:"Clock",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["ACC_TIME"]={name:"ACC_TIME",verbal:"Accumulated CPU time",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["TTCPU"]={name:"TTCPU",verbal:"Several Tristates to the internal data bus in CPU activated",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states["ACC_PWR"]={name:"ACC_PWR",verbal:"Accumulated Energy Consumption",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.signals["C"]={name:"C",visible:true,type:"L",value:0,default_value:0,nbits:"4",behavior:["MV MUXC_MUXB VAL_ZERO; FIRE B","MBIT MUXC_MUXB INT 0 1; FIRE B","MBIT MUXC_MUXB IORDY 0 1; FIRE B","MBIT MUXC_MUXB MRDY 0 1; FIRE B","MBIT MUXC_MUXB REG_SR 0 1; FIRE B","MBIT MUXC_MUXB REG_SR 1 1; FIRE B","MBIT MUXC_MUXB REG_SR 28 1; FIRE B","MBIT MUXC_MUXB REG_SR 29 1; FIRE B","MBIT MUXC_MUXB REG_SR 30 1; FIRE B","MBIT MUXC_MUXB REG_SR 31 1; FIRE B","MV MUXC_MUXB INEX; FIRE B"],fire_name:["svg_cu:text3410"],draw_data:[["svg_cu:path3108"],["svg_cu:path3062"],["svg_cu:path3060"],["svg_cu:path3136"],["svg_cu:path3482"],["svg_cu:path3480"],["svg_cu:path3488"],["svg_cu:path3486"],["svg_cu:path3484"],["svg_cu:path3484-9"],["svg_cu:path3108-3","svg_cu:path3260-3-8-6","svg_cu:path3260-3-8","svg_cu:path3260-3"]],draw_name:[["svg_cu:path3496","svg_cu:path3414","svg_cu:path3194-08"]]};sim.ep.signals["B"]={name:"B",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV A1 MUXC_MUXB; FIRE A1","NOT_ES A1 MUXC_MUXB; FIRE A1"],depends_on:["CLK"],fire_name:["svg_cu:text3408"],draw_data:[["svg_cu:path3100-8-7","svg_cu:path3108-1"],["svg_cu:path3392","svg_cu:path3372","svg_cu:path3390","svg_cu:path3384","svg_cu:path3100-8-7"]],draw_name:[[],["svg_cu:path3194-0","svg_cu:path3138-8","svg_cu:path3498-6"]]};sim.ep.signals["A0"]={name:"A0",visible:false,type:"L",value:0,default_value:0,nbits:"1",behavior:["SBIT_SIGNAL A0A1 0 1; FIRE A0A1","SBIT_SIGNAL A0A1 1 1; FIRE A0A1"],depends_on:["CLK"],fire_name:["svg_cu:text3406"],draw_data:[["svg_cu:path3096"],["svg_cu:path3096"]],draw_name:[[],["svg_cu:path3138-8-1","svg_cu:path3098-2","svg_cu:path3124-2-5"]]};sim.ep.signals["A1"]={name:"A1",visible:false,type:"L",value:0,default_value:0,nbits:"1",behavior:["SBIT_SIGNAL A0A1 0 0; FIRE A0A1","SBIT_SIGNAL A0A1 1 0; FIRE A0A1"],depends_on:["CLK"],fire_name:[],draw_data:[["svg_cu:path3094"],["svg_cu:path3094"]],draw_name:[[]]};sim.ep.signals["A0A1"]={name:"A0A1",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["PLUS1 MUXA_MICROADDR REG_MICROADDR","CP_FIELD MUXA_MICROADDR REG_MICROINS/MADDR","MV MUXA_MICROADDR ROM_MUXA","MV MUXA_MICROADDR FETCH"],depends_on:["CLK"],fire_name:[],draw_data:[["svg_cu:path3102","svg_cu:path3100","svg_cu:path3098","svg_cu:path3100-9","svg_cu:path3088"],["svg_cu:path3104","svg_cu:path3134","svg_cu:path3500","svg_cu:path3416"],["svg_cu:path3504","svg_cu:path3100-8","svg_cu:path3234-9"],["svg_cu:path3124"]],draw_name:[[]]};sim.ep.signals["C0"]={name:"C0",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_MAR BUS_IB"],fire_name:["svg_p:text3077"],draw_data:[["svg_p:path3081"]],draw_name:[["svg_p:path3075"]]};sim.ep.signals["C1"]={name:"C1",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_MBR M1_C1"],fire_name:["svg_p:text3079"],draw_data:[["svg_p:path3055"]],draw_name:[["svg_p:path3073"]]};sim.ep.signals["C2"]={name:"C2",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_PC M2_C2; UPDATEDPC"],fire_name:["svg_p:text3179"],draw_data:[["svg_p:path3485"]],draw_name:[["svg_p:path3177"]]};sim.ep.signals["C3"]={name:"C3",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_IR BUS_IB; DECO; FIRE_IFSET C 10"],fire_name:["svg_p:text3439"],draw_data:[["svg_p:path3339"]],draw_name:[["svg_p:path3337"]]};sim.ep.signals["C4"]={name:"C4",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_RT1 BUS_IB"],fire_name:["svg_p:text3441"],draw_data:[["svg_p:path3263"]],draw_name:[["svg_p:path3255"]]};sim.ep.signals["C5"]={name:"C5",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_RT2 BUS_IB"],fire_name:["svg_p:text3443"],draw_data:[["svg_p:path3277"]],draw_name:[["svg_p:path3269"]]};sim.ep.signals["C6"]={name:"C6",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_RT3 ALU_C6"],fire_name:["svg_p:text3445"],draw_data:[["svg_p:path3325","svg_p:path3323","svg_p:path3321","svg_p:path3261-8","svg_p:path3317-9","svg_p:path3901-6-9"]],draw_name:[["svg_p:path3245"]]};sim.ep.signals["C7"]={name:"C7",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_SR M7_C7"],fire_name:["svg_p:text3655"],draw_data:[["svg_p:path3651-9"]],draw_name:[["svg_p:path3681"]]};sim.ep.signals["TA"]={name:"TA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MV BUS_AB REG_MAR; MOVE_BITSE A1A0 0 2 BUS_AB 0; FIRE_IFCHANGED A1A0 A1A0"],fire_name:["svg_p:text3091"],draw_data:[["svg_p:path3083","svg_p:path3089","svg_p:path3597","svg_p:path3513","svg_p:path3601","svg_p:path3601-2","svg_p:path3187","svg_p:path3087","svg_p:path2995","svg_p:path3535"]],draw_name:[["svg_p:path3085"]]};sim.ep.signals["TD"]={name:"TD",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; CHECK_RTD","MV BUS_DB BS_TD; MOVE_BITSE A1A0 0 2 BUS_AB 0; FIRE_IFCHANGED A1A0 A1A0; CHECK_RTD"],fire_name:["svg_p:text3103"],draw_data:[["svg_p:path3093","svg_p:path3101","svg_p:path3587","svg_p:path3515","svg_p:path3071","svg_p:path3419","svg_p:path3099","svg_p:path3097","svg_p:path3559-5","svg_p:path3419-1-0","svg_p:path3583","svg_p:path3419-1","svg_p:path3491","svg_p:path3641","svg_p:path3541"]],draw_name:[["svg_p:path3095"]]};sim.ep.signals["T1"]={name:"T1",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 0","MV BUS_IB REG_MBR; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 0"],fire_name:["svg_p:text3105"],draw_data:[["svg_p:path3065","svg_p:path3071","svg_p:path3049","svg_p:path3063-9","svg_p:path3071","svg_p:path3071","svg_p:path3069"]],draw_name:[["svg_p:path3067"]]};sim.ep.signals["T2"]={name:"T2",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 1","MV BUS_IB REG_PC; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 1"],fire_name:["svg_p:text3449"],draw_data:[["svg_p:path3195","svg_p:path3199","svg_p:path3201","svg_p:path3049"]],draw_name:[["svg_p:path3329"]]};sim.ep.signals["T3"]={name:"T3",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 2","MV BUS_IB SELEC_T3; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 2"],fire_name:["svg_p:text3451"],draw_data:[["svg_p:path3347","svg_p:path3349","svg_p:path3931","svg_p:path3345","svg_p:path3049"]],draw_name:[["svg_p:path3351"]]};sim.ep.signals["T4"]={name:"T4",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 3","MV BUS_IB REG_RT1; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 3"],fire_name:["svg_p:text3453"],draw_data:[["svg_p:path3257","svg_p:path3261","svg_p:path3259","svg_p:path3049"]],draw_name:[["svg_p:path3305"]]};sim.ep.signals["T5"]={name:"T5",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 4","MV BUS_IB REG_RT2; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 4"],fire_name:["svg_p:text3455"],draw_data:[["svg_p:path3271","svg_p:path3275","svg_p:path3273","svg_p:path3049"]],draw_name:[["svg_p:path3307"]]};sim.ep.signals["T6"]={name:"T6",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 5","MV BUS_IB ALU_C6; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 5"],fire_name:["svg_p:text3457"],draw_data:[["svg_p:path3315","svg_p:path3589","svg_p:path3317","svg_p:path3163-2","svg_p:path3049","svg_p:path3321","svg_p:path3261-8","svg_p:path3317-9","svg_p:path3901-6-9"]],draw_name:[["svg_p:path3319"]]};sim.ep.signals["T7"]={name:"T7",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 6","MV BUS_IB REG_RT3; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 6"],fire_name:["svg_p:text3459"],draw_data:[["svg_p:path3309","svg_p:path3327","svg_p:path3311","svg_p:path3049"]],draw_name:[["svg_p:path3313"]]};sim.ep.signals["T8"]={name:"T8",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 7","MV BUS_IB REG_SR; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 7"],fire_name:["svg_p:text3657"],draw_data:[["svg_p:path3645","svg_p:path3651","svg_p:path3647","svg_p:path3049"]],draw_name:[["svg_p:path3649"]]};sim.ep.signals["T9"]={name:"T9",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 8","MV BUS_IB RA_T9; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 8"],fire_name:["svg_p:text3147"],draw_data:[["svg_p:path3131","svg_p:path3143","svg_p:path3139","svg_p:path3049","svg_p:path3143-9"]],draw_name:[["svg_p:path3133"]]};sim.ep.signals["T10"]={name:"T10",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 9","MV BUS_IB RB_T10; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 9"],fire_name:["svg_p:text3149"],draw_data:[["svg_p:path3135","svg_p:path3145","svg_p:path3141","svg_p:path3049","svg_p:path3145-5"]],draw_name:[["svg_p:path3137"]]};sim.ep.signals["T11"]={name:"T11",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 10","CP_FIELD BUS_IB REG_MICROINS/EXCODE; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 10"],fire_name:["svg_p:text3147-5","svg_cu:tspan4426"],draw_data:[["svg_p:path3131-3","svg_p:path3145","svg_p:path3081-3","svg_p:path3139-7","svg_p:path3049","svg_cu:path3081-3","svg_cu:path3139-7"]],draw_name:[["svg_p:path3133-6","svg_cu:path3133-6"]]};sim.ep.signals["T12"]={name:"T12",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 11","MV BUS_IB HPC_T12; FIRE M7; FIRE M2; FIRE M1; SET_TT TTCPU 11"],fire_name:["svg_p:text3147-5-0-1-1"],draw_data:[["svg_p:path3131-3-8-4-31","svg_p:path3139-7-1-4-3","svg_p:path3049","svg_p:path3081-3-8-5-3"]],draw_name:[["svg_p:path3133-6-9-7-5"]]};sim.ep.signals["M1"]={name:"M1",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M1_C1 BUS_IB","MV M1_C1 BS_M1"],depends_on:["C1"],fire_name:["svg_p:text3469"],draw_data:[["svg_p:path3063","svg_p:path3061","svg_p:path3059"],["svg_p:path3057","svg_p:path3641","svg_p:path3419","svg_p:path3583"]],draw_name:[[],["svg_p:path3447"]]};sim.ep.signals["M2"]={name:"M2",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M2_C2 BUS_IB","PLUS4 M2_C2 REG_PC"],depends_on:["C2"],fire_name:["svg_p:text3471"],draw_data:[["svg_p:path3217","svg_p:path3215","svg_p:path3213","svg_p:path3213-9"],["svg_p:path3211","svg_p:path3209","svg_p:path3193","svg_p:path3207","svg_p:path3197","svg_p:path3201"]],draw_name:[[],["svg_p:path3467","svg_p:path3467"]]};sim.ep.signals["M7"]={name:"M7",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M7_C7 BUS_IB","MV M7_C7 SELP_M7"],depends_on:["C7"],fire_name:["svg_p:text3673"],draw_data:[["svg_p:path3691","svg_p:path3693","svg_p:path3659"],["svg_p:path3695"]],draw_name:[[],["svg_p:path3667"]]};sim.ep.signals["MA"]={name:"MA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV MA_ALU RA_T9; FIRE COP","MV MA_ALU REG_RT1; FIRE COP"],depends_on:["SELA","SELB"],fire_name:["svg_p:text3463"],draw_data:[["svg_p:path3249","svg_p:path3161","svg_p:path3165"],["svg_p:path3279"]],draw_name:[[],["svg_p:path3423"]]};sim.ep.signals["MB"]={name:"MB",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MV MB_ALU RB_T10; FIRE COP","MV MB_ALU REG_RT2; FIRE COP","MV MB_ALU VAL_FOUR; FIRE COP","MV MB_ALU VAL_ONE; FIRE COP"],depends_on:["SELA","SELB"],fire_name:["svg_p:text3465"],draw_data:[["svg_p:path3281","svg_p:path3171","svg_p:path3169"],["svg_p:path3283"],["svg_p:path3295","svg_p:path3293"],["svg_p:path3297","svg_p:path3299"]],draw_name:[[],["svg_p:path3425","svg_p:path3427"]]};sim.ep.signals["MH"]={name:"MH",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MV HPC_T12 CLK","MV HPC_T12 ACC_TIME","MV HPC_T12 ACC_PWR","NOP"],fire_name:["svg_p:text3147-5-0-1-8-4"],draw_data:[[],["svg_p:path3081-3-8-5-3"]],draw_name:[[],["svg_p:path3306-8-7-6"]]};sim.ep.signals["COP"]={name:"COP",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["NOP_ALU; UPDATE_NZVC","AND ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","OR ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","NOT ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","XOR ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SRL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SRA ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","RR ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","RL ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","ADD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SUB ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MUL ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","DIV ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MOD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","LUI ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FADD ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FSUB ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FMUL ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FDIV ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FCVT ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","FCLASS ALU_C6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","ADDU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","SUBU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","MULU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","DIVU ALU_C6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET SELP 3","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU"],depends_on:["SELCOP"],fire_name:["svg_p:text3303"],draw_data:[["svg_p:path3237","svg_p:path3239","svg_p:path3261-8","svg_p:path3321","svg_p:path3901-6","svg_p:path3317-9"]],draw_name:[["svg_p:path3009","svg_p:path3301"]]};sim.ep.signals["SELP"]={name:"SELP",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["NOP","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_U 0; FIRE M7","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_I 1; FIRE M7","MV SELP_M7 REG_SR; UPDATE_FLAG SELP_M7 FLAG_C 31; UPDATE_FLAG SELP_M7 FLAG_V 30; UPDATE_FLAG SELP_M7 FLAG_N 29; UPDATE_FLAG SELP_M7 FLAG_Z 28; FIRE M7"],fire_name:["svg_p:text3703"],draw_data:[[],["svg_p:path3643"],["svg_p:path3705"],["svg_p:path3675","svg_p:path3331"]],draw_name:[[],["svg_p:path3697"]]};sim.ep.signals["SELA"]={name:"SELA",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE MR_RA"],depends_on:["RA"],fire_name:["svg_cu:text3164"],draw_data:[[]],draw_name:[[]]};sim.ep.signals["SELB"]={name:"SELB",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE MR_RB"],depends_on:["RB"],fire_name:["svg_cu:text3168"],draw_data:[[]],draw_name:[[]]};sim.ep.signals["SELC"]={name:"SELC",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE MR_RC"],depends_on:["RC"],fire_name:["svg_cu:text3172"],draw_data:[[]],draw_name:[[]]};sim.ep.signals["SELCOP"]={name:"SELCOP",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE MC"],depends_on:["COP"],fire_name:["svg_cu:text3312"],draw_data:[[]],draw_name:[[]]};sim.ep.signals["EXCODE"]={name:"EXCODE",visible:true,type:"L",value:0,default_value:0,nbits:"4",behavior:["FIRE T11"],fire_name:["svg_cu:text3312-6"],draw_data:[[]],draw_name:[]};sim.ep.signals["RA"]={name:"RA",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["GET RA_T9 BR RA; FIRE_IFSET T9 1; FIRE_IFSET MA 0"],depends_on:["SELA"],fire_name:["svg_p:text3107"],draw_data:[[]],draw_name:[["svg_p:path3109"]]};sim.ep.signals["RB"]={name:"RB",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["GET RB_T10 BR RB; FIRE_IFSET T10 1; FIRE_IFSET MB 0"],depends_on:["SELB"],fire_name:["svg_p:text3123"],draw_data:[[]],draw_name:[["svg_p:path3113"]]};sim.ep.signals["RC"]={name:"RC",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["FIRE LC"],depends_on:["SELC"],fire_name:["svg_p:text3125"],draw_data:[[]],draw_name:[["svg_p:path3117"]]};sim.ep.signals["LC"]={name:"LC",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","SET BR RC BUS_IB"],fire_name:["svg_p:text3127"],draw_data:[["svg_p:path3153","svg_p:path3151","svg_p:path3129"]],draw_name:[["svg_p:path3121"]]};sim.ep.signals["SE"]={name:"SE",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3; MOVE_BITS SBWA 4 1 SE; FIRE_IFCHANGED SBWA SE","MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3; MOVE_BITS SBWA 4 1 SE; FIRE_IFCHANGED SBWA SE"],depends_on:["T3"],fire_name:["svg_p:text3593","svg_p:text3431"],draw_data:[[]],draw_name:[["svg_p:path3591","svg_p:path3447-7-7"]]};sim.ep.signals["SIZE"]={name:"SIZE",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3363"],draw_data:[[]],draw_name:[["svg_p:path3355"]]};sim.ep.signals["OFFSET"]={name:"OFFSET",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["MBITS SELEC_T3 0 REG_IR OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3707"],draw_data:[[]],draw_name:[["svg_p:path3359"]]};sim.ep.signals["MC"]={name:"MC",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT COP REG_IR 0 5; FIRE COP;","CP_FIELD COP REG_MICROINS/SELCOP; FIRE COP;"],depends_on:["SELCOP"],fire_name:["svg_cu:text3322","svg_cu:text3172-1-5"],draw_data:[["svg_cu:path3320","svg_cu:path3142"],["svg_cu:path3318","svg_cu:path3502-6"]],draw_name:[[],["svg_cu:path3306"]]};sim.ep.signals["MR"]={name:"MR",verbal:["Copy from IR[SelA], from IR[SelB], and from IR[SelB] into RA, RB, and RC. ","Copy SelA, SelB, and SelB into RA, RB, and RC. "],visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV MR_RA MR; FIRE MR_RA; MV MR_RB MR; FIRE MR_RB; MV MR_RC MR; FIRE MR_RC;","MV MR_RA MR; FIRE MR_RA; MV MR_RB MR; FIRE MR_RB; MV MR_RC MR; FIRE MR_RC;"],depends_on:["SELA","SELB","SELC"],fire_name:["svg_cu:text3222","svg_cu:text3242","svg_cu:text3254","svg_cu:text3172-1"],draw_data:[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3260","svg_cu:path3196","svg_cu:path3278","svg_cu:path3292","svg_cu:path3142","svg_cu:path3258-4","svg_cu:path3390-7","svg_cu:path3258","svg_cu:path3280"],["svg_cu:path3270","svg_cu:path3282","svg_cu:path3300","svg_cu:path3258","svg_cu:path3260","svg_cu:path3258-4","svg_cu:path3278","svg_cu:path3196","svg_cu:path3294","svg_cu:path3292","svg_cu:path3288","svg_cu:path3280","svg_cu:path3258","svg_cu:path3258-4","svg_cu:path3390-7"]],draw_name:[[],["svg_cu:path3220","svg_cu:path3240","svg_cu:path3252"]]};sim.ep.signals["MR_RA"]={name:"MR_RA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RA REG_IR REG_MICROINS/SELA 5; FIRE RA;","CP_FIELD RA REG_MICROINS/SELA; FIRE RA;"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.ep.signals["MR_RB"]={name:"MR_RB",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RB REG_IR REG_MICROINS/SELB 5; FIRE RB;","CP_FIELD RB REG_MICROINS/SELB; FIRE RB;"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.ep.signals["MR_RC"]={name:"MR_RC",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RC REG_IR REG_MICROINS/SELC 5; FIRE RC;","CP_FIELD RC REG_MICROINS/SELC; FIRE RC;"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.ep.signals["BW"]={name:"BW",verbal:["Select one byte (based on A1A0) from Word. ","Select two bytes (one Half Word based on A1A0) from Word. ","","Select the full Word. "],visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW","MOVE_BITS BWA 2 2 BW; MOVE_BITS SBWA 2 2 BW; FIRE_IFCHANGED BWA BW; FIRE SBWA; RESET_CHANGED BW"],fire_name:["svg_p:text3433"],draw_data:[["svg_p:path3061-2-6","svg_p:path3101-8","svg_p:path3535-8"]],draw_name:[[],[]]};sim.ep.signals["A1A0"]={name:"A1A0",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA","MOVE_BITS BWA 0 2 A1A0; MOVE_BITS SBWA 0 2 A1A0; FIRE BWA; FIRE SBWA"],fire_name:["svg_p:text3603"],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["BWA"]={name:"BWA",visible:false,type:"L",value:0,default_value:0,nbits:"4",behavior:["BSEL BS_TD 0 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 8 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 24 8 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 0 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","BSEL BS_TD 16 16 REG_MBR 0; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W","MV BS_TD REG_MBR; FIRE TD; FIRE R; FIRE W"],fire_name:["svg_p:text3533-5"],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["SBWA"]={name:"SBWA",visible:false,type:"L",value:0,default_value:0,nbits:"5",behavior:["BSEL BS_M1 0 8 BUS_DB 0; FIRE M1","BSEL BS_M1 0 8 BUS_DB 8; FIRE M1","BSEL BS_M1 0 8 BUS_DB 16; FIRE M1","BSEL BS_M1 0 8 BUS_DB 24; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","BSEL BS_M1 0 8 BUS_DB 0; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 8; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 16; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 8 BUS_DB 24; EXT_SIG BS_M1 7; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 0; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","BSEL BS_M1 0 16 BUS_DB 16; EXT_SIG BS_M1 15; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1","MV BS_M1 BUS_DB; FIRE M1"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["IOR"]={name:"IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MOVE_BITS KBD_IOR 0 1 IOR; MOVE_BITS SCR_IOR 0 1 IOR; MOVE_BITS L3D_IOR 0 1 IOR; MOVE_BITS L3D_IOR 0 1 IOR; FIRE KBD_IOR; FIRE SCR_IOR; FIRE L3D_IOR; FIRE LEDM_IOR"],fire_name:["svg_p:text3715"],draw_data:[[],["svg_p:path3733","svg_p:path3491","svg_p:text3715"]],draw_name:[[],[]]};sim.ep.signals["IOW"]={name:"IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MOVE_BITS SCR_IOW 0 1 IOW; FIRE SCR_IOW; MOVE_BITS IO_IOW 0 1 IOW; FIRE IO_IOW; MOVE_BITS L3D_IOW 0 1 IOW; FIRE L3D_IOW; MOVE_BITS LEDM_IOW 0 1 IOW; FIRE LEDM_IOW"],fire_name:["svg_p:text3717"],draw_data:[[],["svg_p:path3735","svg_p:path3491","svg_p:text3717"]],draw_name:[[],[]]};sim.ep.signals["I"]={name:"I",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_I VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_I VAL_ONE; FIRE_IFSET SELP 2"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["U"]={name:"U",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_U VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_U VAL_ONE; FIRE_IFSET SELP 2"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals["TEST_C"]={name:"TEST_C",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_C VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_C VAL_ONE; FIRE_IFSET SELP 3"],depends_on:["SELCOP","COP"],fire_name:["svg_p:text3701-3"],draw_data:[["svg_p:text3701-3"]],draw_name:[[]]};sim.ep.signals["TEST_V"]={name:"TEST_V",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_V VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_V VAL_ONE; FIRE_IFSET SELP 3"],depends_on:["SELCOP","COP"],fire_name:["svg_p:text3701-3-1"],draw_data:[["svg_p:text3701-3-1"]],draw_name:[[]]};sim.ep.signals["TEST_N"]={name:"TEST_N",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_N VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_N VAL_ONE; FIRE_IFSET SELP 3"],depends_on:["SELCOP","COP"],fire_name:["svg_p:text3701-3-2"],draw_data:[["svg_p:text3701-3-2"]],draw_name:[[]]};sim.ep.signals["TEST_Z"]={name:"TEST_Z",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_Z VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_Z VAL_ONE; FIRE_IFSET SELP 3"],depends_on:["SELCOP","COP"],fire_name:["svg_p:text3701-3-5"],draw_data:[["svg_p:text3701-3-5"]],draw_name:[[]]};sim.ep.signals["TEST_I"]={name:"TEST_I",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_I VAL_ZERO; FIRE_IFSET SELP 2","MV FLAG_I VAL_ONE; FIRE_IFSET SELP 2"],depends_on:["CLK"],fire_name:["svg_p:text3669"],draw_data:[["svg_p:text3669"]],draw_name:[[]]};sim.ep.signals["TEST_U"]={name:"TEST_U",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_U VAL_ZERO; FIRE_IFSET SELP 1","MV FLAG_U VAL_ONE; FIRE_IFSET SELP 1"],depends_on:["CLK"],fire_name:["svg_p:text3669-1"],draw_data:[["svg_p:text3669-1"]],draw_name:[[]]};sim.ep.signals["TEST_INTV"]={name:"TEST_INTV",visible:true,type:"L",value:0,default_value:0,nbits:"8",forbidden:true,behavior:["MBIT INTV TEST_INTV 0 32"],depends_on:["INT"],fire_name:["svg_p:tspan4225"],draw_data:[["svg_p:path3749"]],draw_name:[[]]};sim.ep.behaviors["NOP"]={nparameters:1,operation:function(s_expr){},verbal:function(s_expr){return""}};sim.ep.behaviors["NOP_ALU"]={nparameters:1,operation:function(s_expr){sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0},verbal:function(s_expr){return""}};sim.ep.behaviors["MV"]={nparameters:3,types:["X","X"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)},verbal:function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(newval)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(newval)+"). "}};sim.ep.behaviors["LOAD"]={nparameters:3,types:["X","X"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)},verbal:function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Load from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(newval)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(newval)+"). "}};sim.ep.behaviors["CP_FIELD"]={nparameters:3,types:["X","X"],operation:function(s_expr){r=s_expr[2].split("/");sim_elto_org=get_reference(r[0]);newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval!="undefined"){sim_elto_dst=get_reference(s_expr[1]);set_value(sim_elto_dst,newval)}},verbal:function(s_expr){var newval=0;var r=s_expr[2].split("/");var sim_elto_org=get_reference(r[0]);var sim_elto_dst=get_reference(r[1]);if(typeof sim_elto_dst=="undefined")sim_elto_dst={};if(typeof sim_elto_org.value[r[1]]!="undefined")newval=sim_elto_org.value[r[1]];else if(typeof sim_elto_dst.default_value!="undefined")newval=sim_elto_dst.default_value;else newval="<undefined>";var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from Field "+r[1]+" of "+show_verbal(r[0])+" to "+show_verbal(s_expr[1])+" value "+newval+". "}return show_verbal(s_expr[1])+" = "+show_verbal(r[0])+"."+r[1]+" ("+newval+"). "}};sim.ep.behaviors["NOT_ES"]={nparameters:3,types:["S","E"],operation:function(s_expr){set_value(sim.ep.signals[s_expr[1]],Math.abs(get_value(sim.ep.states[s_expr[2]])-1))},verbal:function(s_expr){var value=Math.abs(get_value(sim.ep.states[s_expr[2]])-1);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Set "+show_verbal(s_expr[1])+" with value "+show_value(value)+" (Logical NOT of "+s_expr[2]+"). "}return show_verbal(s_expr[1])+" = "+show_value(value)+" (Logical NOT "+s_expr[2]+"). "}};sim.ep.behaviors["GET"]={nparameters:4,types:["E","E","S"],operation:function(s_expr){set_value(sim.ep.states[s_expr[1]],get_value(sim.ep.states[s_expr[2]][sim.ep.signals[s_expr[3]].value]))},verbal:function(s_expr){var value=get_value(sim.ep.states[s_expr[2]][sim.ep.signals[s_expr[3]].value]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Set "+show_verbal(s_expr[1])+" with value "+show_value(value)+" (Register File "+s_expr[3]+"). "}return show_verbal(s_expr[1])+" = "+show_value(value)+" (Register File "+s_expr[3]+"). "}};sim.ep.behaviors["SET"]={nparameters:4,types:["E","S","E"],operation:function(s_expr){set_value(sim.ep.states[s_expr[1]][sim.ep.signals[s_expr[2]].value],get_value(sim.ep.states[s_expr[3]]))},verbal:function(s_expr){var value=get_value(sim.ep.states[s_expr[3]]);var o_ref=sim.ep.states[s_expr[1]][sim.ep.signals[s_expr[2]].value];var o_verbal=o_ref.name;if(typeof o_ref.verbal!="undefined")o_verbal=o_ref.verbal;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy to "+o_verbal+" the value "+show_value(value)+". "}return o_verbal+" = "+show_value(value)+". "}};sim.ep.behaviors["AND"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])&get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])&get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU AND with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (AND). "}};sim.ep.behaviors["OR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])|get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])|get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU OR with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (OR). "}};sim.ep.behaviors["NOT"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=~get_value(sim.ep.states[s_expr[2]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=~get_value(sim.ep.states[s_expr[2]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU NOT with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (NOT). "}};sim.ep.behaviors["XOR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])^get_value(sim.ep.states[s_expr[3]]);set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])^get_value(sim.ep.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU XOR with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (XOR). "}};sim.ep.behaviors["SRL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Right Logical with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SRL). "}};sim.ep.behaviors["SRA"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Right Arithmetic with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SRA). "}};sim.ep.behaviors["SL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=result>>>31},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Left with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SL). "}};sim.ep.behaviors["RR"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1|(get_value(sim.ep.states[s_expr[2]])&1)<<31;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])>>>1|(get_value(sim.ep.states[s_expr[2]])&1)<<31;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Right Rotation with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (RR). "}};sim.ep.behaviors["RL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1|(get_value(sim.ep.states[s_expr[2]])&2147483648)>>>31;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<1|(get_value(sim.ep.states[s_expr[2]])&2147483648)>>>31;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Left Rotation with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (LR). "}};sim.ep.behaviors["ADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a+b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a+b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU ADD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (ADD). "}};sim.ep.behaviors["SUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a-b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a-b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU SUB with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SUB). "}};sim.ep.behaviors["MUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a*b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;var result=a*b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MUL with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MUL). "}};sim.ep.behaviors["DIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){return"ALU DIV zero by zero (oops!). "}var result=Math.floor(a/b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU DIV with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (DIV). "}};sim.ep.behaviors["MOD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=a%b;set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var b=get_value(sim.ep.states[s_expr[3]])<<0;if(0==b){return"ALU MOD zero by zero (oops!). "}var result=a%b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MOD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MOD). "}};sim.ep.behaviors["LUI"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<16;set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.ep.states[s_expr[2]])<<16;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Load Upper Immediate with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (LUI). "}};sim.ep.behaviors["ADDU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a+b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a+b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU ADDU with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (ADDU). "}};sim.ep.behaviors["SUBU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a-b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a-b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU SUBU with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SUBU). "}};sim.ep.behaviors["MULU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a*b;set_value(sim.ep.states[s_expr[1]],result>>>0);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;var result=a*b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MULU with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MULU). "}};sim.ep.behaviors["DIVU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;if(0==b){set_value(sim.ep.states[s_expr[1]],0);sim.ep.internal_states.alu_flags.flag_n=0;sim.ep.internal_states.alu_flags.flag_z=1;sim.ep.internal_states.alu_flags.flag_v=1;sim.ep.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_v=0;sim.ep.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]])>>>0;if(0==b){return"ALU DIVU zero by zero (oops!). "}var result=Math.floor(a/b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU DIVU with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (DIVU). "}};sim.ep.behaviors["FADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)+hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)+hex2float(b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FADD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FADD). "}};sim.ep.behaviors["FSUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FSUB with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FSUB). "}};sim.ep.behaviors["FMUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)*hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)*hex2float(b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FMUL with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FMUL). "}};sim.ep.behaviors["FDIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)/hex2float(b);set_value(sim.ep.states[s_expr[1]],float32_to_uint(result));sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]]);var b=get_value(sim.ep.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FDIV with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FDIV). "}};sim.ep.behaviors["FCVT"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]]);var result=a;switch(b){case 1:result=hex2float(result);result=Math.trunc(result);break;case 2:result=hex2float(result);result=Math.round(result);break;case 4:result=result.toFixed(5);result=parseFloat(result);result=float2decimal(result);break;default:break}set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var b=get_value(sim.ep.states[s_expr[3]]);var result=a;switch(b){case 1:result=hex2float(result);result=Math.trunc(result);break;case 2:result=hex2float(result);result=Math.round(result);break;case 4:result=result.toFixed(5);result=parseFloat(result);result=float2decimal(result);break;default:break}var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FCVT with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FCVT). "}};sim.ep.behaviors["FCLASS"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])>>>0;var result=float_class(a);set_value(sim.ep.states[s_expr[1]],result);sim.ep.internal_states.alu_flags.flag_n=result<0?1:0;sim.ep.internal_states.alu_flags.flag_z=result==0?1:0;sim.ep.internal_states.alu_flags.flag_c=0;sim.ep.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.ep.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.ep.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])>>>0;var result=float_class(a);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU FCLASS with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (FCLASS). "}};sim.ep.behaviors["PLUS1"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+1;set_value(sim.ep.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy to "+show_verbal(s_expr[1])+" "+show_verbal(s_expr[2])+" plus one with result "+show_value(result)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" + 1"+" ("+show_value(result)+"). "}};sim.ep.behaviors["PLUS4"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+4;set_value(sim.ep.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.ep.states[s_expr[2]])<<0;var result=a+4;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy to "+show_verbal(s_expr[1])+" "+show_verbal(s_expr[2])+" plus four with result "+show_value(result)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" + 4"+" ("+show_value(result)+"). "}};sim.ep.behaviors["SET_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a|m;set_value(sim.ep.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.ep.behaviors["RST_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.ep.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a&~m;set_value(sim.ep.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.ep.behaviors["CHECK_RTD"]={nparameters:1,operation:function(s_expr){var number_active_tri=parseInt(simhw_sim_signal("TD").value)+parseInt(simhw_sim_signal("R").value);update_system_bus_fire(number_active_tri)},verbal:function(s_expr){return""}};sim.ep.behaviors["MBIT"]={nparameters:5,types:["X","X","I","I"],operation:function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);set_value(sim_elto_dst,parseInt(n2,2))},verbal:function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=parseInt(n2,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(n3)+" (copied "+size+" bits from bit "+offset+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(n3)+", "+size+" bits from bit "+offset+"). "}};sim.ep.behaviors["MBIT_SN"]={nparameters:5,types:["S","E","E","I"],operation:function(s_expr){var base=0;var r=s_expr[3].split("/");if(1==r.length)base=get_value(sim.ep.states[s_expr[3]]);else if(typeof sim.ep.states[r[0]].value[r[1]]!="undefined")base=sim.ep.states[r[0]].value[r[1]];else if(typeof sim.ep.signals[r[1]].default_value!="undefined")base=sim.ep.signals[r[1]].default_value;else if(typeof sim.ep.states[r[1]].default_value!="undefined")base=sim.ep.states[r[1]].default_value;else ws_alert("WARN: undefined state/field pair -> "+r[0]+"/"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.ep.states[s_expr[2]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var base=0;var r=s_expr[3].split("/");if(1==r.length)base=get_value(sim.ep.states[s_expr[3]]);else if(typeof sim.ep.states[r[0]].value[r[1]]!="undefined")base=sim.ep.states[r[0]].value[r[1]];else if(typeof sim.ep.signals[r[1]].default_value!="undefined")base=sim.ep.signals[r[1]].default_value;else if(typeof sim.ep.states[r[1]].default_value!="undefined")base=sim.ep.states[r[1]].default_value;else ws_alert("WARN: undefined state/field pair -> "+r[0]+"/"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.ep.states[s_expr[2]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);var from_elto="";if(1==r.length)from_elto=show_verbal(s_expr[3]);else from_elto=show_verbal(s_expr[2])+"["+r[1]+"] ";var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+from_elto+"into "+show_verbal(s_expr[1])+" "+"value "+parseInt(n3,2)+". "}return show_verbal(s_expr[1])+" = "+from_elto+" ("+parseInt(n3,2)+"). "}};sim.ep.behaviors["SBIT_SIGNAL"]={nparameters:4,types:["X","I","I"],operation:function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)},verbal:function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)}};sim.ep.behaviors["UPDATE_FLAG"]={nparameters:4,types:["X","X","I"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value&~(1<>>0)},verbal:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Update "+show_verbal(s_expr[2])+" to value "+sim_elto_org.value+". "}return show_verbal(s_expr[1])+"."+show_verbal(s_expr[3])+" = "+sim_elto_org.value+". "}};sim.ep.behaviors["MBITS"]={nparameters:8,types:["E","I","E","S","S","I","S"],operation:function(s_expr){var offset=parseInt(sim.ep.signals[s_expr[4]].value);var size=parseInt(sim.ep.signals[s_expr[5]].value);var n1=get_value(sim.ep.states[s_expr[3]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;if("1"==sim.ep.signals[s_expr[7]].value&&"1"==n2.substr(0,1)){n3="11111111111111111111111111111111".substring(0,32-n2.length)+n2}set_value(sim.ep.states[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var offset=parseInt(sim.ep.signals[s_expr[4]].value);var size=parseInt(sim.ep.signals[s_expr[5]].value);var n1=get_value(sim.ep.states[s_expr[3]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;if("1"==sim.ep.signals[s_expr[7]].value&&"1"==n2.substr(0,1)){n3="11111111111111111111111111111111".substring(0,32-n2.length)+n2}n1=parseInt(n3,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return" Copy from "+show_verbal(s_expr[3])+" to "+show_verbal(s_expr[1])+" value "+show_value(n1)+" (copied "+size+" bits from bit "+offset+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[3])+" ("+show_value(n1)+", "+size+" bits from bit "+offset+"). "}};sim.ep.behaviors["BSEL"]={nparameters:6,types:["E","I","I","E","I"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var n4="00000000000000000000000000000000".substr(0,posd);n3=n3+n4;set_value(sim.ep.states[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var posd=parseInt(s_expr[2]);var len=parseInt(s_expr[3]);var poso=parseInt(s_expr[5]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var n4="00000000000000000000000000000000".substr(0,posd);n3=n3+n4;var n5=parseInt(n3,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[4])+" to "+show_verbal(s_expr[1])+" value "+show_value(n5)+" (copied "+len+" bits, from bit "+poso+" of "+s_expr[4]+" to bit "+posd+" of "+s_expr[1]+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[4])+" ("+show_value(n5)+", "+len+" bits, from bit "+poso+" of "+s_expr[4]+" to bit "+posd+" of "+s_expr[1]+"). "}};sim.ep.behaviors["EXT_SIG"]={nparameters:3,types:["E","I"],operation:function(s_expr){var n1=get_value(sim.ep.states[s_expr[1]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if("1"==n2[31-s_expr[2]]){n4="11111111111111111111111111111111".substring(0,32-n3.length)+n4}set_value(sim.ep.states[s_expr[1]],parseInt(n4,2))},verbal:function(s_expr){var n1=get_value(sim.ep.states[s_expr[1]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if("1"==n2[31-s_expr[2]]){n4="11111111111111111111111111111111".substring(0,32-n3.length)+n4}var n5=parseInt(n4,2);return"Sign Extension with value "+show_value(n5)+". "}};sim.ep.behaviors["MOVE_BITS"]={nparameters:5,types:["S","I","I","S"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=0;var len=parseInt(s_expr[3]);var n1=sim.ep.signals[s_expr[4]].value.toString(2);n1="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.ep.signals[s_expr[1]].value.toString(2);n2="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.ep.behaviors["MOVE_BITSE"]={nparameters:6,types:["S","I","I","E","I"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.ep.states[s_expr[4]]).toString(2);n1="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.ep.signals[s_expr[1]].value.toString(2);n2="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.ep.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.ep.behaviors["DECO"]={nparameters:1,operation:function(s_expr){sim.ep.states["INEX"].value=0;var oi=decode_instruction(sim.ep.internal_states.FIRMWARE,sim.ep.ctrl_states.ir,get_value(sim.ep.states["REG_IR"]));if(null==oi.oinstruction){ws_alert("ERROR: undefined instruction code in IR ("+"co:"+oi.op_code.toString(2)+", "+"cop:"+oi.cop_code.toString(2)+")");sim.ep.states["ROM_MUXA"].value=0;sim.ep.states["INEX"].value=1;return-1}var rom_addr=oi.op_code<<6;if(typeof oi.oinstruction.cop!="undefined"){rom_addr=rom_addr+oi.cop_code}if(typeof sim.ep.internal_states["ROM"][rom_addr]=="undefined"){ws_alert("ERROR: undefined rom address "+rom_addr+" in firmware");sim.ep.states["ROM_MUXA"].value=0;return-1}sim.ep.states["ROM_MUXA"].value=sim.ep.internal_states["ROM"][rom_addr];var val=get_value(sim.ep.states["DECO_INS"]);set_value(sim.ep.states["DECO_INS"],val+1);var pc=get_value(sim.ep.states["REG_PC"])-4;var decins=get_deco_from_pc(pc);set_value(sim.ep.states["REG_IR_DECO"],decins);show_dbg_ir(get_value(sim.ep.states["REG_IR_DECO"]))},verbal:function(s_expr){return"Decode instruction. "}};sim.ep.behaviors["FIRE"]={nparameters:2,types:["S"],operation:function(s_expr){if(sim.ep.internal_states.fire_stack.indexOf(s_expr[1])!=-1){return}sim.ep.internal_states.fire_stack.push(s_expr[1]);update_draw(sim.ep.signals[s_expr[1]],sim.ep.signals[s_expr[1]].value);if("L"==sim.ep.signals[s_expr[1]].type){update_state(s_expr[1])}sim.ep.internal_states.fire_stack.pop(s_expr[1])},verbal:function(s_expr){return""}};sim.ep.behaviors["FIRE_IFSET"]={nparameters:3,types:["S","I"],operation:function(s_expr){if(get_value(sim.ep.signals[s_expr[1]])!=parseInt(s_expr[2])){return}sim.ep.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.ep.behaviors["FIRE_IFCHANGED"]={nparameters:3,types:["S","X"],operation:function(s_expr){sim_elto=get_reference(s_expr[2]);if(sim_elto.changed==false){return}sim.ep.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.ep.behaviors["RESET_CHANGED"]={nparameters:2,types:["X"],operation:function(s_expr){sim_elto=get_reference(s_expr[1]);sim_elto.changed=false},verbal:function(s_expr){return""}};sim.ep.behaviors["CLOCK"]={nparameters:1,operation:function(s_expr){var new_maddr=null;var mcelto=null;var t0=performance.now();var val=get_value(sim.ep.states["CLK"]);set_value(sim.ep.states["CLK"],val+1);set_value(sim.ep.states["TTCPU"],0);new_maddr=get_value(sim.ep.states["REG_MICROADDR"]);mcelto=sim.ep.internal_states["MC"][new_maddr];if(typeof mcelto!=="undefined"&&false==mcelto.is_native){for(var i=0;i>>0},set_value:function(elto,value){var origin="";var r_value=main_memory_get_program_counter();if(r_value!=null){origin="PC=0x"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.ep.internal_states.MP,elto,melto);show_main_memory(sim.ep.internal_states.MP,elto,typeof valref==="undefined",true);return value}};sim.ep.internal_states.segments={};sim.ep.internal_states.MP_wc=0;sim.ep.internal_states.MP={};sim.ep.internal_states.CM_cfg=[];sim.ep.internal_states.CM=[];sim.ep.signals.MRDY={name:"MRDY",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE_IFCHANGED MRDY C","FIRE_IFCHANGED MRDY C"],fire_name:["svg_p:tspan3916","svg_p:text3909"],draw_data:[[],["svg_p:path3895","svg_p:path3541"]],draw_name:[[],[]]};sim.ep.signals.R={name:"R",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; CHECK_RTD","MEM_READ BUS_AB BUS_DB BWA MRDY CLK; FIRE MRDY; CHECK_RTD"],fire_name:["svg_p:text3533-5-2","svg_p:text3713"],draw_data:[[],["svg_p:path3557","svg_p:path3571"]],draw_name:[[],[]]};sim.ep.signals.W={name:"W",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MEM_WRITE BUS_AB BUS_DB BWA MRDY CLK; FIRE MRDY"],fire_name:["svg_p:text3533-5-08","svg_p:text3527","svg_p:text3431-7"],draw_data:[[],["svg_p:path3559","svg_p:path3575","svg_p:path3447-7"]],draw_name:[[],[]]};sim.ep.behaviors.MEM_READ={nparameters:6,types:["E","E","S","S","E"],operation:function(s_expr){var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);sim.ep.signals[s_expr[4]].value=0;var remain=get_value(sim.ep.internal_states.MP_wc);if(typeof sim.ep.events.mem[clk-1]!="undefined"&&sim.ep.events.mem[clk-1]>0){remain=sim.ep.events.mem[clk-1]-1}var first_time=typeof sim.ep.events.mem[clk]=="undefined";sim.ep.events.mem[clk]=remain;if(remain>0){return}address=address&4294967292;var value=main_memory_getvalue(sim.ep.internal_states.MP,address);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}dbvalue=main_memory_fusionvalues(dbvalue,value,bw);sim.ep.states[s_expr[2]].value=dbvalue>>>0;sim.ep.signals[s_expr[4]].value=1;show_main_memory(sim.ep.internal_states.MP,address,full_redraw,false);if(first_time&&sim.ep.internal_states.CM.length>0){cache_memory_access(sim.ep.internal_states.CM[0],address,"read",clk)}},verbal:function(s_expr){var verbal="";var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);var bw_type="word";if(0==(bw&12))bw_type="byte";else if(1==(bw&12))bw_type="half";var value=main_memory_getvalue(sim.ep.internal_states.MP,address);if(typeof value==="undefined")value=0;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){verbal="Try to read a "+bw_type+" from memory "+"at address 0x"+address.toString(16)+" with value 0x"+value.toString(16)+". "}verbal="Memory output = 0x"+value.toString(16)+" (Read a "+bw_type+" from 0x"+address.toString(16)+"). ";return verbal}};sim.ep.behaviors.MEM_WRITE={nparameters:6,types:["E","E","S","S","E"],operation:function(s_expr){var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);sim.ep.signals[s_expr[4]].value=0;var remain=get_value(sim.ep.internal_states.MP_wc);if(typeof sim.ep.events.mem[clk-1]!="undefined"&&sim.ep.events.mem[clk-1]>0){remain=sim.ep.events.mem[clk-1]-1}var first_time=typeof sim.ep.events.mem[clk]=="undefined";sim.ep.events.mem[clk]=remain;if(remain>0){return}address=address&4294967292;var value=main_memory_getvalue(sim.ep.internal_states.MP,address);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}value=main_memory_fusionvalues(value,dbvalue,bw);var origin="";var r_value=main_memory_get_program_counter();if(r_value!=null){origin="PC=0x"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.ep.internal_states.MP,address,melto);sim.ep.signals[s_expr[4]].value=1;show_main_memory(sim.ep.internal_states.MP,address,full_redraw,true);if(first_time&&sim.ep.internal_states.CM.length>0){cache_memory_access(sim.ep.internal_states.CM[0],address,"write",clk)}},verbal:function(s_expr){var verbal="";var address=sim.ep.states[s_expr[1]].value;var dbvalue=sim.ep.states[s_expr[2]].value;var bw=sim.ep.signals[s_expr[3]].value;var clk=get_value(sim.ep.states[s_expr[5]]);var bw_type="word";if(0==(bw&12))bw_type="byte";else if(1==(bw&12))bw_type="half";var value=main_memory_getvalue(sim.ep.internal_states.MP,address);if(typeof value==="undefined")value=0;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){verbal="Try to write a "+bw_type+" to memory "+"at address 0x"+address.toString(16)+" with value "+value.toString(16)+". "}verbal="Memory[0x"+address.toString(16)+"] = "+"0x"+value.toString(16)+" (Write a "+bw_type+" to 0x"+address.toString(16)+"). ";return verbal}};sim.ep.behaviors.MEMORY_RESET={nparameters:1,operation:function(s_expr){sim.ep.events.mem={}},verbal:function(s_expr){return"Reset main memory (all values will be zeroes). "}};sim.ep.elements.memory={name:"Main memory",description:"Main memory subsystem",type:"subcomponent",belongs:"MEMORY",states:{addr:{ref:"BUS_AB"},data:{ref:"BUS_DB"},mrdy:{ref:"MRDY"}},signals:{be:{ref:"BWA"},r:{ref:"R"},w:{ref:"W"}},states_inputs:["addr","data"],states_outputs:["mrdy","data"],signals_inputs:["be","r","w"],signals_output:[]};sim.ep.components.IO={name:"IO",version:"1",abilities:["IO_TIMER"],details_name:["IO_STATS","IO_CONFIG"],details_fire:[["svg_p:text3775"],[]],write_state:function(vec){return vec},read_state:function(o,check){return false},get_state:function(reg){return null},get_value:function(elto){var associated_state=simhw_internalState_get("io_hash",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("IOR"),1);compute_behavior("FIRE IOR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("IOW"),1);compute_behavior("FIRE IOW");return value}};sim.ep.internal_states.io_int_factory=[];sim.ep.internal_states.io_int_factory[0]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[1]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[2]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[3]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[4]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[5]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[6]={period:0,probability:.5,accumulated:0,active:false};sim.ep.internal_states.io_int_factory[7]={period:0,probability:.5,accumulated:0,active:false};var IOSR_ID=4352;var IOCR_ID=4356;var IODR_ID=4360;sim.ep.internal_states.io_hash[IOSR_ID]="IOSR";sim.ep.internal_states.io_hash[IOCR_ID]="IOCR";sim.ep.internal_states.io_hash[IODR_ID]="IODR";sim.ep.states.IOSR={name:"IOSR",verbal:"IO State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.IOCR={name:"IOCR",verbal:"IO Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.IODR={name:"IODR",verbal:"IO Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.signals.INT={name:"INT",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE C","FIRE C"],fire_name:["svg_p:tspan4199"],draw_data:[[],["svg_p:path3809"]],draw_name:[[],[]]};sim.ep.signals.IORDY={name:"IORDY",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE_IFCHANGED IORDY C","FIRE_IFCHANGED IORDY C"],fire_name:["svg_p:tspan4089","svg_p:path3793","svg_p:text3911"],draw_data:[[],["svg_p:path3897"]],draw_name:[[],[]]};sim.ep.signals.IO_IOR={name:"IO_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","IO_IOR BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE SBWA"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.signals.IO_IOW={name:"IO_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","IO_IOW BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE SBWA"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.signals.IO_IE={name:"IO_IE",visible:true,type:"L",value:1,default_value:1,nbits:"1",behavior:["NOP","IO_CHK_I CLK INT INTV; FIRE C"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.ep.signals.INTA={name:"INTA",visible:true,type:"L",value:1,default_value:0,nbits:"1",behavior:["NOP","INTA CLK INT INTA BUS_DB INTV; FIRE BW; FIRE C"],fire_name:["svg_p:text3785-0-6-0-5-5-1-1"],draw_data:[[],["svg_p:path3807","svg_p:path3737"]],draw_name:[[],[]]};sim.ep.behaviors.IO_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==IOSR_ID)set_value(sim.ep.states[s_expr[2]],iosr);if(bus_ab==IOCR_ID)set_value(sim.ep.states[s_expr[2]],iocr);if(bus_ab==IODR_ID)set_value(sim.ep.states[s_expr[2]],iodr)},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==IOSR_ID)verbal="I/O device read at IOSR of value "+iosr+". ";if(bus_ab==IOCR_ID)verbal="I/O device read at IOCR of value "+iocr+". ";if(bus_ab==IODR_ID)verbal="I/O device read at IODR of value "+iodr+". ";return verbal}};sim.ep.behaviors.IO_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab!=IOSR_ID&&bus_ab!=IOCR_ID&&bus_ab!=IODR_ID){return}if(bus_ab==IOSR_ID)set_value(sim.ep.states[s_expr[3]],bus_db);if(bus_ab==IOCR_ID)set_value(sim.ep.states[s_expr[4]],bus_db);if(bus_ab==IODR_ID)set_value(sim.ep.states[s_expr[5]],bus_db);var iocr_id=get_value(sim.ep.states[s_expr[4]]);var iodr_id=get_value(sim.ep.states[s_expr[5]]);if(iocr_id<0||iocr_id>7)return;set_var(sim.ep.internal_states.io_int_factory[iocr_id].period,iodr_id);set_var(sim.ep.internal_states.io_int_factory[iocr_id].probability,1);if(0==iodr_id){set_var(sim.ep.internal_states.io_int_factory[iocr_id].probability,0)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab==IOSR_ID)verbal="I/O device write at IOSR with value "+bus_db+". ";if(bus_ab==IOCR_ID)verbal="I/O device write at IOCR with value "+bus_db+". ";if(bus_ab==IODR_ID)verbal="I/O device write at IODR with value "+bus_db+". ";return verbal}};sim.ep.behaviors.IO_CHK_I={nparameters:4,types:["E","S","E"],operation:function(s_expr){var clk=get_value(sim.ep.states[s_expr[1]]);for(var i=sim.ep.internal_states.io_int_factory.length-1;i>=0;i--){if(get_var(sim.ep.internal_states.io_int_factory[i].period)==0)continue;if(get_var(sim.ep.internal_states.io_int_factory[i].active)==true){set_value(sim.ep.signals[s_expr[2]],1);set_value(sim.ep.states[s_expr[3]],i)}if(clk%get_var(sim.ep.internal_states.io_int_factory[i].period)==0){if(Math.random()>get_var(sim.ep.internal_states.io_int_factory[i].probability))continue;var acc=get_var(sim.ep.internal_states.io_int_factory[i].accumulated);set_var(sim.ep.internal_states.io_int_factory[i].accumulated,acc+1);set_var(sim.ep.internal_states.io_int_factory[i].active,true);if(typeof sim.ep.events.io[clk]=="undefined"){sim.ep.events.io[clk]=[]}sim.ep.events.io[clk].push(i);set_value(sim.ep.signals[s_expr[2]],1);set_value(sim.ep.states[s_expr[3]],i)}}},verbal:function(s_expr){return"Check I/O Interruption. "}};sim.ep.behaviors.INTA={nparameters:6,types:["E","S","S","E","E"],operation:function(s_expr){var clk=get_value(sim.ep.states[s_expr[1]]);if(typeof sim.ep.events.io[clk]!="undefined"){set_value(sim.ep.states[s_expr[4]],sim.ep.events.io[clk][0]);return}set_value(sim.ep.signals[s_expr[2]],0);set_value(sim.ep.states[s_expr[5]],0);for(var i=0;i>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("IOR"),1);compute_behavior("FIRE IOR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("IOW"),1);compute_behavior("FIRE IOW");return value}};sim.ep.internal_states.l3d_dim=4;sim.ep.internal_states.l3d_neltos=Math.pow(sim.ep.internal_states.l3d_dim,3);sim.ep.internal_states.l3d_state=Array.from({length:sim.ep.internal_states.l3d_neltos},(()=>({active:false})));sim.ep.internal_states.l3d_frame="0".repeat(sim.ep.internal_states.l3d_neltos);var L3DSR_ID=8448;var L3DCR_ID=8452;var L3DDR_ID=8456;sim.ep.internal_states.io_hash[L3DSR_ID]="L3DSR";sim.ep.internal_states.io_hash[L3DCR_ID]="L3DCR";sim.ep.internal_states.io_hash[L3DDR_ID]="L3DDR";sim.ep.states.L3DSR={name:"L3DSR",verbal:"L3D State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.L3DCR={name:"L3DCR",verbal:"L3D Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.L3DDR={name:"L3DDR",verbal:"L3D Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.signals.L3D_IOR={name:"L3D_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","L3D_IOR BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE SBWA"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.signals.L3D_IOW={name:"L3D_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","L3D_IOW BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE SBWA; L3D_SYNC"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.behaviors.L3D_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==L3DCR_ID){set_value(sim.ep.states[s_expr[2]],iocr)}if(bus_ab==L3DDR_ID){set_value(sim.ep.states[s_expr[2]],iodr)}if(bus_ab==L3DSR_ID){var x=(iodr&4278190080)>>24;var y=(iodr&16711680)>>16;var z=(iodr&65280)>>8;var p=z*Math.pow(sim.ep.internal_states.l3d_dim,2)+y*sim.ep.internal_states.l3d_dim+x;var s=get_var(sim.ep.internal_states.l3d_state[p].active);set_value(sim.ep.states[s_expr[2]],s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==L3DSR_ID)verbal="I/O device read at L3DSR of value "+iosr+". ";if(bus_ab==L3DCR_ID)verbal="I/O device read at L3DCR of value "+iocr+". ";if(bus_ab==L3DDR_ID)verbal="I/O device read at L3DDR of value "+iodr+". ";return verbal}};sim.ep.behaviors.L3D_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab!=L3DSR_ID&&bus_ab!=L3DCR_ID&&bus_ab!=L3DDR_ID){return}if(bus_ab==L3DSR_ID){set_value(sim.ep.states[s_expr[3]],bus_db)}if(bus_ab==L3DDR_ID){set_value(sim.ep.states[s_expr[5]],bus_db)}if(bus_ab==L3DCR_ID){set_value(sim.ep.states[s_expr[4]],bus_db);var x=(bus_db&4278190080)>>24;var y=(bus_db&16711680)>>16;var z=(bus_db&65280)>>8;var p=z*Math.pow(sim.ep.internal_states.l3d_dim,2)+y*sim.ep.internal_states.l3d_dim+x;var s=(bus_db&255)!=0;set_var(sim.ep.internal_states.l3d_state[p].active,s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);if(bus_ab==L3DSR_ID)verbal="I/O device write at L3DSR with value "+bus_db+". ";if(bus_ab==L3DCR_ID)verbal="I/O device write at L3DCR with value "+bus_db+". ";if(bus_ab==L3DDR_ID)verbal="I/O device write at L3DDR with value "+bus_db+". ";return verbal}};sim.ep.behaviors.L3D_RESET={nparameters:1,operation:function(s_expr){sim.ep.events.l3d={};var n=sim.ep.internal_states.l3d_state.length;for(var i=0;i>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("IOR"),1);compute_behavior("FIRE IOR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("IOW"),1);compute_behavior("FIRE IOW");return value}};sim.ep.internal_states.ledm_dim=24;sim.ep.internal_states.ledm_neltos=Math.pow(sim.ep.internal_states.ledm_dim,2);sim.ep.internal_states.ledm_state=Array.from({length:sim.ep.internal_states.ledm_neltos},(()=>({color:0})));sim.ep.internal_states.ledm_colors=colors_clone("");sim.ep.internal_states.ledm_frame="0".repeat(sim.ep.internal_states.ledm_neltos);var LEDMSR_ID=12544;var LEDMCR_ID=12548;var LEDMDR_ID=12552;sim.ep.internal_states.io_hash[LEDMSR_ID]="LEDMSR";sim.ep.internal_states.io_hash[LEDMCR_ID]="LEDMCR";sim.ep.internal_states.io_hash[LEDMDR_ID]="LEDMDR";sim.ep.states.LEDMSR={name:"LEDMSR",verbal:"LEDM State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.LEDMCR={name:"LEDMCR",verbal:"LEDM Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.states.LEDMDR={name:"LEDMDR",verbal:"LEDM Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.ep.signals.LEDM_IOR={name:"LEDM_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","LEDM_IOR BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE SBWA"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.signals.LEDM_IOW={name:"LEDM_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","LEDM_IOW BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE SBWA; LEDM_SYNC"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.ep.behaviors.LEDM_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==LEDMCR_ID){set_value(sim.ep.states[s_expr[2]],iocr)}if(bus_ab==LEDMDR_ID){set_value(sim.ep.states[s_expr[2]],iodr)}if(bus_ab==LEDMSR_ID){var x=(iodr&4278190080)>>24;var y=(iodr&16711680)>>16;var p=y*sim.ep.internal_states.ledm_dim+x;var s=get_var(sim.ep.internal_states.ledm_state[p].color);set_value(sim.ep.states[s_expr[2]],s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.ep.states[s_expr[1]]);var iosr=get_value(sim.ep.states[s_expr[3]]);var iocr=get_value(sim.ep.states[s_expr[4]]);var iodr=get_value(sim.ep.states[s_expr[5]]);if(bus_ab==LEDMSR_ID)verbal="I/O device read at LEDMSR of value "+iosr+". ";if(bus_ab==LEDMCR_ID)verbal="I/O device read at LEDMCR of value "+iocr+". ";if(bus_ab==LEDMDR_ID)verbal="I/O device read at LEDMDR of value "+iodr+". ";return verbal}};sim.ep.behaviors.LEDM_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.ep.states[s_expr[1]]);var bus_db=get_value(sim.ep.states[s_expr[2]]);switch(bus_ab){case LEDMSR_ID:set_value(sim.ep.states[s_expr[3]],bus_db);break;case LEDMDR_ID:set_value(sim.ep.states[s_expr[5]],bus_db);break;case LEDMCR_ID:set_value(sim.ep.states[s_expr[4]],bus_db);break;default:break}if(LEDMCR_ID==bus_ab){var dr=get_value(sim.ep.states[s_expr[5]]);if(16&bus_db){var x=(dr&4278190080)>>24;var y=(dr&16711680)>>16;var s=dr&255;set_value(sim.ep.states[s_expr[3]],1);if(x>=sim.ep.internal_states.ledm_dim&&y>=sim.ep.internal_states.ledm_dim){set_value(sim.ep.states[s_expr[3]],-1);return}var p=y*sim.ep.internal_states.ledm_dim+x;set_var(sim.ep.internal_states.ledm_state[p].color,s)}if(32&bus_db){set_value(sim.ep.states[s_expr[3]],1);var s=0;var neltos=sim.ep.internal_states.ledm_neltos;for(var p=0;p>0);set_var(sim.ep.internal_states.ledm_state[p+1].color,(s&65280)>>8);set_var(sim.ep.internal_states.ledm_state[p+2].color,(s&16711680)>>16);set_var(sim.ep.internal_states.ledm_state[p+3].color,(s&4278190080)>>24)}}if(64&bus_db){set_value(sim.ep.states[s_expr[3]],1);var s=0;var c="";var neltos=sim.ep.internal_states.ledm_colors.length;for(var p=0;p>>8;s=s.toString(16);c="#"+simcoreui_pack(s,6);sim.ep.internal_states.ledm_colors[p]=c}neltos=sim.ep.internal_states.ledm_neltos;for(var p=0;p>24;var y=(dr&16711680)>>16;var s=dr&255;verbal="I/O device write at LEDMCR with value "+bus_db+" (set pixel x:"+x+", y:"+y+", with color:"+s+"). "}if(64&bus_db){verbal="I/O device write at LEDMCR with value "+bus_db+" (set color palette at:"+bus_db+"). "}break;default:break}return verbal}};sim.ep.behaviors.LEDM_RESET={nparameters:1,operation:function(s_expr){sim.ep.events.ledm={};sim.ep.internal_states.ledm_colors=colors_clone("");for(var i=0;i>>0;if(value!=0){vec.CPU["R"+i]={type:"register",default_value:0,id:"R"+i,op:"=",value:"0x"+value.toString(16)}}}for(var i=0;i>>0;if(value!=0){vec.CPU[internal_reg[i]]={type:"register",default_value:0,id:internal_reg[i],op:"=",value:"0x"+value.toString(16)}}}return vec},read_state:function(vec,check){if(typeof vec.CPU=="undefined")vec.CPU={};var key=check["id"].toUpperCase().trim();var val=parseInt(check["value"]).toString(16);if("REGISTER"==check["type"].toUpperCase().trim()){vec.CPU[key]={type:"register",default_value:0,id:key,op:check["condition"],value:"0x"+val};return true}return false},get_state:function(reg){var r_reg=reg.toUpperCase().trim();if(typeof sim.poc.states["REG_"+r_reg]!="undefined"){var value=get_value(sim.poc.states["REG_"+r_reg])>>>0;return"0x"+value.toString(16)}r_reg=r_reg.replace("R","");var index=parseInt(r_reg);if(typeof sim.poc.states.BR[index]!="undefined"){var value=get_value(sim.poc.states.BR[index])>>>0;return"0x"+value.toString(16)}return null},get_value:function(elto){if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index))return get_value(simhw_sim_state(elto))>>>0;return get_value(simhw_sim_states().BR[index])>>>0},set_value:function(elto,value){var pc_name=simhw_sim_ctrlStates_get().pc.state;if(Number.isInteger(elto))index=elto;else index=parseInt(elto);if(isNaN(index)){set_value(simhw_sim_state(elto),value);if(pc_name===elto){show_asmdbg_pc()}return value}return set_value(simhw_sim_states().BR[index],value)}};sim.poc.ctrl_states.pc={name:"PC",state:"REG_PC",is_pointer:true};sim.poc.ctrl_states.sp={name:"SP",state:"BR.29",is_pointer:true};sim.poc.ctrl_states.fp={name:"FP",state:"BR.30",is_pointer:true};sim.poc.ctrl_states.ir={name:"IR",state:"REG_IR",default_eltos:{co:{begin:0,end:5,length:6},cop:{begin:27,end:31,length:5}},is_pointer:false};sim.poc.ctrl_states.mpc={name:"mPC",state:"REG_MICROADDR",is_pointer:false};sim.poc.internal_states.MC={};sim.poc.internal_states.ROM={};sim.poc.internal_states.FIRMWARE=ws_empty_firmware;sim.poc.internal_states.io_hash={};sim.poc.internal_states.fire_stack=[];sim.poc.internal_states.tri_state_names=["T1","T2","T3","T6","T8","T9","T10","T11","T12"];sim.poc.internal_states.fire_visible={databus:false,internalbus:false};sim.poc.internal_states.filter_states=["REG_IR_DECO,col-12","REG_IR,col-auto","REG_PC,col-auto","REG_SR,col-auto","REG_RT1,col-auto","REG_MAR,col-auto","REG_MBR,col-auto","REG_MICROADDR,col-auto"];sim.poc.internal_states.filter_signals=["A0,0","B,0","C,0","SELA,5","SELB,5","SELC,2","SELCOP,0","MRA,0","MRB,0","MRC,0","MC,0","C0,0","C1,0","C2,0","C3,0","C4,0","C7,0","T1,0","T2,0","T3,0","T6,0","T8,0","T9,0","T10,0","T11,0","M1,0","M7,0","MA,0","MB,0","LC,0","SE,0","SIZE,0","OFFSET,0","BW,0","R,0","W,0","TA,0","TD,0","IOR,0","IOW,0","TEST_I,0","TEST_U,0"];sim.poc.internal_states.alu_flags={flag_n:0,flag_z:0,flag_v:0,flag_c:0};sim.poc.states.BR=[];sim.poc.states.BR[0]={name:"R0",verbal:"Register 0",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[1]={name:"R1",verbal:"Register 1",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[2]={name:"R2",verbal:"Register 2",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[3]={name:"R3",verbal:"Register 3",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[4]={name:"R4",verbal:"Register 4",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[5]={name:"R5",verbal:"Register 5",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[6]={name:"R6",verbal:"Register 6",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[7]={name:"R7",verbal:"Register 7",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[8]={name:"R8",verbal:"Register 8",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[9]={name:"R9",verbal:"Register 9",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[10]={name:"R10",verbal:"Register 10",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[11]={name:"R11",verbal:"Register 11",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[12]={name:"R12",verbal:"Register 12",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[13]={name:"R13",verbal:"Register 13",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[14]={name:"R14",verbal:"Register 14",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[15]={name:"R15",verbal:"Register 15",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[16]={name:"R16",verbal:"Register 16",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[17]={name:"R17",verbal:"Register 17",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[18]={name:"R18",verbal:"Register 18",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[19]={name:"R19",verbal:"Register 19",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[20]={name:"R20",verbal:"Register 20",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[21]={name:"R21",verbal:"Register 21",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[22]={name:"R22",verbal:"Register 22",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[23]={name:"R23",verbal:"Register 23",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[24]={name:"R24",verbal:"Register 24",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[25]={name:"R25",verbal:"Register 25",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[26]={name:"R26",verbal:"Register 26",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[27]={name:"R27",verbal:"Register 27",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[28]={name:"R28",verbal:"Register 28",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[29]={name:"R29",verbal:"Register 29",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[30]={name:"R30",verbal:"Register 30",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[31]={name:"R31",verbal:"Register 31",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[32]={name:"R32",verbal:"Register 32",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[33]={name:"R33",verbal:"Register 33",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[34]={name:"R34",verbal:"Register 34",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[35]={name:"R35",verbal:"Register 35",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[36]={name:"R36",verbal:"Register 36",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[37]={name:"R37",verbal:"Register 37",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[38]={name:"R38",verbal:"Register 38",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[39]={name:"R39",verbal:"Register 39",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[40]={name:"R40",verbal:"Register 40",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[41]={name:"R41",verbal:"Register 41",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[42]={name:"R42",verbal:"Register 42",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[43]={name:"R43",verbal:"Register 43",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[44]={name:"R44",verbal:"Register 44",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[45]={name:"R45",verbal:"Register 45",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[46]={name:"R46",verbal:"Register 46",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[47]={name:"R47",verbal:"Register 47",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[48]={name:"R48",verbal:"Register 48",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[49]={name:"R49",verbal:"Register 49",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[50]={name:"R50",verbal:"Register 50",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[51]={name:"R51",verbal:"Register 51",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[52]={name:"R52",verbal:"Register 52",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[53]={name:"R53",verbal:"Register 53",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[54]={name:"R54",verbal:"Register 54",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[55]={name:"R55",verbal:"Register 55",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[56]={name:"R56",verbal:"Register 56",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[57]={name:"R57",verbal:"Register 57",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[58]={name:"R58",verbal:"Register 58",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[59]={name:"R59",verbal:"Register 59",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[60]={name:"R60",verbal:"Register 60",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[61]={name:"R61",verbal:"Register 61",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[62]={name:"R62",verbal:"Register 62",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.BR[63]={name:"R63",verbal:"Register 63",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_PC"]={name:"PC",verbal:"Program Counter Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_MAR"]={name:"MAR",verbal:"Memory Address Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_MBR"]={name:"MBR",verbal:"Memory Data Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_IR"]={name:"IR",verbal:"Instruction Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_SR"]={name:"SR",verbal:"State Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_RT1"]={name:"RT1",verbal:"Temporal Register 1",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BUS_IB"]={name:"I_BUS",verbal:"Internal Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BUS_AB"]={name:"A_BUS",verbal:"Address Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BUS_CB"]={name:"C_BUS",verbal:"Control Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BUS_DB"]={name:"D_BUS",verbal:"Data Bus",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["RA_T9"]={name:"RA_T9",verbal:"Input of T9 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["RB_T10"]={name:"RB_T10",verbal:"Input of T10 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["HPC_T12"]={name:"HPC_T12",verbal:"Input of T12 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["SELEC_T3"]={name:"SELEC_T3",verbal:"Input of T3 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["ALU_T6"]={name:"ALU_T6",verbal:"Input of T6 Tristate",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["MA_ALU"]={name:"MA_ALU",verbal:"Input ALU via MA",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["MB_ALU"]={name:"MB_ALU",verbal:"Input ALU via MB",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_C"]={name:"FLAG_C",verbal:"Carry Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_V"]={name:"FLAG_V",verbal:"Overflow Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_N"]={name:"FLAG_N",verbal:"Negative Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_Z"]={name:"FLAG_Z",verbal:"Zero Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_I"]={name:"FLAG_I",verbal:"Interruption Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["FLAG_U"]={name:"FLAG_U",verbal:"User Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["REG_MICROADDR"]={name:"µADDR",verbal:"Microaddress Register",visible:true,nbits:"12",value:0,default_value:0,draw_data:["svg_cu:text4667"]};sim.poc.states["REG_MICROINS"]={name:"µINS",verbal:"Microinstruction Register",visible:true,nbits:"77",value:{},default_value:{},draw_data:[]};sim.poc.states["FETCH"]={name:"FETCH",verbal:"Input Fetch",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.poc.states["ROM_MUXA"]={name:"ROM_MUXA",verbal:"Input ROM",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.poc.states["SUM_ONE"]={name:"SUM_ONE",verbal:"Input next microinstruction",visible:false,nbits:"12",value:1,default_value:1,draw_data:[]};sim.poc.states["MUXA_MICROADDR"]={name:"MUXA_MICROADDR",verbal:"Input microaddress",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.poc.states["MUXC_MUXB"]={name:"MUXC_MUXB",verbal:"Output of MUX C",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["INEX"]={name:"INEX",verbal:"Illegal Instruction Exception",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["BS_M1"]={name:"BS_M1",verbal:"from Memory",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["BS_TD"]={name:"BS_TD",verbal:"Memory",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["INTV"]={name:"INTV",verbal:"Interruption Vector",visible:false,nbits:"8",value:0,default_value:0,draw_data:[]};sim.poc.states["M1_C1"]={name:"M1_C1",verbal:"Input of Memory Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["M7_C7"]={name:"M7_C7",verbal:"Input of State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["VAL_ZERO"]={name:"VAL_ZERO",verbal:"Wired Zero",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.poc.states["VAL_ONE"]={name:"VAL_ONE",verbal:"Wired One",visible:false,nbits:"32",value:1,default_value:1,draw_data:[]};sim.poc.states["VAL_FOUR"]={name:"VAL_FOUR",verbal:"Wired Four",visible:false,nbits:"32",value:4,default_value:4,draw_data:[]};sim.poc.states["REG_IR_DECO"]={name:"IR_DECO",verbal:"Instruction Decoded",visible:true,nbits:"0",value:0,default_value:0,draw_data:[]};sim.poc.states["DECO_INS"]={name:"DECO_INS",verbal:"Instruction decoded in binary",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["CLK"]={name:"CLK",verbal:"Clock",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["ACC_TIME"]={name:"ACC_TIME",verbal:"Accumulated CPU time",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["TTCPU"]={name:"TTCPU",verbal:"Several Tristates to the internal data bus in CPU activated",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states["ACC_PWR"]={name:"ACC_PWR",verbal:"Accumulated Energy Consumption",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.signals["C"]={name:"C",visible:true,type:"L",value:0,default_value:0,nbits:"4",behavior:["MV MUXC_MUXB VAL_ZERO; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB INT 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB IORDY 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB MRDY 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 0 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 1 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 28 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 29 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 30 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MBIT MUXC_MUXB REG_SR 31 1; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB","MV MUXC_MUXB INEX; FIRE_IFCHANGED B MUXC_MUXB; RESET_CHANGED MUXC_MUXB"],fire_name:["svg_cu:text3410"],draw_data:[["svg_cu:path3108"],["svg_cu:path3062"],["svg_cu:path3060"],["svg_cu:path3136"],["svg_cu:path3482"],["svg_cu:path3480"],["svg_cu:path3488"],["svg_cu:path3486"],["svg_cu:path3484"],["svg_cu:path3484-9"],["svg_cu:path3108-3","svg_cu:path3260-3-8-6","svg_cu:path3260-3-8","svg_cu:path3260-3"]],draw_name:[["svg_cu:path3496","svg_cu:path3414","svg_cu:path3194-08"]]};sim.poc.signals["B"]={name:"B",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV A1 MUXC_MUXB; FIRE A1","NOT_ES A1 MUXC_MUXB; FIRE A1"],depends_on:["CLK"],fire_name:["svg_cu:text3408"],draw_data:[["svg_cu:path3094-7"],["svg_cu:path3392","svg_cu:path3372","svg_cu:path3390","svg_cu:path3384","svg_cu:path3108-1","svg_cu:path3100-8-7"]],draw_name:[[],["svg_cu:path3194-0","svg_cu:path3138-8","svg_cu:path3498-6"]]};sim.poc.signals["A0"]={name:"A0",visible:false,type:"L",value:0,default_value:0,nbits:"1",behavior:["SBIT_SIGNAL A0A1 0 1; FIRE A0A1","SBIT_SIGNAL A0A1 1 1; FIRE A0A1"],depends_on:["CLK"],fire_name:["svg_cu:text3406"],draw_data:[["svg_cu:path3096"],["svg_cu:path3096"]],draw_name:[[],["svg_cu:path3138-8-1","svg_cu:path3098-2","svg_cu:path3124-2-5"]]};sim.poc.signals["A1"]={name:"A1",visible:false,type:"L",value:0,default_value:0,nbits:"1",behavior:["SBIT_SIGNAL A0A1 0 0; FIRE A0A1","SBIT_SIGNAL A0A1 1 0; FIRE A0A1"],depends_on:["CLK"],fire_name:[],draw_data:[["svg_cu:path3094"],["svg_cu:path3094"]],draw_name:[[]]};sim.poc.signals["A0A1"]={name:"A0A1",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["PLUS1 MUXA_MICROADDR REG_MICROADDR","CP_FIELD MUXA_MICROADDR REG_MICROINS/MADDR","MV MUXA_MICROADDR ROM_MUXA","MV MUXA_MICROADDR FETCH"],depends_on:["CLK"],fire_name:[],draw_data:[["svg_cu:path3102","svg_cu:path3100","svg_cu:path3098","svg_cu:path3100-9","svg_cu:path3088"],["svg_cu:path3104","svg_cu:path3134","svg_cu:path3500","svg_cu:path3416"],["svg_cu:path3504","svg_cu:path3100-8","svg_cu:path3234-9"],["svg_cu:path3124"]],draw_name:[[]]};sim.poc.signals["C0"]={name:"C0",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_MAR BUS_IB"],fire_name:["svg_p:text3077"],draw_data:[["svg_p:path3081"]],draw_name:[["svg_p:path3075"]]};sim.poc.signals["C1"]={name:"C1",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_MBR M1_C1"],fire_name:["svg_p:text3079"],draw_data:[["svg_p:path3055"]],draw_name:[["svg_p:path3073"]]};sim.poc.signals["C2"]={name:"C2",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_PC BUS_IB; UPDATEDPC"],fire_name:["svg_p:text3179"],draw_data:[["svg_p:path3217"]],draw_name:[["svg_p:path3177"]]};sim.poc.signals["C3"]={name:"C3",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_IR BUS_IB; DECO; FIRE_IFSET C 10"],fire_name:["svg_p:text3439"],draw_data:[["svg_p:path3339","svg_p:path3913-4"]],draw_name:[["svg_p:path3337"]]};sim.poc.signals["C4"]={name:"C4",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_RT1 BUS_IB"],fire_name:["svg_p:tspan482"],draw_data:[["svg_p:path3339-4"]],draw_name:[["svg_p:path3337-0"]]};sim.poc.signals["C7"]={name:"C7",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","MV REG_SR M7_C7"],fire_name:["svg_p:text3655"],draw_data:[["svg_p:path3651-9"]],draw_name:[["svg_p:path3681"]]};sim.poc.signals["TA"]={name:"TA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MV BUS_AB REG_MAR"],fire_name:["svg_p:text3091"],draw_data:[["svg_p:path3083","svg_p:path3089","svg_p:path3597","svg_p:path3513","svg_p:path3601","svg_p:path3601-2","svg_p:path3187","svg_p:path3087","svg_p:path2995","svg_p:path3535"]],draw_name:[["svg_p:path3085"]]};sim.poc.signals["TD"]={name:"TD",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; CHECK_RTD","MV BUS_DB REG_MBR; FIRE R; FIRE W; CHECK_RTD"],fire_name:["svg_p:text3103"],draw_data:[["svg_p:path3093","svg_p:path3101","svg_p:path3587","svg_p:path3419-8","svg_p:path3071","svg_p:path3099","svg_p:path3097","svg_p:path3559-5","svg_p:path3419-1-0","svg_p:path3583","svg_p:path3419-1","svg_p:path3491","svg_p:path3641","svg_p:path3541"]],draw_name:[["svg_p:path3095"]]};sim.poc.signals["T1"]={name:"T1",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 0","MV BUS_IB REG_MBR; FIRE M7; FIRE M1; SET_TT TTCPU 0"],fire_name:["svg_p:text3105"],draw_data:[["svg_p:path3065","svg_p:path3071","svg_p:path3069","svg_p:path3049","svg_p:path3063-9","svg_p:path3071"]],draw_name:[["svg_p:path3067"]]};sim.poc.signals["T2"]={name:"T2",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 1","MV BUS_IB REG_PC; FIRE M7; FIRE M1; SET_TT TTCPU 1"],fire_name:["svg_p:text3449"],draw_data:[["svg_p:path3195","svg_p:path3199","svg_p:path3201","svg_p:path3049"]],draw_name:[["svg_p:path3329"]]};sim.poc.signals["T3"]={name:"T3",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 2","MV BUS_IB SELEC_T3; FIRE M7; FIRE M1; SET_TT TTCPU 2"],fire_name:["svg_p:text3451"],draw_data:[["svg_p:path3347","svg_p:path3349","svg_p:path3931","svg_p:path3345","svg_p:path3049"]],draw_name:[["svg_p:path3351"]]};sim.poc.signals["T6"]={name:"T6",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 3","MV BUS_IB ALU_T6; FIRE M7; FIRE M1; SET_TT TTCPU 3"],fire_name:["svg_p:text3457"],draw_data:[["svg_p:path3315","svg_p:path3589","svg_p:path3317","svg_p:path3163-2","svg_p:path3049","svg_p:path3317-9","svg_p:path3321","svg_p:path3261-8"]],draw_name:[["svg_p:path3319"]]};sim.poc.signals["T8"]={name:"T8",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 4","MV BUS_IB REG_SR; FIRE M7; FIRE M1; SET_TT TTCPU 4"],fire_name:["svg_p:text3657"],draw_data:[["svg_p:path3645","svg_p:path3651","svg_p:path3647","svg_p:path3049"]],draw_name:[["svg_p:path3649"]]};sim.poc.signals["T9"]={name:"T9",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 5","MV BUS_IB RA_T9; FIRE M7; FIRE M1; SET_TT TTCPU 5"],fire_name:["svg_p:text3147"],draw_data:[["svg_p:path3131","svg_p:path3143","svg_p:path3139","svg_p:path3049","svg_p:path3143-9"]],draw_name:[["svg_p:path3133"]]};sim.poc.signals["T10"]={name:"T10",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 6","MV BUS_IB RB_T10; FIRE M7; FIRE M1; SET_TT TTCPU 6"],fire_name:["svg_p:text3149"],draw_data:[["svg_p:path3135","svg_p:path3145","svg_p:path3141","svg_p:path3049","svg_p:path3145-5"]],draw_name:[["svg_p:path3137"]]};sim.poc.signals["T11"]={name:"T11",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 7","CP_FIELD BUS_IB REG_MICROINS/EXCODE; FIRE M7; FIRE M1; SET_TT TTCPU 7"],fire_name:["svg_p:text3147-5","svg_cu:tspan4426"],draw_data:[["svg_p:path3131-3","svg_p:path3081-3","svg_p:path3139-7","svg_p:path3049","svg_cu:path3081-3","svg_cu:path3139-7","svg_cu:path3502"]],draw_name:[["svg_p:path3133-6","svg_cu:path3133-6"]]};sim.poc.signals["T12"]={name:"T12",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; RST_TT TTCPU 8","MV BUS_IB HPC_T12; FIRE M7; FIRE M1; SET_TT TTCPU 8"],fire_name:["svg_p:text3147-5-0-1-1"],draw_data:[["svg_p:path3131-3-8-4-31","svg_p:path3139-7-1-4-3","svg_cu:path3049"]],draw_name:[["svg_cu:path3133-6-9-7-5"]]};sim.poc.signals["M1"]={name:"M1",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M1_C1 BUS_IB","MV M1_C1 BUS_DB"],depends_on:["C1"],fire_name:["svg_p:text3469"],draw_data:[["svg_p:path3063","svg_p:path3061","svg_p:path3059"],["svg_p:path3057","svg_p:path3641","svg_p:path3419","svg_p:path3583"]],draw_name:[[],["svg_p:path3447"]]};sim.poc.signals["M7"]={name:"M7",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M7_C7 BUS_IB","MV M7_C7 REG_SR; UPDATE_FLAG M7_C7 FLAG_C 31; UPDATE_FLAG M7_C7 FLAG_V 30; UPDATE_FLAG M7_C7 FLAG_N 29; UPDATE_FLAG M7_C7 FLAG_Z 28"],depends_on:["C7"],fire_name:["svg_p:text3673"],draw_data:[["svg_p:path3691","svg_p:path3693","svg_p:path3659"],["svg_p:path3695"]],draw_name:[[],["svg_p:path3667"]]};sim.poc.signals["MA"]={name:"MA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV MA_ALU RA_T9; FIRE COP","MV MA_ALU BUS_IB; FIRE COP"],depends_on:["SELA","SELB"],fire_name:["svg_p:text3463"],draw_data:[["svg_p:path3249","svg_p:path3161","svg_p:path3165"],["svg_p:path3279"]],draw_name:[[],["svg_p:path3423"]]};sim.poc.signals["MB"]={name:"MB",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV MB_ALU RB_T10; FIRE COP","MV MB_ALU REG_PC; FIRE COP"],depends_on:["SELA","SELB"],fire_name:["svg_p:text3465"],draw_data:[["svg_p:path3281","svg_p:path3171","svg_p:path3169"],["svg_p:path3283"]],draw_name:[[],["svg_p:path3425","svg_p:path3427"]]};sim.poc.signals["MH"]={name:"MH",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MV HPC_T12 CLK","MV HPC_T12 ACC_TIME","MV HPC_T12 ACC_PWR","NOP"],fire_name:["svg_p:text3147-5-0-1-8-4"],draw_data:[[],["svg_p:path3081-3-8-5-3"]],draw_name:[[],["svg_p:path3306-8-7-6"]]};sim.poc.signals["COP"]={name:"COP",visible:true,type:"L",value:0,default_value:0,nbits:"5",forbidden:true,behavior:["NOP_ALU; UPDATE_NZVC","AND ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","OR ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","NOT ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","XOR ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SRL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SRA ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","RR ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","RL ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUB ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","MUL ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","DIV ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","MOD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","LUI ALU_T6 MA_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADDFOUR ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","ADDONE ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUBFOUR ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","SUBONE ALU_T6 MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FADD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FSUB ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FMUL ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FDIV ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","FMOD ALU_T6 MA_ALU MB_ALU; UPDATE_NZVC; FIRE_IFSET T6 1; FIRE_IFSET M7 1","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU"],depends_on:["SELCOP"],fire_name:["svg_p:text3303"],draw_data:[["svg_p:path3237","svg_p:path3239","svg_p:path3261-8","svg_p:path3321","svg_p:path3901-6","svg_p:path3317-9"]],draw_name:[["svg_p:path3009","svg_p:path3301"]]};sim.poc.signals["SELA"]={name:"SELA",visible:true,type:"L",value:0,default_value:0,nbits:"6",behavior:["FIRE_IFCHANGED MRA SELA; RESET_CHANGED SELA"],depends_on:["RA"],fire_name:["svg_cu:text3164"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["SELB"]={name:"SELB",visible:true,type:"L",value:0,default_value:0,nbits:"6",behavior:["FIRE_IFCHANGED MRB SELB; RESET_CHANGED SELB"],depends_on:["RB"],fire_name:["svg_cu:text3168"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["SELC"]={name:"SELC",visible:true,type:"L",value:0,default_value:0,nbits:"6",behavior:["FIRE_IFCHANGED MRC SELC; RESET_CHANGED SELC"],depends_on:["RC"],fire_name:["svg_cu:text3172"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["SELCOP"]={name:"SELCOP",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["FIRE_IFCHANGED MC SELCOP; RESET_CHANGED SELCOP"],depends_on:["COP"],fire_name:["svg_cu:text3312"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["EXCODE"]={name:"EXCODE",visible:true,type:"L",value:0,default_value:0,nbits:"4",behavior:["FIRE T11"],fire_name:["svg_cu:text3312-6"],draw_data:[[]],draw_name:[[]]};sim.poc.signals["RA"]={name:"RA",visible:true,type:"L",value:0,default_value:0,nbits:"6",forbidden:true,behavior:["GET RA_T9 BR RA; FIRE_IFSET T9 1; FIRE_IFSET MA 0"],depends_on:["SELA"],fire_name:["svg_p:text3107"],draw_data:[[]],draw_name:[["svg_p:path3109"]]};sim.poc.signals["RB"]={name:"RB",visible:true,type:"L",value:0,default_value:0,nbits:"6",forbidden:true,behavior:["GET RB_T10 BR RB; FIRE_IFSET T10 1; FIRE_IFSET MB 0"],depends_on:["SELB"],fire_name:["svg_p:text3123"],draw_data:[[]],draw_name:[["svg_p:path3113"]]};sim.poc.signals["RC"]={name:"RC",visible:true,type:"L",value:0,default_value:0,nbits:"6",forbidden:true,behavior:["FIRE LC"],depends_on:["SELC"],fire_name:["svg_p:text3125"],draw_data:[[]],draw_name:[["svg_p:path3117"]]};sim.poc.signals["LC"]={name:"LC",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","SET BR RC BUS_IB"],fire_name:["svg_p:text3127"],draw_data:[["svg_p:path3153","svg_p:path3151","svg_p:path3129"]],draw_name:[["svg_p:path3121"]]};sim.poc.signals["SE"]={name:"SE",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3","MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3593"],draw_data:[[]],draw_name:[["svg_p:path3591","svg_p:path3447-7-7"]]};sim.poc.signals["SIZE"]={name:"SIZE",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3363"],draw_data:[[]],draw_name:[["svg_p:path3355"]]};sim.poc.signals["OFFSET"]={name:"OFFSET",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["MBITS SELEC_T3 0 REG_RT1 OFFSET SIZE 0 SE; FIRE T3"],depends_on:["T3"],fire_name:["svg_p:text3707"],draw_data:[[]],draw_name:[["svg_p:path3359"]]};sim.poc.signals["MC"]={name:"MC",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT COP REG_IR 0 5; FIRE_IFCHANGED COP MC","CP_FIELD COP REG_MICROINS/SELCOP; FIRE_IFCHANGED COP MC"],depends_on:["SELCOP"],fire_name:["svg_cu:text3322","svg_cu:text3172-1-5"],draw_data:[["svg_cu:path3320","svg_cu:path3142"],["svg_cu:path3318","svg_cu:path3502-6","svg_cu:path3232-6"]],draw_name:[[],["svg_cu:path3306"]]};sim.poc.signals["MRA"]={name:"MRA",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RA REG_IR REG_MICROINS/SELA 5; FIRE RA;","CP_FIELD RA REG_MICROINS/SELA; FIRE RA;"],depends_on:["SELA"],fire_name:["svg_cu:text3222"],draw_data:[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3142b","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3260"],["svg_cu:path3270","svg_cu:path3258","svg_cu:path3260","svg_cu:path3294","svg_cu:path3288","svg_cu:path3280"]],draw_name:[[],["svg_cu:path3220"]]};sim.poc.signals["MRB"]={name:"MRB",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RB REG_IR REG_MICROINS/SELB 5; FIRE RB;","CP_FIELD RB REG_MICROINS/SELB; FIRE RB;"],depends_on:["SELB"],fire_name:["svg_cu:text3242"],draw_data:[["svg_cu:path3196","svg_cu:path3278","svg_cu:path3292"],["svg_cu:path3282","svg_cu:path3258-4","svg_cu:path3278","svg_cu:path3196"]],draw_name:[[],["svg_cu:path3240"]]};sim.poc.signals["MRC"]={name:"MRC",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN RC REG_IR REG_MICROINS/SELC 5; FIRE RC;","CP_FIELD RC REG_MICROINS/SELC; FIRE RC;"],depends_on:["SELC"],fire_name:["svg_cu:text3254"],draw_data:[["svg_cu:path3494","svg_cu:path3492","svg_cu:path3490","svg_cu:path3142b","svg_cu:path3188","svg_cu:path3190","svg_cu:path3192","svg_cu:path3194","svg_cu:path3276","svg_cu:path3290","svg_cu:path3232","svg_cu:path3292"],["svg_cu:path3300","svg_cu:path3294","svg_cu:path3292","svg_cu:path3288","svg_cu:path3232"]],draw_name:[[],["svg_cu:path3252"]]};sim.poc.signals["IOR"]={name:"IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MOVE_BITS SCR_IOR 0 1 IOR; FIRE SCR_IOR; MOVE_BITS IO_IOR 0 1 IOR; FIRE IO_IOR; MOVE_BITS L3D_IOR 0 1 IOR; FIRE L3D_IOR; MOVE_BITS KBD_IOR 0 1 IOR; FIRE KBD_IOR; MOVE_BITS LEDM_IOR 0 1 IOR; FIRE LEDM_IOR"],fire_name:[],draw_data:[[],["svg_p:path3733","svg_p:path3491","svg_p:text3715"]],draw_name:[[],[]]};sim.poc.signals["IOW"]={name:"IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MOVE_BITS SCR_IOW 0 1 IOW; FIRE SCR_IOW; MOVE_BITS IO_IOW 0 1 IOW; FIRE IO_IOW; MOVE_BITS L3D_IOW 0 1 IOW; FIRE L3D_IOW; MOVE_BITS LEDM_IOW 0 1 IOW; FIRE LEDM_IOW"],fire_name:[],draw_data:[[],["svg_p:path3735","svg_p:path3491","svg_p:text3717"]],draw_name:[[],[]]};sim.poc.signals["TEST_C"]={name:"TEST_C",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_C VAL_ZERO; FIRE M7","MV FLAG_C VAL_ONE; FIRE M7"],depends_on:["SELCOP"],fire_name:["svg_p:text3701-3"],draw_data:[["svg_p:text3701-3"]],draw_name:[[]]};sim.poc.signals["TEST_V"]={name:"TEST_V",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_V VAL_ZERO; FIRE M7","MV FLAG_V VAL_ONE; FIRE M7"],depends_on:["SELCOP"],fire_name:["svg_p:text3701-3-1"],draw_data:[["svg_p:text3701-3-1"]],draw_name:[[]]};sim.poc.signals["TEST_N"]={name:"TEST_N",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_N VAL_ZERO; FIRE M7","MV FLAG_N VAL_ONE; FIRE M7"],depends_on:["SELCOP"],fire_name:["svg_p:text3701-3-2"],draw_data:[["svg_p:text3701-3-2"]],draw_name:[[]]};sim.poc.signals["TEST_Z"]={name:"TEST_Z",visible:true,type:"L",value:0,default_value:0,nbits:"1",forbidden:true,behavior:["MV FLAG_Z VAL_ZERO; FIRE M7","MV FLAG_Z VAL_ONE; FIRE M7"],depends_on:["SELCOP"],fire_name:["svg_p:text3701-3-5"],draw_data:[["svg_p:text3701-3-5"]],draw_name:[[]]};sim.poc.signals["TEST_I"]={name:"TEST_I",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_I VAL_ZERO; FIRE M7","MV FLAG_I VAL_ONE; FIRE M7"],depends_on:["CLK"],fire_name:["svg_cu:text3440"],draw_data:[["svg_cu:text3440"]],draw_name:[[]]};sim.poc.signals["TEST_U"]={name:"TEST_U",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV FLAG_U VAL_ZERO; FIRE M7","MV FLAG_U VAL_ONE; FIRE M7"],depends_on:["CLK"],fire_name:["svg_cu:text3442"],draw_data:[["svg_cu:text3442"]],draw_name:[[]]};sim.poc.signals["TEST_INTV"]={name:"TEST_INTV",visible:true,type:"L",value:0,default_value:0,nbits:"8",forbidden:true,behavior:["MBIT INTV TEST_INTV 0 32"],depends_on:["INT"],fire_name:["svg_p:tspan4225"],draw_data:[["svg_p:path3749"]],draw_name:[[]]};sim.poc.behaviors["NOP"]={nparameters:1,operation:function(s_expr){},verbal:function(s_expr){return""}};sim.poc.behaviors["NOP_ALU"]={nparameters:1,operation:function(s_expr){sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){return"Reset ALU flags. "}};sim.poc.behaviors["MV"]={nparameters:3,types:["X","X"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)},verbal:function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg("verbal_verbose");if(verbose!=="short"){return"Copy from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(newval)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(newval)+"). "}};sim.poc.behaviors["LOAD"]={nparameters:3,types:["X","X"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);newval=get_value(sim_elto_org);set_value(sim_elto_dst,newval)},verbal:function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var newval=get_value(sim_elto_org);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Load from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(newval)+". "}return show_verbal(s_expr[1])+" = "+show_value(newval)+" ( "+show_verbal(s_expr[2])+"). "}};sim.poc.behaviors["CP_FIELD"]={nparameters:3,types:["X","X"],operation:function(s_expr){r=s_expr[2].split("/");sim_elto_org=get_reference(r[0]);newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval!="undefined"){sim_elto_dst=get_reference(s_expr[1]);set_value(sim_elto_dst,newval)}},verbal:function(s_expr){var r=s_expr[2].split("/");var sim_elto_org=get_reference(r[0]);var newval=get_value(sim_elto_org);newval=newval[r[1]];if(typeof newval=="undefined")newval="<undefined>";else newval=show_value(newval);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return'Copy from "'+show_verbal(r[0])+'"['+r[1]+"] "+"to "+show_verbal(s_expr[1])+" (value "+newval+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(r[0])+"."+r[1]+" ("+newval+"). "}};sim.poc.behaviors["NOT_ES"]={nparameters:3,types:["S","E"],operation:function(s_expr){set_value(sim.poc.signals[s_expr[1]],Math.abs(get_value(sim.poc.states[s_expr[2]])-1))},verbal:function(s_expr){var value=Math.abs(get_value(sim.poc.states[s_expr[2]])-1);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Set "+show_verbal(s_expr[1])+" with value "+show_value(value)+" (Logical NOT of "+s_expr[2]+"). "}return show_verbal(s_expr[1])+" = "+show_value(value)+" (Logical NOT "+s_expr[2]+"). "}};sim.poc.behaviors["GET"]={nparameters:4,types:["E","E","S"],operation:function(s_expr){set_value(sim.poc.states[s_expr[1]],get_value(sim.poc.states[s_expr[2]][sim.poc.signals[s_expr[3]].value]))},verbal:function(s_expr){var value=get_value(sim.poc.states[s_expr[2]][sim.poc.signals[s_expr[3]].value]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Set "+show_verbal(s_expr[1])+" with value "+show_value(value)+" (Register File "+s_expr[3]+"). "}return show_verbal(s_expr[1])+" = "+show_value(value)+" (Register File "+s_expr[3]+"). "}};sim.poc.behaviors["SET"]={nparameters:4,types:["E","S","E"],operation:function(s_expr){set_value(sim.poc.states[s_expr[1]][sim.poc.signals[s_expr[2]].value],get_value(sim.poc.states[s_expr[3]]))},verbal:function(s_expr){var value=get_value(sim.poc.states[s_expr[3]]);var o_ref=sim.poc.states[s_expr[1]][sim.poc.signals[s_expr[2]].value];var o_verbal=o_ref.name;if(typeof o_ref.verbal!="undefined")o_verbal=o_ref.verbal;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy to "+o_verbal+" the value "+show_value(value)+". "}return o_verbal+" = "+show_value(value)+". "}};sim.poc.behaviors["AND"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])&get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])&get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU AND with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (AND). "}};sim.poc.behaviors["OR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])|get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])|get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU OR with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (OR). "}};sim.poc.behaviors["NOT"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=~get_value(sim.poc.states[s_expr[2]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=~get_value(sim.poc.states[s_expr[2]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU NOT with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (NOT). "}};sim.poc.behaviors["XOR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])^get_value(sim.poc.states[s_expr[3]]);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])^get_value(sim.poc.states[s_expr[3]]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU XOR with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (XOR). "}};sim.poc.behaviors["SRL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Right Logical with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SRL). "}};sim.poc.behaviors["SRA"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Right Arithmetic with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SRA). "}};sim.poc.behaviors["SL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Shift Left with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SL). "}};sim.poc.behaviors["RR"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1|(get_value(sim.poc.states[s_expr[2]])&1)<<31;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])>>>1|(get_value(sim.poc.states[s_expr[2]])&1)<<31;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Right Rotation with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (RR). "}};sim.poc.behaviors["RL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1|(get_value(sim.poc.states[s_expr[2]])&2147483648)>>>31;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<1|(get_value(sim.poc.states[s_expr[2]])&2147483648)>>>31;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Left Rotation with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (LR). "}};sim.poc.behaviors["ADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a+b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a+b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU ADD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (ADD). "}};sim.poc.behaviors["SUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a-b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a-b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU SUB with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (SUB). "}};sim.poc.behaviors["MUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a*b;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a*b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MUL with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MUL). "}};sim.poc.behaviors["DIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){return"ALU DIV zero by zero (oops!). "}var result=Math.floor(a/b);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU DIV with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (DIV). "}};sim.poc.behaviors["MOD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=a%b;set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){return"ALU MOD zero by zero (oops!). "}var result=a%b;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU MOD with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (MOD). "}};sim.poc.behaviors["LUI"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"ALU Load Upper Immediate with result "+show_value(result)+". "}return"ALU output = "+show_value(result)+" (LUI). "}};sim.poc.behaviors["ADDFOUR"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;return"ALU ADD 4 with result "+show_value(result)+". "}};sim.poc.behaviors["ADDONE"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;return"ALU ADD 1 with result "+show_value(result)+". "}};sim.poc.behaviors["SUBFOUR"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-4;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-4;return"ALU SUB 4 with result "+show_value(result)+". "}};sim.poc.behaviors["SUBONE"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-1;set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=a>>>31&&b>>>31;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a-1;return"ALU SUB 1 with result "+show_value(result)+". "}};sim.poc.behaviors["FADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)+b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)+b.toFixed(2);return"ALU Float ADD with result "+result+". "}};sim.poc.behaviors["FSUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)-b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)-b.toFixed(2);return"ALU Float SUB with result "+result+". "}};sim.poc.behaviors["FMUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)*b.toFixed(2);set_value(sim.poc.states[s_expr[1]],result>>>0);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_c=0;sim.poc.internal_states.alu_flags.flag_v=0;if(result<0&&a>=0&&b>=0)sim.poc.internal_states.alu_flags.flag_v=1;if(result>=0&&a<0&&b<0)sim.poc.internal_states.alu_flags.flag_v=1},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)*b.toFixed(2);return"ALU Float MUL with result "+result+". "}};sim.poc.behaviors["FDIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;if(0==b){set_value(sim.poc.states[s_expr[1]],0);sim.poc.internal_states.alu_flags.flag_n=0;sim.poc.internal_states.alu_flags.flag_z=1;sim.poc.internal_states.alu_flags.flag_v=1;sim.poc.internal_states.alu_flags.flag_c=0;return}var result=Math.floor(a/b);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)/b.toFixed(2);return"ALU Float DIV with result "+result+". "}};sim.poc.behaviors["FMOD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=(get_value(sim.poc.states[s_expr[2]])<<0)%(get_value(sim.poc.states[s_expr[3]])<<0);set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var b=get_value(sim.poc.states[s_expr[3]])<<0;var result=a.toFixed(2)%b.toFixed(2);return"ALU Float MOD with result "+result+". "}};sim.poc.behaviors["LUI"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;set_value(sim.poc.states[s_expr[1]],result);sim.poc.internal_states.alu_flags.flag_n=result<0?1:0;sim.poc.internal_states.alu_flags.flag_z=result==0?1:0;sim.poc.internal_states.alu_flags.flag_v=0;sim.poc.internal_states.alu_flags.flag_c=0},verbal:function(s_expr){var result=get_value(sim.poc.states[s_expr[2]])<<16;return"ALU Load Upper Immediate with result "+show_value(result)+". "}};sim.poc.behaviors["PLUS1"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;set_value(sim.poc.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+1;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Add one to "+show_verbal(s_expr[2])+" and copy to "+show_verbal(s_expr[1])+" with result "+show_value(result)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" + 1"+" ("+show_value(result)+"). "}};sim.poc.behaviors["PLUS4"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;set_value(sim.poc.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.poc.states[s_expr[2]])<<0;var result=a+4;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Add four to "+show_verbal(s_expr[2])+" and copy to "+show_verbal(s_expr[1])+" with result "+show_value(result)+". "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" + 4"+" ("+show_value(result)+"). "}};sim.poc.behaviors["SET_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a|m;set_value(sim.poc.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.poc.behaviors["RST_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.poc.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a&~m;set_value(sim.poc.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.poc.behaviors["CHECK_RTD"]={nparameters:1,operation:function(s_expr){var number_active_tri=parseInt(simhw_sim_signal("TD").value)+parseInt(simhw_sim_signal("R").value);update_system_bus_fire(number_active_tri)},verbal:function(s_expr){return""}};sim.poc.behaviors["MBIT"]={nparameters:5,types:["X","X","I","I"],operation:function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);set_value(sim_elto_dst,parseInt(n2,2))},verbal:function(s_expr){var sim_elto_dst=get_reference(s_expr[1]);var sim_elto_org=get_reference(s_expr[2]);var offset=parseInt(s_expr[3]);var size=parseInt(s_expr[4]);var n1=get_value(sim_elto_org).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3=parseInt(n2,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[2])+" to "+show_verbal(s_expr[1])+" value "+show_value(n3)+" (copied "+size+" bits from bit "+offset+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(n3)+", "+size+" bits from bit "+offset+"). "}};sim.poc.behaviors["MBIT_SN"]={nparameters:5,types:["S","E","E","I"],operation:function(s_expr){var base=0;var r=s_expr[3].split("/");if(1==r.length)base=get_value(sim.poc.states[s_expr[3]]);else if(typeof sim.poc.states[r[0]].value[r[1]]!="undefined")base=sim.poc.states[r[0]].value[r[1]];else if(typeof sim.poc.signals[r[1]].default_value!="undefined")base=sim.poc.signals[r[1]].default_value;else if(typeof sim.poc.states[r[1]].default_value!="undefined")base=sim.poc.states[r[1]].default_value;else ws_alert("WARN: undefined state/field pair -> "+r[0]+"/"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.poc.states[s_expr[2]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var base=0;var r=s_expr[3].split("/");if(1==r.length)base=get_value(sim.poc.states[s_expr[3]]);else if(typeof sim.poc.states[r[0]].value[r[1]]!="undefined")base=sim.poc.states[r[0]].value[r[1]];else if(typeof sim.poc.signals[r[1]].default_value!="undefined")base=sim.poc.signals[r[1]].default_value;else if(typeof sim.poc.states[r[1]].default_value!="undefined")base=sim.poc.states[r[1]].default_value;else ws_alert("WARN: undefined state/field pair -> "+r[0]+"/"+r[1]);var offset=parseInt(s_expr[4]);var n1=get_value(sim.poc.states[s_expr[2]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-(base+offset-1),offset);var from_elto="";if(1==r.length)from_elto=show_verbal(s_expr[3]);else from_elto='"'+show_verbal(s_expr[2])+'"['+r[1]+"] ";var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+from_elto+"into "+show_verbal(s_expr[1])+" "+"value "+parseInt(n3,2)+". "}return show_verbal(s_expr[1])+" = "+from_elto+" ("+parseInt(n3,2)+"). "}};sim.poc.behaviors["SBIT_SIGNAL"]={nparameters:4,types:["X","I","I"],operation:function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)},verbal:function(s_expr){sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value;var mask=1<>>0)}};sim.poc.behaviors["UPDATE_FLAG"]={nparameters:4,types:["X","X","I"],operation:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var new_value=sim_elto_dst.value&~(1<>>0)},verbal:function(s_expr){sim_elto_org=get_reference(s_expr[2]);sim_elto_dst=get_reference(s_expr[1]);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Update "+show_verbal(s_expr[2])+" to value "+sim_elto_org.value+". "}return show_verbal(s_expr[1])+"."+show_verbal(s_expr[3])+" = "+sim_elto_org.value+". "}};sim.poc.behaviors["MBITS"]={nparameters:8,types:["E","I","E","S","S","I","S"],operation:function(s_expr){var offset=parseInt(sim.poc.signals[s_expr[4]].value);var size=parseInt(sim.poc.signals[s_expr[5]].value);var n1=get_value(sim.poc.states[s_expr[3]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;if("1"==sim.poc.signals[s_expr[7]].value&&"1"==n2.substr(0,1)){n3="11111111111111111111111111111111".substring(0,32-n2.length)+n2}set_value(sim.poc.states[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var offset=parseInt(sim.poc.signals[s_expr[4]].value);var size=parseInt(sim.poc.signals[s_expr[5]].value);var n1=get_value(sim.poc.states[s_expr[3]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(offset+size-1),size);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;if("1"==sim.poc.signals[s_expr[7]].value&&"1"==n2.substr(0,1)){n3="11111111111111111111111111111111".substring(0,32-n2.length)+n2}n1=parseInt(n3,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return" Copy from "+show_verbal(s_expr[3])+" to "+show_verbal(s_expr[1])+" value "+show_value(n1)+" (copied "+size+" bits from bit "+offset+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[3])+" ("+show_value(n1)+", "+size+" bits from bit "+offset+"). "}};sim.poc.behaviors["BSEL"]={nparameters:6,types:["E","I","I","E","I"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var n4="00000000000000000000000000000000".substr(0,posd);n3=n3+n4;set_value(sim.poc.states[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var posd=parseInt(s_expr[2]);var len=parseInt(s_expr[3]);var poso=parseInt(s_expr[5]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n2=n2.substr(31-(poso+len)+1,len);var n3="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var n4="00000000000000000000000000000000".substr(0,posd);n3=n3+n4;var n5=parseInt(n3,2);var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){return"Copy from "+show_verbal(s_expr[4])+" to "+show_verbal(s_expr[1])+" value "+show_value(n5)+" (copied "+len+" bits, from bit "+poso+" of "+s_expr[4]+" to bit "+posd+" of "+s_expr[1]+"). "}return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[4])+" ("+show_value(n5)+", "+len+" bits, from bit "+poso+" of "+s_expr[4]+" to bit "+posd+" of "+s_expr[1]+"). "}};sim.poc.behaviors["EXT_SIG"]={nparameters:3,types:["E","I"],operation:function(s_expr){var n1=get_value(sim.poc.states[s_expr[1]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if("1"==n2[31-s_expr[2]]){n4="11111111111111111111111111111111".substring(0,32-n3.length)+n4}set_value(sim.poc.states[s_expr[1]],parseInt(n4,2))},verbal:function(s_expr){var n1=get_value(sim.poc.states[s_expr[1]]).toString(2);var n2="00000000000000000000000000000000".substring(0,32-n1.length)+n1;var n3=n2.substr(31-s_expr[2],31);var n4=n3;if("1"==n2[31-s_expr[2]]){n4="11111111111111111111111111111111".substring(0,32-n3.length)+n4}var n5=parseInt(n4,2);return"Sign Extension with value "+show_value(n5)+". "}};sim.poc.behaviors["MOVE_BITS"]={nparameters:5,types:["S","I","I","S"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=0;var len=parseInt(s_expr[3]);var n1=sim.poc.signals[s_expr[4]].value.toString(2);n1="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.poc.signals[s_expr[1]].value.toString(2);n2="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.poc.behaviors["MOVE_BITSE"]={nparameters:6,types:["S","I","I","E","I"],operation:function(s_expr){var posd=parseInt(s_expr[2]);var poso=parseInt(s_expr[5]);var len=parseInt(s_expr[3]);var n1=get_value(sim.poc.states[s_expr[4]]).toString(2);n1="00000000000000000000000000000000".substring(0,32-n1.length)+n1;n1=n1.substr(31-poso-len+1,len);var n2=sim.poc.signals[s_expr[1]].value.toString(2);n2="00000000000000000000000000000000".substring(0,32-n2.length)+n2;var m1=n2.substr(0,32-(posd+len));var m2=n2.substr(31-posd+1,posd);var n3=m1+n1+m2;set_value(sim.poc.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.poc.behaviors["DECO"]={nparameters:1,operation:function(s_expr){sim.poc.states["INEX"].value=0;var oi=decode_instruction(sim.poc.internal_states.FIRMWARE,sim.poc.ctrl_states.ir,get_value(sim.poc.states["REG_IR"]));if(null==oi.oinstruction){ws_alert("ERROR: undefined instruction code in IR ("+"co:"+oi.op_code.toString(2)+", "+"cop:"+oi.cop_code.toString(2)+")");sim.poc.states["ROM_MUXA"].value=0;sim.poc.states["INEX"].value=1;return-1}var rom_addr=oi.op_code<<6;if(typeof oi.oinstruction.cop!="undefined"){rom_addr=rom_addr+oi.cop_code}if(typeof sim.poc.internal_states["ROM"][rom_addr]=="undefined"){ws_alert("ERROR: undefined rom address "+rom_addr+" in firmware");sim.poc.states["ROM_MUXA"].value=0;return-1}sim.poc.states["ROM_MUXA"].value=sim.poc.internal_states["ROM"][rom_addr];var val=get_value(sim.poc.states["DECO_INS"]);set_value(sim.poc.states["DECO_INS"],val+1);var pc=get_value(sim.poc.states["REG_PC"])-4;var decins=get_deco_from_pc(pc);set_value(sim.poc.states["REG_IR_DECO"],decins);show_dbg_ir(get_value(sim.poc.states["REG_IR_DECO"]))},verbal:function(s_expr){return"Decode instruction. "}};sim.poc.behaviors["FIRE"]={nparameters:2,types:["S"],operation:function(s_expr){if(sim.poc.internal_states.fire_stack.indexOf(s_expr[1])!=-1){return}sim.poc.internal_states.fire_stack.push(s_expr[1]);update_draw(sim.poc.signals[s_expr[1]],sim.poc.signals[s_expr[1]].value);if("L"==sim.poc.signals[s_expr[1]].type){update_state(s_expr[1])}sim.poc.internal_states.fire_stack.pop(s_expr[1])},verbal:function(s_expr){return""}};sim.poc.behaviors["FIRE_IFSET"]={nparameters:3,types:["S","I"],operation:function(s_expr){if(get_value(sim.poc.signals[s_expr[1]])!=parseInt(s_expr[2])){return}sim.poc.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.poc.behaviors["FIRE_IFCHANGED"]={nparameters:3,types:["S","X"],operation:function(s_expr){sim_elto=get_reference(s_expr[2]);if(sim_elto.changed==false)return;sim.poc.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.poc.behaviors["RESET_CHANGED"]={nparameters:2,types:["X"],operation:function(s_expr){sim_elto=get_reference(s_expr[1]);sim_elto.changed=false},verbal:function(s_expr){return""}};sim.poc.behaviors["CLOCK"]={nparameters:1,operation:function(s_expr){var new_maddr=null;var mcelto=null;var t0=performance.now();var val=get_value(sim.poc.states["CLK"]);set_value(sim.poc.states["CLK"],val+1);set_value(sim.poc.states["TTCPU"],0);new_maddr=get_value(sim.poc.states["REG_MICROADDR"]);mcelto=sim.poc.internal_states["MC"][new_maddr];if(typeof mcelto!=="undefined"&&false==mcelto.is_native){for(var i=0;i>>0},set_value:function(elto,value){var origin="";var r_value=main_memory_get_program_counter();if(r_value!=null){origin="PC=0x"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var valref=main_memory_set(sim.poc.internal_states.MP,elto,melto);show_main_memory(sim.poc.internal_states.MP,elto,typeof valref==="undefined",true);return value}};sim.poc.internal_states.segments={};sim.poc.internal_states.MP={};sim.poc.internal_states.MP_wc=0;sim.poc.internal_states.CM_cfg=[];sim.poc.internal_states.CM=[];sim.poc.signals.MRDY={name:"MRDY",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE_IFCHANGED MRDY C","FIRE_IFCHANGED MRDY C"],fire_name:["svg_p:tspan3916"],draw_data:[[],["svg_p:path3895","svg_p:path3541"]],draw_name:[[],[]]};sim.poc.signals.R={name:"R",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP; CHECK_RTD","MEM_READ BUS_AB BUS_DB BW MRDY CLK; FIRE M1; FIRE MRDY; CHECK_RTD"],fire_name:["svg_p:text3533-5-2"],draw_data:[[],["svg_p:path3557","svg_p:path3571"]],draw_name:[[],[]]};sim.poc.signals.W={name:"W",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MEM_WRITE BUS_AB BUS_DB BW MRDY CLK; FIRE M1; FIRE MRDY"],fire_name:["svg_p:text3533-5-08"],draw_data:[[],["svg_p:path3559","svg_p:path3575","svg_p:path3447-7"]],draw_name:[[],[]]};sim.poc.signals.BW={name:"BW",verbal:["Access to one byte from memory. ","Access to two bytes from memory. ","Access to three bytes from memory. ","Access to a word from memory. "],visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["FIRE R; FIRE W","FIRE R; FIRE W","FIRE R; FIRE W","FIRE R; FIRE W"],fire_name:["svg_p:text3533-5-2-8"],draw_data:[["svg_p:path3557-0"]],draw_name:[[],[]]};sim.poc.behaviors.MEM_READ={nparameters:6,types:["E","E","S","S","E"],operation:function(s_expr){var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);sim.poc.signals[s_expr[4]].value=0;var remain=get_value(sim.poc.internal_states.MP_wc);if(typeof sim.poc.events.mem[clk-1]!="undefined"&&sim.poc.events.mem[clk-1]>0){remain=sim.poc.events.mem[clk-1]-1}var first_time=typeof sim.poc.events.mem[clk]=="undefined";sim.poc.events.mem[clk]=remain;if(remain>0){return}var wordress=address&4294967292;var value=main_memory_getvalue(sim.poc.internal_states.MP,wordress);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}dbvalue=main_memory_extractvalues(value,bw,address&3);sim.poc.states[s_expr[2]].value=dbvalue>>>0;sim.poc.signals[s_expr[4]].value=1;show_main_memory(sim.poc.internal_states.MP,wordress,full_redraw,false);if(first_time&&sim.poc.internal_states.CM.length>0){cache_memory_access(sim.poc.internal_states.CM[0],address,"read",clk)}},verbal:function(s_expr){var verbal="";var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);switch(bw){case 0:bw_type="byte";break;case 1:bw_type="half";break;case 2:bw_type="three bytes";break;case 3:bw_type="word";break}var value=main_memory_getvalue(sim.poc.internal_states.MP,address);if(typeof value==="undefined"){value=0}verbal="Try to read a "+bw_type+" from memory "+"at address 0x"+address.toString(16)+" with value "+value.toString(16)+". ";return verbal}};sim.poc.behaviors.MEM_WRITE={nparameters:6,types:["E","E","S","S","E"],operation:function(s_expr){var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);sim.poc.signals[s_expr[4]].value=0;var remain=get_value(sim.poc.internal_states.MP_wc);if(typeof sim.poc.events.mem[clk-1]!="undefined"&&sim.poc.events.mem[clk-1]>0){remain=sim.poc.events.mem[clk-1]-1}var first_time=typeof sim.poc.events.mem[clk]=="undefined";sim.poc.events.mem[clk]=remain;if(remain>0){return}var wordress=address&4294967292;var value=main_memory_getvalue(sim.poc.internal_states.MP,wordress);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}value=main_memory_updatevalues(value,dbvalue,bw,address&3);var origin="";var r_value=main_memory_get_program_counter();if(r_value!=null){origin="PC=0x"+r_value.toString(16)}var melto={value:value>>>0,source_tracking:[origin],comments:null};var elto=main_memory_set(sim.poc.internal_states.MP,wordress,melto);sim.poc.signals[s_expr[4]].value=1;show_main_memory(sim.poc.internal_states.MP,wordress,full_redraw,true);if(first_time&&sim.poc.internal_states.CM.length>0){cache_memory_access(sim.poc.internal_states.CM[0],address,"write",clk)}},verbal:function(s_expr){var verbal="";var address=sim.poc.states[s_expr[1]].value;var dbvalue=sim.poc.states[s_expr[2]].value;var bw=sim.poc.signals[s_expr[3]].value;var clk=get_value(sim.poc.states[s_expr[5]]);switch(bw){case 0:bw_type="byte";break;case 1:bw_type="half";break;case 2:bw_type="three bytes";break;case 3:bw_type="word";break}var value=main_memory_getvalue(sim.poc.internal_states.MP,address);if(typeof value==="undefined"){value=0}verbal="Try to write a "+bw_type+" to memory "+"at address 0x"+address.toString(16)+" with value "+value.toString(16)+". ";return verbal}};sim.poc.behaviors.MEMORY_RESET={nparameters:1,operation:function(s_expr){sim.poc.events.mem={}},verbal:function(s_expr){return"Reset the memory (all values will be zeroes). "}};sim.poc.elements.memory={name:"Main memory",description:"Main memory subsystem",type:"subcomponent",belongs:"MEMORY",states:{addr:{ref:"BUS_AB"},data:{ref:"BUS_DB"},mrdy:{ref:"MRDY"}},signals:{bw:{ref:"BW"},r:{ref:"R"},w:{ref:"W"}},states_inputs:["addr","data"],states_outputs:["mrdy","data"],signals_inputs:["bw","r","w"],signals_output:[]};sim.poc.components.IO={name:"IO",version:"1",abilities:["IO_TIMER"],details_name:["IO_STATS","IO_CONFIG"],details_fire:[["svg_p:text3775"],[]],write_state:function(vec){return vec},read_state:function(o,check){return false},get_state:function(reg){return null},get_value:function(elto){var associated_state=simhw_internalState_get("io_hash",elto);var value=get_value(simhw_sim_state(associated_state))>>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("IOR"),1);compute_behavior("FIRE IOR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("IOW"),1);compute_behavior("FIRE IOW");return value}};sim.poc.internal_states.io_int_factory=[];sim.poc.internal_states.io_int_factory[0]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[1]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[2]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[3]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[4]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[5]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[6]={period:0,probability:.5,accumulated:0,active:false};sim.poc.internal_states.io_int_factory[7]={period:0,probability:.5,accumulated:0,active:false};var IOSR_ID=4352;var IOCR_ID=4356;var IODR_ID=4360;sim.poc.internal_states.io_hash[IOSR_ID]="IOSR";sim.poc.internal_states.io_hash[IOCR_ID]="IOCR";sim.poc.internal_states.io_hash[IODR_ID]="IODR";sim.poc.states.IOSR={name:"IOSR",verbal:"IO State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.IOCR={name:"IOCR",verbal:"IO Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.IODR={name:"IODR",verbal:"IO Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.signals.INT={name:"INT",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE C","FIRE C"],fire_name:["svg_p:tspan4199"],draw_data:[[],["svg_p:path3809"]],draw_name:[[],[]]};sim.poc.signals.IORDY={name:"IORDY",visible:true,type:"L",value:0,default_value:0,nbits:"1",depends_on:["CLK"],behavior:["FIRE_IFCHANGED IORDY C","FIRE_IFCHANGED IORDY C"],fire_name:["svg_p:tspan4089","svg_p:path3793","svg_p:tspan4089"],draw_data:[[],["svg_p:path3897"]],draw_name:[[],[]]};sim.poc.signals.IO_IOR={name:"IO_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","IO_IOR BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE M1"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.signals.IO_IOW={name:"IO_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","IO_IOW BUS_AB BUS_DB IOSR IOCR IODR CLK; FIRE M1"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.signals.IO_IE={name:"IO_IE",visible:true,type:"L",value:1,default_value:1,nbits:"1",behavior:["NOP","IO_CHK_I CLK INT INTV; FIRE C"],fire_name:[],draw_data:[[],[]],draw_name:[[],[]]};sim.poc.signals.INTA={name:"INTA",visible:true,type:"L",value:1,default_value:0,nbits:"1",behavior:["NOP","INTA CLK INT INTA BUS_DB INTV; FIRE M1; FIRE C"],fire_name:["svg_p:text3785-0-6-0-5-5-1-1"],draw_data:[[],["svg_p:path3807","svg_p:path3737"]],draw_name:[[],[]]};sim.poc.behaviors.IO_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==IOSR_ID)set_value(sim.poc.states[s_expr[2]],iosr);if(bus_ab==IOCR_ID)set_value(sim.poc.states[s_expr[2]],iocr);if(bus_ab==IODR_ID)set_value(sim.poc.states[s_expr[2]],iodr)},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==IOSR_ID)verbal="I/O device read at IOSR of value "+iosr+". ";if(bus_ab==IOCR_ID)verbal="I/O device read at IOCR of value "+iocr+". ";if(bus_ab==IODR_ID)verbal="I/O device read at IODR of value "+iodr+". ";return verbal}};sim.poc.behaviors.IO_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab!=IOSR_ID&&bus_ab!=IOCR_ID&&bus_ab!=IODR_ID){return}if(bus_ab==IOSR_ID)set_value(sim.poc.states[s_expr[3]],bus_db);if(bus_ab==IOCR_ID)set_value(sim.poc.states[s_expr[4]],bus_db);if(bus_ab==IODR_ID)set_value(sim.poc.states[s_expr[5]],bus_db);var iocr_id=get_value(sim.poc.states[s_expr[4]]);var iodr_id=get_value(sim.poc.states[s_expr[5]]);if(iocr_id<0||iocr_id>7)return;set_var(sim.poc.internal_states.io_int_factory[iocr_id].period,iodr_id);set_var(sim.poc.internal_states.io_int_factory[iocr_id].probability,1);if(0==iodr_id)set_var(sim.poc.internal_states.io_int_factory[iocr_id].probability,0)},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab==IOSR_ID)verbal="I/O device write at IOSR with value "+bus_db+". ";if(bus_ab==IOCR_ID)verbal="I/O device write at IOCR with value "+bus_db+". ";if(bus_ab==IODR_ID)verbal="I/O device write at IODR with value "+bus_db+". ";return verbal}};sim.poc.behaviors.IO_CHK_I={nparameters:4,types:["E","S","E"],operation:function(s_expr){var clk=get_value(sim.poc.states[s_expr[1]]);for(var i=sim.poc.internal_states.io_int_factory.length-1;i>=0;i--){if(get_var(sim.poc.internal_states.io_int_factory[i].period)==0)continue;if(get_var(sim.poc.internal_states.io_int_factory[i].active)==true){set_value(sim.poc.signals[s_expr[2]],1);set_value(sim.poc.states[s_expr[3]],i)}if(clk%get_var(sim.poc.internal_states.io_int_factory[i].period)==0){if(Math.random()>get_var(sim.poc.internal_states.io_int_factory[i].probability))continue;set_var(sim.poc.internal_states.io_int_factory[i].accumulated,get_var(sim.poc.internal_states.io_int_factory[i].accumulated)+1);set_var(sim.poc.internal_states.io_int_factory[i].active,true);if(typeof sim.poc.events.io[clk]=="undefined")sim.poc.events.io[clk]=[];sim.poc.events.io[clk].push(i);set_value(sim.poc.signals[s_expr[2]],1);set_value(sim.poc.states[s_expr[3]],i)}}},verbal:function(s_expr){return"Check I/O Interruption. "}};sim.poc.behaviors.INTA={nparameters:6,types:["E","S","S","E","E"],operation:function(s_expr){var clk=get_value(sim.poc.states[s_expr[1]]);if(typeof sim.poc.events.io[clk]!="undefined"){set_value(sim.poc.states[s_expr[4]],sim.poc.events.io[clk][0]);return}set_value(sim.poc.signals[s_expr[2]],0);set_value(sim.poc.states[s_expr[5]],0);for(var i=0;i>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("L3DR"),1);compute_behavior("FIRE L3DR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("L3DW"),1);compute_behavior("FIRE L3DW");return value}};sim.poc.internal_states.l3d_dim=4;sim.poc.internal_states.l3d_neltos=Math.pow(sim.poc.internal_states.l3d_dim,3);sim.poc.internal_states.l3d_state=Array.from({length:sim.poc.internal_states.l3d_neltos},(()=>({active:false})));sim.poc.internal_states.l3d_frame="0".repeat(sim.poc.internal_states.l3d_neltos);var L3DSR_ID=8448;var L3DCR_ID=8452;var L3DDR_ID=8456;sim.poc.internal_states.io_hash[L3DSR_ID]="L3DSR";sim.poc.internal_states.io_hash[L3DCR_ID]="L3DCR";sim.poc.internal_states.io_hash[L3DDR_ID]="L3DDR";sim.poc.states.L3DSR={name:"L3DSR",verbal:"L3D State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.L3DCR={name:"L3DCR",verbal:"L3D Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.L3DDR={name:"L3DDR",verbal:"L3D Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.signals.L3D_IOR={name:"L3D_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","L3D_IOR BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE M1"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.signals.L3D_IOW={name:"L3D_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","L3D_IOW BUS_AB BUS_DB L3DSR L3DCR L3DDR CLK; FIRE M1; L3D_SYNC"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.behaviors.L3D_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==L3DCR_ID){set_value(sim.poc.states[s_expr[2]],iocr)}if(bus_ab==L3DDR_ID){set_value(sim.poc.states[s_expr[2]],iodr)}if(bus_ab==L3DCR_ID){var x=(iodr&4278190080)>>24;var y=(iodr&16711680)>>16;var z=(iodr&65280)>>8;var p=z*Math.pow(sim.poc.internal_states.l3d_dim,2)+y*sim.poc.internal_states.l3d_dim+x;var s=get_var(sim.poc.internal_states.l3d_state[p].active);set_value(sim.poc.states[s_expr[2]],s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==L3DSR_ID)verbal="I/O device read at L3DSR of value "+iosr+". ";if(bus_ab==L3DCR_ID)verbal="I/O device read at L3DCR of value "+iocr+". ";if(bus_ab==L3DDR_ID)verbal="I/O device read at L3DDR of value "+iodr+". ";return verbal}};sim.poc.behaviors.L3D_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab!=L3DSR_ID&&bus_ab!=L3DCR_ID&&bus_ab!=L3DDR_ID){return}if(bus_ab==L3DSR_ID){set_value(sim.poc.states[s_expr[3]],bus_db)}if(bus_ab==L3DDR_ID){set_value(sim.poc.states[s_expr[5]],bus_db)}if(bus_ab==L3DCR_ID){set_value(sim.poc.states[s_expr[4]],bus_db);var x=(bus_db&4278190080)>>24;var y=(bus_db&16711680)>>16;var z=(bus_db&65280)>>8;var p=z*Math.pow(sim.poc.internal_states.l3d_dim,2)+y*sim.poc.internal_states.l3d_dim+x;var s=(bus_db&255)!=0;var l3dstates=sim.poc.internal_states.l3d_state;set_var(l3dstates[p].active,s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);if(bus_ab==L3DSR_ID)verbal="I/O device write at L3DSR with value "+bus_db+". ";if(bus_ab==L3DCR_ID)verbal="I/O device write at L3DCR with value "+bus_db+". ";if(bus_ab==L3DDR_ID)verbal="I/O device write at L3DDR with value "+bus_db+". ";return verbal}};sim.poc.behaviors.L3D_RESET={nparameters:1,operation:function(s_expr){sim.poc.events.l3d={};var n=sim.poc.internal_states.l3d_state.length;for(var i=0;i>>0;set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_signal("LEDMR"),1);compute_behavior("FIRE LEDMR");value=get_value(simhw_sim_state("BUS_DB"));return value},set_value:function(elto,value){var associated_state=simhw_internalState_get("io_hash",elto);set_value(simhw_sim_state(associated_state),value);set_value(simhw_sim_state("BUS_AB"),elto);set_value(simhw_sim_state("BUS_DB"),value);set_value(simhw_sim_signal("LEDMW"),1);compute_behavior("FIRE LEDMW");return value}};sim.poc.internal_states.ledm_dim=24;sim.poc.internal_states.ledm_neltos=Math.pow(sim.poc.internal_states.ledm_dim,2);sim.poc.internal_states.ledm_state=Array.from({length:sim.poc.internal_states.ledm_neltos},(()=>({color:0})));sim.poc.internal_states.ledm_colors=colors_clone("");sim.poc.internal_states.ledm_frame="0".repeat(sim.poc.internal_states.ledm_neltos);var LEDMSR_ID=12544;var LEDMCR_ID=12548;var LEDMDR_ID=12552;sim.poc.internal_states.io_hash[LEDMSR_ID]="LEDMSR";sim.poc.internal_states.io_hash[LEDMCR_ID]="LEDMCR";sim.poc.internal_states.io_hash[LEDMDR_ID]="LEDMDR";sim.poc.states.LEDMSR={name:"LEDMSR",verbal:"LEDM State Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.LEDMCR={name:"LEDMCR",verbal:"LEDM Control Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.states.LEDMDR={name:"LEDMDR",verbal:"LEDM Data Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.poc.signals.LEDM_IOR={name:"LEDM_IOR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","LEDM_IOR BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE M1"],fire_name:["svg_p:tspan4173"],draw_data:[[],["svg_p:path3795","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.signals.LEDM_IOW={name:"LEDM_IOW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","LEDM_IOW BUS_AB BUS_DB LEDMSR LEDMCR LEDMDR CLK; FIRE M1; LEDM_SYNC"],fire_name:["svg_p:text3785-0-6-0-5-5"],draw_data:[[],["svg_p:path3805","svg_p:path3733"]],draw_name:[[],[]]};sim.poc.behaviors.LEDM_IOR={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==LEDMCR_ID){set_value(sim.poc.states[s_expr[2]],iocr)}if(bus_ab==LEDMDR_ID){set_value(sim.poc.states[s_expr[2]],iodr)}if(bus_ab==LEDMCR_ID){var x=(iodr&4278190080)>>24;var y=(iodr&16711680)>>16;var p=y*sim.poc.internal_states.ledm_dim+x;var s=get_var(sim.poc.internal_states.ledm_state[p].color);set_value(sim.poc.states[s_expr[2]],s)}},verbal:function(s_expr){var verbal="";var bus_ab=get_value(sim.poc.states[s_expr[1]]);var iosr=get_value(sim.poc.states[s_expr[3]]);var iocr=get_value(sim.poc.states[s_expr[4]]);var iodr=get_value(sim.poc.states[s_expr[5]]);if(bus_ab==LEDMSR_ID)verbal="I/O device read at LEDMSR of value "+iosr+". ";if(bus_ab==LEDMCR_ID)verbal="I/O device read at LEDMCR of value "+iocr+". ";if(bus_ab==LEDMDR_ID)verbal="I/O device read at LEDMDR of value "+iodr+". ";return verbal}};sim.poc.behaviors.LEDM_IOW={nparameters:7,types:["E","E","E","E","E","E"],operation:function(s_expr){var bus_ab=get_value(sim.poc.states[s_expr[1]]);var bus_db=get_value(sim.poc.states[s_expr[2]]);switch(bus_ab){case LEDMSR_ID:set_value(sim.poc.states[s_expr[3]],bus_db);break;case LEDMDR_ID:set_value(sim.poc.states[s_expr[5]],bus_db);break;case LEDMCR_ID:set_value(sim.poc.states[s_expr[4]],bus_db);break;default:break}if(LEDMCR_ID==bus_ab){var dr=get_value(sim.poc.states[s_expr[5]]);if(16&bus_db){var x=(dr&4278190080)>>24;var y=(dr&16711680)>>16;var s=dr&255;set_value(sim.poc.states[s_expr[3]],1);if(x>=sim.poc.internal_states.ledm_dim&&y>=sim.poc.internal_states.ledm_dim){set_value(sim.poc.states[s_expr[3]],-1);return}var p=y*sim.poc.internal_states.ledm_dim+x;set_var(sim.poc.internal_states.ledm_state[p].color,s)}if(32&bus_db){set_value(sim.poc.states[s_expr[3]],1);var s=0;var neltos=sim.poc.internal_states.ledm_neltos;var ldmstates=sim.poc.internal_states.ledm_state;for(var p=0;p>0);set_var(sim.poc.internal_states.ledm_state[p+1].color,(s&65280)>>8);set_var(sim.poc.internal_states.ledm_state[p+2].color,(s&16711680)>>16);set_var(sim.poc.internal_states.ledm_state[p+3].color,(s&4278190080)>>24)}}if(64&bus_db){set_value(sim.poc.states[s_expr[3]],1);var s=0;var c="";var neltos=sim.poc.internal_states.ledm_colors.length;for(var p=0;p>>8;s=s.toString(16);c="#"+simcoreui_pack(s,6);sim.poc.internal_states.ledm_colors[p]=c}neltos=sim.poc.internal_states.ledm_neltos;for(var p=0;p>24;var y=(dr&16711680)>>16;var s=dr&255;verbal="I/O device write at LEDMCR with value "+bus_db+" (set pixel x:"+x+", y:"+y+", with color:"+s+"). "}if(64&bus_db){verbal="I/O device write at LEDMCR with value "+bus_db+" (set color palette at:"+bus_db+"). "}break;default:break}return verbal}};sim.poc.behaviors.LEDM_RESET={nparameters:1,operation:function(s_expr){sim.poc.events.ledm={};sim.poc.internal_states.ledm_colors=colors_clone("");for(var i=0;i0)line2=context.newlines[context.newlines.length-1]+1;var line1=0;if(context.newlines.length>1)line1=context.newlines[context.newlines.length-2]+1;var lowI=line1;var highI=Math.min(context.t-1,line2+32);for(;typeof context.text[highI+1]!="undefined"&&context.text[highI+1]!="\n";highI++);var line3=highI+2;highI++;for(;typeof context.text[highI+1]!="undefined"&&context.text[highI+1]!="\n";highI++);highI++;context.error="
"+"
"+"...\n";for(var i=lowI;i"+"(*) "+i18n_get_TagFor("compiler","PROBLEM AROUND LINE")+" "+context.line+": 
"+msgError+".
";simcore_ga("compile","compile.error","compile.error."+msgError);return context}function frm_getLabelContext(context){return{t:context.t,line:context.line,newlines:context.newlines.slice()}}function frm_setLabelContext(context,labelContext){context.t=labelContext.t;context.line=labelContext.line;context.newlines=labelContext.newlines}function frm_getComments(context){return context.comments.join("\n")}function frm_resetComments(context){context.comments=[]}function frm_nextNative(context){var first=context.t;var last=context.t;var braces=1;while(context.t=Math.pow(2,simhw_sim_signal(nombre_tok).nbits)){return frm_langError(context,i18n_get_TagFor("compiler","OUT OF RANGE")+"'"+frm_getToken(context)+"'")}frm_nextToken(context)}if(frm_isToken(context,",")){frm_nextToken(context)}}var acc_cmt=frm_getComments(context);microcomments.push(acc_cmt);frm_resetComments(context);microprograma.push(microInstruccionAux);context.contadorMC++;frm_nextToken(context);if(frm_isToken(context,","))frm_nextToken(context)}if(microprograma.length===0){return frm_langError(context,i18n_get_TagFor("compiler","EMPTY MICROCODE"))}frm_nextToken(context);return{NATIVE:"",microprograma:microprograma,microcomments:microcomments}}function read_native(context){var microprograma=[];var microcomments=[];if(!frm_isToken(context,"{")){return frm_langError(context,i18n_get_TagFor("compiler","OPEN BRACE NOT FOUND"))}frm_nextNative(context);var native_code=frm_getToken(context);microprograma.push({});microcomments.push("");frm_nextToken(context);return{NATIVE:native_code,microprograma:microprograma,microcomments:microcomments}}function firm_begin_read(context){var instruccionAux={};instruccionAux.name=frm_getToken(context);instruccionAux["mc-start"]=context.contadorMC;instruccionAux["is_native"]=false;frm_nextToken(context);if(frm_isToken(context,",")){frm_nextToken(context)}if(frm_isToken(context,"native")){instruccionAux["is_native"]=true;frm_nextToken(context);if(frm_isToken(context,",")){frm_nextToken(context)}context.etiquetas[context.contadorMC]="fetch"}if(true==instruccionAux.is_native)ret=read_native(context);else ret=firm_mcode_signals_read(context);if(typeof ret.error!="undefined"){return ret}instruccionAux.signature="begin";instruccionAux.signatureGlobal="begin";instruccionAux.signatureUser="begin";instruccionAux.signatureRaw="begin";instruccionAux.NATIVE=ret.NATIVE;instruccionAux.microcode=ret.microprograma;instruccionAux.microcomments=ret.microcomments;context.instrucciones.push(instruccionAux);context.contadorMC=context.contadorMC+9;return{}}function firm_pseudoinstructions_read(context){frm_nextToken(context);if(!frm_isToken(context,"{")){return frm_langError(context,i18n_get_TagFor("compiler","OPEN BRACE NOT FOUND"))}frm_nextToken(context);while(!frm_isToken(context,"}")){var pseudoInstructionAux={};var pseudoInitial={};pseudoInitial.signature="";pseudoInitial.name="";pseudoInitial.fields=[];pseudoInitial.name=frm_getToken(context);pseudoInitial.signature=pseudoInitial.signature+frm_getToken(context)+",";frm_nextToken(context);while(!frm_isToken(context,"{")){var pseudoFieldAux={};pseudoFieldAux.name="";pseudoFieldAux.type="";pseudoFieldAux.indirect=false;if(frm_isToken(context,"(")){frm_nextToken(context);pseudoFieldAux.name+=frm_getToken(context);frm_nextToken(context);if(!frm_isToken(context,")")){return frm_langError(context,i18n_get_TagFor("compiler","CLOSE PAREN. NOT FOUND"))}frm_nextToken(context);pseudoFieldAux.indirect=true}else{pseudoFieldAux.name+=frm_getToken(context);frm_nextToken(context)}if(!frm_isToken(context,"=")){return frm_langError(context,i18n_get_TagFor("compiler","EQUAL NOT FOUND")+" (for name=type)")}frm_nextToken(context);pseudoFieldAux.type+=frm_getToken(context).replace("num","inm");switch(pseudoFieldAux.type){case"reg":case"inm":case"addr":case"address":break;default:return frm_langError(context,i18n_get_TagFor("compiler","INVALID PARAMETER")+pseudoFieldAux.type+"."+i18n_get_TagFor("compiler","ALLOWED PARAMETER"))}pseudoInitial.fields.push(pseudoFieldAux);if(pseudoFieldAux.indirect==true)pseudoInitial.signature+="("+frm_getToken(context)+"),";else pseudoInitial.signature+=frm_getToken(context)+",";frm_nextToken(context);if(frm_isToken(context,",")){frm_nextToken(context)}}frm_nextToken(context);pseudoInitial.signature=pseudoInitial.signature.substr(0,pseudoInitial.signature.length-1).replace(/num/g,"inm");pseudoInstructionAux.initial=pseudoInitial;var contPseudoFinish=0;var pseudoFinishAux={};pseudoFinishAux.signature="";var inStart=0;var cont=false;while(!frm_isToken(context,"}")){if(inStart==0){for(i=0;i32*parseInt(instruccionAux.nwords)-1){return frm_langError(context,i18n_get_TagFor("compiler","STARTBIT OoR")+"'"+frm_getToken(context)+"'")}frm_nextToken(context);if(!frm_isToken(context,",")){return frm_langError(context,i18n_get_TagFor("compiler","COMMA NOT FOUND"))}frm_nextToken(context);instruccionAux.fields[camposInsertados].stopbit=frm_getToken(context);var stop=parseInt(instruccionAux.fields[camposInsertados].stopbit);if(stop>32*parseInt(instruccionAux.nwords)){return frm_langError(context,i18n_get_TagFor("compiler","STOPBIT OoR")+"'"+frm_getToken(context)+"'")}for(i=stop;i<=start;i++){if(typeof instruccionAux.overlapping[i]!="undefined"){return frm_langError(context,i18n_get_TagFor("compiler","OVERLAPPING FIELD")+instruccionAux.fields[camposInsertados].name)}instruccionAux.overlapping[i]=1}frm_nextToken(context);if(!frm_isToken(context,")")){return frm_langError(context,i18n_get_TagFor("compiler","CLOSE PAREN. NOT FOUND"))}frm_nextToken(context);if(instruccionAux.fields[camposInsertados].type=="address"){if(frm_getToken(context)!="abs"&&frm_getToken(context)!="rel"){return frm_langError(context,i18n_get_TagFor("compiler","INCORRECT ADDRESSING"))}instruccionAux.fields[camposInsertados].address_type=frm_getToken(context);frm_nextToken(context)}if(frm_isToken(context,",")){frm_nextToken(context)}return{}}function firm_instruction_read_fixed_fields(context,instruccionAux,xr_info,all_ones_co){var ret={};frm_nextToken(context);if(!frm_isToken(context,"co")){return frm_langError(context,i18n_get_TagFor("compiler","NO CO FIELD"))}ret=firm_instruction_co_read(context,instruccionAux,xr_info,all_ones_co);if(typeof ret.error!="undefined"){return ret}if(frm_isToken(context,"cop")){ret=firm_instruction_cop_read(context,instruccionAux);if(typeof ret.error!="undefined"){return ret}}if(frm_isToken(context,"nwords")){ret=firm_instruction_nword_read(context,instruccionAux);if(typeof ret.error!="undefined"){return ret}}var campos=instruccionAux.fields;var firma=instruccionAux.signature;var firmaUsuario=instruccionAux.signatureUser;var firmaGlobal=instruccionAux.signatureGlobal;var camposInsertados=0;while(camposInsertados32*parseInt(instruccionAux.nwords)-1){return frm_langError(context,i18n_get_TagFor("compiler","STARTBIT OoR")+"'"+frm_getToken(context)+"'")}frm_nextToken(context);if(!frm_isToken(context,":")){return frm_langError(context,i18n_get_TagFor("compiler","COLON NOT FOUND"))}frm_nextToken(context);tmp_fields.stopbit=frm_getToken(context);var stop=parseInt(tmp_fields.stopbit);if(stop>32*parseInt(instruccionAux.nwords)){return frm_langError(context,i18n_get_TagFor("compiler","STOPBIT OoR")+"'"+frm_getToken(context)+"'")}frm_nextToken(context);if(!frm_isToken(context,")")){return frm_langError(context,i18n_get_TagFor("compiler","CLOSE PAREN. NOT FOUND"))}frm_nextToken(context);if(!frm_isToken(context,"=")){return frm_langError(context,i18n_get_TagFor("compiler","EQUAL NOT FOUND"))}frm_nextToken(context);var tmp_name=frm_getToken(context);if(["oc","cop","funct"].includes(tmp_fields.type)){tmp_fields.value=tmp_name}else{tmp_fields.name=tmp_name;var index_name=-1;for(var i=0;i100){return frm_langError(context,i18n_get_TagFor("compiler","MORE 100 FIELDS"))}if(auxValue=="co"){return frm_langError(context,i18n_get_TagFor("compiler","CO AS FIELD NAME"))}if(auxValue=="nwords"){return frm_langError(context,i18n_get_TagFor("compiler","NW AS FIELD NAME"))}}if(frm_isToken(context,"(")){firma=firma+",(";if(plus_found)firmaUsuario=firmaUsuario+"+(";else firmaUsuario=firmaUsuario+" (";frm_nextToken(context);if(!frm_isToken(context,",")&&!frm_isToken(context,"(")&&!frm_isToken(context,")")){var campoAux={};campoAux.name=frm_getToken(context);instruccionAux.fields.push(campoAux);instruccionAux.numeroCampos++;firma=firma+frm_getToken(context);firmaUsuario=firmaUsuario+frm_getToken(context);frm_nextToken(context)}else{return frm_langError(context,i18n_get_TagFor("compiler","MISSING TOKEN ON")+"'"+context.co_cop[instruccionAux.co].signature+"'")}if(frm_isToken(context,")")){firma=firma+")";firmaUsuario=firmaUsuario+")";frm_nextToken(context)}else{return frm_langError(context,i18n_get_TagFor("compiler","MISSING ) ON")+"'"+context.co_cop[instruccionAux.co].signature+"'")}}firma=firma+",";firmaUsuario=firmaUsuario+" "}firma=firma.substr(0,firma.length-1);firma=firma.replace(/,,/g,",");firmaUsuario=firmaUsuario.substr(0,firmaUsuario.length-1);firmaUsuario=firmaUsuario.replace(/ /g," ");instruccionAux.signature=firma;instruccionAux.signatureGlobal=firma;instruccionAux.signatureUser=firmaUsuario;instruccionAux.signatureRaw=firmaUsuario;if(2==context.version){ret=firm_instruction_read_fields_v2(context,instruccionAux,xr_info,all_ones_co)}else{ret=firm_instruction_read_fixed_fields(context,instruccionAux,xr_info,all_ones_co)}if(typeof ret.error!="undefined"){return ret}ret={};if(true==instruccionAux.is_native)ret=read_native(context);else ret=firm_mcode_signals_read(context);if(typeof ret.error!="undefined")return ret;instruccionAux.NATIVE=ret.NATIVE;instruccionAux.microcode=ret.microprograma;instruccionAux.microcomments=ret.microcomments;context.instrucciones.push(instruccionAux);context.contadorMC=context.contadorMC+9;if(!frm_isToken(context,"}")){return frm_langError(context,i18n_get_TagFor("compiler","CLOSE BRACE NOT FOUND"))}frm_nextToken(context);return{}}function simlang_native_adapt_replaceSyscall(icode){var rc="";var me="";var ff="capi_print_char|capi_print_int|capi_print_float|capi_print_double|capi_print_string|"+"capi_read_char|capi_read_int|capi_read_float|capi_read_double|capi_read_string|"+"capi_sbrk|capi_exit";var re=new RegExp("("+ff+")\\(([^)]*)\\)","g");var match=re.exec(icode);while(match!==null){var f=match[1].trim();var p=match[2].trim().split(",");switch(f){case"capi_print_char":rc="// "+f+" \n"+"\tvar tmp1 = 0x000000FF & "+p[0]+" ;\n"+"\tset_screen_content(tmp1.toString()) ;\n";break;case"capi_print_int":rc="// "+f+" \n"+"\tset_screen_content("+p[0]+".toString()) ;\n";break;case"capi_print_float":rc="// "+f+" \n"+"\tvar tmp1 = hex2float("+p[0]+") ;\n"+"\tset_screen_content(tmp1.toString()) ;\n";break;case"capi_print_double":rc="// "+f+" \n"+"\tvar tmp1 = hex2float("+p[0]+") ;\n"+"\tset_screen_content(tmp1.toString()) ;\n";break;case"capi_print_string":rc="// "+f+" \n"+'\tvar tmp1 = "" ;\n'+'\tvar tmp2 = simcore_native_get_value("MEMORY", '+p[0]+") ;\n"+"\tfor (var k="+p[0]+"+1; (tmp2 !== 0) && (k<8*1024); k++) {\n"+"\t tmp1 += tmp2.toString() ;\n"+'\t tmp2 = simcore_native_get_value("MEMORY", k) ;\n'+"\t} ;\n"+"\tset_screen_content(tmp1) ;\n";break;case"capi_read_char":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tvar "+p[0]+" = 0x000000FF & parseInt(tmp1) ;\n";break;case"capi_read_int":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tvar "+p[0]+" = parseInt(tmp1) ;\n";break;case"capi_read_float":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tvar "+p[0]+" = parseFloat(tmp1) ;\n";break;case"capi_read_double":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tvar "+p[0]+" = parseFloat(tmp1) ;\n";break;case"capi_read_string":rc="// "+f+" \n"+"\tvar tmp1 = get_screen_content() ;\n"+"\tfor (var k=0; k<"+p[1]+"; k++) {\n"+'\t simcore_native_set_value("MEMORY", '+p[0]+"+k, tmp1[k]) ;\n"+"\t} ;\n";break;case"capi_sbrk":rc="// "+f+" \n"+"// TODO: _sbrk_("+p[0]+", "+p[1]+");\n";break;case"capi_exit":rc="// "+f+" \n"+"// exit by setting P.C. register outside text segment\n"+"\tvar pc_name = simhw_sim_ctrlStates_get().pc.state ;\n"+'\tsimcore_native_set_value("CPU", pc_name, 0x00000000) ;\n';break;default:rc="// "+f+" \n"+"// unknown syscall\n";break}me=new RegExp(f+"\\(([^)]*)\\)","g");icode=icode.replace(me,rc);match=re.exec(icode)}return icode}function simlang_native_adapt_provideRegister(icode,reg_log,rf_phy,reg_phy){var re=new RegExp(reg_log,"g");if(icode.search(re)!=-1){icode="var "+reg_log+" = simcore_native_get_value('"+rf_phy+"', "+reg_phy+") ;\n"+icode+"\n"+"simcore_native_set_value('"+rf_phy+"', "+reg_phy+", "+reg_log+") ;\n"}return icode}function simlang_native_adapt_providePC(icode){var re=/PC/g;if(icode.search(re)!=-1){icode="var pc_name = simhw_sim_ctrlStates_get().pc.state ;\n"+"var PC = simcore_native_get_value('CPU', pc_name) ;\n"+icode+"simcore_native_set_value('CPU', pc_name, PC) ;\n"}return icode}function simlang_native_adapt_replaceIf(icode){var re=new RegExp("[iI][fF]\\s*\\(([^\\\\)]*)\\)\\s*{([^\\\\}]*)}\\s*[eE][lL][sS][eE]{[^}]*}\\s*","g");if(icode.search(re)!=-1){var match=re.exec(icode);try{icode=icode.replace(re,"\n")}catch(e){console.log("Syntax error that cause a run-time error: "+e.toString());console.log(match)}}return icode}function simlang_native_adapt_addInitialTabTab(lines_code){var code_lines;code_lines=lines_code.split("\n");code_lines=code_lines.map((function(x){return"\t\t"+x}));return code_lines.join("\n")}function simlang_native_adapt_instructionDefinition(lines_code){var code_lines=lines_code.split(";");if(code_lines.length===1&&!lines_code.trim().startsWith("if")){lines_code=lines_code+";\n"}lines_code=simlang_native_adapt_replaceSyscall(lines_code);lines_code=simlang_native_adapt_provideRegister(lines_code,"HI","CPU","'REG_RT2'");lines_code=simlang_native_adapt_provideRegister(lines_code,"LO","CPU","'REG_RT1'");lines_code=simlang_native_adapt_provideRegister(lines_code,"ra","BR","31");lines_code=simlang_native_adapt_providePC(lines_code);lines_code=simlang_native_adapt_addInitialTabTab(lines_code);return lines_code}function simlang_native_adapt_getField(j,rf,reg){return"\t\t"+"var f_"+reg+" = "+"simcore_native_get_field_from_ir(fields, "+j+") ;\n"+"\t\t"+"var "+reg+" = "+"simcore_native_get_value('"+rf+"', f_"+reg+") ;\n"}function simlang_native_adapt_setField(j,rf,reg){return"\t\t"+"simcore_native_set_value('"+rf+"', f_"+reg+", "+reg+");\n"}function simlang_native_adapt_headerField(fname,tname,start,stop){return"\t"+tname+"("+start+":"+stop+")="+fname+",\n"}function simlang_native_beginMicrocode(){var o="";o+="\n"+"#\n"+"# WepSIM (https://wepsim.github.io/wepsim/)\n"+"#\n"+"\n"+"firmware_version = 2\n"+"\n"+"##\n"+"## Microcode Section\n"+"##\n"+"\n"+"begin,\n"+"native\n"+"{\n"+" // (once) initialize BR2 as FP register file\n"+' if (typeof BR2 === "undefined")\n'+" {\n"+" BR2 = [] ;\n"+" FCSR = 0 ;\n"+" for (var i=0; i<32; i++)\n"+" {\n"+" BR2[i] = {\n"+' name:"R"+i,\n'+' verbal:"Register "+i,\n'+" visible:true,\n"+' nbits:"32",\n'+" value:0,\n"+" default_value:0,\n"+" draw_data:[]\n"+" } ;\n"+" }\n"+" }\n"+"\n"+" // fetch\n"+' var addr = simcore_native_get_value("CPU", "REG_PC") ;\n'+' var value = simcore_native_get_value("MEMORY", addr) ;\n'+"\n"+' simcore_native_set_value("CPU", "REG_IR", value) ;\n'+' simcore_native_set_value("CPU", "REG_PC", addr + 4) ;\n'+"\n"+" simcore_native_deco() ;\n"+" simcore_native_go_opcode() ;\n"+"}\n";return o}function simlang_native_adapt_instructionSet(instruction_list){var o="";var gfields=[];var sfields=[];var hfields=[];var io={};var line_signature="";var signature_names="";var signature_order="";for(var i=0;i> 32);\n"+"\t\t "+io.fields[j].name+"2 = "+io.fields[j].name+" >> 32;\n"+"\t\t"+"simcore_native_set_value('BR2', "+"f_"+io.fields[j].name+"+0, "+io.fields[j].name+"1);\n"+"\t\t"+"simcore_native_set_value('BR2', "+"f_"+io.fields[j].name+"+1, "+io.fields[j].name+"2);\n";break;case"inm":hfields[k]=simlang_native_adapt_headerField(io.fields[j].name,"inm",io.fields[j].startbit,io.fields[j].stopbit);gfields[k]="\t\t"+"var "+io.fields[j].name+" = "+"simcore_native_get_field_from_ir(fields, "+(k-1)+") ;\n\t";break}}var co_cop="\t"+"co=111111,"+"\n";var lines_code=simlang_native_adapt_instructionDefinition(io.definition);if(lines_code.trim()!==""){lines_code="\t\t"+"// instruction specific code"+"\n"+lines_code+"\n"}var gfields_str=gfields.join("");if(gfields_str.trim()!==""){gfields_str="\t\t"+"// get fields values..."+"\n"+gfields_str+"\n"}var sfields_str=sfields.join("");if(sfields_str.trim()!==""){sfields_str="\t\t"+"// set fields values..."+"\n"+sfields_str+"\n"}o+="\n"+line_signature+" {"+"\n"+co_cop+"\t"+"nwords="+io.nwords+","+"\n"+hfields.join("")+"\t"+"native,"+"\n"+"\t"+"{\n"+gfields_str+"\n"+lines_code+"\n"+sfields_str+"\n"+"\t\t"+"// go fetch"+"\n"+"\t\t"+"simcore_native_go_maddr(0);"+"\n"+"\t"+"}"+"\n"+"}\n"}return o}function simlang_native_registerSection(register_list){var o="";var d="";var index=0;for(index=0;index=last_co){return frm_langError(context,i18n_get_TagFor("compiler","NO CO CODES"))}first_co=parseInt(r.label_co,2);curr_instruction.co=r.label_co;context.co_cop[r.label_co].signature=curr_instruction.signature;if(r.label_cop!==""){curr_instruction.cop=r.label_cop;context.co_cop[r.label_co].cop[r.label_cop]=curr_instruction.signature;context.co_cop[r.label_co].withcop=true}}var labelsFounded=0;if(context.labelsNotFound.length>0){for(i=0;i0){for(var j=0;j0){file+="registers"+"\n{\n";for(i=0;i0)line2=context.newlines[context.newlines.length-1]+1;var line1=0;if(context.newlines.length>1)line1=context.newlines[context.newlines.length-2]+1;var lowI=line1;var highI=Math.min(context.t-1,line2+32);for(;typeof context.text[highI+1]!="undefined"&&context.text[highI+1]!="\n";highI++);var line3=highI+2;highI++;for(;typeof context.text[highI+1]!="undefined"&&context.text[highI+1]!="\n";highI++);highI++;context.error="
"+"
"+"...\n";for(var i=lowI;i"+"(*) "+i18n_get_TagFor("compiler","PROBLEM AROUND LINE")+" "+context.line+": 
"+msgError+".
";simcore_ga("compile","compile.error","compile.error."+msgError);return context}function asm_getLabelContext(context){return{t:context.t,line:context.line,newlines:context.newlines.slice()}}function asm_setLabelContext(context,labelContext){context.t=labelContext.t;context.line=labelContext.line;context.newlines=labelContext.newlines}function asm_getComments(context){return context.comments.join("\n")}function asm_resetComments(context){context.comments=[]}sim_segments={".kdata":{name:".kdata",begin:0,end:255,color:"#FF99CC",kindof:"data"},".ktext":{name:".ktext",begin:256,end:4095,color:"#A9D0F5",kindof:"text"},".data":{name:".data",begin:4096,end:32767,color:"#FACC2E",kindof:"data"},".text":{name:".text",begin:32768,end:131071,color:"#BEF781",kindof:"text"},".stack":{name:".stack",begin:131071,end:1048576,color:"#F1F2A3",kindof:"stack"}};function segments_addr_within_text(address){return address>=sim_segments[".text"].begin&&address<=sim_segments[".text"].end||address>=sim_segments[".ktext"].begin&&address<=sim_segments[".ktext"].end}function segments_addr_within_data(address){return address>=sim_segments[".data"].begin&&address<=sim_segments[".data"].end||address>=sim_segments[".kdata"].begin&&address<=sim_segments[".kdata"].end}BYTE_LENGTH=8;WORD_BYTES=4;WORD_LENGTH=WORD_BYTES*BYTE_LENGTH;function isDecimal(n){var ret={number:0,isDecimal:false};if(n.length>1&&n[0]=="0"){return ret}if(typeof n==="string"&&n.includes(".")){return ret}if(!isNaN(parseFloat(n))&&isFinite(n)){ret.isDecimal=true;ret.number=parseInt(n);return ret}return ret}function isOctal(n){var ret={number:0,isDecimal:false};if(n.substring(0,1)=="0"){var octal=n.substring(1).replace(/\b0+/g,"");ret.number=parseInt(octal,8);ret.isDecimal=ret.number.toString(8)===octal;return ret}return ret}function isHex(n){var ret={number:0,isDecimal:false};if(n.substring(0,2).toLowerCase()=="0x"){var hex=n.substring(2).toLowerCase().replace(/\b0+/g,"");if(hex==""){hex="0"}ret.number=parseInt(hex,16);ret.isDecimal=ret.number.toString(16)===hex;return ret}return ret}function isChar(n){var ret={number:0,isDecimal:false};var ret1=treatControlSequences(n);if(true==ret1.error){return ret}var possible_value=ret1.string;if(possible_value[0]=="'"&&possible_value[2]=="'"||possible_value[0]=='"'&&possible_value[2]=='"'){ret.number=possible_value.charCodeAt(1);ret.isDecimal=true;return ret}return ret}function isFloat(n){var ret={number:0,isFloat:false};var non_float=/[a-df-zA-DF-Z]+/;if(non_float.test(n)===true){return ret}ret.number=parseFloat(n);ret.isFloat=!isNaN(ret.number);return ret}function get_decimal_value(possible_value){var ret={number:0,isDecimal:true};ret=isOctal(possible_value);if(ret.isDecimal===false){ret=isHex(possible_value)}if(ret.isDecimal===false){ret=isDecimal(possible_value)}if(ret.isDecimal===false){ret=isChar(possible_value)}return ret}function decimal2binary(number,size){var num_bits=number.toString(2);if(num_bits.length>WORD_LENGTH){return[num_bits,size-num_bits.length]}num_bits=(number>>>0).toString(2);if(number>=0){return[num_bits,size-num_bits.length]}num_bits="1"+num_bits.replace(/^[1]+/g,"");if(num_bits.length>size){return[num_bits,size-num_bits.length]}num_bits="1".repeat(size-num_bits.length)+num_bits;return[num_bits,size-num_bits.length]}function get_inm_value(value){var ret1={};var ret={number:0,isDecimal:false,isFloat:false};ret1=get_decimal_value(value);if(ret1.isDecimal==true){ret1.isFloat=false;return ret1}ret1=isFloat(value);if(ret1.isFloat==true){ret1.isDecimal=false;return ret1}return ret}directives={".kdata":{name:".kdata",kindof:"segment",size:0},".ktext":{name:".ktext",kindof:"segment",size:0},".data":{name:".data",kindof:"segment",size:0},".text":{name:".text",kindof:"segment",size:0},".byte":{name:".byte",kindof:"datatype",size:1},".half":{name:".half",kindof:"datatype",size:2},".word":{name:".word",kindof:"datatype",size:4},".float":{name:".float",kindof:"datatype",size:4},".double":{name:".double",kindof:"datatype",size:8},".ascii":{name:".ascii",kindof:"datatype",size:1},".asciiz":{name:".asciiz",kindof:"datatype",size:1},".space":{name:".space",kindof:"datatype",size:1},".string":{name:".string",kindof:"datatype",size:1},".zero":{name:".zero",kindof:"datatype",size:1},".align":{name:".align",kindof:"datatype",size:0}};function get_datatype_size(datatype){if(typeof directives[datatype]==="undefined"){console.log("ERROR: not defined datatype: "+datatype+"\n");return 0}return directives[datatype].size}function is_directive_kindof(text,kindof){if(typeof directives[text]==="undefined"){return false}return directives[text].kindof==kindof}function is_directive(text){return typeof directives[text]!=="undefined"}function is_directive_segment(text){return is_directive_kindof(text,"segment")}function is_directive_datatype(text){return is_directive_kindof(text,"datatype")}function isValidTag(tag){if(tag.trim()==""){return false}var ret=isDecimal(tag[0]);if(ret.isDecimal==true){return false}var myRegEx=/[^a-z,_\d]/i;return!myRegEx.test(tag)}function sum_array(a){return a.reduce((function(a,b){return a+b}),0)}function get_candidate(advance,instruction){var candidate=false;var candidates={};var signatures={};for(i=0;icandidates[i]){min=candidates[i];candidate=i}}}return candidate?parseInt(candidate):candidate}function reset_assembly(nwords){return"0".repeat(WORD_LENGTH*nwords)}function assembly_replacement(machineCode,num_bits,startbit,stopbit,free_space){var machineCodeAux=machineCode.substring(0,machineCode.length-startbit+free_space);machineCode=machineCodeAux+num_bits+machineCode.substring(machineCode.length-stopbit);return machineCode}function assembly_co_cop(machineCode,co,cop){var xr_info=simhw_sim_ctrlStates_get();if(co!==false)machineCode=assembly_replacement(machineCode,co,WORD_LENGTH,WORD_LENGTH-6,0);if(cop!==false)machineCode=assembly_replacement(machineCode,cop,xr_info.ir.default_eltos.cop.length,0,0);return machineCode}function writememory_and_reset(mp,gen,nwords){if(gen.byteWord>=WORD_BYTES){var melto={value:gen.machineCode,source_tracking:gen.track_source,comments:gen.comments};main_memory_set(mp,"0x"+gen.seg_ptr.toString(16),melto);gen.seg_ptr=gen.seg_ptr+WORD_BYTES;gen.byteWord=0;gen.track_source=[];gen.comments=[];gen.machineCode=reset_assembly(nwords)}}function is_end_of_file(context){return""===asm_getToken(context)&&context.t>=context.text.length}function read_data(context,datosCU,ret){var seg_name=asm_getToken(context);var gen={};gen.byteWord=0;gen.track_source=[];gen.comments=[];gen.machineCode=reset_assembly(1);gen.seg_ptr=ret.seg[seg_name].begin;asm_nextToken(context);while(!is_directive_segment(asm_getToken(context))&&!is_end_of_file(context)){var possible_tag="";while(!is_directive_datatype(asm_getToken(context))&&!is_end_of_file(context)){possible_tag=asm_getToken(context);if("TAG"!=asm_getTokenType(context)){if(""==possible_tag){possible_tag="[empty]"}return asm_langError(context,i18n_get_TagFor("compiler","NO TAG OR DIRECTIVE")+"'"+possible_tag+"'")}var tag=possible_tag.substring(0,possible_tag.length-1);if(!isValidTag(tag)){return asm_langError(context,i18n_get_TagFor("compiler","INVALID TAG FORMAT")+"'"+tag+"'")}if(context.firmware[tag]){return asm_langError(context,i18n_get_TagFor("compiler","TAG OR INSTRUCTION")+"'"+tag+"'")}if(ret.labels2[tag]){return asm_langError(context,i18n_get_TagFor("compiler","REPEATED TAG")+"'"+tag+"'")}ret.labels2[tag]="0x"+(gen.seg_ptr+gen.byteWord).toString(16);asm_nextToken(context)}if(is_end_of_file(context)){break}var possible_datatype=asm_getToken(context);if(".word"==possible_datatype||".half"==possible_datatype||".byte"==possible_datatype||".float"==possible_datatype||".double"==possible_datatype){var size=get_datatype_size(possible_datatype);asm_nextToken(context);var possible_value=asm_getToken(context);while(!is_directive(asm_getToken(context))&&!is_end_of_file(context)){var label_found=false;var ret1=get_inm_value(possible_value);var number=ret1.number;if(ret1.isDecimal==false&&ret1.isFloat==false){if(".word"!==possible_datatype){return asm_langError(context,i18n_get_TagFor("compiler","NO NUMERIC DATATYPE")+"'"+possible_value+"'")}if(!isValidTag(possible_value)){return asm_langError(context,i18n_get_TagFor("compiler","INVALID TAG FORMAT")+"'"+possible_value+"'")}if(context.firmware[possible_value]){return asm_langError(context,i18n_get_TagFor("compiler","TAG OR INSTRUCTION")+"'"+possible_value+"'")}number=0;label_found=true}if(ret1.isDecimal==true)a=decimal2binary(number,size*BYTE_LENGTH);else a=float2binary(number,size*BYTE_LENGTH);num_bits=a[0];free_space=a[1];if(free_space<0){return asm_langError(context,i18n_get_TagFor("compiler","EXPECTED VALUE")+possible_datatype+"' ("+size*BYTE_LENGTH+" bits), "+i18n_get_TagFor("compiler","BUT INSERTED")+possible_value+"' ("+num_bits.length+" bits) "+i18n_get_TagFor("compiler","INSTEAD"))}writememory_and_reset(ret.mp,gen,1);while((gen.seg_ptr+gen.byteWord)%size!=0){gen.byteWord++;writememory_and_reset(ret.mp,gen,1)}if(""!=possible_tag){ret.labels2[possible_tag.substring(0,possible_tag.length-1)]="0x"+(gen.seg_ptr+gen.byteWord).toString(16);possible_tag=""}if(label_found){ret.labels["0x"+gen.seg_ptr.toString(16)]={name:possible_value,addr:gen.seg_ptr,startbit:31,stopbit:0,rel:undefined,nwords:1,labelContext:asm_getLabelContext(context)}}gen.machineCode=assembly_replacement(gen.machineCode,num_bits,BYTE_LENGTH*(size+gen.byteWord),BYTE_LENGTH*gen.byteWord,free_space);gen.byteWord+=size;gen.track_source.push(possible_value);asm_nextToken(context);if(","==asm_getToken(context)){asm_nextToken(context)}if(is_directive(asm_getToken(context))||"TAG"==asm_getTokenType(context)||"."==asm_getToken(context)[0]){break}possible_value=asm_getToken(context)}}else if(".space"==possible_datatype||".zero"==possible_datatype){asm_nextToken(context);var possible_value=asm_getToken(context);var ret1=isDecimal(possible_value);possible_value=ret1.number;if(ret1.isDecimal==false){return asm_langError(context,i18n_get_TagFor("compiler","NO NUMBER OF BYTES")+"'"+possible_value+"'")}if(possible_value<0){return asm_langError(context,i18n_get_TagFor("compiler","NO POSITIVE NUMBER")+"'"+possible_value+"'")}for(i=0;i=0){return asm_langError(context,i18n_get_TagFor("compiler","INVALID ALIGN VALUE")+"'"+possible_value+"'. "+i18n_get_TagFor("compiler","REMEMBER ALIGN VAL"))}writememory_and_reset(ret.mp,gen,1);var align_offset=Math.pow(2,parseInt(possible_value));switch(align_offset){case 1:break;case 2:if(gen.byteWord&1==1)gen.byteWord++;break;default:writememory_and_reset(ret.mp,gen,1);while(gen.seg_ptr%align_offset!=0||gen.byteWord!=0){gen.byteWord++;writememory_and_reset(ret.mp,gen,1)}}asm_nextToken(context)}else if(".ascii"==possible_datatype||".asciiz"==possible_datatype||".string"==possible_datatype){asm_nextToken(context);var possible_value=asm_getToken(context);var ret1=treatControlSequences(possible_value);if(true==ret1.error){return asm_langError(context,ret1.string)}possible_value=ret1.string;while(!is_directive(asm_getToken(context))&&!is_end_of_file(context)){writememory_and_reset(ret.mp,gen,1);if('"'!==possible_value[0]){return asm_langError(context,i18n_get_TagFor("compiler","NO QUOTATION MARKS")+"'"+possible_value+"'")}if('"'!==possible_value[possible_value.length-1]){return asm_langError(context,i18n_get_TagFor("compiler","NOT CLOSED STRING"))}if(""==possible_value){return asm_langError(context,i18n_get_TagFor("compiler","NOT CLOSED STRING"))}if("STRING"!=asm_getTokenType(context)){return asm_langError(context,i18n_get_TagFor("compiler","NO QUOTATION MARKS")+"'"+possible_value+"'")}for(i=0;i0){var melto={value:gen.machineCode,source_tracking:gen.track_source,comments:gen.comments};main_memory_set(ret.mp,"0x"+gen.seg_ptr.toString(16),melto);gen.seg_ptr=gen.seg_ptr+WORD_BYTES}ret.seg[seg_name].end=gen.seg_ptr}function read_text(context,datosCU,ret){var seg_name=asm_getToken(context);var seg_ptr=ret.seg[seg_name].begin;var firmware=context.firmware;var pseudoInstructions=context.pseudoInstructions;var finish=[];var isPseudo=false;var pfinish=[];var npseudoInstructions=0;var pseudo_fields={};var counter=-1;var candidate;var error="";var registers={};for(i=0;i=signature_fields[j].length){if("TAG"!=asm_getTokenType(context)&&!firmware[value]&&!is_end_of_file(context)){advance[j]=0}continue}var field=firmware[instruction][j].fields[i];var size=field.startbit-field.stopbit+1;var label_found=false;var sel_found=false;switch(field.type){case"address":case"inm":if(isPseudo&&"sel"==value){counter++;var start=pfinish[counter++];var stop=pfinish[counter++];var value=pseudo_fields[pfinish[counter++]];counter++;sel_found=true}var ret1=get_inm_value(value);converted=ret1.number;if(ret1.isDecimal==false&&ret1.isFloat==false){error=i18n_get_TagFor("compiler","NO NUMERIC DATATYPE")+"'"+value+"'";if(value[0]=="'"){advance[j]=0;break}if(!isValidTag(value)){advance[j]=0;break}if(firmware[value]){error=i18n_get_TagFor("compiler","TAG OR INSTRUCTION")+"'"+value+"'";advance[j]=0;break}label_found=true}if(sel_found){if(ret1.isDecimal==true)res=decimal2binary(converted,WORD_LENGTH);else res=float2binary(converted,WORD_LENGTH);if(res[1]<0){return asm_langError(context,"'"+value+"' "+i18n_get_TagFor("compiler","BIGGER THAN")+WORD_LENGTH+" "+i18n_get_TagFor("compiler","BITS"))}if(label_found){s[i+1]=value}else{converted="0".repeat(res[1])+res[0];converted=converted.substring(WORD_LENGTH-start-1,WORD_LENGTH-stop);converted=parseInt(converted,2);s[i+1]="0x"+converted.toString(16)}}if(!label_found){if(ret1.isDecimal==true)var res=decimal2binary(converted,size);else var res=float2binary(converted,size);if(field.type=="address"&&"rel"==field.address_type){res=decimal2binary(converted,size)}}break;case"reg":if(typeof value==="undefined"){error=i18n_get_TagFor("compiler","INS. MISSING FIELD");advance[j]=0;break}var aux=false;if(value.startsWith("(")){if("(reg)"!=signature_fields[j][i]){error=i18n_get_TagFor("compiler","UNEXPECTED (REG)");advance[j]=0;break}if(counter==-1){asm_nextToken(context);value=asm_getToken(context)}else{value=pseudo_fields[pfinish[counter++]]}aux=true}else{if("(reg)"==signature_fields[j][i]){error=i18n_get_TagFor("compiler","EXPECTED (REG)")+"'"+value+"'";advance[j]=0;break}}if(typeof registers[value]==="undefined"){error=i18n_get_TagFor("compiler","EXPECTED REG")+"'"+value+"'";advance[j]=0;break}if(aux){s[i+1]="("+value+")";if(counter==-1){asm_nextToken(context);aux=asm_getToken(context)}else{aux=pfinish[counter++]}if(")"!=aux){error=i18n_get_TagFor("compiler","CLOSE PAREN. NOT FOUND");advance[j]=0;break}}var ret1=isDecimal(registers[value]);converted=ret1.number;var res=decimal2binary(converted,size);value=s[i+1];break;default:return asm_langError(context,i18n_get_TagFor("compiler","UNKNOWN 1")+"'"+field.type+"'")}if(advance[j]==1&&!label_found){if(res[1]<0){if(field.type=="address"&&"rel"==field.address_type){error="Relative value ("+(converted-seg_ptr-WORD_BYTES)+" in decimal)"+i18n_get_TagFor("compiler","NEEDS")+res[0].length+i18n_get_TagFor("compiler","SPACE FOR # BITS")+size+" "+i18n_get_TagFor("compiler","BITS")}else{error="'"+value+"'"+i18n_get_TagFor("compiler","NEEDS")+res[0].length+i18n_get_TagFor("compiler","SPACE FOR # BITS")+size+" "+i18n_get_TagFor("compiler","BITS")}advance[j]=0}}if(advance[j]==1&&!(isPseudo&&counter==-1)){binaryAux[j][i]={num_bits:label_found?false:res[0],free_space:label_found?false:res[1],startbit:field.startbit,stopbit:field.stopbit,rel:label_found?field.address_type:false,islabel:label_found,field_name:value,issel:sel_found,sel_start:start,sel_stop:stop}}}if(sum_array(advance)==0){break}if("TAG"==asm_getTokenType(context)||firmware[value]){break}}for(i=0;i0&&i0&&i==firmware[instruction].length-1){format+=" or "}format+="'"+firmware[instruction][i].signatureUser+"'"}if(format==""){format="'"+instruction+"' "+i18n_get_TagFor("compiler","UNKNOWN MC FORMAT")}var sum_res=sum_array(advance);if(sum_res==0){if(advance.length===1){return asm_langError(context,error+".
"+i18n_get_TagFor("compiler","REMEMBER I. FORMAT")+format)}return asm_langError(context,i18n_get_TagFor("compiler","NOT MATCH MICRO")+"
"+i18n_get_TagFor("compiler","REMEMBER I. FORMAT")+format+". "+i18n_get_TagFor("compiler","CHECK MICROCODE"))}if(sum_res>1){candidate=get_candidate(advance,firmware[instruction]);if(candidate===false){return asm_langError(context,i18n_get_TagFor("compiler","SEVERAL CANDIDATES")+format)}}if(isPseudo){if(counter==-1){var s_ori=s.join(" ");s_ori=s_ori.trim();var key="";var val="";pseudo_fields={};for(i=0;i1){s_ori=" "}if(pfinish[counter]=="\n"){counter++}}var machineCode=reset_assembly(firmware[instruction][candidate].nwords);machineCode=assembly_co_cop(machineCode,firmware[instruction][candidate].co,firmware[instruction][candidate].cop);var l_addr="";for(i=0;i=0;i--){if(icontext.text.length){break}}ret.seg[seg_name].end=seg_ptr}function simlang_compile_v1(text,datosCU){var context={};context.line=1;context.error=null;context.i=0;context.contadorMC=0;context.etiquetas={};context.labelsNotFound=[];context.instrucciones=[];context.co_cop={};context.registers=[];context.text=text;context.tokens=[];context.token_types=[];context.t=0;context.newlines=[];context.pseudoInstructions=[];context.stackRegister=null;context.firmware={};context.comments=[];for(i=0;i=0;j--){var melto={value:machineCode.substring(j*WORD_LENGTH,(j+1)*WORD_LENGTH),source_tracking:null,comments:null};main_memory_set(ret.mp,"0x"+auxAddr.toString(16),melto);auxAddr+=WORD_BYTES}}if(text_found){if(typeof ret.labels2["main"]==="undefined"&&typeof ret.labels2["kmain"]==="undefined"){return asm_langError(context,i18n_get_TagFor("compiler","NO MAIN OR KMAIN"))}}for(var key in ret.labels2){ret.revlabels2[ret.labels2[key]]=key}for(var skey in ret.seg){ret.revseg.push({begin:parseInt(ret.seg[skey].begin),name:skey})}return ret}function simlang_compile(text,datosCU){return simlang_compile_v1(text,datosCU)}var i18n={lang:{en:"English",es:"Español",it:"L'italiano - Google-translate",kr:"한국어 - Google-translate",hi:"हिन्दी - Google-translate",fr:"Français - Google-translate",pt:"Português - Google-translate",ja:"日本語 - Google-translate",zh_cn:"汉语 - Thanks to shiptux@github",ru:"русский язык - Google-translate",sv:"Svenska - Google-translate",de:"Deutsch - Google-translate"},eltos:{gui:{},cfg:{},examples:{},states:{},help:{},dialogs:{},compiler:{},hw:{},tutorial_welcome:{},tutorial_simpleusage:{},tour_intro:{}}};function i18n_init(){for(var l in i18n.lang){for(var e in i18n.eltos){i18n.eltos[e][l]={}}}return true}i18n_init();function i18n_update_tags(component){var ws_idiom=get_cfg("ws_idiom");i18n_update_tagsFor(component,ws_idiom)}function i18n_update_tagsFor(component,lang){if(typeof i18n.eltos[component]=="undefined"){return}var tags=document.querySelectorAll("span");Array.from(tags).forEach((function(value,index){var key=value.dataset.langkey;if(i18n.eltos[component][lang][key]){value.innerHTML=i18n.eltos[component][lang][key]}}))}function i18n_get(component,lang,key){if(typeof i18n.eltos[component]==="undefined"){return key}var translation=i18n.eltos[component][lang][key];if(typeof translation==="undefined"){return key}return translation}function i18n_get_TagFor(component,key){var ws_idiom;try{ws_idiom=get_cfg("ws_idiom")}catch(e){ws_idiom="en"}var translation=key+" ";if(typeof i18n.eltos[component][ws_idiom][key]!=="undefined"){translation=i18n.eltos[component][ws_idiom][key]}return translation}function i18n_get_select(div_name,str_onchange){var curr_val=get_cfg("ws_idiom");var o=" ";return o}function i18n_get_selectcfg(){var o=" ";return o}function i18n_get_welcome(){var o='
'+'';for(var key in i18n.lang){o+='"+i18n_get("gui",key,"Welcome")+""}o+=""+"
";return o}i18n.eltos.gui.es={"Loading WepSIM...":"Cargando WepSIM...",About:"Sobre",Configuration:"Configuración",MicroCode:"MicroCódigo",Assembly:"Ensamblador",Simulator:"Simulador",Examples:"Ejemplos",Load:"Cargar",Save:"Guardar","Load/Save":"Cargar/Guardar",Restore:"Restaurar",Help:"Ayuda",Notifications:"Notificaciones",RecordBar:"Grabación",Input:"Entrada",Output:"Salida",Reload:"Reload",Checkpoint:"Checkpoint","Help Index":"Índice ayuda",Processor:"Procesador","Assembly Debugger":"Depurador de Ensamblador",Reset:"Reiniciar",microInstruction:"µInstrucción",Instruction:"Instrucción",Run:"Ejecutar","Hardware Summary":"Hardware Resumido",processor:"procesador",details:"detalles",microcode:"microcódigo",Signals:"Señales",Behaviors:"Comportamientos",States:"Estados","Control States":"Estados de Control",Dependencies:"Dependencias",Close:"Cerrar",Description:"Descripción",Show:"Mostrar","Show Main Memory":"Mostrar Memoria Principal",compile:"compilar",Compile:"Compilar","Please write the file name":"Por favor indique el nombre de fichero","Load from this File":"Cargar de este fichero",labels:"etiquetas",addr:"dir",ess:"ección",content:"contenido",assembly:"ensamblador",instructions:"instrucciones","simulator intro 1":"Puede seleccionar el hardware que se utilizará. El predeterminado es el hardware EP (Elemental Processor).
Puede usar el selector de modo para cambiar el hardware utilizado","simulator intro 2":"A continuación necesita cargar el microcódigo (define el conjunto de instrucciones) y el código de ensamblador.
Puede usar un ejemplo, cargarlo desde un archivo, o puede editar un nuevo microcódigo y un nuevo código de ensamblador.","simulator intro 3":"Finalmente, en el simulador puede ejecutar el microcódigo más el ensamblador cargado antes.
Puede ejecutar ambos, en el nivel de microinstrucción o en el nivel de instrucción de ensamblador.","Prev.":"Anterior",Next:"Siguiente",End:"Fin","Disable tutorial mode":"Deshabilitar modo tutorial",Comment:"Comentar",Pause:"Pausar",Play:"Reproducir",Stop:"Parar",Record:"Grabar",Registers:"Registros","Control Memory":"Memoria de Control",Stats:"Estadísticas",Memory:"Memoria","Keyboard+Display":"Teclado+Pantalla","I/O Stats":"E/S Estadísticas","I/O Configuration":"E/S Configuración",Recent:"Reciente",Refresh:"Refrescar",Welcome:"Bienvenido+a","Microcode & Assembly":"WepSIM hardware","Pick firm/soft":"Firm/soft desde",Information:"Información",Native:"Nativo","MIPS32-like":"Basado en MIPS32",RISCV32:"RISCV32","Z80-like":"Basado en Z80",Actions:"Acciones",Utilities:"Utilidades","Information from":"Información de","Pick firm/soft from":"Cargar firm/soft desde","Welcome tutorial":"Tutorial de bienvenida","Assembly only":"Solo ensamblador","Micro & Assembly":"Micro y ensamblador",idiom:"idioma","quick config":"configuración rápida","Graph: quick interactive mode":"Gráfico: modo interactivo",_last_:"_last_"};i18n.eltos.tutorial_welcome.es={title_0:"¡Bienvenidos al simulador WepSIM!",message_0:"
wepsim screenshot
"+"

"+"

"+"Este breve tutorial le mostrará:"+"
    "+"
  1. Carga de un ejemplo.
  2. "+"
  3. Ejecución de ejemplo.
  4. "+"
  5. Configuración del simulador.
  6. "+"
  7. Obtener ayuda.
  8. "+"
"+"
",title_1:"Cómo cargar algunos ejemplos.",message_1:"
wepsim screenshot
"+"

"+"

"+"Haga click en el botón de 'examples' y haga click en el 'título' del ejemplo que desea cargar."+"
"+"
",title_2:"Cómo cargar algunos ejemplos.",message_2:"
wepsim screenshot
"+"

"+"

"+"Haga click en next instruction/microinstruction para ejecutar paso a paso.
"+"Haga click en run para ejecutar hasta el primer punto de ruptura o el fin del programa en ensamblador."+"
"+"
",title_3:"Cómo configurar WepSIM.",message_3:"
wepsim screenshot
"+"

"+"

"+"Haga click en el botón de configuración para configurar diversos aspectos de WepSIM para su comididad."+"
"+"
",title_4:"Cómo conseguir la ayuda básica.",message_4:"
wepsim screenshot
"+"

"+"

"+"Haga click en el botón verde de ayuda 'help'.
"+"Puede obtener la ayuda en Spanish/English, ir al índice de la ayuda o cerrar la pantalla de ayuda."+"
"+"
",title_5:"¡Bienvenido a WepSIM!",message_5:"
wepsim screenshot
"+"

"+"

"+"Por favor explorer las secciones de la ayuda para más información.
"+"Si hace click en el botón 'end' del tutorial entonces WepSIM cargará el primer ejemplo por usted. ¡Diviertase aprendiendo!"+"
"+"
"};i18n.eltos.tutorial_simpleusage.es={title_0:"WepSIM: microprogramar, ensamblar y simular",message_0:"
wepsim screenshot
"+"

"+"

"+"Este breve tutorial le mostrará:"+"
    "+"
  1. La edición de microcódigo.
  2. "+"
  3. La edición de código ensamblador.
  4. "+"
  5. Ejecución del anterior ensamblador definido anteriormente.
  6. "+"
"+"
",title_1:"WepSIM: microprogramar, ensamblar y simular",message_1:"
wepsim screenshot
"+"

"+"

"+"El primer paso es microprogramar el firmware a ser usado. "+"Por favor use el botón de 'Microcode' para ir a la pantalla de trabajo del microcódigo."+"
",title_2:"WepSIM: microprogramar, ensamblar y simular",message_2:"
wepsim screenshot
"+"

"+"

"+"La pantalla de microprogramación ofrece:"+"
    "+"
  • El editor de microcródigo.
  • "+"
  • El microcompilador.
  • "+"
  • El resumen del hardware y la ayuda.
  • "+"
"+"Una vez que el microcódigo esté listo (editado y compile sin errores) el siguiente paso el el código ensamblador."+"
",title_3:"WepSIM: microprogramar, ensamblar y simular",message_3:"
wepsim screenshot
"+"

"+"

"+"El segundo paso es programar el ensamblador a ser ejecutado. "+"Por favor use el botón de 'Assembly' para ir a la pantalla de ensamblador."+"
",title_4:"WepSIM: microprogramar, ensamblar y simular",message_4:"
wepsim screenshot
"+"

"+"

"+"La pantalla de programación en ensamblador ofrece:"+"
    "+"
  • El editor para el código ensamblador.
  • "+"
  • El compilador de ensamblador.
  • "+"
  • El visualizador de mapa de memoria y ayuda.
  • "+"
"+"Asegure antes de ir a la pantalla del simulador que su código este listo (editado y compilado sin errores)."+"
",title_5:"WepSIM: microprogramar, ensamblar y simular",message_5:"
wepsim screenshot
"+"

"+"

"+"El tercer paso es ejecutar el código ensamblador en el ensamblador.
"+"La pantalla de simulación ofrece:"+"
    "+"
  • Las vista de ensamblador y hardware.
  • "+"
  • Los detalles de registros, memoria de control, memoria principal, etc.
  • "+"
  • Las acciones de reinicio, ejecución paso a paso o hasta punto de ruptura (o fin).
  • "+"
"+"Este tutorial ha introducido el uso típico de WepSIM para estudiantes y profesores. ¡Disfrute con WepSIM!."+"
"};i18n.eltos.tour_intro.es={step1:"WepSIM ayudará a entender mejor cómo funciona un computador: "+"es visual, interactivo, integra interrupciones, llamadas al sistema, etc.
"+"
"+"Nosotros realmente creemos que WepSIM es una herramienta revolucionaria. "+"Este breve tour le muestra las partes clave de la interfaz de WepSIM.",step2:"En la esquina superior derecha está el selector de 'modo de ejecución'.
"+"
"+"Los usuarios pueden seleccionar:"+"
    "+"
  • El hardware con el que trabajar (ejemplo: procesador EP, POC, etc.)
  • "+"
  • El modo solo ensamblador, con instrucciones MIPS32 de enteros o RISC-V32
  • "+"
",step3:"En la esquina superior derecha el botón de ayuda abre el panel de ayuda asociado.
"+"
"+"El cuadro de diálogo permite el acceso a tutoriales, información, etc.",step4:"En la esquina superior izquierda, el botón de 'ejemplos' abre el panel asociado.
"+"
"+"Hay muchos ejemplos muy útiles para el aprendizaje incremental.",step5:"En la esquina superior izquierda está el botón de configuracion que abre el cuadro de diálogo de la configuración.
"+"
"+"Con la configuracióón se puede adaptar distintos aspectos de ejecución, interfaz de usuario/a, preferencias, etc.",step6:"¡Felicidades!. Ya conoce las partes clave de la interfaz de WepSIM.
"+"Desde el panel de 'Ayuda' puede acceder al 'Tutorial de bienvenida'. para continuar aprendiendo.
"};i18n.eltos.cfg.es={General:"General","Idiom for help, examples, etc.":"Idioma para ayuda, ejemplos, etc.","Notification speed: time before disapear":"Velocidad en notificaciones: tiempo en desaparecer","Dark Mode":"Modo oscuro",Editor:"Editor","Editor theme: light or dark":"Tema de editor: claro u oscuro",Light:"Claro",Dark:"Oscuro","Editor mode: vim, emacs, etc.":"Modo de edición: vim, emacs, etc.",Execution:"Ejecución","Running speed: execution speed":"Velocidad de ejecución",Slow:"Lento",Normal:"Normal",Fast:"Veloz","Step-by-step: element in run mode":"Paso-a-paso: elemento a ejecutar de uno a uno",Instructions:"Instrucciones",Instruction:"Instrucción","µinstructions":"µinstrucciones",microInstruction:"µInstrucción","Breakpoint icon: icon to be used for breakpoints":"Icono a ser usado en puntos de ruptura","Limit instructions: number of instructions to be executed":"Límite instrucciones: número de instrucciones a ser ejecutadas","Limit instruction ticks: to limit clock ticks":"Límite ticks: limitación de ticks de reloj por instrucción","Register file":"Banco de registros","Display format":"Formato de presentación","Register file names":"Nombre de los registros",Numbers:"Números",Labels:"Etiquetas","Editable registers: edit register file values":"Registros editables: editar los valores de los registros","Circuitry simulation":"Circuitería","Data-path color":"Color del camino de datos","Signal color":"Color de las señales activas","Show by value or by activation":"Mostrar por valor o por activación",Value:"Valor",Activation:"Activación","Interactive mode: signal value can be updated":"Modo interactivo: valores de las señales puede actualizarse","Quick interactive mode: quick update of signal value":"Modo interactivo-rápido: actualización rápida de valores de señales","(example)":"(ejemplo)",Accesibility:"Accesibilidad","Beginner view":"Vista principiante","Auto-scroll while executing":"Auto-scroll mientras en ejecución","Active voice: external voice control":"Activar voz: control por voz (externo)","Verbalization: textual or mathematical":"Tipo de verbalizar: texto o matemática","WepSIM User Interface views":"Vistas de la Interfaz de Usuarios+as",Privacy:"Privacidad",On:"On",Off:"Off",_last_:"_last_"};i18n.eltos.help.es={"Welcome tutorial":"Tutorial de bienvenida",help_01_01:"Abre el tutorial de bienvenida","Simple usage tutorial":"Tutorial simple de uso",help_01_02:"Tutorial de uso simple, ejemplo básico para microprogramar y programar en ensamblador","Execute example":"Ejecución de ejemplo",help_01_03:"Reproduce el tutorial de ejecución de ejemplo","Simulator: firmware":"Simulador: microcódigo",help_02_01:"Descripción de cómo trabajar en el simulador con el microcódigo","Microcode format":"Formato del microcódigo",help_02_02:"Sintáxis del microcódigo usado","Simulator: assembly":"Simulador: ensamblador",help_02_03:"Descripción de cómo trabajar en el simulador con el ensamblador","Assembly format":"Formato del ensamblador",help_02_04:"Sintáxis del ensamblador","Simulator: execution":"Simulador: ejecución",help_02_05:"Descripción de cómo ejecutar en el simulador el ensamblador y microcódigo","Simulated architecture":"Arquitectura del simulador",help_03_01:"Descripción de la arquitectura del procesador simulado","Simulated signals":"Señales simuladas",help_03_02:"Resumen de las señales principales del procesador elemental","Hardware summary":"Resumen del Hardware",help_03_03:"Resumen del hardware del procesador elemental simulado","License, platforms, etc.":"Licencia, plataformas, etc.",help_04_01:"Licencia de WepSIM, plataformas disponibles, tecnologías usadas",Authors:"Autores",help_04_02:"Autores de WepSIM"};i18n.eltos.states.es={States:"Estados",state:"estado",Current:"Actual","Current State":"Estado Actual",History:"Historia",None:"Ninguno","Empty history":"Historia vacía","Empty (only modified values are shown)":"Vacío (solo se muestra los valores modificados)",Differences:"Diferencias","differences with clipboard state":"diferencias con estado en portapapeles","Meets the specified requirements":"Iguales (cumple los requisitos)",history:"historial",Add:"Añadir","'Current State' to History":"'Estado Actual' al historial",Check:"Comprobar",Copy:"Copiar","to clipboard":"al portapapeles",Checkpoint:"Checkpoint","File name":"Nombre de fichero","Tag for checkpoint":"Etiqueta para checkpoint","File to be loaded":"Fichero a cargar","Save to File":"Guardar a fichero","State(s) to checkpoint":"Estados para checkpoint","Record to checkpoint":"Grabación para checkpoint","Browser cache":"Cache navegador","Session to be restore":"Sesión a restaurar",_last_:"_last_"};i18n.eltos.examples.es={"addv + seqv.":"addv + seqv.","Alloc.s":"Alloc.s","Dummy instruction":"Instrucción vacía",Exception:"Excepción",Instructions:"Instrucciones",Interruptions:"Interrupciones","Int. + syscall + except.":"Int. + syscall + excep.","I/O":"E/S",Looping:"Blucles","madd, mmul, mxch":"madd, mmul, mxch","Masks & shift":"Máscaras y desplazamientos",Matrix:"Matriz","Memory access":"Acceso a memoria","SC 1, 4-5, 8, 11-12":"SC 1, 4-5, 8, 11-12",Subrutine:"Subrutina","syscall 1, 4-5, 8, 11-12":"syscall 1, 4-5, 8, 11-12","System call":"Llamada a systema",Threads:"Hilos",Vector:"Vector","Compiler Explorer":"Compiler Explorer",Instructive:"Instructivo",example_04_01:"Ejemplo avanzado con interrupciones, llamada al sistema y excepciones.",example_05_01:"Extensiones Específicas de Aplicación: addv + seqv.",example_05_03:"Extensiones Específicas de Aplicación: madd + mmul + mxch.",example_03_01:"Ejemplo con excepción de coma flotante.",example_03_02:"Ejemplo con interrupciones: fetch, RETI y .ktext/.kdata.",example_03_03:"Ejemplo con llamada al sistema.",example_03_04:"Ejemplo con convenio simple de pila.",example_04_04:"Examplo de malloc + free.",example_04_02:"Examplo de llamada a sistema para imprimir/leer enteros y string.",example_04_03:"Examplo de hilos.",example_03_01b:"Examplo con excepción de coma flotante.",example_03_02b:"Examplo con interrupciones: fetch, RETI y .ktext/.kdata.",example_02_01:"Examplo con acceso con E/S programada y segmento de .text/.data básico.",example_03_03b:"Examplo con llamada a sistema.",example_02_02:"Ejemplo extendido con más instrucciones y E/S (teclado y pantalla).",example_02_04:"Ejemplo extendido con subrutina y matriz.",example_02_03:"Ejemplo extendido con máscaras, desplazamiento y segmentos básicos.",example_01_01:"Ejemplo simple con fetch, instrucciones artiméticas y segmentos básicos.",example_01_04:"Ejemplo simple con fetch, salto y segmento básico de .text/.data.",example_01_03:"Ejemplo simple con fetch, salto y segmento básico de .text.",example_01_02:"Ejemplo simple con fetch, acceso a memoria, y segmento básico de .text/.data.",example_06_01:"Ejemplo de prueba.",example_06_02:"Ejemplo simple con Compiler Explorer.",Advanced:"Avanzado",Initial:"Inicial",Intermediate:"Intermedio",Laboratory:"Laboratorio","Operating Systems":"Sistemas Operativos",Extra:"Bonus",Special:"Especial","Load example":"Cargar ejemplo","Load Assembly only":"Cargar Ensamblador solo","Load Firmware only":"Cargar Firmware solo","Copy reference to clipboard":"Copiar referencia al portapapeles",Share:"Compartir","No examples available...":"No examples are available for the selected hardware","Simple example":"Ejemplo simple."};i18n.eltos.compiler.es={"PROBLEM AROUND LINE":"Problema entorno a la línea","NO TAG OR DIRECTIVE":"No es una etiqueta (ej.: tag1:) o directiva (ej.: .data) válida, se encontró: ","NO TAG, DIR OR INS":"No es una etiqueta (ej.: tag1:) directiva (ej.: .data) o instrucción válida, se encontró: ","INVALID TAG FORMAT":"Una etiqueta debe seguir un formato alfanumérico (comenzando con una letra o un guión bajo): ","TAG OR INSTRUCTION":"Una etiqueta no puede tener el mismo nombre que una instrucción: ","REPEATED TAG":"Etiqueta repetida: ","NO NUMERIC DATATYPE":"Se esperaba un valor para el tipo de datos numéricos, pero se encontró: ","NO POSITIVE NUMBER":"Se esperaba un número positivo, pero se encontró: ","NO NUMBER OF BYTES":"Se esperaba un número natural para los bytes a reservar en .space, pero se encontró: ","INVALID ALIGN VALUE":"Se esperaba que el parámetro align sea un número positivo, pero se encontró: ","REMEMBER ALIGN VAL":"Recuerde que el número para .align será una potencia de dos, consulte la documentación de MIPS","NOT CLOSED STRING":"La cadena de caracteres no está cerrada (posiblemente se olvidó de terminar con comillas)","NO QUOTATION MARKS":"Cadena prevista entre comillas, pero encontrado: ","UNEXPECTED DATATYPE":"Inesperada nombre de tipo de datos: ","INVALID SEGMENT NAME":"Se espera un segmento .data/.text/..., pero se encontró: ","NO MAIN OR KMAIN":"Tags 'main' o 'kmain' no están definidos en el segmento de texto (s). Es obligatorio para definir al menos una de esas etiquetas con el fin de ejecutar un programa","UNKNOWN 1":"Se produjo un error desconocido (1)","UNKNOWN 2":"Error inesperado (2)","REMEMBER I. FORMAT":"Recuerde que el formato de instrucción se ha definido como: ","SEVERAL CANDIDATES":"Instrucción y campos coincide con más de una instrucción posible. Por favor, compruebe el microcódigo. En la actualidad, el formato de la instrucción puede ser: ","NOT MATCH MICRO":"Instrucción y campos no coinciden con el formato de instrucción definido","CHECK MICROCODE":"Por favor, compruebe el microcódigo. Probablemente se olvidó de agregar un campo, un número no encaja en su rango, o simplemente usa una instrucción equivocada","LABEL NOT DEFINED":"Label used but not defined in the assembly code: ","INS. MISSING FIELD":"Falta un campo en la instrucción","UNEXPECTED (REG)":"Se esperaba un registro pero se encontró un registro entre paréntesis.","EXPECTED (REG)":"Registro esperado entre paréntesis, pero se encontró: ","EXPECTED REG":"Se esperaba un registro (e.g.: $1/$a0/...) pero se encontró: ","UNKNOWN ESCAPE CHAR":"Secuencia de escape desconocida","SPACE FOR # BITS":" bits en binario pero hay espacio para solo ",NEEDS:" necesita ","UNKNOWN MC FORMAT":"(unknown format in microcode)","LABEL NOT FOUND":"Esperada ':' no encontrada, se encontró: ","REPEATED LABEL":"Etiqueta repetida: ","INVALID LABEL FORMAT":"Formato de etiqueta no válido para: ","OPEN BRACE NOT FOUND":"Esperado '{' no encontrado","CLOSE BRACE NOT FOUND":"Esperado '}' no encontrado","OPEN PAREN. NOT FOUND":"Esperado '(' no encontrado","CLOSE PAREN. NOT FOUND":"Esperado ')' no encontrado","COMMA NOT FOUND":"Esperado ',' no encontrado","EQUAL NOT FOUND":"Esperado '=' no encontrado","SIGNAL NOT EXISTS":"Señal no existente: ","SIGNAL NO DIRECTLY":" no puede usarse directamente, por favor use las señales de la Unidad de Control en su lugar para generarlas.","INCORRECT BIN. FORMAT":"Formato binario incorrecto: ","OUT OF RANGE":"Valor fuera de rango: ","EMPTY MICROCODE":"No hay microcódigo","EMPTY NAME LIST":"Lista vacía de nombres asociada al registro: x=[]","DUPLICATE SP":"Definición de puntero de pila duplicada","NO SP":"Esperado token stack_pointer no encontrado","UNDEF. INSTR.":"Instrucción no definida: ","MORE 100 FIELDS":"Más de 100 campos en una sola instrucción.","CO AS FIELD NAME":"Campo de instrucción tiene 'co' como nombre.","NW AS FIELD NAME":"Campo de instrucción tiene 'nwords' como nombre.","NO CO FIELD":"Esperada palabra clave 'co' no encontrada","INCORRECT CO BIN.":"Formato binary incorrecto en 'co': ","INCORRECT COP BIN.":"Formato binary incorrecto en 'cop': ","INVALID PARAMETER":"Parámetro invalido: ","ALLOWED PARAMETER":"Solo se permite los siguientes campos: reg, num, inm, addr, address","MISSING TOKEN ON":"'token' no está despues de '(' en: ","MISSING ) ON":"')' no se encuentra en: ","CO ALREADY USED":"'co' ya se está usando por: ","CO+COP ALREADY USED":"'co+cop' is already been used by: ","NO NWORDS":"Palabra clave 'nwords' esperado no encontrada","INCORRECT ADDRESSING":"Tipo de direccionamiento incorrecto (abs o rel)","UNEXPECTED FIELD":"Encontrado un campo no esperado: ","CHECK ORDER":"Por favor compruebe el orden de los campos","STARTBIT OoR":"startbit fuera de rango: ","STOPBIT OoR":"stopbit fuera de rango: ","OVERLAPPING FIELD":"Campos que se solapan: ","BAD COP BIN. LEN.":"Longitud binaria incorrecta para 'cop': ","SP NOT DEFINED":"Registro puntero de pila no definido","NO LABEL FETCH":"Etiqueta 'fetch' no definida","NO LABEL BEGIN":"'begin' no encontrado","NO CO CODES":"No hay códigos suficientes en 'co' para instrucciones","NO LABEL MADDR":"Etiqueta MADDR no encontrada: ","INS. NAME":"Nombre de instrucción: '","NOT VALID FOR":"' no es válido para: ","BIGGER THAN":"es mayor que ",BITS:" bits","EXPECTED VALUE":"Valor se esperaba que quepa en un '","BUT INSERTED":"pero insertado ",INSTEAD:"en su lugar",_last_:"_last_"};i18n.eltos.hw.es={Component:"Componente",Element:"Elemento","States (In)":"Estados (In)","States (Out)":"Estados (Out)",Signals:"Señales","It has":"Tiene",inputs:"entradas",outputs:"salidas",signals:"señales",Graph:"Gráfico",Text:"Texto","Graph: split view":"Gráfico: vista dividida","Graph: interactive mode":"Gráfico: modo interactivo",name:"nombre",version:"versión",abilities:"habilidad",value:"valor",default_value:"valor por defecto",nbits:"nbit",type:"tipo",visible:"visible","EP:CPU_T1:STATES:IN":"La entrada es el valor del registro MBR","EP:CPU_T1:STATES:OUT":"La salida va al bus interno de datos","EP:CPU_T1:SIGNALS:CTL":"Confirma que el valor de entrad se copia a la salida","EP:CPU_T2:STATES:IN":"La entrada es el valor del registro de PC","EP:CPU_T2:STATES:OUT":"La salida va al bus interno","EP:CPU_T2:SIGNALS:CTL":"Confirmar que el valor de entrada se copia a la salida","EP:CPU_T3:STATES:IN":"La entrada es la salida del selector-IR","EP:CPU_T3:STATES:OUT":"La salida va al bus interno","EP:CPU_T3:SIGNALS:CTL":"Confirmar que el valor de entrada se copia a la salida","EP:CPU_T4:STATES:IN":"La entrada es el valor del registro RT1","EP:CPU_T4:STATES:OUT":"La salida va al bus interno","EP:CPU_T4:SIGNALS:CTL":"Confirmar que el valor de entrada se copia a la salida","EP:CPU_T5:STATES:IN":"La entrada es el valor del registro RT2","EP:CPU_T5:STATES:OUT":"La salida va al bus interno","EP:CPU_T5:SIGNALS:CTL":"Confirmar que el valor de entrada se copia a la salida","EP:CPU_T6:STATES:IN":"La entrada es la salida ALU","EP:CPU_T6:STATES:OUT":"La salida va al bus interno","EP:CPU_T6:SIGNALS:CTL":"Confirmar que el valor de entrada se copia a la salida","EP:CPU_T7:STATES:IN":"La entrada es el valor del registro RT3","EP:CPU_T7:STATES:OUT":"La salida va al bus interno","EP:CPU_T7:SIGNALS:CTL":"Confirmar que el valor de entrada se copia a la salida","EP:CPU_T8:STATES:IN":"La entrada es el valor del registro SR","EP:CPU_T8:STATES:OUT":"La salida va al bus interno","EP:CPU_T8:SIGNALS:CTL":"Confirmar que el valor de entrada se copia a la salida","EP:CPU_T9:STATES:IN":"La entrada es el valor de la salida del puerto A del banco de registros","EP:CPU_T9:STATES:OUT":"La salida va al bus interno","EP:CPU_T9:SIGNALS:CTL":"Confirmar que el valor de entrada se copia a la salida","EP:CPU_T10:STATES:IN":"La entrada es el valor de la salida del puerto B del banco de registros","EP:CPU_T10:STATES:OUT":"La salida va al bus interno","EP:CPU_T10:SIGNALS:CTL":"Confirmar que el valor de entrada se copia a la salida","EP:CPU_T11:STATES:IN":"La entrada es la salida de la microinstrucción/ExCode","EP:CPU_T11:STATES:OUT":"La salida va al bus interno","EP:CPU_T11:SIGNALS:CTL":"Confirmar que el valor de entrada se copia a la salida","EP:CPU_T12:STATES:IN":"La entrada es la salida de Hardware Performance Counter (HPC)","EP:CPU_T12:STATES:OUT":"La salida va al bus interno","EP:CPU_T12:SIGNALS:CTL":"Confirmar que el valor de entrada se copia a la salida","EP:CPU_TA:STATES:IN":"La entrada es la salida del registro MAR","EP:CPU_TA:STATES:OUT":"La salida va al bus de direcciones","EP:CPU_TA:SIGNALS:CTL":"Confirmar que el valor de entrada se copia a la salida","EP:CPU_TB:STATES:IN":"La entrada es la salida del selector de bytes","EP:CPU_TB:STATES:OUT":"La salida va al bus de datos","EP:CPU_TB:SIGNALS:CTL":"Confirmar que el valor de entrada se copia a la salida","EP:CPU_MUX_A:STATES:MUX_0":"Entrada 0 de MUX A, del banco de registros (A)","EP:CPU_MUX_A:STATES:MUX_1":"Entrada 1 de MUX A, del registro RT1","EP:CPU_MUX_A:STATES:MUX_O":"Salida a ALU, operador 0","EP:CPU_MUX_A:SIGNALS:MA":"Seleccione el valor de entrada para enviar a la salida","EP:CPU_MUX_B:STATES:MUX_0":"Entrada 0 de MUX B, del banco de registros (B)","EP:CPU_MUX_B:STATES:MUX_1":"Entrada 1 de MUX B, del registro RT2","EP:CPU_MUX_B:STATES:MUX_2":"Entrada 2 de MUX B, valor 4","EP:CPU_MUX_B:STATES:MUX_3":"Entrada 3 de MUX B, valor 1","EP:CPU_MUX_B:STATES:MUX_O":"Salida a ALU, operador 1","EP:CPU_MUX_B:SIGNALS:MB":"Seleccione el valor de entrada para enviar a la salida","EP:CPU_MUX_1:STATES:MUX_0":"Entrada 0 de MUX 1, desde bus interno","EP:CPU_MUX_1:STATES:MUX_1":"Entrada 1 de MUX 1, del selector de bytes","EP:CPU_MUX_1:STATES:MUX_O":"Salida a MBR, desde MUX 1","EP:CPU_MUX_1:SIGNALS:M1":"Seleccione el valor de entrada para enviar a la salida","EP:CPU_MUX_2:STATES:MUX_0":"Entrada 0 de MUX 2, desde bus interno","EP:CPU_MUX_2:STATES:MUX_1":"Entrada 1 de MUX 2, PC + 4","EP:CPU_MUX_2:STATES:MUX_O":"Salida a PC","EP:CPU_MUX_2:SIGNALS:M2":"Seleccione el valor de entrada para enviar a la salida","EP:CPU_MUX_7:STATES:MUX_0":"Entrada 0 de MUX 7, desde bus interno","EP:CPU_MUX_7:STATES:MUX_1":"Entrada 1 de MUX 7, desde el selector de banderas","EP:CPU_MUX_7:STATES:MUX_O":"Salida para registrar SR","EP:CPU_MUX_7:SIGNALS:M7":"Seleccione el valor de entrada para enviar a la salida","EP:CU_MUX_A:STATES:MUX_0":"Entrada 0 de MUX A, desde microADDR + 1","EP:CU_MUX_A:STATES:MUX_1":"Entrada 1 de MUX A, de co2maddr","EP:CU_MUX_A:STATES:MUX_2":"Entrada 2 de MUX A, desde microIR/MADDR","EP:CU_MUX_A:STATES:MUX_3":"Entrada 3 de MUX A, desde 0","EP:CU_MUX_A:STATES:MUX_O":"Salida a microADDR, desde MUX A","EP:CU_MUX_A:SIGNALS:A0":"mIR/A0","EP:CU_MUX_A:SIGNALS:A1":"Salida de la unidad de control MUX B","EP:CU_MUX_B:STATES:MUX_0":"Entrada 0 de MUX B, desde MUX C","EP:CU_MUX_B:STATES:MUX_1":"Entrada 1 de MUX B, de NOT (MUX C)","EP:CU_MUX_B:STATES:MUX_O":"Salida a MUX A/A1","EP:CU_MUX_B:SIGNALS:MB":"Seleccione el valor de entrada para enviar a la salida","EP:CU_MUX_C:STATES:MUX_0":"Entrada 0 de MUX C, desde 0","EP:CU_MUX_C:STATES:MUX_1":"Entrada 1 de MUX C, desde INT","EP:CU_MUX_C:STATES:MUX_2":"Entrada 2 de MUX C, de IORdy","EP:CU_MUX_C:STATES:MUX_3":"Entrada 3 de MUX C, de MRdy","EP:CU_MUX_C:STATES:MUX_4":"Entrada 4 de MUX C, desde SR/U","EP:CU_MUX_C:STATES:MUX_5":"Entrada 5 de MUX C, desde SR/I","EP:CU_MUX_C:STATES:MUX_6":"Entrada 6 de MUX C, desde SR/Z","EP:CU_MUX_C:STATES:MUX_7":"Entrada 7 de MUX C, desde SR/N","EP:CU_MUX_C:STATES:MUX_8":"Entrada 8 de MUX C, desde SR/V","EP:CU_MUX_C:STATES:MUX_9":"Entrada 9 de MUX C, desde SR/C","EP:CU_MUX_C:STATES:MUX_10":"Entrada 10 de MUX C, desde InEx","EP:CU_MUX_C:STATES:MUX_O":"Salida a MUX B","EP:CU_MUX_C:SIGNALS:CTL":"Salida de la unidad de control MUX C","EP:CU_MUX_RA:STATES:MUX_0":"Entrada 0 de MUX MR, desde IR [SelA + 0 ... SelA + 4]","EP:CU_MUX_RA:STATES:MUX_1":"Entrada 1 de MUX MR, de SelA","EP:CU_MUX_RA:STATES:MUX_O":"Salida a RA","EP:CU_MUX_RA:SIGNALS:CTL":"Seleccione el valor de entrada para enviar a la salida","EP:CU_MUX_RB:STATES:MUX_0":"Entrada 0 de MUX MR, desde IR [SelB + 0 ... SelB + 4]","EP:CU_MUX_RB:STATES:MUX_1":"Entrada 1 de MUX MR, de SelB","EP:CU_MUX_RB:STATES:MUX_O":"Salida a RB","EP:CU_MUX_RB:SIGNALS:MR":"Seleccione el valor de entrada para enviar a la salida","EP:CU_MUX_RC:STATES:MUX_0":"Entrada 0 de MUX MR, desde IR [SelC + 0 ... SelC + 4]","EP:CU_MUX_RC:STATES:MUX_1":"Entrada 1 de MUX MR, de SelC","EP:CU_MUX_RC:STATES:MUX_O":"Salida a RC","EP:CU_MUX_RC:SIGNALS:MR":"Seleccione el valor de entrada para enviar a la salida","EP:CU_MUX_MC:STATES:MUX_0":"Entrada 0 de MUX MC, desde IR3 ... IR0","EP:CU_MUX_MC:STATES:MUX_1":"Entrada 1 de MUX MC, de SelCop","EP:CU_MUX_MC:STATES:MUX_O":"Salida a COP","EP:CU_MUX_MC:SIGNALS:CTL":"Seleccione el valor de entrada para enviar a la salida","EP:CPU_MUX_H:STATES:MUX_0":"Entrada 0 de MUX H, del Hardware Performance Counter","EP:CPU_MUX_H:STATES:MUX_1":"Entrada 1 de MUX H, del Hardware Performance Counter","EP:CPU_MUX_H:STATES:MUX_2":"Entrada 2 de MUX H, del Hardware Performance Counter","EP:CPU_MUX_H:STATES:MUX_3":"Entrada 3 de MUX H, del Hardware Performance Counter","EP:CPU_MUX_H:STATES:MUX_O":"Salida a T12","EP:CPU_MUX_H:SIGNALS:MH":"Seleccione el valor de entrada para enviar a la salida","EP:MAR:STATES:IN":"La entrada es el bus interno","EP:MAR:STATES:OUT":"La salida va al estado Ta","EP:MAR:SIGNALS:C0":"Confirmar que la entrada está almacenada","EP:MBR:STATES:IN":"La entrada es la salida M1","EP:MBR:STATES:OUT":"La salida va al triestado T1","EP:MBR:SIGNALS:C1":"Confirmar que la entrada está almacenada","EP:PC:STATES:IN":"La entrada es la salida M2","EP:PC:STATES:OUT":"La salida va al triestado T2","EP:PC:SIGNALS:CTL":"Confirmar que la entrada está almacenada","EP:IR:STATES:IN":"La entrada es el bus interno","EP:IR:STATES:OUT":"La salida va al selector IR y al CU","EP:IR:SIGNALS:C3":"Confirmar que la entrada está almacenada","EP:RT1:STATES:IN":"La entrada es el bus interno","EP:RT1:STATES:OUT":"La salida va al triestado T4","EP:RT1:SIGNALS:CTL":"Confirmar que la entrada está almacenada","EP:RT2:STATES:IN":"La entrada es el bus interno","EP:RT2:STATES:OUT":"La salida va al triestado T5","EP:RT2:SIGNALS:CTL":"Confirmar que la entrada está almacenada","EP:RT3:STATES:IN":"La entrada es la salida de la ALU","EP:RT3:STATES:OUT":"La salida va al triestado T7","EP:RT3:SIGNALS:CTL":"Confirmar que la entrada está almacenada","EP:SR:STATES:IN":"La entrada es la salida del M7","EP:SR:STATES:OUT":"La salida va a la entrada T8 y la CU","EP:SR:SIGNALS:CTL":"Confirmar que la entrada está almacenada","EP:REGISTER_FILE:STATES:A":"Salida de RF a T9 y MA/0","EP:REGISTER_FILE:STATES:B":"Salida de RF a T10 y MB/0","EP:REGISTER_FILE:STATES:C":"Entrada a RF desde bus interno","EP:REGISTER_FILE:SIGNALS:RA":"Seleccione el registro cuyo valor se envía a A","EP:REGISTER_FILE:SIGNALS:RB":"Seleccione el registro cuyo valor se envía a B","EP:REGISTER_FILE:SIGNALS:RC":"Seleccione el registro donde se almacena el valor de C","EP:REGISTER_FILE:SIGNALS:LC":"Confirme que RC se va a actualizar","EP:CPU_ALU:STATES:A":"Salida del multiplexor MUX A","EP:CPU_ALU:STATES:B":"Salida del multiplexor MUX B","EP:CPU_ALU:STATES:ALU":"El resultado va a la entrada de T6 y RT3","EP:CPU_ALU:STATES:FLAGS":"Banderas C, V, N, Z actualizadas","EP:CPU_ALU:SIGNALS:COP":"Código de operación (+, -, *, ...)","EP:SELECT_SR:STATES:MUX_1":"Entrada 1 de SELECT-SR, bandera U","EP:SELECT_SR:STATES:MUX_2":"Entrada 2 de SELECT-SR, indicador I","EP:SELECT_SR:STATES:MUX_3":"Entrada 3 de SELECT-SR, marca C V N Z","EP:SELECT_SR:STATES:MUX_O":"Salida a MUX 7/1","EP:SELECT_SR:SIGNALS:SELP":"Seleccione el valor de entrada para enviar a la salida","EP:SELECT_IR:STATES:MUX_I":"Entrada de SELECT-IR desde IR","EP:SELECT_IR:STATES:MUX_O":"Salida a bus interno a través de T3","EP:SELECT_IR:SIGNALS:SE":"Extensión de señal","EP:SELECT_IR:SIGNALS:SIZE":"Tamaño","EP:SELECT_IR:SIGNALS:OFFSET":"Offset","EP:BYTE_SELECTOR:STATES:FROM_MBR":"Entrada del registro MBR","EP:BYTE_SELECTOR:STATES:FROM_DATA":"Entrada desde bus de datos","EP:BYTE_SELECTOR:STATES:BE":"Salida a BE","EP:BYTE_SELECTOR:STATES:TO_MBR":"Salida a M1/1","EP:BYTE_SELECTOR:STATES:TO_TD":"Salida a Td/entrada","EP:BYTE_SELECTOR:SIGNALS:W":"Escribir en la memoria principal","EP:BYTE_SELECTOR:SIGNALS:SE":"Extensión de señal","EP:BYTE_SELECTOR:SIGNALS:A1A0":"A1A0","EP:BYTE_SELECTOR:SIGNALS:BW":"Número de bytes para empaquetar","EP:MEMORY:STATES:ADDR":"Bus de direcciones","EP:MEMORY:STATES:DATA":"Bus de datos","EP:MEMORY:STATES:MRDY":"Memoria lista","EP:MEMORY:SIGNALS:BE":"BW + A1A0","EP:MEMORY:SIGNALS:R":"Leer","EP:MEMORY:SIGNALS:W":"Escribir","EP:IO:STATES:ADDR":"Bus de direcciones","EP:IO:STATES:DATA":"Bus de datos","EP:IO:SIGNALS:IOR":"Leer desde dispositivo IO","EP:IO:SIGNALS:IOW":"Escribir en el dispositivo IO","EP:KEYBOARD:STATES:ADDR":"Bus de direcciones","EP:KEYBOARD:STATES:DATA":"Bus de datos","EP:KEYBOARD:SIGNALS:IOR":"Leer desde el teclado","EP:DISPLAY:STATES:ADDR":"Bus de direcciones","EP:DISPLAY:STATES:DATA":"Bus de datos","EP:DISPLAY:SIGNALS:IOR":"Leer de la pantalla (desactivado)","EP:DISPLAY:SIGNALS:IOW":"Escribir en la pantalla","EP:L3D:STATES:ADDR":"Bus de direcciones","EP:L3D:STATES:DATA":"Bus de datos","EP:L3D:SIGNALS:IOR":"Leer desde L3D","EP:L3D:SIGNALS:IOW":"Escribir en L3D","EP:LEDM:STATES:ADDR":"Bus de direcciones","EP:LEDM:STATES:DATA":"Bus de datos","EP:LEDM:SIGNALS:IOR":"Leer desde LEDM","EP:LEDM:SIGNALS:IOW":"Escribir en LEDM","POC:CPU_T1:STATES:IN":"La entrada es el valor del registro MBR","POC:CPU_T1:STATES:OUT":"La salida va al bus interno","POC:CPU_T1:SIGNALS:CTL":"Confirmar que la salida está conectada a la entrada","POC:CPU_T2:STATES:IN":"La entrada es la salida del registro de PC","POC:CPU_T2:STATES:OUT":"La salida va al bus interno","POC:CPU_T2:SIGNALS:CTL":"Confirmar que la salida está conectada a la entrada","POC:CPU_T3:STATES:IN":"La entrada es el selector de salida del registro IR","POC:CPU_T3:STATES:OUT":"La salida va al bus interno","POC:CPU_T3:SIGNALS:CTL":"Confirmar que la salida está conectada a la entrada","POC:CPU_T6:STATES:IN":"La entrada es la salida ALU","POC:CPU_T6:STATES:OUT":"La salida va al bus interno","POC:CPU_T6:SIGNALS:CTL":"Confirmar que la salida está conectada a la entrada","POC:CPU_T8:STATES:IN":"La entrada es la salida del registro SR","POC:CPU_T8:STATES:OUT":"La salida va al bus interno","POC:CPU_T8:SIGNALS:CTL":"Confirmar que la salida está conectada a la entrada","POC:CPU_T9:STATES:IN":"La entrada es la salida en el puerto A del banco de registros","POC:CPU_T9:STATES:OUT":"La salida va al bus interno","POC:CPU_T9:SIGNALS:CTL":"Confirmar que la salida está conectada a la entrada","POC:CPU_T10:STATES:IN":"La entrada es la salida en el puerto B del banco de registros","POC:CPU_T10:STATES:OUT":"La salida va al bus interno","POC:CPU_T10:SIGNALS:CTL":"Confirmar que la salida está conectada a la entrada","POC:CPU_T11:STATES:IN":"La entrada es la salida MIR/ExCode","POC:CPU_T11:STATES:OUT":"La salida va al bus interno","POC:CPU_T11:SIGNALS:CTL":"Confirmar que la salida está conectada a la entrada","POC:CPU_TA:STATES:IN":"La entrada es la salida del registro MAR","POC:CPU_TA:STATES:OUT":"La salida va al bus de direcciones","POC:CPU_TA:SIGNALS:CTL":"Confirmar que la salida está conectada a la entrada","POC:CPU_TB:STATES:IN":"La entrada es la salida del selector de bytes","POC:CPU_TB:STATES:OUT":"La salida va al bus de datos","POC:CPU_TB:SIGNALS:CTL":"Confirmar que la salida está conectada a la entrada","POC:CPU_MUX_A:STATES:MUX_0":"Entrada 0 de MUX A, desde RF/A","POC:CPU_MUX_A:STATES:MUX_1":"Entrada 1 de MUX A, desde bus interno","POC:CPU_MUX_A:STATES:MUX_O":"Salida a ALU/0, desde MUX A","POC:CPU_MUX_A:SIGNALS:MA":"Seleccione el valor de entrada para enviar a la salida","POC:CPU_MUX_B:STATES:MUX_0":"Entrada 0 de MUX B, desde RF/B","POC:CPU_MUX_B:STATES:MUX_1":"Entrada 1 de MUX B, desde PC","POC:CPU_MUX_B:STATES:MUX_O":"Salida a ALU/1, desde MUX B","POC:CPU_MUX_B:SIGNALS:MB":"Seleccione el valor de entrada para enviar a la salida","POC:CPU_MUX_1:STATES:MUX_0":"Entrada 0 de MUX 1, desde bus interno","POC:CPU_MUX_1:STATES:MUX_1":"Entrada 1 de MUX 1, desde bus de datos","POC:CPU_MUX_1:STATES:MUX_O":"Salida a MBR, desde MUX 1","POC:CPU_MUX_1:SIGNALS:M1":"Seleccione el valor de entrada para enviar a la salida","POC:CPU_MUX_7:STATES:MUX_0":"Entrada 0 de MUX 7, desde bus interno","POC:CPU_MUX_7:STATES:MUX_1":"Entrada 1 de MUX 7, del selector de banderas","POC:CPU_MUX_7:STATES:MUX_O":"Salida a SR, desde MUX 7","POC:CPU_MUX_7:SIGNALS:M7":"Seleccione el valor de entrada para enviar a la salida","POC:CU_MUX_A:STATES:MUX_0":"Entrada 0 de MUX A, desde mADDR + 1","POC:CU_MUX_A:STATES:MUX_1":"Entrada 1 de MUX A, de co2maddr","POC:CU_MUX_A:STATES:MUX_2":"Entrada 2 de MUX A, desde mIR/MADDR","POC:CU_MUX_A:STATES:MUX_3":"Entrada 3 de MUX A, desde 0","POC:CU_MUX_A:STATES:MUX_O":"Salida a mADDR, desde MUX A","POC:CU_MUX_A:SIGNALS:A0":"mIR/A0","POC:CU_MUX_A:SIGNALS:A1":"Salida de la unidad de control MUX B","POC:CU_MUX_B:STATES:MUX_0":"Entrada 0 de MUX B, desde MUX C","POC:CU_MUX_B:STATES:MUX_1":"Entrada 1 de MUX B, de NOT (MUX C)","POC:CU_MUX_B:STATES:MUX_O":"Salida a MUX A/A1, desde MUX B","POC:CU_MUX_B:SIGNALS:MB":"Seleccione el valor de entrada para enviar a la salida","POC:CU_MUX_C:STATES:MUX_0":"Entrada 0 de MUX C, desde 0","POC:CU_MUX_C:STATES:MUX_1":"Entrada 1 de MUX C, desde INT","POC:CU_MUX_C:STATES:MUX_2":"Entrada 2 de MUX C, de IORdy","POC:CU_MUX_C:STATES:MUX_3":"Entrada 3 de MUX C, de MRdy","POC:CU_MUX_C:STATES:MUX_4":"Entrada 4 de MUX C, desde SR/U","POC:CU_MUX_C:STATES:MUX_5":"Entrada 5 de MUX C, desde SR/I","POC:CU_MUX_C:STATES:MUX_6":"Entrada 6 de MUX C, desde SR/Z","POC:CU_MUX_C:STATES:MUX_7":"Entrada 7 de MUX C, desde SR/N","POC:CU_MUX_C:STATES:MUX_8":"Entrada 8 de MUX C, desde SR/V","POC:CU_MUX_C:STATES:MUX_9":"Entrada 9 de MUX C, desde SR/C","POC:CU_MUX_C:STATES:MUX_10":"Entrada 10 de MUX C, desde InEx","POC:CU_MUX_C:STATES:MUX_O":"Salida a MUX B","POC:CU_MUX_C:SIGNALS:CTL":"Salida de la unidad de control MUX C","POC:CU_MUX_RA:STATES:MUX_0":"Entrada 0 de MUX MR, desde IR [SelA + 0 ... SelA + 4]","POC:CU_MUX_RA:STATES:MUX_1":"Entrada 1 de MUX MR, de SelA","POC:CU_MUX_RA:STATES:MUX_O":"Salida a RA","POC:CU_MUX_RA:SIGNALS:CTL":"Seleccione el valor de entrada para enviar a la salida","POC:CU_MUX_RB:STATES:MUX_0":"Entrada 0 de MUX MR, desde IR [SelB + 0 ... SelB + 4]","POC:CU_MUX_RB:STATES:MUX_1":"Entrada 1 de MUX MR, de SelB","POC:CU_MUX_RB:STATES:MUX_O":"Salida a RB","POC:CU_MUX_RB:SIGNALS:MR":"Seleccione el valor de entrada para enviar a la salida","POC:CU_MUX_RC:STATES:MUX_0":"Entrada 0 de MUX MR, desde IR [SelC + 0 ... SelC + 4]","POC:CU_MUX_RC:STATES:MUX_1":"Entrada 1 de MUX MR, de SelC","POC:CU_MUX_RC:STATES:MUX_O":"Salida a RC","POC:CU_MUX_RC:SIGNALS:MR":"Seleccione el valor de entrada para enviar a la salida","POC:CU_MUX_MC:STATES:MUX_0":"Entrada 0 de MUX MC, desde IR3 ... IR0","POC:CU_MUX_MC:STATES:MUX_1":"Entrada 1 de MUX MC, de SelCop","POC:CU_MUX_MC:STATES:MUX_O":"Salida a COP","POC:CU_MUX_MC:SIGNALS:CTL":"Seleccione el valor de entrada para enviar a la salida","POC:MAR:STATES:IN":"La entrada es el bus interno","POC:MAR:STATES:OUT":"La salida va al estado Ta","POC:MAR:SIGNALS:C0":"Confirmar que la entrada está almacenada","POC:MBR:STATES:IN":"La entrada es la salida M1","POC:MBR:STATES:OUT":"La salida va al triestado T1","POC:MBR:SIGNALS:C1":"Confirmar que la entrada está almacenada","POC:PC:STATES:IN":"La entrada es el bus interno","POC:PC:STATES:OUT":"La salida va al triestado T2","POC:PC:SIGNALS:CTL":"Confirmar que la entrada está almacenada","POC:IR:STATES:IN":"La entrada es el bus interno","POC:IR:STATES:OUT":"La salida va al selector IR y al CU","POC:IR:SIGNALS:C3":"Confirmar que la entrada está almacenada","POC:RT1:STATES:IN":"La entrada es el bus interno","POC:RT1:STATES:OUT":"La salida va al select-rt1","POC:RT1:SIGNALS:CTL":"Confirmar que la entrada está almacenada","POC:SR:STATES:IN":"La entrada es la salida del M7","POC:SR:STATES:OUT":"La salida va a la entrada T8 y la CU","POC:SR:SIGNALS:CTL":"Confirmar que la entrada está almacenada","POC:REGISTER_FILE:STATES:A":"Salida de RF a T9 y MA/0","POC:REGISTER_FILE:STATES:B":"Salida de RF a T10 y MB/0","POC:REGISTER_FILE:STATES:C":"Entrada a RF desde bus interno","POC:REGISTER_FILE:SIGNALS:RA":"Seleccione el registro cuyo valor se envía a A","POC:REGISTER_FILE:SIGNALS:RB":"Seleccione el registro cuyo valor se envía a B","POC:REGISTER_FILE:SIGNALS:RC":"Seleccione el registro donde se almacena el valor de C","POC:REGISTER_FILE:SIGNALS:LC":"Confirme que RC se va a actualizar","POC:CPU_ALU:STATES:A":"Salida del multiplexor MUX A","POC:CPU_ALU:STATES:B":"Salida del multiplexor MUX B","POC:CPU_ALU:STATES:ALU":"El resultado va a la entrada de T6 y RT3","POC:CPU_ALU:STATES:FLAGS":"Banderas C, V, N, Z actualizadas","POC:CPU_ALU:SIGNALS:COP":"Código de operación (+, -, *, ...)","POC:SELECT_RT1:STATES:MUX_I":"Entrada de SELECT-RT1 desde RT1","POC:SELECT_RT1:STATES:MUX_O":"Salida a bus interno a través de T3","POC:SELECT_RT1:SIGNALS:SE":"Extensión de señal","POC:SELECT_RT1:SIGNALS:SIZE":"Tamaño","POC:SELECT_RT1:SIGNALS:OFFSET":"Desplazamiento","POC:MEMORY:STATES:ADDR":"Bus de direcciones","POC:MEMORY:STATES:DATA":"Bus de datos","POC:MEMORY:STATES:MRDY":"Memoria lista","POC:MEMORY:SIGNALS:BW":"Ancho de bytes","POC:MEMORY:SIGNALS:R":"Leer","POC:MEMORY:SIGNALS:W":"Escribir","POC:IO:STATES:ADDR":"Bus de direcciones","POC:IO:STATES:DATA":"Bus de datos","POC:IO:SIGNALS:IOR":"Leer desde dispositivo IO","POC:IO:SIGNALS:IOW":"Escribir en el dispositivo IO","POC:KEYBOARD:STATES:ADDR":"Bus de direcciones","POC:KEYBOARD:STATES:DATA":"Bus de datos","POC:KEYBOARD:SIGNALS:IOR":"Leer desde el teclado","POC:DISPLAY:STATES:ADDR":"Bus de direcciones","POC:DISPLAY:STATES:DATA":"Bus de datos","POC:DISPLAY:SIGNALS:IOR":"Leer de la pantalla (desactivado)","POC:DISPLAY:SIGNALS:IOW":"Escribir en la pantalla","POC:L3D:STATES:ADDR":"Bus de direcciones","POC:L3D:STATES:DATA":"Bus de datos","POC:L3D:SIGNALS:IOR":"Leer desde L3D","POC:L3D:SIGNALS:IOW":"Escribir en L3D",_last_:"_last_"};i18n.eltos.dialogs.es={"Show/Hide ActionBar":"Mostrar/Ocultar barra","Show/Hide Slider":"Mostrar/Ocultar sliders","WepSIM User Interface skin":"Variante de Interfaz de Usuario para WepSIM","Initial intro":"Intro inicial","About WepSIM":"Sobre WepSIM",Title:"Título",Message:"Mensaje",Duration:"Duración","Confirm remove record...":"¿Seguro que quiere borrar la grabación actual?","Close or Reset...":"Por favor haga click en Cerrar para mantener la grabación o en Reiniciar para borrarla.","Sure Control Memory...":"¿Seguro que quiere salvar el contenido actual de la memoria de control en lugar del contenido del editor?.","Show/Hide labels":"Mostrar/Ocultar etiquetas","Show/Hide content":"Mostrar/Ocultar hexadecimal","Show/Hide assembly":"Mostrar/Ocultar ensamblador","Show/Hide pseudo-instructions":"Mostrar/Ocultar pseudo-instrucciones",Close:"Cerrar",details:"detalles",idiom:"idioma",_last_:"_last_"};i18n.eltos.gui.en={"Loading WepSIM...":"Loading WepSIM...",About:"About",Configuration:"Configuration",MicroCode:"MicroCode",Assembly:"Assembly",Simulator:"Simulator",Examples:"Examples",Load:"Load",Save:"Save","Load/Save":"Load/Save",Restore:"Restore",Help:"Help",Notifications:"Notifications",RecordBar:"RecordBar",Input:"Input",Output:"Output",Reload:"Reload",Checkpoint:"Checkpoint","Help Index":"Help Index",Processor:"Processor","Assembly Debugger":"Assembly Debugger",Reset:"Reset",microInstruction:"µInstruction",Instruction:"Instruction",Run:"Run","Hardware Summary":"Hardware Summary",processor:"processor",details:"details",microcode:"microcode",Signals:"Signals",Behaviors:"Behaviors",States:"States","Control States":"Control States",Dependencies:"Dependencies",Close:"Close",Description:"Description",Show:"Show","Show Main Memory":"Show Main Memory",compile:"compile",Compile:"Compile","Please write the file name":"Please write the file name","Load from this File":"Load from this File",labels:"labels",addr:"addr",ess:"ess",content:"content",assembly:"assembly",instructions:"instructions","simulator intro 1":"You can select the hardware to be used. The default one is the EP (Elemental Processor) hardware.
"+"You can use the mode selector to change the hardware used.","simulator intro 2":"Then you need to load the microcode (defines the instruction set) and the assembly code.
"+"You can use an example, "+"load it from a file, "+"or you can edit a new microcode "+" and a new assembly code.","simulator intro 3":"Finally, in the simulator you are able to execute the microcode plus assembly loaded before.
"+"You can execute it both, at microinstruction level or assembly instruction level.","Prev.":"Prev.",Next:"Next",End:"End","Disable tutorial mode":"Disable tutorial mode",Comment:"Comment",Pause:"Pause",Play:"Play",Stop:"Stop",Record:"Record",Registers:"Registers","Control Memory":"Control Memory",Stats:"Stats",Memory:"Memory","Keyboard+Display":"Keyboard+Display","I/O Stats":"I/O Stats","I/O Configuration":"I/O Configuration",Recent:"Recent",Refresh:"Refresh",Welcome:"Welcome","Microcode & Assembly":"Microcode & Assembly","Pick firm/soft":"Pick firm/soft from",Information:"Information",Native:"Native","MIPS32-like":"MIPS32-like",RISCV32:"RISCV32","Z80-like":"Z80-like",Actions:"Actions",Utilities:"Utilities","Information from":"Information from","Pick firm/soft from":"Pick firm/soft from","Welcome tutorial":"Welcome tutorial","Assembly only":"Assembly only","Micro & Assembly":"Micro & Assembly",idiom:"idiom","quick config":"quick config","Graph: quick interactive mode":"Graph: quick interactive mode",_last_:"_last_"};i18n.eltos.tutorial_welcome.en={title_0:"Welcome to the WepSIM simulator!",message_0:"
wepsim screenshot
"+"

"+"

"+"This brief tutorial is going to show you how to:"+"
    "+"
  1. Load an example.
  2. "+"
  3. Execute an example.
  4. "+"
  5. Configure the simulation.
  6. "+"
  7. Get help.
  8. "+"
"+"
",title_1:"How to load some example.",message_1:"
wepsim screenshot
"+"

"+"

"+"Click in the 'example' button, then click in the example 'title' name.
"+"Then the example for microcode and assembly is loaded and microcompiled and compiled.
"+"
"+"
",title_2:"How to execute an example.",message_2:"
wepsim screenshot
"+"

"+"

"+"Click on next instruction/microinstruction to execute step by step.
"+"Click on run button to execute until the first breakpoint or the end of the assembly program."+"
"+"
",title_3:"How to configure WepSIM.",message_3:"
wepsim screenshot
"+"

"+"

"+"Click in the 'configuration' button and users are able to customize different parts of WepSIM."+"
"+"
",title_4:"How to get the basic help.",message_4:"
wepsim screenshot
"+"

"+"

"+"Please click in the green 'help' button to reach the help dialog.
"+"You are able to switch idiom (Spanish/English), go to the help index, or close the help dialog."+"
"+"
",title_5:"Welcome to WepSIM!",message_5:"
wepsim screenshot
"+"

"+"

"+"Please explorer the help sections for more information.
"+"If you click on the end button of this tutorial, WepSIM is going to load the first example for you. Enjoy!"+"
"+"
"};i18n.eltos.tutorial_simpleusage.en={title_0:"Simple WepSIM experience: microprogramming and programming",message_0:"
wepsim screenshot
"+"

"+"

"+"This brief tutorial is going to show you how to:"+"
    "+"
  1. Edit your microcode.
  2. "+"
  3. Edit your assembly (based on the previous microcode).
  4. "+"
  5. Execute the assembly+microcode in the simulation.
  6. "+"
"+"
",title_1:"Simple WepSIM experience: microprogramming and programming",message_1:"
wepsim screenshot
"+"

"+"

"+"The first step is to microprogramming the firmware to be used. "+"Please use the 'Microcode' button to switch to the microcode screen."+"
",title_2:"Simple WepSIM experience: microprogramming and programming",message_2:"
wepsim screenshot
"+"

"+"

"+"The microprogramming screen provides:"+"
    "+"
  • The editor for the microcode.
  • "+"
  • The microcompiler.
  • "+"
  • The hardware summary and help.
  • "+"
"+"Once your code is ready (compiled without errors), next step is to go to the assembly screen."+"
",title_3:"Simple WepSIM experience: microprogramming and programming",message_3:"
wepsim screenshot
"+"

"+"

"+"The second step is to programming the assembly to be executed. "+"Please use the 'Assembly' button from both, the simulator screen or the microcode screen."+"
",title_4:"Simple WepSIM experience: microprogramming and programming",message_4:"
wepsim screenshot
"+"

"+"

"+"The programming screen provides:"+"
    "+"
  • The editor for the assembly code.
  • "+"
  • The assembly compiler.
  • "+"
  • The memory map viewer and help.
  • "+"
"+"Once your assebly code is ready (edited and compiled without errors) next step is to go into the simulation screen."+"
",title_5:"Simple WepSIM experience: microprogramming and programming",message_5:"
wepsim screenshot
"+"

"+"

"+"The third step is to execute the assembly code in the simulator.
"+"The simulator screen provides:"+"
    "+"
  • The assembly and hardware view.
  • "+"
  • The detail view of registers, control memory, main memory, etc.
  • "+"
  • The reset, step by step or run until breakpoint/end actions.
  • "+"
"+"This tutorial has introduced the typical usage of WepSIM for students and teachers. Enjoy WepSIM!"+"
"};i18n.eltos.tour_intro.en={step1:"WepSIM helps to better understand how a computer works: "+"it is visual, interactive, integrates from signals up to interruptions, system calls, exceptions, etc.
"+"
"+"We really believe WepSIM is a revolutionary teaching tool. "+"This brief tour introduces the key elements of its interface.",step2:"This button on the top-right is a quick access menu to differents 'work modes'.
"+"
"+"Users might select:"+"
    "+"
  • The hardware to work with (e.g. EP processor, etc.)
  • "+"
  • Assembly only mode, with integer MIPS32 or RISC-V32 instructions
  • "+"
",step3:"On the top-right, the 'help' button opens the associated dialog.
"+"
"+"The help dialog summarizes the tutorials, descriptions, information, etc.",step4:"And on the left, the 'examples' button open the example dialog.
"+"
"+"There are many examples that can be used to learn incrementally.",step5:"On the top-left, the 'configuration' button opens the configuration dialog.
"+"
"+"It allows users to adapt several aspects of the execution, user interface, preferences, etc.",step6:"Congrats! You know the key elements in the WepSIM interface.
"+"From the 'Help' dialog you can access the 'Welcome tutorial' to continue learning.
"};i18n.eltos.cfg.en={General:"General","Idiom for help, examples, etc.":"Idiom for help, examples, etc.","Notification speed: time before disapear":"Notification speed: time before disapear","Dark Mode":"Dark mode",Editor:"Editor","Editor theme: light or dark":"Editor theme: light or dark",Light:"Light",Dark:"Dark","Editor mode: vim, emacs, etc.":"Editor mode: vim, emacs, etc.",Execution:"Execution","Running speed: execution speed":"Running speed: execution speed",Slow:"Slow",Normal:"Normal",Fast:"Fast","Step-by-step: element in run mode":"Step-by-step: element in run mode",Instructions:"Instructions",Instruction:"Instruction","µinstructions":"µinstructions",microInstruction:"µInstruction","Breakpoint icon: icon to be used for breakpoints":"Breakpoint icon: icon to be used for breakpoints","Limit instructions: number of instructions to be executed":"Limit instructions: number of instructions to be executed","Limit instruction ticks: to limit clock ticks":"Limit instruction ticks: clock ticks limit per instruction","Register file":"Register file","Display format":"Display format","Register file names":"Register file names",Numbers:"Numbers",Labels:"Labels","Editable registers: edit register file values":"Editable registers: edit register file values","Circuitry simulation":"Circuitry simulation","Data-path color":"Data-path color","Signal color":"Signal color","Show by value or by activation":"Show by value or by activation",Value:"Value",Activation:"Activation","Interactive mode: signal value can be updated":"Interactive mode: signal value can be updated","Quick interactive mode: quick update of signal value":"Quick interactive mode: quick update of signal value","(example)":"(example)",Accesibility:"Accesibility","Beginner view":"Beginner view","Auto-scroll while executing":"Auto-scroll while executing","Active voice: external voice control":"Active voice: external voice control","Verbalization: textual or mathematical":"Verbalization: textual or mathematical","WepSIM User Interface views":"WepSIM User Interface views",Privacy:"Privacy",On:"On",Off:"Off",_last_:"_last_"};i18n.eltos.help.en={"Welcome tutorial":"Welcome tutorial",help_01_01:"Open the welcome tutorial","Simple usage tutorial":"Simple usage tutorial",help_01_02:"Open the simple usage tutorial, for microprogramming and assembly programming","Execute example":"Execute example",help_01_03:"Play the execute example tutorial","Simulator: firmware":"Simulator: firmware",help_02_01:"How to work with the firmware to be loaded into the control memory","Microcode format":"Microcode format",help_02_02:"Syntax of the microcode used","Simulator: assembly":"Simulator: assembly",help_02_03:"How to work with the assembly that use the aforementioned firmware","Assembly format":"Assembly format",help_02_04:"Syntax of the assembly elements","Simulator: execution":"Simulator: execution",help_02_05:"How the simulator can execute the assembly and firmware","Simulated architecture":"Simulated architecture",help_03_01:"Description of the simulated processor architecture","Simulated signals":"Simulated signals",help_03_02:"Main signals summary of the simulated elemental processor","Hardware summary":"Hardware summary",help_03_03:"Reference card for the simulated elemental processor hardware","License, platforms, etc.":"License, platforms, etc.",help_04_01:"WepSIM license, supported platforms, technologies used",Authors:"Authors",help_04_02:"Authors of WepSIM"};i18n.eltos.states.en={States:"States",state:"state",Current:"Current","Current State":"Current State",History:"History",None:"None","Empty history":"Empty history","Empty (only modified values are shown)":"Empty (only modified values are shown)",Differences:"Differences","differences with clipboard state":"differences with clipboard state","Meets the specified requirements":"Meets the specified requirements",history:"history",Add:"Add","'Current State' to History":"'Current State' to History",Check:"Check",Copy:"Copy","to clipboard":"to clipboard",Checkpoint:"Checkpoint","File name":"File name","Tag for checkpoint":"Tag for checkpoint","File to be loaded":"File to be loaded","Save to File":"Save to File","State(s) to checkpoint":"State(s) to checkpoint","Record to checkpoint":"Record to checkpoint","Browser cache":"Browser cache","Session to be restore":"Session to be restore",_last_:"_last_"};i18n.eltos.examples.en={"addv + seqv.":"addv + seqv.","Alloc.s":"Alloc.s","Dummy instruction":"Dummy instruction",Exception:"Exception",Instructions:"Instructions",Interruptions:"Interruptions","Int. + syscall + except.":"Int. + syscall + except.","I/O":"I/O",Looping:"Looping","madd, mmul, mxch":"madd, mmul, mxch","Masks & shift":"Masks & shift",Matrix:"Matrix","Memory access":"Memory access","SC 1, 4-5, 8, 11-12":"SC 1, 4-5, 8, 11-12",Subrutine:"Subrutine","syscall 1, 4-5, 8, 11-12":"syscall 1, 4-5, 8, 11-12","System call":"System call",Threads:"Threads",Vector:"Vector","Compiler Explorer":"Compiler Explorer",Instructive:"Instructive",example_04_01:"Advanced example with interruption, system call, and exception.",example_05_01:"Application-specific extension: addv + seqv.",example_05_03:"Application-specific extension: madd + mmul + mxch.",example_03_01:"Example with floating point exception.",example_03_02:"Example with interruptions support: fetch, RETI, and .ktext/.kdata.",example_03_03:"Example with system call support.",example_03_04:"Example with simple stack convention.",example_04_04:"Example of malloc + free.",example_04_02:"Example of syscall for printing/reading integer and string.",example_04_03:"Example of threads.",example_03_01b:"Example with floating point exception.",example_03_02b:"Example with interruptions support: fetch, RETI, and .ktext/.kdata.",example_02_01:"Example with programmed I/O access, and basic .text/.data segment.",example_03_03b:"Example with system call support.",example_02_02:"Extended example with more instructions and I/O (keyboard, display).",example_02_04:"Extended example with subrutine and matrix.",example_02_03:"More extended example with masks, shift, and basic .text/.data segment.",example_01_01:"Simple example with fetch, arithmetic instructions, and basic .text segment.",example_01_04:"Simple example with fetch, branch, and basic .text/.data segment.",example_01_03:"Simple example with fetch, branch, and basic .text segment.",example_01_02:"Simple example with fetch, memory access, and basic .text/.data segment.",example_06_01:"Test example.",example_06_02:"Simple Compiler Explorer example.",Advanced:"Advanced",Initial:"Initial",Intermediate:"Intermediate",Laboratory:"Laboratory","Operating Systems":"Operating Systems",Extra:"Bonus",Special:"Special","Load example":"Load example","Load Assembly only":"Load Assembly only","Load Firmware only":"Load Firmware only","Copy reference to clipboard":"Copy reference to clipboard",Share:"Share","No examples available...":"No examples are available for the selected hardware","Simple example":"Simple example."};i18n.eltos.compiler.en={"PROBLEM AROUND LINE":"Problem around line","NO TAG OR DIRECTIVE":"Not a valid tag (e.g.: tag1:) or directive (e.g.: .data), found ","NO TAG, DIR OR INS":"Not a valid tag (e.g.: tag1:) directive (e.g.: .data) or instruction, found ","INVALID TAG FORMAT":"A tag must follow an alphanumeric format, starting with a letter or underscore (e.g.: _tag1:) but found ","TAG OR INSTRUCTION":"A tag can not have the same name as an instruction ","REPEATED TAG":"Repeated tag ","NO NUMERIC DATATYPE":"Expected value for numeric datatype but found ","NO POSITIVE NUMBER":"Expected a positive number but found ","NO NUMBER OF BYTES":"Expected number of bytes to reserve in .space but found ","INVALID ALIGN VALUE":"Expected the align parameter as positive number but found ","REMEMBER ALIGN VAL":"Remember that number is the power of two for alignment, see MIPS documentation.","NOT CLOSED STRING":"String is not closed (forgot to end it with quotation marks)","NO QUOTATION MARKS":"Expected string between quotation marks but found ","UNEXPECTED DATATYPE":"Unexpected datatype name ","INVALID SEGMENT NAME":"Expected segment name (e.g.: .data/.text/...) but found ","NO MAIN OR KMAIN":"Tags 'main' or 'kmain' are not defined in the text segment(s). "+"It is compulsory to define at least one of those tags in order to execute a program","UNKNOWN 1":"An unknown error ocurred (1) for field type ","UNKNOWN 2":"Unexpected error (2)","REMEMBER I. FORMAT":"Remember that the instruction format has been defined as ","SEVERAL CANDIDATES":"Instruction and fields match with more than one instruction in microcode. "+"Please check the microcode. Currently, the instruction format can be ","NOT MATCH MICRO":"Instruction and fields don't match with microprogram. ","CHECK MICROCODE":"Please check the microcode. Probably you forgot to add a field, a number is out of range, or you just used a wrong instruction","LABEL NOT DEFINED":"Label used but not defined in the assembly code ","INS. MISSING FIELD":"Missing field in the instruction","UNEXPECTED (REG)":"Expected register but found register between parenthesis.","EXPECTED (REG)":"Expected register between parenthesis but found ","EXPECTED REG":"Expected valid register (e.g.: $1/$a0/...) but found ","UNKNOWN ESCAPE CHAR":"Unknown escape char","SPACE FOR # BITS":" bits in binary but there is space for only ",NEEDS:" needs ","UNKNOWN MC FORMAT":"(unknown format in microcode)","LABEL NOT FOUND":"Expected '