From 92cd4cc622cf7fb67e78fd3dbbdc7cf68ea7f857 Mon Sep 17 00:00:00 2001 From: Alejandro Calderon Mateos Date: Thu, 29 Jun 2023 20:56:31 +0200 Subject: [PATCH] 2.3.0: minor updates --- devel/mk_dist.sh | 6 +- devel/test_jshint.sh | 5 +- examples/examples_set/rv32/default.json | 264 ++ examples/examples_set/rv32/es_rv.json | 266 ++ examples/hardware/poc/images/processor.svg | 623 ++-- examples/hardware/rv/images/cpu.svg | 2230 +++++++++++++ examples/hardware/rv/images/index.html | 0 examples/hardware/rv/images/processor.svg | 2230 +++++++++++++ examples/hardware/rv/index.html | 0 examples/microcode/rv32/rv_base.mc | 471 +++ images/author_juanbanpar.png | Bin 16685 -> 14413 bytes sim_hw/sim_hw_ep/sim_hw_cpu.js | 7 +- sim_hw/sim_hw_poc/sim_hw_cpu.js | 7 +- sim_hw/sim_hw_rv/sim_hw_board.js | 51 + sim_hw/sim_hw_rv/sim_hw_cpu.js | 2924 +++++++++++++++++ sim_hw/sim_hw_rv/sim_hw_mem.js | 360 ++ sim_hw/sim_hw_rv/sim_rv.js | 45 + wepsim_web/wepsim_uielto_cpusvg.js | 68 +- wepsim_web/wepsim_web_api.js | 14 +- wepsim_web/wepsim_web_simulator.js | 2 +- .../examples/examples_set/rv32/default.json | 264 ++ ws_dist/examples/examples_set/rv32/es_rv.json | 266 ++ ws_dist/examples/hardware/ep/hw_def.json | 2 +- ws_dist/examples/hardware/poc/hw_def.json | 2 +- .../hardware/poc/images/processor.svg | 623 ++-- ws_dist/examples/hardware/rv/images/cpu.svg | 2230 +++++++++++++ .../examples/hardware/rv/images/index.html | 0 .../examples/hardware/rv/images/processor.svg | 2230 +++++++++++++ ws_dist/examples/hardware/rv/index.html | 0 ws_dist/examples/microcode/rv32/rv_base.mc | 471 +++ ws_dist/images/author_juanbanpar.png | Bin 16685 -> 14413 bytes ws_dist/min.sim_all.js | 2 +- ws_dist/min.wepsim_node.js | 2 +- ws_dist/min.wepsim_web.js | 2 +- 34 files changed, 15199 insertions(+), 468 deletions(-) create mode 100644 examples/examples_set/rv32/es_rv.json create mode 100644 examples/hardware/rv/images/cpu.svg create mode 100644 examples/hardware/rv/images/index.html create mode 100644 examples/hardware/rv/images/processor.svg create mode 100644 examples/hardware/rv/index.html create mode 100644 examples/microcode/rv32/rv_base.mc create mode 100644 sim_hw/sim_hw_rv/sim_hw_board.js create mode 100644 sim_hw/sim_hw_rv/sim_hw_cpu.js create mode 100644 sim_hw/sim_hw_rv/sim_hw_mem.js create mode 100644 sim_hw/sim_hw_rv/sim_rv.js create mode 100644 ws_dist/examples/examples_set/rv32/es_rv.json create mode 100644 ws_dist/examples/hardware/rv/images/cpu.svg create mode 100644 ws_dist/examples/hardware/rv/images/index.html create mode 100644 ws_dist/examples/hardware/rv/images/processor.svg create mode 100644 ws_dist/examples/hardware/rv/index.html create mode 100644 ws_dist/examples/microcode/rv32/rv_base.mc diff --git a/devel/mk_dist.sh b/devel/mk_dist.sh index 6125f58cb..22cace03c 100755 --- a/devel/mk_dist.sh +++ b/devel/mk_dist.sh @@ -139,6 +139,10 @@ cat sim_core/sim_cfg.js \ sim_hw/sim_hw_poc/sim_hw_scr.js \ sim_hw/sim_hw_poc/sim_hw_l3d.js \ sim_hw/sim_hw_poc/sim_hw_ldm.js \ + sim_hw/sim_hw_rv/sim_rv.js \ + sim_hw/sim_hw_rv/sim_hw_board.js \ + sim_hw/sim_hw_rv/sim_hw_cpu.js \ + sim_hw/sim_hw_rv/sim_hw_mem.js \ \ sim_sw/firmware/lexical.js \ sim_sw/firmware/firm_mcode.js \ @@ -373,7 +377,7 @@ jq 'reduce inputs as $i (.; . += $i)' $DEFAULT_EXAMPLE_SET > examples/examples_s DEFAULT_EXAMPLE_SET="examples/examples_set/mips/es_ep_instructive.json examples/examples_set/mips/es_poc_instructive.json" jq 'reduce inputs as $i (.; . += $i)' $DEFAULT_EXAMPLE_SET > examples/examples_set/mips/default_instructive.json # RV32 -DEFAULT_EXAMPLE_SET="examples/examples_set/rv32/es_ep.json examples/examples_set/rv32/es_poc.json examples/examples_set/rv32/es_ep_native.json examples/examples_set/rv32/es_poc_native.json" +DEFAULT_EXAMPLE_SET="examples/examples_set/rv32/es_ep.json examples/examples_set/rv32/es_poc.json examples/examples_set/rv32/es_ep_native.json examples/examples_set/rv32/es_poc_native.json examples/examples_set/rv32/es_rv.json" jq 'reduce inputs as $i (.; . += $i)' $DEFAULT_EXAMPLE_SET > examples/examples_set/rv32/default.json # RV32 instructive DEFAULT_EXAMPLE_SET="examples/examples_set/rv32/es_ep_instructive.json examples/examples_set/rv32/es_poc_instructive.json" diff --git a/devel/test_jshint.sh b/devel/test_jshint.sh index d4aece6d6..e614d9e4b 100755 --- a/devel/test_jshint.sh +++ b/devel/test_jshint.sh @@ -42,10 +42,11 @@ echo "checking sim_sw..." jshint ./sim_sw/firmware/firm_pseudoinstructions.js #jshint ./sim_sw/firmware/firm_instruction_v1.js jshint ./sim_sw/firmware/firm_fields_v1.js - jshint ./sim_sw/firmware/firm_fields_v2.js +#jshint ./sim_sw/firmware/firm_fields_v2.js #jshint ./sim_sw/firmware/firm_instruction.js #jshint ./sim_sw/firmware.js jshint ./sim_sw/firmware/creator2native.js + jshint ./sim_sw/assembly/lexical.js #jshint ./sim_sw/assembly/memory_segments.js jshint ./sim_sw/assembly/lexical.js #jshint ./sim_sw/assembly.js @@ -107,7 +108,7 @@ echo "checking wepsim_web..." jshint ./wepsim_web/wepsim_uielto_compilationbar.js jshint ./wepsim_web/wepsim_uielto_console.js jshint ./wepsim_web/wepsim_uielto_cpu.js - jshint ./wepsim_web/wepsim_uielto_cpusvg.js +#jshint ./wepsim_web/wepsim_uielto_cpusvg.js jshint ./wepsim_web/wepsim_uielto_dbg_asm.js jshint ./wepsim_web/wepsim_uielto_dbg_mc.js jshint ./wepsim_web/wepsim_uielto_editas.js diff --git a/examples/examples_set/rv32/default.json b/examples/examples_set/rv32/default.json index 5cc56f294..7840d5f9e 100644 --- a/examples/examples_set/rv32/default.json +++ b/examples/examples_set/rv32/default.json @@ -933,5 +933,269 @@ "assembly": "s7e2", "description": "Simple example with fetch, arithmetic instructions, and basic .text segment.", "testing": true + }, + { + "id": "R1E1", + "title": "Instructions", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e1", + "description": "Simple example with fetch, arithmetic instructions, and basic .text segment.", + "testing": true + }, + { + "id": "R1E2", + "title": "Memory access", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e2", + "description": "Simple example with fetch, memory access, and basic .text/.data segment.", + "testing": true + }, + { + "id": "R1E3", + "title": "Looping", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e3", + "description": "Simple example with fetch, branch, and basic .text segment.", + "testing": true + }, + { + "id": "R1E5", + "title": "If-Then, If-Then-Else", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e5", + "description": "If-Then and If-Then-Else.", + "testing": true + }, + { + "id": "R1E4", + "title": "Vector", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e4", + "description": "Simple example with fetch, branch, and basic .text/.data segment.", + "testing": true + }, + { + "id": "R2E3", + "title": "Masks & shift", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e3", + "description": "More extended example with masks, shift, and basic .text/.data segment.", + "testing": true + }, + { + "id": "R2E4", + "title": "Matrix", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e4", + "description": "Extended example with subrutine and matrix.", + "testing": true + }, + { + "id": "R5E3", + "title": "Array of strings", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e3", + "description": "Array of strings.", + "testing": true + }, + { + "id": "R2E5", + "title": "Simple stack conv.", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e5", + "description": "Example with simple stack convention.", + "testing": true + }, + { + "id": "R2E2", + "title": "Subrutine", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e2", + "description": "Simple example with fetch, branch, and basic .text segment.", + "testing": true + }, + { + "id": "R2E6", + "title": "Fibonacci", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e6", + "description": "Fibonacci.", + "testing": true + }, + { + "id": "R3E1", + "title": "Interruptions", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s3e1", + "description": "Example with interruptions support: fetch, RETI, and .ktext/.kdata.", + "testing": true + }, + { + "id": "R3E2", + "title": "System call", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s3e2", + "description": "Example with system call support.", + "testing": true + }, + { + "id": "R3E3", + "title": "Exception", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s3e3", + "description": "Example with floating point exception.", + "testing": true + }, + { + "id": "R4E1", + "title": "Int. + syscall + except.", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e1", + "description": "Advanced example with interruption, system call, and exception.", + "testing": true + }, + { + "id": "R2E1", + "title": "I/O", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e1", + "description": "Example with programmed I/O access, and basic .text/.data segment.", + "testing": false + }, + { + "id": "R4E2", + "title": "SC 1, 4-5, 8, 11-12", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e2", + "description": "Example of syscall for printing/reading integer and string.", + "testing": true + }, + { + "id": "R5E2", + "title": "3D-Led", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e1", + "description": "Example for 3D-Led.", + "testing": true + }, + { + "id": "R5E4", + "title": "Led Matrix (movement)", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e2", + "description": "Example for Led Matrix.", + "testing": true + }, + { + "id": "R5E5", + "title": "Led Matrix (colors)", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e4", + "description": "Example for Led Matrix.", + "testing": true + }, + { + "id": "R4E3", + "title": "Threads", + "type": "Extra", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e3", + "description": "Example of threads.", + "testing": true + }, + { + "id": "R4E5", + "title": "Side-channel attack", + "type": "Extra", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e5", + "description": "Example of side-channel attack.", + "testing": true + }, + { + "id": "R5E1", + "title": "Dummy instruction", + "type": "Special", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s6e1", + "description": "Test example.", + "testing": true + }, + { + "id": "R5E2", + "title": "IEEE 754 (32 bits)", + "type": "Special", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s6e7", + "description": "Simple example with fetch, arithmetic instructions, and basic .text segment.", + "testing": true } ] diff --git a/examples/examples_set/rv32/es_rv.json b/examples/examples_set/rv32/es_rv.json new file mode 100644 index 000000000..68bc899db --- /dev/null +++ b/examples/examples_set/rv32/es_rv.json @@ -0,0 +1,266 @@ +[ + { + "id": "R1E1", + "title": "Instructions", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e1", + "description": "Simple example with fetch, arithmetic instructions, and basic .text segment.", + "testing": true + }, + { + "id": "R1E2", + "title": "Memory access", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e2", + "description": "Simple example with fetch, memory access, and basic .text/.data segment.", + "testing": true + }, + { + "id": "R1E3", + "title": "Looping", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e3", + "description": "Simple example with fetch, branch, and basic .text segment.", + "testing": true + }, + { + "id": "R1E5", + "title": "If-Then, If-Then-Else", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e5", + "description": "If-Then and If-Then-Else.", + "testing": true + }, + { + "id": "R1E4", + "title": "Vector", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e4", + "description": "Simple example with fetch, branch, and basic .text/.data segment.", + "testing": true + }, + { + "id": "R2E3", + "title": "Masks & shift", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e3", + "description": "More extended example with masks, shift, and basic .text/.data segment.", + "testing": true + }, + { + "id": "R2E4", + "title": "Matrix", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e4", + "description": "Extended example with subrutine and matrix.", + "testing": true + }, + { + "id": "R5E3", + "title": "Array of strings", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e3", + "description": "Array of strings.", + "testing": true + }, + { + "id": "R2E5", + "title": "Simple stack conv.", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e5", + "description": "Example with simple stack convention.", + "testing": true + }, + { + "id": "R2E2", + "title": "Subrutine", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e2", + "description": "Simple example with fetch, branch, and basic .text segment.", + "testing": true + }, + { + "id": "R2E6", + "title": "Fibonacci", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e6", + "description": "Fibonacci.", + "testing": true + }, + { + "id": "R3E1", + "title": "Interruptions", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s3e1", + "description": "Example with interruptions support: fetch, RETI, and .ktext/.kdata.", + "testing": true + }, + { + "id": "R3E2", + "title": "System call", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s3e2", + "description": "Example with system call support.", + "testing": true + }, + { + "id": "R3E3", + "title": "Exception", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s3e3", + "description": "Example with floating point exception.", + "testing": true + }, + { + "id": "R4E1", + "title": "Int. + syscall + except.", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e1", + "description": "Advanced example with interruption, system call, and exception.", + "testing": true + }, + { + "id": "R2E1", + "title": "I/O", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e1", + "description": "Example with programmed I/O access, and basic .text/.data segment.", + "testing": false + }, + { + "id": "R4E2", + "title": "SC 1, 4-5, 8, 11-12", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e2", + "description": "Example of syscall for printing/reading integer and string.", + "testing": true + }, + { + "id": "R5E2", + "title": "3D-Led", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e1", + "description": "Example for 3D-Led.", + "testing": true + }, + { + "id": "R5E4", + "title": "Led Matrix (movement)", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e2", + "description": "Example for Led Matrix.", + "testing": true + }, + { + "id": "R5E5", + "title": "Led Matrix (colors)", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e4", + "description": "Example for Led Matrix.", + "testing": true + }, + { + "id": "R4E3", + "title": "Threads", + "type": "Extra", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e3", + "description": "Example of threads.", + "testing": true + }, + { + "id": "R4E5", + "title": "Side-channel attack", + "type": "Extra", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e5", + "description": "Example of side-channel attack.", + "testing": true + }, + { + "id": "R5E1", + "title": "Dummy instruction", + "type": "Special", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s6e1", + "description": "Test example.", + "testing": true + }, + { + "id": "R5E2", + "title": "IEEE 754 (32 bits)", + "type": "Special", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s6e7", + "description": "Simple example with fetch, arithmetic instructions, and basic .text segment.", + "testing": true + } +] diff --git a/examples/hardware/poc/images/processor.svg b/examples/hardware/poc/images/processor.svg index 1fa675ccd..409904008 100644 --- a/examples/hardware/poc/images/processor.svg +++ b/examples/hardware/poc/images/processor.svg @@ -86,14 +86,16 @@ style="visibility:hidden" /> @@ -107,7 +109,8 @@ id="path2997" /> @@ -141,49 +144,57 @@ id="tspan4063">Address Bus @@ -200,7 +211,8 @@ id="text3025">ALU @@ -228,7 +240,8 @@ id="text3031">File @@ -245,7 +258,8 @@ id="text3035">MAR @@ -262,7 +276,8 @@ id="text3039">IR @@ -310,13 +325,15 @@ @@ -333,62 +350,72 @@ id="text3053">MBR @@ -416,31 +443,36 @@ id="text3079">C1 @@ -457,25 +489,29 @@ id="text3091">Ta @@ -514,43 +550,50 @@ id="text3107">RA @@ -589,55 +632,64 @@ id="text3127">LC @@ -665,13 +717,15 @@ id="text3149">T10 @@ -734,7 +791,8 @@ id="text3175">PC @@ -751,7 +809,8 @@ id="text3179">C2 @@ -777,20 +836,23 @@ id="path3185" /> @@ -807,7 +869,8 @@ id="text3223">MUX @@ -854,13 +917,15 @@ id="text3235">MUX @@ -877,7 +942,8 @@ id="text3155">A @@ -888,41 +954,47 @@ id="path3163" /> @@ -939,62 +1011,72 @@ id="text3303">Cop @@ -1011,13 +1093,15 @@ id="text3335">4 @@ -1041,26 +1125,30 @@ id="text3343">SELEC @@ -1077,25 +1165,29 @@ id="text3353">5 @@ -1118,25 +1210,29 @@ transform="matrix(1.0001417,0,0,0.77930839,-20.094415,58.087533)"> @@ -1166,13 +1262,15 @@ @@ -1189,7 +1287,8 @@ id="text3439">C3 @@ -1327,15 +1426,17 @@ id="text3483">6 @@ -1383,13 +1484,15 @@ id="text3501">A0 @@ -1400,13 +1503,15 @@ id="path3517" /> @@ -1417,13 +1522,15 @@ id="path3537" /> @@ -1434,19 +1541,22 @@ id="path3543" /> @@ -1457,7 +1567,8 @@ id="path3569" /> @@ -1468,20 +1579,23 @@ id="path3573" /> @@ -1498,31 +1612,36 @@ id="text3593">SE @@ -1550,13 +1669,15 @@ id="text3657">T8 @@ -1573,7 +1694,8 @@ id="text3665">MUX @@ -1590,7 +1712,8 @@ id="text3673">M7 @@ -1607,33 +1730,38 @@ id="text3679">SR @@ -1669,13 +1797,15 @@ id="path3815" /> @@ -1691,7 +1821,8 @@ id="text3823">KBDR @@ -1725,13 +1856,15 @@ id="path3831" /> @@ -1748,7 +1881,8 @@ id="text3839">DDR @@ -1775,7 +1909,8 @@ id="text3845">Display @@ -1786,7 +1921,8 @@ id="path3849" /> @@ -1797,13 +1933,15 @@ id="path3853" /> @@ -1814,19 +1952,22 @@ id="path3859" /> @@ -1837,7 +1978,8 @@ id="path3867" /> @@ -1848,13 +1990,15 @@ id="path3883" /> @@ -1865,7 +2009,8 @@ id="path3903" /> @@ -1874,7 +2019,8 @@ stroke-width="0.03px" d="m 641.86661,167.51097 v 63.43231 h -1.60343 v -63.43231 z m 4.07774,59.38584 -4.87956,7.85768 -5.04287,-8.02098 z" inkscape:connector-curvature="0" - style="stroke:#000000;stroke-linejoin:round" + style="stroke-linejoin:round" + stroke="#000000" sodipodi:nodetypes="ccccccccc" /> + style="stroke-linejoin:round" /> + stroke="#000000" 1 @@ -2048,7 +2202,8 @@ stroke-width="1.00002">W @@ -2123,13 +2278,15 @@ id="g5295"> @@ -2156,7 +2313,8 @@ stroke-width="1.00002">IOR @@ -2167,7 +2325,8 @@ id="path3875" /> @@ -2236,14 +2395,16 @@ transform="matrix(0.85999684,0,0,0.86176366,104.19746,31.454579)"> @@ -2342,25 +2505,29 @@ stroke-width="1.00002">D31- @@ -2384,7 +2551,8 @@ id="tspan4426">T11 @@ -2462,19 +2630,22 @@ id="tspan5205">N @@ -2502,19 +2673,22 @@ id="text3007">Control Bus @@ -2535,7 +2709,8 @@ y="582.60175">28 @@ -2556,7 +2731,8 @@ y="257.81976">RT1 @@ -2577,19 +2753,22 @@ y="249.36784">C4 @@ -2600,13 +2779,15 @@ id="path3543-7" /> @@ -2620,13 +2801,15 @@ id="path3745" /> @@ -2637,13 +2820,15 @@ id="path3751" /> @@ -2684,7 +2869,8 @@ id="path3763" /> @@ -2695,13 +2881,15 @@ id="path3767" /> @@ -2727,7 +2915,8 @@ id="text3775">I/O @@ -2743,7 +2932,8 @@ id="text3779">IOSR @@ -2764,25 +2954,29 @@ id="path3787" /> @@ -2793,7 +2987,8 @@ id="path3797" /> @@ -2804,25 +2999,29 @@ id="path3801" /> @@ -2833,13 +3032,15 @@ id="path3811" /> @@ -2850,7 +3051,8 @@ id="path3899" /> @@ -2991,7 +3193,8 @@ id="path3543-3" /> @@ -3002,7 +3205,8 @@ id="path3185-1" /> @@ -3013,13 +3217,15 @@ id="path3537-0" /> @@ -3030,7 +3236,8 @@ id="path3569-8" /> diff --git a/examples/hardware/rv/images/cpu.svg b/examples/hardware/rv/images/cpu.svg new file mode 100644 index 000000000..08421afc2 --- /dev/null +++ b/examples/hardware/rv/images/cpu.svg @@ -0,0 +1,2230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +53232IRWrite + + + + + + + + + + + + + + + + + + + + + + + + + +WBESEWOutDMRDMW + + +Word/Byte BEWDataRWord/Byte BEWBE + + + + + + + + + + + + + +Sign ExtAluOpM231 0'sM34RWM1M4IMRPCControlUnitALUInstructionMemoryInstructionRegisterOUTMUXMUXDataMemoryByte/WordSelectorRegister FileImm. Gen.PCWritejumpZNWAddrAddrRDataR01111RDataRead Reg 1ReadData 1ReadData 2ControlSignalsRead Reg 2Write Reg 2Write DataIR[19:15]IR[24:20]IR[11:7]MUXMUX0002ZZNN diff --git a/examples/hardware/rv/images/index.html b/examples/hardware/rv/images/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/examples/hardware/rv/images/processor.svg b/examples/hardware/rv/images/processor.svg new file mode 100644 index 000000000..08421afc2 --- /dev/null +++ b/examples/hardware/rv/images/processor.svg @@ -0,0 +1,2230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +53232IRWrite + + + + + + + + + + + + + + + + + + + + + + + + + +WBESEWOutDMRDMW + + +Word/Byte BEWDataRWord/Byte BEWBE + + + + + + + + + + + + + +Sign ExtAluOpM231 0'sM34RWM1M4IMRPCControlUnitALUInstructionMemoryInstructionRegisterOUTMUXMUXDataMemoryByte/WordSelectorRegister FileImm. Gen.PCWritejumpZNWAddrAddrRDataR01111RDataRead Reg 1ReadData 1ReadData 2ControlSignalsRead Reg 2Write Reg 2Write DataIR[19:15]IR[24:20]IR[11:7]MUXMUX0002ZZNN diff --git a/examples/hardware/rv/index.html b/examples/hardware/rv/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/examples/microcode/rv32/rv_base.mc b/examples/microcode/rv32/rv_base.mc new file mode 100644 index 000000000..f8b8c0511 --- /dev/null +++ b/examples/microcode/rv32/rv_base.mc @@ -0,0 +1,471 @@ +# +# WepSIM (https://wepsim.github.io/wepsim/) +# + +begin +{ + fetch: # IR <- MP[PC] + (IMR), + # Decode, PC <- PC + 4 + (AluOp=1010, M3=01, M4, PCWrite, IRWrite), + # Control Unit signal + (CU=10) + +} + + +# LUI rd,imm Load Upper Immediate rd ← imm << 12 +lui rd inm { + co=111111, + nwords=1, + rd=reg(25,21), + inm=inm(15,0), + help='rd = (inm << 15)', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M2, M3=10, AluOp=11111, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# AUIPC rd,offset Add Upper Immediate to PC rd ← pc + (offset << 12) +auipc rd offset { + co=111111, + nwords=1, + rd=reg(25,21), + offset=inm(19,0), + help='rd = pc + (offset << 12)', + { + (SE_IMM=1, OFFSET=0, SIZE=10011, GEN_IMM=1, M2=0, M3=10, AluOp=1010, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# +# LOAD/STORE +# + +lw reg addr { + co=000100, + nwords=1, + reg=reg(25,21), + addr=address(15,0)abs, + help='r1 = (MEM[addr] ... MEM[addr+3])', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M3=10, DMR), + (REG_W2=10101, RW, CU=11) + } +} + +sw reg addr { + co=000101, + nwords=1, + reg=reg(25,21), + addr=address(15,0)abs, + help='MEM[addr] = r1', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10101), + (M2, M3=10, AluOp=11110, WOut), + (DMW, CU=11) + } +} + +lb reg addr { + co=001000, + nwords=1, + reg=reg(25,21), + addr=address(15,0)abs, + help='r1 = MEM[addr]', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M3=10, WBE, DMR), + (REG_W2=10101, RW, CU=11) + } +} + +sb reg addr { + co=001001, + nwords=1, + reg=reg(25,21), + addr=address(15,0)abs, + help='MEM[addr] = r1', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10101), + (M2, M3=10, AluOp=11110, WOut), + (WBE, DMW, CU=11) + } +} + +# AND rd,rs1,rs2 And rd ← ux(rs1) ∧ ux(rs2) +and reg1 reg2 reg3 { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + reg3=reg(15,11), + help='r1 = r2 & r3', + { + (REG_R1=10000, REG_R2=1011), + (M2, M3=0, AluOp=0001, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# ANDI rd,rs1,imm And Immediate rd ← ux(rs1) ∧ ux(imm) +andi reg1 reg2 inm { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + inm=inm(15,0), + help='rd = rs1 & inm', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10000), + (M2, M3=10, AluOp=0001, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# OR rd,rs1,rs2 Or rd ← ux(rs1) ∨ ux(rs2) +or reg1 reg2 reg3 { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + reg3=reg(15,11), + help='r1 = r2 | r3', + { + (REG_R1=10000, REG_R2=1011), + (M2, M3=0, AluOp=0010, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# ORI rd,rs1,imm Or Immediate rd ← ux(rs1) ∨ ux(imm) +ori reg1 reg2 inm { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + inm=inm(15,0), + help='rd = rs1 | inm', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10000), + (M2, M3=10, AluOp=0010, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# XOR rd,rs1,rs2 Xor rd ← ux(rs1) ⊕ ux(rs2) +xor reg1 reg2 reg3 { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + reg3=reg(15,11), + help='r1 = r2 ^ r3', + { + (REG_R1=10000, REG_R2=1011), + (M2, M3=0, AluOp=0100, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# XORI rd,rs1,imm Xor Immediate rd ← ux(rs1) ⊕ ux(imm) +xori reg1 reg2 inm { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + inm=inm(15,0), + help='rd = ux(rs1) ^ ux(inm)', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10000), + (M2, M3=10, AluOp=0100, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# ADD rd,rs1,rs2 Add rd ← sx(rs1) + sx(rs2) +add reg1 reg2 reg3 { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + reg3=reg(15,11), + help='r1 = r2 + r3', + { + (REG_R1=10000, REG_R2=1011), + (M2, M3=0, AluOp=1010, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# ADDI rd,rs1,imm Add Immediate rd ← rs1 + sx(imm) +addi reg1 reg2 inm { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + inm=inm(15,0), + help='rd = rs1 + SignEx(inm)', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10000), + (M2, M3=10, AluOp=1010, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# SUB rd,rs1,rs2 Subtract rd ← sx(rs1) - sx(rs2) +sub reg1 reg2 reg3 { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + reg3=reg(15,11), + help='r1 = r2 - r3', + { + (REG_R1=10000, REG_R2=1011), + (M2, M3=0, AluOp=1011, WOut), + (REG_W2=10101, RW, CU=11) + } +} + + +# SUBI rd,rs1,imm Sub Immediate rd ← rs1 - sx(imm) +subi reg1 reg2 inm { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + inm=inm(15,0), + help='rd = rs1 - SignEx(inm)', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10000), + (M2, M3=10, AluOp=1011, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# MUL rd,rs1,rs2 Multiply rd ← ux(rs1) × ux(rs2) +mul reg1 reg2 reg3 { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + reg3=reg(15,11), + help='reg1 = reg2 * reg3', + { + (REG_R1=10000, REG_R2=1011), + (M2, M3=0, AluOp=1100, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# +# b* +# + +b offset { + co=001100, + nwords=1, + offset=address(15,0)rel, + help='pc = pc + offset', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M2=0, M3=10, AluOp=1010, M2, M4, PCWrite, CU=11) + } +} + +# BEQ rs1,rs2,offset Branch Equal if rs1 = rs2 then pc ← pc + offset +beq rs1 rs2 offset { + co=001101, + nwords=1, + rs1=reg(25,21), + rs2=reg(20,16), + offset=address(15,0)rel, + help='if ($r1 == $r2) pc += offset', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M2=0, M3=10, AluOp=1010, WOut), + (REG_R1=10101, REG_R2=10000), + (M2, M3=0, AluOp=1011), + (CU=111, MADDR=bck2ftch), + (CU=11), +bck2ftch: (PCWrite, CU=11) + } +} + +# BNE rs1,rs2,offset Branch Not Equal if rs1 ≠ rs2 then pc ← pc + offset +bne rs1 rs2 offset { + co=111111, + nwords=1, + rs1=reg(25,21), + rs2=reg(20,16), + offset=address(15,0)rel, + help='if ($r1 != $r2) pc += offset', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M2=0, M3=10, AluOp=1010, WOut), + (REG_R1=10101, REG_R2=10000), + (M2, M3=0, AluOp=1011), + (CU=110, MADDR=bck3ftch), + (CU=11), +bck3ftch: (PCWrite, CU=11) + } +} + +# BGE rs1,rs2,offset Branch Greater than Equal if rs1 ≥ rs2 then pc ← pc + offset +bge rs1 rs2 offset { + co=111111, + nwords=1, + rs1=reg(25,21), + rs2=reg(20,16), + offset=address(15,0)rel, + help='if (rs1 >= rs2) pc += offset', + { + (OFFSET=0, SIZE=10000, GEN_IMM=1, M2=0, M3=10, AluOp=1010, WOut), + (REG_R1=10000, REG_R2=10101), + (M2, M3=0, AluOp=1011, jump, CU=11) + } +} + +# JAL rd,offset Jump and Link rd ← pc + length(inst) +# pc ← pc + offset +jal rd offset { + co=111111, + nwords=1, + rd=reg(25,21), + offset=address(19,0)rel, + help='rd = pc; pc = pc + sext(offset)', + { + (M2=0, AluOp=11110, WOut), + (REG_W2=10101, RW), + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M2=0, M3=10, AluOp=1010, M4, PCWrite, CU=11) + } +} + +# JALR rd,rs1,offset Jump and Link Register rd ← pc + length(inst) +# pc ← (rs1 + offset) & -2 +jalr rd rs1 offset { + co=111111, + nwords=1, + rd=reg(25,21), + rs1=reg(20,16), + offset=address(15,0)rel, + help='rd = pc; pc = rs1 + offset', + { + (M2=0, AluOp=11110, WOut), + (REG_W2=10101, RW), + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10000, M2, M3=10, AluOp=1010, M4, PCWrite, CU=11) + } +} + +pseudoinstructions +{ + # nop addi zero,zero,0 No operation + nop + { + addi zero zero 0 + } + + # li rd, expression (several expansions) Load immediate + li rd=reg, expression=inm + { + lui rd, sel(31,12,expression) + addu rd, rd, sel(11,0,expression) + } + + # j offset jal x0, offset Jump + j offset=inm + { + jal zero, offset + } + + # jal offset jal x1, offset Jump register + #jal offset=inm + #{ + # jal ra, offset + #} + + # jr rs jalr x0, rs, 0 Jump register + jr rs=reg + { + jalr zero, rs, 0 + } + + # ret jalr x0, x1, 0 Return from subroutine + ret + { + jalr zero, ra, 0 + } +} + +# +# Register naming +# + +# ABI Name Description Saver +#0 zero Hard-wired zero -- +#1 ra Return address Caller +#2 sp Stack pointer Callee +#3 gp Global pointer -- +#4 tp Thread pointer -- +#5 t0 Temporaries Caller +#6 t1 Temporaries Caller +#7 t2 Temporaries Caller +#8 s0/fp Saved register/frame pointer Caller +#9 s1 Saved register Callee +#10 a0 Function arguments/return values Caller +#11 a1 Function arguments/return values Caller +#12 a2 Function arguments Caller +#13 a3 Function arguments Caller +#14 a4 Function arguments Caller +#15 a5 Function arguments Caller +#16 a6 Function arguments Caller +#17 a7 Function arguments Caller +#18 s2 Saved registers Callee +#19 s3 Saved registers Callee +#20 s4 Saved registers Callee +#21 s5 Saved registers Callee +#22 s6 Saved registers Callee +#23 s7 Saved registers Callee +#24 s8 Saved registers Callee +#25 s9 Saved registers Callee +#26 s10 Saved registers Callee +#27 s11 Saved registers Callee +#28 t3 Temporaries Caller +#29 t4 Temporaries Caller +#30 t5 Temporaries Caller +#31 t6 Temporaries Caller + +registers +{ + 0=(zero, x0), + 1=(ra, x1), + 2=(sp, x2) (stack_pointer), + 3=(gp, x3), + 4=(tp, x4), + 5=(t0, x5), + 6=(t1, x6), + 7=(t2, x7), + 8=(s0, x8), + 9=(s1, x9), + 10=(a0, x10), + 11=(a1, x11), + 12=(a2, x12), + 13=(a3, x13), + 14=(a4, x14), + 15=(a5, x15), + 16=(a6, x16), + 17=(a7, x17), + 18=(s2, x18), + 19=(s3, x19), + 20=(s4, x20), + 21=(s5, x21), + 22=(s6, x22), + 23=(s7, x23), + 24=(s8, x24), + 25=(s9, x25), + 26=(s10, x26), + 27=(s11, x27), + 28=(t3, x28), + 29=(t4, x29), + 30=(t5, x30), + 31=(t6, x31) +} diff --git a/images/author_juanbanpar.png b/images/author_juanbanpar.png index d65d3f2d15f0f79fe93cb8cac2c5a3b77bfebdcd..fc9e3e32e6ece06209b2e2d0e86c440d8e6e7ab2 100644 GIT binary patch literal 14413 zcmb7qWmp``*6!f$8rLBrtg4#71965Iy{3mSq;aQEOIf=h6hpux!y2o8e`ce3|B z=ljmN&;4<$=IQCxU0vPpT2;%co|d0}0Ps~5lobF72mpW*yaJxK07mk@j`je6x;lUZ z005u^5D^FgNboZRcm+f{0+9bY2LM>${{R3|KEnUp%}4y#T?Al0(!bBe|1^B+0}!Ai zh$8@z5EuZ61PDk32u}k5T6n)G2!EA7jo<|d5g7pmfQp8Wfr$lg(2oy5K!RUGLPkYK zLq$eM^*}%bAQ2!F(xdPbG2o+0YYPxtxiO-J&?U-{6zB-nGg?I(ZIe51M?XL z8#{-HsF;$nilLFQiNkBhH$J|8{t=N;(J={W=^39g^Giz0$}1}Cnp;}i+BgJ=l@2z3Xp}%4)MrCJq!*5MrFJ};lY%ntK<05jlr4pqHn4#x-BnO4gT+{c8clvVCc4% zLv5#-Q;^=8%PDr}`tXzP#$&*k^YXXEshoedYmT?(MnLzZnX_bAX6(BY<5kMHRsU5< zG%tJ#Ks#e!?SxpJ(|L$ccU+_5)Hm=qa0=Ig{j`{4a&F86tkzuS#x3$h<3#Z5l%s`fgD zy@yUMwzu3dExcG?3vllL&;H!0!B|$<8CWmpB_BOwYoISI!e#H>O8(tq@AIz&A9Wi5ISyAZ~6ScYmd)^ z!P|?ePu|(-FJN(NeougWcW)y}=L?$1ca&dn3&RJhD~t*~gXy!aT@JdU4?1l2ue}U% zvV*P;bDe&gff`#@U;gj@T0R@w(}R2l?;;6?7d#G|ggbK#HH^OROgpGYeUZ??QZ-@W z)Y`|C8K{(`?MRzCFkB~ba3TBRL)>cipxZLzz0&f(Y5~VC!9#3li{0SD;pex$8-caX zzGaN&6E|5RW`SyJUu#~Os9K?VStt&51%FQi-|JXgIHz+XotG=6jZZ?|e z;m{^f@|QFB<+xcqf57O`)=SQqP4S?qcnT2(6rYhp}}t_=lM#@_yjd!?ksXI zt1j-21d&T$*0-&a|20W;j3q}wv*~ra58cx5j%Yl5mg^@P=h8}#pvOdC^ab;;)0%4q zeT*Ao()t=!-#L|S3Ab*)ZN&Lc@%}~C*u1}@rTKBB8#8ly)8aJMq)xMVbWA;m`=Q80 z{5iY+l-WMb`^-zcBW{1+yXe)G^Z%6Vzhs=eACx)FErGHV5oB2Wi1XHUGxudqz+3nI zoSB8ke46bK=_b&|=3};wJl&C;Rv(uC!t;+3aNfyOxG;EsAd#m|y5QUx^mCKUKl4%( zGUnuDp|P%)!}@Yj@+Hd6%jvr=+vAS9{~QYcP`K&itJ=1p$?mTQol}~hoR%BZ+tR<% zd2p}1YKwn92kayXA>a#~Kl>V4c0eknF{yu;{I>bOY9^LJPN7DHv*=_Jomx_i6vOfJQDe$%&>Jo$OoEj#&XwJPe>>k8Q+fh;=Bg5tS7 zep8x?PaobkzOsxJ2&v8v)7jUu6QToT##Wvx8SwtlX%R={=ByrB9?HItwQv7gnDp7> zeW?_3RHB{+p_R6Bbc}&Yr8P@8T%V)EttJ8r;u8SOEX|<4ILlH?u*~!XQ1Lz>eYE12 znPUJi93}FX-Vdg=lpYMF>x!?RD95yl8r1shWPb^@ahqaTBlAfcTamEgdyzi9!TM<2 zbz8dmT4Sfn{AAW9xs<2Axw@lNihDXgmYBU}1DPEo8nxfgtUAjuW=6~=QK0NmcNs90(_m#ruvcO!Fx32~Q zVu157<_+~i-ggWw=38AnKFqzw6Vd#BN8?=IW;~+F5H!3#vxvV(!`&^ozSs@nB~-I++8A`E7gF*y7#A4mP;IZIxkG z?_m4fTEQ1bR3$50M4go5xbpF1ob+!H(KJ`HB+*MCgqKu$a)k$CsAj&{5gUZz==h7= zrdd3#i?T1wsH*wUA{>toT;9qSeodJTO31%Sq zBw;L0>!Uo~2xT8X>0;-V(egQdI)US_Nb~;Y0R5z)&sx#iUyVvfcitf=f8X9c?uG!# zR%87@BBHI#*q2c!v*ews>gTF*KbbkJIIT3QC!*3lVp#9&1uA&;jeM|42t((#??Km( zWv_6O&Y73N<(;xYRpJ4w?PZGLJFpiD>F253d`bm(lEx-2g9^vv2_igwnaown?!07P z98o5gZF=4W;?D;rDh-^i_{#?BJziva)?NlpO*S{zCyc#?6`c7rx;dv7_1Ejz-AjbL zTAlySqCUE%{mLbsOkib|=laIlTpk>uf)9t&r7m}eR6Vd8fF(Ta9vgwX`j(7w>u3ql1oR+gLM>2||B7uASNHza2-f?=8eZ#%72^_$C>#K}AO~ z?97gK7wP!~AZUv-K8__658s~c@m)v}MNOAnXb4JL_T+j)WEh4~RAzhDW=>j9@7~F# z#TI{s0})MYtl%HE;|mSgQheqH>F0S%bQMb!X{E#|%#ltilY63KB>{j9b@=RY;!z)z+KtF<;|tT3=YKY!V*A45C$C0~r^(-!a6+0qqrQWy{&Q;_(^vZJFjr=@hA_z9r*&T;6(s#2Xo zZ;AWab02n%KW@d*SG^*xZs*MQ`ML|T+HsNu|%Q|t2o0+!;+?7EL_LkMtz%9hQ61=sTLZp zq^e>zN?6>Nt&;)$xI%zz0m=H}xz_vgGf7XOYpNk#8)V73aOb`BptatQCW7Y_Snrek zVhG+=U>e?4`XOs?s#v%E{3QGgWp&M#Fn>;wCXUz(S3h{ZySSN}l!Erk07@@kvo)Vz zgjt-Rl29U}?R$LU;Wi@msfTc5rqa660r9{DAOF_`-d*LbM|PCfn~=)o=Dw0=ggRBq z1I`xK;qSP8>{M3iOrxU_g+$WBsDSejEmhMKd8ZEJ3n>!&7i~SD@Xt9l&-t5%hNf_= zSFM!exLm6~HkbuzRf;_UDs0o@1xib_*oR*Kb`~{Di&PP+qmV@?2|dqW**UCrEhT{! zCMozT4r$BRQK+`9%4F`aacJZVp(0_}C>ZJ@JGix5?H-x`m}`0040F#HW&TxzzT=wP z&0i#CqsYaUZTi+pc33Zy&s;OMEn%at-uAB67&P_NrmSdGczO4lOly$Yb`75 z7;MgyF&nD!w<7{3&ULTUhW(!ae3B253IVL`yi+6KFRefG>TEhk*+Y>-NLK|88ey)1 zQ-4`!cq|V@xDzq~)*-weIz}i>#?J_{(8KZ#I|PU(r90V+ru`&rRY7c7rrTONBiQqkw-716R=#yJ^xRX;rP8nCe) zC)3NP=M|BE%ETd0VVG7CdNE_yr?AtXS1MA-3VozW2+4Sr9k|#dSSLB}(z5FQ4mK4@ z^V`5vHbQ*&Y8XlvNM&D2_0XeBmXd-a8fzy>lOFxfABv=ZDP6dn?aaq^&|so@+IGGZ zyf=}&miov^KV+1{MHkWQI36_rsHPafy!TN&u(&5qkhT@l_ezy?St-&_`C-=dqR~Rn z&k>!wxMbqCt9)yiyZ5u`5^(!&`P`X{^;vVpy-iy~+78&1P=XKgl4&5?otEmWg4q+` z^<#_xW1qX)Bkf--gl9zHEPO%Te~svvW-%g|__i(@f0!A1*B~z6xvRiCalL(SwS4aw zZIdu?9tPF``xRsU&VD=0A+9+qNzS5og4agC_ew471X<;~8xtk1LJ+yH11I;FM5b>o zudH~CMV-GXQfLBi7MFPml*ah5GPfC`GQTW)9j9Jvd#@Y1NzNX-sh zW+ra22$TBa(`1Aa(nuh?E1`EUMee&kJOMCl_R?}GTa@UUgz|PTySnAhGcwZ5!WpIa zMD_%G++;296g;q1ezwU5egBO`6)NOln`0JvVZ+r zA!RWKxOLZf5aG7s$=F!>0Mz;^5*?w%|0`5F;{ETYScgz3cA;VppUvtGZ3$Rv zfR=5T;1c|gUx*6);}?o$N>)WZ0VujRY3rF`Pk<}QtdzhGu@Y(7d2knIg*4-QL&lV- z1ukwPvf`OnnzDmoq3Wy{-kxNB?YZI|uRIs%5R%MprLCqDgjt0C1yTE6Hnv)IYzy|8 zU2{(Jo^fpdJV{M=H}mjn=@?d4SuT;=@n9YmsC@4mDV37`OWT4~KPgh%m6)8rI>zt4 znCT4bby8nKem-dUu6%V>Ir>Khux+$?=|XTK1&jffRR=m5mPqzo#i9KQbi?%TE=o^5 z4_dKR-7Zgsq|0*)mOVz%l*lle*OYZI=5nCVm`Nm5ZJJ0`>auA{EZo@6zjyi6Rbq*q3$pdVkU5cg-IQC zWfgV~wt?cci4PRhNSLF^0O!M-ohoB5Z_x&q>d~5m4$v%w%T|tdVYs=0k-thpwG)ak zsqpSTs<<(d1|nU0el`!S4V#w4hG!wu;}nV#fvF^0=O)kT5O+j zi2Ae7zy4`PRgLU9pDtTCGPXNi;s*C2q_5i+Uv>dMuT`et#*bVwKED%XW>&@6i3q7+ z`$!dB!$HCv+hruLjFw)2O;}@%ha%>8)2{=xD?wNB)vHYPKGfu}9qTL7>a&-Qb~t@7 zs;L&8dq`_g%%bJJq9EDFA-|L=No_^*_op?$a5(uidG=K!T={jg_*~xB$rE$W(wyqdFpI)|q-wfaez7RN$t= zp*)C8+g;*ae+dQ2!A-@k$W760;NDS`6hN}X@zft&;WR2A=;k56OQL=AdY&xb5b-RN z&Wd$aF(Y%%*P?gxAgTsf8p8nEy8JOT9C(SF&7HH#nq99#;keV4}e zAr>_oxL_w=9+?D2MZdNv3!=E;2|s)UFT|9Un3>5+R_oQ_=2XIX)!BwvVG&uNy{=J`*p!uF5iROdRCXxeG7 z6h6#1h+i;L)8yt&=zoeQIfa5N4#n9MZv^^SQNJ5V4ul-;i3m@e3H#;x`cQ z%IbA0Lld#q6*jwAe7A|#T}03)6`Ekd7gfm%{&SC})P0H#0HJ#bV;t@BY;$InSpboTm*7-T>7kQ~4J^^oQ0GKKXlZ!mI-XZQ(F+OaRo5E{sS)(GSIK-I z8hHfvJafJ48ta!%QU$^iTBJ=~k{8?@#x^&JL5d-1ZG=?Mz)s8`%%xeceC+}v&ny8l zbS+8=S3sYvU*b;yuUmRUc z{msTFz|1PM>-Vl&Zxz3Y{)6EK>z6pggUKAw*I)2DD${9jkmQV6FuyLB-Cn z?qVA|t}_j#;P#d7QE9zZB(1&`B!dSL4>BoXCgS!`4eoao*jH@n0L?}Aw#tqVzQg_1 zE$as0ml${gs88A?i?YLIQE5QO_4IF-poPBWT61@G-+rwsr8P&&E6 zcs|+$vP*Ccxj9dogWaC=!Nk$dnX5>~z5Y9+Cjih;BGU_f4jPjsDSTUq7>^j0+#}lQ zN-$$C4otO_K_f2v8kdX7FKA!pS?D2&_vbs~8qWNt9y_>@k9BEdB{7K*2DPF$e%{2} zC`_~sG%{9Tf(LoM)tm3b*?d5;=$-nhBF@UW#=>38VH3Dec^{j z_Kc5g)^X=lvRn4wF2)s!fUt-kM7W^6@dh2w<9gLOONL1mX*syR*}LL8b8R#+h8eSn zBl2F+61Y&Cf@`xca9*MD@aKh=mgzOXjwI)M+q1jki1X!c#h5l7x#fuf2az%ul6A^_ z1Ef!HMR>_GRs?TKnBRj|_JJd<$88hNgkT*oP3b`8j$i6Z%G7m@l^N5ThbHk{runE& z*HUDqRjSO2TRl74((QZ@HeKNGT_azJVow?T!2nwhm#w_W2QvG#l|3ODa377cvZe4x zBboD9z8TO0F60$i%qS02=`8}yY_T846)hyhd@~CO3ttYC5dIG4HX`L@F>IP-QwDRA zDoc1s^=1NM)bEc{3j`W;VGFug1(5Pgv0YQSz?#qDImPrC6N&c2xWz)B_y~@C;dAIv zR*LQ&m*lql2t!Ur@Qy=HTKiVaZ#utPQcceF4E8IEfoLuS;gPmwHFK7SVz4*hz7w{& zKzR%2;x+)L}J;b zjnPD9c$Tuf)y20nH5-;b8XO;+>Zd)0yj5brxCiH6en0rQ8)}6MxEsZvOo1e0nAlT8 zoe|1Vl%lL{hpK1sN4#ftdp@N_qrQ;!G}X{Y7TMdatk(V(PwCMvDv5K9kT0{{7_-0s zioVYDVHvHxz80RQxWlrg(fkP-G8wy~Y=t3Hb5M+(NmgV0xNvZlm?rO3@xtNlP~`~D zE|vuEt#zlbb2{7xR}oEI&cO99X`Nv?*e-9+zJi+CvK=x>EX41#roihgnwu8`4p&A&wK zEKRO{Sge7^@C#$!6F@eTn!<*+TwAGd-cu$Xe9;Kp6JHqHZ&KpY@}5&nx2freY-fY} z-dOrZ9k2<&#wdW?@$jdVD+&F=7h%lI5a)z?!=#a^OmpxC>)?nvS~u_o9rl@d{!!y& zIU`nj+=qzJ+fA&byxiI+K(VhIGRWr%U_S;t{3)f8MNG6+UJ!@06dV8P$4NoK7aOWg zyVR4yE*dNXIQX#hs5cEb?+NCFeo#x8$78$_;^_feECeUJK|c!^Nd|ECIB-7P7wzLx zX?D05pTWxAXf(-C5^i!U;A*7UUJwJS7nO=w?MEqLe8e>iILet8fAFmz=P?*SD*nFx z*u{$;pw|86yV8-`<0jK>8`DANn;gB@lfXyjS~1T^9BCs8wzdL}eY*S@_w`Bn-o&ca z^NKLmiGBAA&}BaM@`hsC_~9V`1?3aqryQP6=kvUT0W`9ig#^aEPE}H*%p?r)H!CT> zw2F7$@a2d+0U}IZO@22WwY~69aJ_;*0|t=rC3!ke1*OsDZ#c{KZC|i7^A9rCXt?+k zMI^HVV=AHObvpbsz(?MuqDM}0*L8O4)Fg6RLTG3FODa-h0qcRw+kBm8gDyd#Q$_{XPI_uIm1%+fLV4I;X;|*#CGw(cv z#^kxcX0mXkM`WmoUmW`3t%G3+7|jKTUnE@+Q)uQ&b1>cfRR>TT1|`J4USxxyj~m+X zFbZUo){Bg^T{#G$>%xBm!2M{T%6quP4EU!e$Qn45e4175pp^VG^QOut-*lWvo&cwS zvG=MR6=(haN6`HwhQaLu`F*$<$sgW5ZnroK$Z|2T9{iY+MkDXKgh{iA>DcxJm{i?s zK<@Qs1tvcMJj1X#>WTBq>kU_?J~)!HQ2`%@Grqq8ugY!^zE+&fB~{@(E?9pl*Oe*T zD=JbnnxdC&wr5p*2nu*}%z8eQ^#l-w6tVAuzwvs_ei|eO_s~88$m42<-n@j*GVJA; zo&`=qcr-73v9?^VR(b|v8Qbys24zdm0%TD$y9RVFADz}1hNizsJ%Evee{@cZ*BO~{ zv9|+ZL^~7j^b3T_Yf0tEP81*Bq-41#2|WQ4o49mJ?yh6#PPw4YRA8K27Zj4kPk!An z)b6uNXLD!x01f$|zdCsXUvXLb=wt@tMXIO`K{z#kh2J{}JYIURqT|lbkGU-C*?J!j zUHAPuoB9NZ^M&(~77F*<{%0{B|F5kN00v*Rzfb-g5t*6jFU~FhxqzTo`z$TBGFIwu z8sVkIt#_zBd>#LTi+~>Y)4yYXafV{uFqT2N)Tx zW4}ff`t+W5jP5zUOgAeqb)`4_~CqQs4R#wIjlnS+v z&n9h#!H+Mj$W_krgj}k^KIHCrCR05D_HoP_xIt4uw#DxY1y6uciuXgjN^Z)dt2k$Y z6}YOxT>Mk8m)cu5QB;0NOt)PFl*le@4%mWl8C$k9{gSp^V|dpHcVBOFM)DbRk(8K{ zd%G~_p8#iqo3=Qgw|hf8lCZ`=rRc%%5wYz6cWb#^MVj8JIS((nx<pexwLL0 z6$A2Gp8%xFS9uE`Pe4OVzF24(10%O$Es*V&m9kK}nguwd;79t)Rfw-8zEict4kOcK zS&UDY&B)Bs6M!*)ubj&``4eM5W&1}48dVEerp?d&_FA?aJYibQw33&g`-N6~YHJ|>r7Je}p$#|00dL*=CUy_Ra0IoL< za|*;2XSzNy-PUC)9%Zr7QGhQrc%slqSNA_`A)~=nMjjp!US2hIX~LNx*8Y70hWmH8 zN+kKH|K)R@Kxa^8kp06Pb+N>h0-UQ9Cz#|7(3VxM_EQn?8AU!*Q;R^rsN>h2BqKEV zB8EJ@pW6jrN_)2I9*B&+siyyVQ;@#Q1QI{{RBwJP8-?s+umBgR?1Oaz~KXc zFQ+d07#-*5&KqL~z5(w}@`Q=(C6uX{OotdXVI9t$7i6}`kYiU>@ZGeV5X)Mtfk)Tt zS1wNg)@bgG<>(EE+_FJ>f><6+%G0^tN_#c}d}KHh9et zHnaK!6}MR|yxxAViuVNOiD z-+n`b7{W{%;(R^t`+_No8DvgJ?to<2OS+)*3yBmR8S-xdR=n*-)P=rcZD${o0;=E| z^zzekgI|HJQSydsJVu}a+i3w_0_Qa?3IqACPoQF;wY^Y~%_B-xMQ<_gtZu2RJ$H1q;6Ew}Jw%A*%IAN`G%E#gfFW zU*k3flG23piK69ZIm$|8reJ7vp)dNVtq$lq2&G zWEs9sxuN42x!0K zFOpMnAgU=t zc2~V1c_puQxwVZ~EWv!Ku!;0=Uz|X4yjZ}Gt=diET!1IQ5(un}K+L8p9)>i;bD0ku zKm=DUxj(ROLLZD9@ag=Ofx6&mPC+8MLmS!egDF}N|Hg_W!E-k|dfAN2Wh7sn?yk`} z^bJtQ*PG`?$7M9)r^(PFDjlXgSX91l-hKu$5wjLhF8nva`oNtc($a!KBQuhkfqeL^ zW;%U91eWF1!{;!rAJm}O&3&N$5L!e( z*aOrMZC*tvjj-D=ym4l!yh!tgT(x_F;qa|;St7119`wpYuK$CU;nHqwZtyRX4X0<= zd9e57x>g}1zHImPr-&JNYxnU{4WDyp7E2OPekQe*hRa7a5D`oPyNSJIe8o53M9}4G zN&p*zAPc;LJ8T47SkuXmDG~d$TTg&ko#-N>cG`6wt)sJTi$Q_JOpmi41;&-Xyi!4;CIVn8dBr_1;Gt_qnZq;Zh|AXZ~Qj)8If3NMCzOoS>Z9@S4e0I zJ*S)m^3-*sgWV@L=t-bCA`}S?(&j6ibzz6jGc5V2oy`Repgl0~Q|(D1%KKPB9{1Yj znPjnj1`~F~(1;}eZGCk#Ra`poO97!;y6ekhU%VqQ7;-VSn15y`4T|9@->V%d!I#vk zxPVo+Pbo}YJ0{Wv!xgGPRpNLA)XkC#1D6;lNZbhW=aP1R7CNx1I z`j!vKcxBCMk4py@jt(aE)kNC{J~zz#fFcgnIFgbGcBn!G*cwYZQ(?-|9<*KZ;_`AmkMc{`&=?ThIFMp*Dqo|xpWnMTMQQ9@Gc?wdzAKT~IYl(e6RD@q(vWW9`w21Y%a(_7 zMQkNYdrlKvmC6ouf99XAN;5Bw3!Z9C!G-=pD&#`sagdmJ>>~#LJ?2j)RIZUHz#ic} z_?8&r^BiIsW1kYAU@EN(?+~pKj2QD7`+8|* zFb-F)<*O2D8=_+0SkHe%Cdp^6l#uFQH<1x%^`@YfXmyOtzs*jXk1PttwluE)l`@e6 z+!39oq}=wc6BkO|wSDBE^5CdpEhSpSf9tG_;b-yqs2hW?dSxYNh8)RH8xJy+3>W32 zq!lFY-F=NWo_%Ez?7{~Y0B0MI8p#_&Z_a3mzs(U%pdeQ<8$$Buh=4+O0nJFe(icXl z&$6Cx*`hyiWUi7&i!yy|>uP0)k4RLcoGZ9Z%1_NM=SVCd_o`P%k|@V#-HUfKCWyv0 zN|Lm@HvY!uHp;#<2v={1)Js%TSm8gOEl0*vLhIWS5Rz7gZk1vj+CEz&MSbOcVRZI}@so_III0qVm)(#go@gf(U*nV$` zZTae1z!x`qJw3?T@f!;?jl7O|kcK;S7`USh&Qls^vy8mjd*TAZ3~PiS<%fAs;%9p{ zkJ49mVd+jG-7*amBmMVRx zNn^&rOO@KH#S*_EiQFl=0+xvpQK+n4z zL>D5XuIv&vt)M)p(xL+6GJKW@-qWrM?Z7|HxT(7c_$6T;Z#AV=(J!hvA_)?iqi@TuH>5;-gvc3yTwCS&>ChY4PWMlvhrLF5RJ zrq)VZNe(%YGz{b$Qb+txqoFvW+K4GA5<;I4%#$WDDs^8J zHG}oYw|GL2ilm}8LZ#&khWy*--A*3DG2ObG}FQu@z3w4Hy5G_EUu(k z5E-IYMm`=|q3_ps_H$)Gorp79NRe`1T}B)B^~k6ce65j`~qA>{O`cSFOZT&PV)xT@B1fHU+6HQa=tS* zdjwTnki8)rP-ngpH^77zM5pf$9RxTUyq2+dRM=PivCBHI=cHj)8m#hR^ELohjf)T} z`AQ_T)|{;!qh1_jq%-0F0b4Qc)Yq(*7WU!H8>2r*7WT8|nKwg6KaYo;E}=S|BfDTO zyYp`YJCY=3F+T7YB)&eV)je(IcS&n^;#pobYbK&Qj>m+sDPT0(b{U(ywaD1RZU=I4 z;HSr!AcyZUXHxGPd{i?`uc*PEJ-|o0eWjj#Dq2wBJbE?K+|cco<9oZkn6A2FPX{6B zUhK45^7P15$DT%NJw8R)%>8S7Tg(XZjpUKrPFF6c4>^8iCCf@gC&Hh~_{demZ%6li z9Zd7Ic!M(VjwK$|H;6-(PLc!YuR7&dLKp|KCG1{cP-Jfal>9zDdnATWk6Glknc_q7 zE2hT9C@R3a=n%l< zN=(|O-^uipPjY>@GLmCPNn@SzOT}i6g4?!{_zC1~T(dzDxb&kNISiL^X(wcnNKs&{ z`*{CVHS*^Ep<0vs4I;IH+CNkh|u}DBGb2lUJFyb0y-daaNx3KcsNeu z=_$x(44oPY@5-7clGp<-2ffeLNxzjf=?=-;lIKQ#7AUhfMCo~YwD2=<=yC~Vu>@Zv zJ_4VMNvUTm2c?Y$Yfoa^1uAuWgZ2q$-0+qP?awOFW z0Og5X^yL8e3RCZx!g>OM4~|_+*8QP61Seydu;9}TnL6NbW-{8yc9c?CLU~A9G0OWa zNWv&)pVVIG58FdL>5J9gb0azg0DLD0%XtV{-NT}`uEcy%WJJl*(PxAkrBomc0iNV% z{D3vWIHu_GTpr-^!gkO%o)vns&4dUK`LXcc$PC`Z^q!uZrIlTZPzrezVBpnn*W*hb z;W-E?4G%6Dc%qDb#M?U*g*TRr=}zB;bt1@=Y>zYPV%Q~DZF2clh_GfIB<~OQny8g~ z7nBlp9a_5-H-K-mI5^y)&AutnGQtbBF+QppfeV{gfE!ct9lsp3V%Sj#6BYoYiF!lL zxZ4HW(asJT4{yz-kG1l*izwNxo1)0Dsd>e@hc2o}WiH<;dZ80k`mw8g?0F#0Z{2g? zj*wCJ$|9>`FHzHqloAtUc9PZBfdq$@RvI32XL>Uw~^`g^Amum2kzcy zab~S|{|Gzh9m55w=y?#VxyEB@KSQb-sD;J9@C>6@12M7T`fPw#2zYFMh1%m_w0|fqEL9cf zuR73Y>oe4YhgI$7KJImmEPDbb(#RHo__!wy?>-1+h#mR zeWq}o9+H|%GT2lWJ*>3U8@O}eY-(3T(_}itIS9*iW#PJI;ij)MUUmz6O<#Crc#I`I zxc>tKaBFFNmcf4iTez_kd|jEeXyE_Q%6;rcrNvaki6rXU|*x1u3V}(G`~4Lm0mQL4t_& z_yT}reX1@w$-B2)d2FKZhcwudb5Hz@BS&qWXMNJiT&yp8Y(9ywKNwV7e!gyV#NOS1 zo0N559ee z$L7Q8Zq=rMq{mmYdzQvuGo9EAhn_VQ5BNG=4e96X9S?g=*>MApcNahBQM-T5-tmY! z-A_hV6*mu`X1ktbwS~Aw{s$Itx2D?pf ztM-H2{sRO6syO6&UO7KvU`vl-?$&2kXNEt`EWSgd9kt%kU&@ZF4kAy#H0dAB9Mda0 z&9E*x;dFC(ku@Cs??C{7lklylU2y3WP9(-5q{mkq29Mo}JzzOEKWcc{mO*t5>kjgl zy5d^zz5vowCJ)>#>f6Uw!xhK>?BTm%=_PbRz%UBbgFZk_K zuQC6`G9K)qeUxGC)yy;1V0r$$yXgDB#6i+dJH7yLZlUrzws{yu2W0y`f7n7?aje)l z-|GrDRp68qY-Oh()(lr90=U-hKqUT`FmPYC>E;Q?_2KJO_BQk4q27~RzB_L*8}4;$ zKk|#{1(9=Yigyc1?uMi1wc+SQ^X1+D`gEec^d~A35o*jA-hF&LFD=>)Is{SNOpe`b z84lK_xqVaNNH=mFPWKhtCvN2h4Q8V-1w}aHB#Dv#**uV7V+eK`rgdwShEeG3W)7~X zIwpDY2`8(|eflc|Pyc3B0<`K+6)9^gjcf6Rs}DZ9CQc5!gJA~;ZU4gX{&Ld8Fa_(G zdI?2%btUm{NZ>f4bhOrTm5o75Yci>y2BA?X#?_VM(*&&f(zEvyy3SOo={o7~n)f&| zhO-qM^v#zy%}v8FmeCJMg|tOai4?jLO4U*%h8fyavzclD0Ha=*iWG~oH_ebybBffu zceAkZaQvwLu*M?3jvJd~)k6AlHEtkZq_^Tgg0A_kJLOwn$Fc;YagVw;5=#|gyKi$N zv=VKZj}}G-^{#XWXrPvqkgm zZohf{wu4Jdgt1MVqWyUn$Ag78ME-DP<%1giAfq?vQc@wMa})ZeU{dql7%h{sd4hRq z7Nx<>0Vh5VoA*$RvDzdZ>cP50!q3W4Ld-k4AWk%@#3B35daJX3IqZS2KsHy|79}2jUfOO z3<((#g$SGxm6(BF4g!skgh_yunT$oy?%PU2ej869FyJr1U7xe|LiJw4bG@^wPF{Uu zMT}>z$qbON3Rt55do~aVcrt*Wx!)&w3u*HfAsO|jf*G2yS5Tr;v|M|H*e*PG5y@(5lcl!f1&>C&r!T;&1$#E zuxLMv${nCNi;`4qW9%KFAa$QQFO+CzfY=1>cng7{s%=FN_a-&>J1!T? z;PoHzv{Y*ZS9R8bcc=<;PN)=4%R+PKpB<$yjlYKD)VeOq{Nq;y| zntM5;@`Y6-ZMdhdabO5ok!-~Nup#JpjP$B|F&iGxRA-6T=wB1>Q1UT@4_k2F#3pZQ zpD+-a5TzU2q2*f6@l0=i{v*}4XEy_4rqa@vpDLFMjT|7~M0r0xO^@3o%1>FXY_?72 z<#Gl!r#Cw4czUy%3F1=U?RiEo&r@)0tQp)}^T}izE9o>%HA*+G!%91Npls|RP5PF* zUiF-8!|LkDtVnvb6gP{C7sS!+riS#D5rDaq;@SN;Pr!)QoS56~a;Xs;B(; z*tk`{0K5~8V3w62ll_0MQ}_+@Vg9yxl6SPU`IZfI!(@~`Ph#F>VOhKlir`2rK?0V; zVy{p}e&>nhd&RA&4FG0(!85TF%w}tJi-DZepyTWi|aJ19zU(K9^vS6)LvJH&VS8d)Aeq4VAGhOiuzO{^=Xo zR(b}lqwcU$)dqd76;j-Gsa{UtbtRdBw?y4Qw8Pl(qVwG(pI22P2VT&~jiZO=B0z$P z3QMQk{;T~rH!U(s1lL9h&Oe{KQ^WGEx~TSMZ33GwVVIW6C`F)wJ3}1m?BBJv2k_*q zmucm=-onVXf0_OE)dk59H&RDGMmOK58lyA=5@`~fw6|OjEl?w_dDN;%vic2J9BX+J zK1=tY)2z%squQ4r;Z*>GUjAjh--@!g#fcAJp;3_$Fpd_3&fxR~&>c>z-mN}#rH;*A z?5>`(Nc%hEw8&nq%<0JRlS%_ZTkO{*No$$?-4JPQdpx%Z9?kCnHv(y+MTpnHvuuq` z?7w;6i!yFP$7gZXz-B$>35E!$I+W8MSJz>_7$p6O$t~jvncEiTLTZ_FXP@Ui_lC25 zk?>Iykw#LDS~6M$;eQy>6^X1LJ2V>GvUNV8S9(YN&^)WM9m^Ja=~(OvRHfQ_O;=o! zH7lJF!u1WtK7sQoF#Yov*IdNV{_gNjP4cL<<;43lw?H0`VDAc%yXZAR_&WE@(u0Q- zpX9VW-Zmg*yV#Y2VWp(QGi|X&cQ2<{C9^PlA*87dL*83ontv`Ux?zG)=Gq~vHFmLm zIqp4Yki_Y?F+M~Si&voTEo9|l%$4O?B;V!FxG^wSkl|Ooa)wOvg|!Wo{j;jyb#g7y zEz8=Y$O?gcj5seJxsAN#`4Dpq)d;WvEiey+CSdGxblIZ*<*@5 z;Op>yN{)K6?T_Xa#nymB80rd&6ne{Zx6|LUz6Shw=Q9M_&@IN$VnS*`xqg(DeVlQl zaA`{R&RYHgKywUsDPt|q>Wer_co5yc!};Xl4Txp@hJcEWzS|Lrm%ArmozBBC(xGYQCp5$h9@2+HaG+gJLg8u)-dPpQMx!nLaGd*Nx_ zere79P~16VE;TZW8Wq}f;|*Gg>`Y_dd%IONia=*HVWTn7(^RlH@0N8~TZu&S^P@oW z3ky@=&hdb_Yr}V8J625C?t~j`L*iQ`bF_IUK6oH$4ICtLaAn1*-A|~emQTVkcWs5$ zF@Hx^i3641QOwL}Ksi)VkQoVZ*eDH0`eXH)&{43pi&u`TTBR0d-|bH|SZ%Zv*`_#W zr<1%o%(o$VyOl>{lBVokNID$?7nS_;8c^ zG172_#x|9}7*C%!V7;r5QiptC;guHk9`AuxlGs6IamR*&LdVAQ%XU{}?}~V%iGV76 z&Ib>>^<=Pmux;{T-{q&bm$*_Q8<7svMr|YY;u+s?4D@_(Xp;G~*k}K@#wq`$@o$BL z{+G7-c2bcLk%<@>3Hb#;QHYrYV1ARr5g9Grc?fgJd?H7d-S%>1eq4 z)mB+OcW~qt8y)ct%b3zmF@l4SC(aUM2$vda2rxS_M~V<>R$dMDKgqmhWSVO zYT1dNPq=*u!KCCAq(HjZ96Y>@CEkya=FM065gboNM#mkMnW=!H5c)tK~ ze}reNne1^Da|#y*6+h}eW>G_nx8v8`shR2*QBI8A7M~KEUpwRiEP|DBGt=RRX;k^= z-5lMTd@j}2H*<(CQhlL?edW&S_DP3QSTHv3lzkl&HE2H z3z{F)Wm8sJP7(E7PZl#_P!42MZH@vNRWjA5>Y{GCLhnPW)MsO-B20qEi|J@Sn%olP z=ft0uT2&>1mG|P9Ak{OV4)bFKpFOElGbyhiIch>qytA@2ZYj#V>4=3MbwSHrM`crJ z_SIiy5E~5p_o7o@1JHgr;{IHFm=2dBx4>UHBQ-(vD8dqbQ|@~XCQRef_I5_Fa^@=K zcM1}_xo)(G5T_N%Y(lUdg}7f;YLhT@hul_kT;umkQ{cD)ja)YH5;;O6&xoGC+y29A z>@2WW-Jt#kla!tfJ#>b`VE|@!`vtJ=2A2oylK;}K07v}AP=+!n5e3zxBE)Z7T1x?DA)55WkaLeNZ6$QVpHt zDU3QdCTTGnb=@L2sh^W|G&A@VKMqmpt>`b4q?&t^9bh zbnT9ibtf6B!k*&b0)wE$%OV;zw+_M$M)=ULr5?pSfkQW0kH@JN_B+6~#cePYD#D!u z`By-q1&ape*UXE8Hm`gLXXOmf3HqYDGH%+2p%xD~mp`O55aCw)BHUV5KzRa!t)bb8 zMc?Z7Z9#%EjEL4#-?up@yBC>d}$9y-92*=;nfHq?sK`+Qp?Sf~G+N zl;$~1;Pp{8hB$Uic4!J+wGeITiQG5@y9_q>%u_Sh9H?<{{5H{Mta=WrHu1&eJDoR8 zg60coV#()}d4&nDC}hz>&=zD%5?nHIS$l**K{C~S2rCxfV}II7uaI+6UTE3&TAe&X zlp~lSjUt{3DuHso;AC8zAYs?5Yn2iibx`+JVlY?WxE+^L+{w(gamlGqRZvURwNJvT zpLI{_WmIa(#t-8zVW^LcF{k)A^81y#Q>Xn^PE^_n)Jk&BY7(48uWYArcW0zbVwXYL zASaPyD%hfM7GzGcw>nOT!?K9Z7W0-Ve$UL3eu+Lzi8!dfzR8apryxhN$h^C6XrLb1Ef)I`Hfl zEqS*&Krycs(jbKU+}v^F+&u9#mS&E0*lWWxNFoZasE7Vrdfv7rHRB+f@L89WdVL9V z4`VXsxd!y(zI<)&d&( z+2Lr*Nz2K#iTDBH)ENTOwV9`UNvm12t#XVx{MM45zELo^99bLgTa zZKqtN{6ZPuo;~}AyoO5xmcAa}@*9y(RC&w2T2KtqxI^|4aS`0mIn--H%I4x~X2$Pu zu;voQ5R!5-bDSSoHLiAS*g+=GaM?d8uJ~_S$mWwvH}no_kJ#}v1PCSdqEi;xRWe5# zEFi>6zW~_#!6*B}geCs?75Na^r^+4U&K&0Hj9&niY@(Ylz#>iq)~y^yK2Ak9;C@- zKLP;(kcb!s5aspl{RsKv^6KPzXLoNHZvP>(_=vs$hrYCy%X#6wTf?WmY^5B=pTF9- zx8=jnBV}9e@jW06Pd3awPpGekoR1K8CgX88aVS*HJasQ2?%TXiYJooCe~W|iXRZ4n z8v5sK9C4CgzNMuB-H}{F$-fIxAgHY>A9P2&4K7}VzfPmn`3#`@ZRpY}V*(=feZPE(?igs+UyNz?5swPj_CA# zvu~kZO`blHE*)(xOG-#U)2}w_=P$@z*H`w%kGjH)pbV^baA|ykElHj8>vJw$5ivV% zDSrSpt2CeG<97r!QzGZgu*!Hr#7&mBOiCr*6N>L8Bs%25Q-)_hO0J=9|1#X#Gt~3h z={LJFl@hBbJiy8D26R-AA3g3d>u9zj6{+ia|MJ^94JX{wi}@Sca>WIq9IWN_6p-8i zj)1)9vQ_N>$7w+lw&A;aCid(sf6#onVlRJXzMiECr!|3{Cy4GvvWVOo4U+UIFTLi+>c@z%6t0|Vq zwx^Bcq5no7_S;gXJdh;+YAV8XobbM-mo_1daqo-e?I8pGAY(GUAn#FYvd5Sgtilt+ z(aYpF*=0E)a9w_eRWHgPuF!1h367xPz@6aG~P+f_%zgx5q2 zt?M=YU^$fH8TqT12{)B{D{uqrE@)}5@&?zH$^isZEQM^AvN{GG`OMW@_re%^h#v!D zo8KCK(K;D+ox%cCLX2C8G#KOfr!hXNSs0w~5LWL`e*k@lYvdnz_wMtjz?l(`Num2( z^~I`o8>AX`pPPZ}>bk?!h4#Ee%PWDzx#r1JF$hX@T39th7t7U^DLIp>!I_PWXD@5%N^=3OO*o zBYk2>!O+(jtrQXCDbq^npv~uUP3!c|?wrC16-*A`4EpwXJBD_E4pC`1;y8E{Pw9Yzk< zXb?xM|8yQlSoAzYFeNsZAa;p6(hqKWIB7)lnI+PPln#%&5KJ$58os-vykAsAHMBj!NhkH*I(qD11}2*pTc6@LMqC_6V_qWAT6@&M04_4DNw zF3HXNp?{6lpFC_3J;N6N=EM`bVmUJ;wi^2?iyex*tTp`Z`XpSKAP}0UeIAHNpoe9{ zya&HA-lNJW0tBC3;s8$;MS3tATtQ?aS6!hqQi%`$G&g8Z(HZ>cayfg7nZUI2uUXRd zB$I*L1FQBhwGO3RLO@K#LkA}s1Iiz@M4cclwr27R3bGad*y)2d*?7O|ptW_&cZZLY zswTm|`9b&5jT(9Yw(a-~dbe(i9o zqC?hhbOMtSY0(h2X%ech$he2jox%edfP5{#a_^nMOxMrUhTps^-+MpcgFEpGW->g7 zJW@I&yAeYFK`Oghs5 ztI$jdsmY9{uY6eIC1mAkVoC5DXqlRBJM}&FYechrT&8->lZoC!S$i_|X5?ous|$jQ z(!iC7m(XPYL>1_yQDu&L610cJEJAqHat`vP08%?)zr2%>KeXHe$K@X~deaksuoR*# zW6VTo_*4?kwu-{OSJ6DC(k(R(bVG<@$RR8@h?`7}0D0M{SGof0z+S-p7E$f(7HgE5 zgd;lnOPeZY?PQ;ha=SN(f2{T^0bVGF*RjyFQsuvS-=?FUH5_3Bh3bUA0ax&T!M9*HE$jPPd2^b)__|_8i1SKVb`(euo>F z#*|TQ)bN8K_cPtk9Plmn0?D!a;g+(}2z9|t{0LLpqwMHm${__`Dz?D`R+VC84aj905M@yBN=|;jL zL}TB|_{<(4D+JpZ+7h<)1<1uQPVdEW0+l1WG2xq8HVRK8RfaYh+%*S#x=2JQO{@kwXO z;f=2@KbPmEdHX*044Gm$<_c;y89AdL|3i=fEU=A9WMJgvaUcm&ksboJV`0!?#~U5; zrfEd&fuy|ar#GIE{em;>Lx-$SBFsf3rzJlBep? zX|;J<+L7_2^3&&R!zq)sB$P9ZlMh6}d~~FvHubAE-#3Bu?|du($T!W3ct6ek|5f`D z{_jH*ICEOh^Z$GPXbq~Wd`puw~O5P}x!zbk&vru7P~ zVgY*pN9?z{wiUWJ@~B)7@PChTLmsBdO2r z9Ad-C(iztrdF<*YhV+MNg$;f5xQPM>yE^a@UYi?IN%9xxJrxd(+UV4Vy5BS-1=7Fc zHPG*n?f)?9|BlxX8NMk-Lj5>7`&qxdy55_A*mT4Xb2Q}3el_1gD-lZ+$5pO;v<36R zS0d|iw*Y={EcF#%?>bw0w87%smlV3-0$H8H@D*~nz@)|wj4(5jT7r1CSZF9k#d8X0 zhy{c&K{WMNqY2a!O&6?yAw5K5EIBc5xXDdx2JK&t{&jZ5!uw1G369=YC}jb}UZP>e z#;JQ`)vyg%Ua`MZ8!8pAx?ww0hI4W5p^`qg$Y=#R#8x_acT)}U)G6^0HLNk7&-Hn7 z1_1r2k}5>f@e@!6gh~Q1MWDUH=@6e}Te)8VZ+-iGGMsk5Pz*#myaFucvf}(Q6x}0l zzh%tNc!~i(R5p&JHorLD8$WsLmbwlSc;d3uY_(!flHvNQ4rQhVy*}7ktZ5*B78hlv ztRL~r<1&cz7Zs@GP}mlb78)iBbyQ+TwcfvPDXgXQdJE&IZH@Y>3mkHHlq?jgLSal(|H>%+SCU13rGK^E%J6@ zJ^Um7Y7R|O?~ejq*y5&7G;j2ZT_`#*6n1PWb33V7onRwgRiA!BqC5&S^g#YaM7Gq$ z>lP$1d09t3#`Ay((JS>A7|K*<1c)sy1Q-x+dJ&2>a*|J*I~8myZ?2n2Go{ievI7aq zEqm$F0g(egu(=8ZLuxn<5s(`Xpsn^AgEquK)^NJthE+n120WipqBw?Fkm8+=9W8HA z<#b_Oc{&mrmDY&KQ3%vd8u?`Oz~-NxlLA;XC14$Kz5R(A!FLAKe`i{^>X%@Yj2nbR zVUT}`JlMWMdWc?wn9YmJB9ySme5n2*O+h{fd=H6^(;SnQ|gKD zV;5rW{Hl&zY3bU)>Og+-@nBhFj47D&Ma8j8ywvm$u32Zv{Qi)h;poTTpln37-zQ4_e>f9RAh7?F9Q!|< z$-gL*Z^GmTk^h@BA>6%X_%COI_)S5KA>%0{>WQI;GowzO&^O|I(w@Ru$O%SG1t~7% zP|%-@vfVghCu?=fKM*Tirip1ut;6`wA4NPytaE;wdM!Dxp3b;46Gi4Nn4&%%3;YQQ zV%RA9kOSSDb73b9+7h%#k9dlq@wB~a zcScp=sXt?cg4ZAHowOJsVo3cOE_L@fzLbUjSa@hh`nWa?^`-O$lqjGm4b<-Rm5%WK zAexx2tw!hWT;R*5&w_VUs6b673OH}c>t&WJdijfqNlPKFZ-A`H7zsa$M~;mKjM`KW z?GFQ|Yo*7+>Q>0n*j&^l`39a5VHH)Z`f<^hbI{toR<2||{46z~sU5l+!(s$=2jDy+ z)1LwBkqL0v+jYINiii{@i+J_;s&m9ONiI5w`RDotp*05JajLQ;qjJb^nBI`y?*ep0 z29EF0vsRAuA=!$W=Zj0{46#ZrJZNfRl_^AJS8rQxLBKWw$ssueVd}H`>o-7oQ8u+DxKw;ES8tlR=E4%@A6yrKrzAF zJF-g_DDD>Bxd?Reb~yxgj_dB>@xLFBOO{`w7|l2+yCZ_fl#AF)js{fyhW&3pJcg|O z@yaQ4^JtKe8MQL^nYN2ENP^yyHX^WWSR~n5_-K^6c87ra1K2Uwscm~z#D=dUvmxcQ zqHY!?#meDzh4N}_l5pp)Xv&Tm)(CHDwJMZyl!0?k^8Q?ZPEpm)j!S!gU&&6;d{Pi0j(t=*?z$u4Ui@D`|yVZa0-#d@%@Atn4SYcpCYBGtGel# z>6;NF?LI533y98zN!23`3JS7G0-w{)rmk^KZzmnyDUy|A$cp|A0EfzFL%h?|b^`Xa0y z1(v-${sO2iy$D4ty;; z*W;FQ1zTa}Xa3w%=0lqY2(9nXy>bHHeW^21-rF4Rk$;6Z?C%4K4mgY*A5?5E7H)pK zlng>Ll|pN|ic*G?WwTciMjc#-0kkmGzHs6(bL-oCpz^(@<_})UHPh=J3(%ns3GpCy zP9asW2jikf9O)3W*0K<(a;O}s#K&Y-zv5E6?I270a-dRc_kFS^$}|7qAWB{AkFzas z%v?0*FTjd+yXxX^(+NQ=B_2K0WU^I2aqW!sCsrtf|4@;iH-ftM%Qd^ah>2ku+;@Ue zfg^R7exM0Gtib623AlOLl+6W)vu=*UF0{F6=#x)wqaBw?m`~DGU}0djZ4O_j6C0ru z_`8u~>MV3qJA+Nb zty+3p?JTvOTI7T}G&6=-t=*r7<>*giZ!^Nh6(hGkgvw@LaQ?$DK#lk`G&GNOw@g;W z-^xbBK@bMYnY~G%hzs&4yBdN_G4x58(IqED_jDYp7DUX3Jq1{$5%{*?KiEggQ=El$ z9d3l#DP95r@x)PB?m;R^vykC>Q8f03%Ba%VH*~VokI}J+)JY2O0rZm8bQFHapRYZn z2a@FoTTNQ760~1{1)MX#av+}TGpvRXFr2AS|2g#uBis7D{01XJi$9XPo~Nv;GPUI9 zf~!GbxC3Q$?Hh%Q$E5IoQm9i;k-E4AFkFX-h4jzqC6PpqXlf;HC{F{HfQI>PPax{v zE|;VGLQNkl;7^ZKE3AnVNTMv---MC0Ycx`m9IvTK>I}^4Dy9YOVlqhp!?F&L8x9Fk>UH9H@MFT%;2~(xSCcrqk_1H>9+ zk<(uKAtF1AT}KJ(yMZ+dz(`Rk`ii|v_*iGQ9%aM1?~y?p%}>dP^w8$f(3?_A<(>Fg zL5#_W`25#m_(O4UP%qVcG_e67J3uNdR}c@X%XC=H@C?GKcG55Op1z7!-pgme@)^ z^ONT9Q{j{W=U|r*7?^3wjHM;;!XX~CJ7NUd)lvfi$H}3rqd1#F!D%I;fNwg%A zRcex$)Z37%h3V46{icl4{ROQs0>Y$xeaO;aI(q;10FgueI-aN`<32EbP1Iep|8OMA`e(X71$VC3p)X*;I2S`^F-*&<5#+fXQVaz18Y!_w%u#(}D3X6>#a zTIr!4?u4Q!PcR^K6kG&LqGzMv_MmE#h<_irqJ?+&;pdo?BbQFibvwTDvxhEkeHpe$ zeQe&+2VrDE&%Q!sM|2*}Z3Mas6)FxkwH%`+-5Yp^MGF#Udj6j%b?neFcS?(PQh1AQwyXTKomk?;6x?6D!U{6&CmdPoWFq$!r181GWie8wa5?E zdOh_z-v!{5k@vbE0@}ci_6f_=-xm8fQjD}toRg+M1<(i`Xk_$8jocUimYG&{?~h=q8gXZoWt5-<0R{jny2=0k!=g8r_1HrBzleA z9H3=wM8MQWpW?dZ!p8y64HDRbA4;c<~E z3u)}u>@1Aw;GxCTxM|Z}cIBk`#WI$K0sSexv}%S^BDr|bZLPOfW^o7YehkBOR(5xA z)*Vt7w#i@5H|&t5U!>$LRN6$Rs9Q#h5}K$`g)=n`h$b=`{3)Hm5>|}jkqqA=TEWP>2{nuB%ZOuutW#GG_>8llZq6C zubEDZ@nw}B2S54(oKiC4R)T9c_`jAD7lnBNfp2g)iRPm)eF2oZF|xv@w0pqi=4%MD zj9rAlOsMW}A*}(Q$dQRavA4UQdGlgJ#nu`lP8oVTt)+Qp*8?4Ee%((hRIB9`Q`fT* zqF`i4(;q>RaTwYO_wQxUiTR-;Y7C^swf=qu+tb>Dea&%#RJN}fkl{mqpJ@9aX>)0A zfjxlt4N|y=Zb*^-phb^Qdl-D7%03|D&fSo51`7a94Bqd<{#{VzPR_v*`e5P!;Mv6M zzj%vO?XK;%Tj!yby}m=uPP%vC?9iWR%XK9YaN<`;3xtHDE2=s&)E#QDyfC>0Mf853-D9oaEc6G|-kPN&oC3!UHt>~*;8)ovGB znufsIp((1PuGR5NMIB8@$J zai5;xm&0Aj``vJpCP-TVx8gY`LK|JNB>m^m3zl`!=E7FTQ9FMeu6{&a#DzpX8cF2G z5{7K<)-3`y3ka2`!1M_G*cTwyR<~C#poJm(9p06G*5{7>f zxHGDpYjo-!DM|i%Z#pkjG>}W3(rWhOK5qt$APaE`$K;0rrZ`@?En0IE(5hXncH4D0 z&ksmK#vHSaQq@iq6_($w2+5uUxM`*MrzgGL+qC?YAuTn()M+cylM}?2;Lect3+Q5W zZEM`dm!gxXlnon;I5>MHmfeDfrsi3;1mQwJ`I&{yoOJZt;;ryO4LU?5*i?=J`9*X4f^#us0&-ekF6~nG4OOIW zVvCY8CT6vr?Umd!X(S}O5o>lF25Eh*Q~CN*XLm(1 zR|hc_hF|>LSXUC3;gO#}V^C;FMuIR1u4z-IE7N4*^rl4E}l_K!*?It&3*x-ph$ZF6hBy;-b8U0ph-+c5fIGaDUTFx zB5^7Emvo~j{bU-Td~RecY@b*MxCZ6q7m+0uC&#u6h?Wqghr`um*fEwX^|7TT5F~@s zC(N{(V`-V|KN3jWQN}}abRin(5Y1U+Nuc53XNlLlst+SdWUo4aYzzBKG`3&TA*~yo zLjzr+<>+ELqC^)X<_s>+sb-96j-2$0@?D9ZOcDGp?J@{HcgP4Yt?tqA=yZC=30v`0 z=_<}4D#$uwuB^;dbMX{GPVR9EccTRNp!}FScT>!eYN%mf@6VZkgIZtct`fq-Nx!J! zUzkD$<+3dI25@`#R??S|#+K#$T!m5`!o2E(fEOEPi8X46&C0PWS2xpsI5Ipjgp<U$VyWGtg& zrE>cf!)=iNBrNsY=))-Y(+8;`DCX||y$}mC@UgKoa2IvhQ)mw#c#>uPld3lJ&R-h5 zi5;O>eh3@QAiv2u6_Kr1u4;)9)q_Ad?aJpeAJi@z$&7a*X17Jy+%55(hN zgxF<3jyqcrij95tlKhib>=Y-^-hNaO*-v{Y)w|5@5)HSvs7K1e0hS=u+~tq!cELKo z-9Tr)-~%-;tV^?D`p6*Q4;x6gxi*?hWDJcqfts&bD3t~d8~dH_NNXJr= ztSeLEfzb`BV}(ySKDoX{{3jTHSdJ`v1}H@`(?YF2P9+#*G9e80p0ny&)f7uC$j8UVDBLCvKuJEO)zx0a9whLB4DxSRkW{kN1GSG!)f;Px-4GzK4HTz;Q%fTeRZDNTYe}+lXWz*DJD{q+;e@TyMFEF?Y3d&h_I*yCG zR>xgopabyYF!iF{ldtp>#mp!oJABg8jX!-C#$ahZhtN|b%N!04_yn;GLYe>{Uj6%* zp;uN&ct+68_nfX#BF2Yg=#FfJHEy;Orx<8(J@q)u0M4YOGWChSWeo~vS%-P?oL+qu zIfZ. + * + */ + + + /* + * Syntax of behaviors + */ + + // Print Signal + sim.rv.behaviors.PRINT_S = { nparameters: 2, + types: ["S"], + operation: function(s_expr) + { + console.log(s_expr[1] + ': 0x' + sim.rv.signals[s_expr[1]].value.toString(16)); + }, + verbal: function (s_expr) + { + return "Print value of signal " + s_expr[1] + ': 0x' + sim.rv.signals[s_expr[1]].value.toString(16) + ". " ; + } + }; + + // Print State + sim.rv.behaviors.PRINT_E = { nparameters: 2, + types: ["E"], + operation: function(s_expr) + { + console.log(s_expr[1] + ': 0x' + sim.rv.states[s_expr[1]].value.toString(16)); + }, + verbal: function (s_expr) + { + return "Print value of state " + s_expr[1] + ': 0x' + sim.rv.states[s_expr[1]].value.toString(16) + ". " ; + } + }; + diff --git a/sim_hw/sim_hw_rv/sim_hw_cpu.js b/sim_hw/sim_hw_rv/sim_hw_cpu.js new file mode 100644 index 000000000..6bcb19382 --- /dev/null +++ b/sim_hw/sim_hw_rv/sim_hw_cpu.js @@ -0,0 +1,2924 @@ +/* + * Copyright 2015-2023 Felix Garcia Carballeira, Alejandro Calderon Mateos, Javier Prieto Cepeda, Saul Alonso Monsalve, Juan Banga Pardo + * + * This file is part of WepSIM. + * + * WepSIM is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * WepSIM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with WepSIM. If not, see . + * + */ + + + /* + * CPU + */ + + sim.rv.components["CPU"] = { + name: "CPU", + version: "1", + abilities: [ "CPU" ], + + // ui: details + details_name: [ "REGISTER_FILE", "CONTROL_MEMORY", "CLOCK", "CPU_STATS" ], + details_fire: [ ['svg_p:text6639'], + ['svg_p:path7363', 'svg_p:path7365', 'svg_p:path7367', 'svg_p:path7369', + 'svg_p:path7371', 'svg_p:path7373', 'svg_p:path7375', 'svg_p:path7377', 'svg_p:path7379'], + ['svg_p:text7327'] ], + + // state: write_state, read_state, get_state + write_state: function ( vec ) { + if (typeof vec.CPU == "undefined") { + vec.CPU = {} ; + } + + var internal_reg = [ "PC" ] ; + + var value = 0 ; + for (var i=0; i>> 0; + if (value != 0) { + vec.CPU["R" + i] = {"type": "register", + "default_value": 0x0, + "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": 0x0, + "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.rv.states['REG_' + r_reg] != "undefined") { + value = get_value(sim.rv.states['REG_' + r_reg]) >>> 0; + return "0x" + value.toString(16) ; + } + + r_reg = r_reg.replace('R','') ; + var index = parseInt(r_reg) ; + if (typeof sim.rv.states.BR[index] != "undefined") { + value = get_value(sim.rv.states.BR[index]) >>> 0; + return "0x" + value.toString(16) ; + } + + return null ; + }, + + // native: get_value, set_value + 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) ; + } + }; + + + /* + * Control States, and Default elements at the Instruction Register (IR) + */ + + sim.rv.ctrl_states.pc = { + name: "PC", + state: "REG_PC", + is_pointer: true + } ; + sim.rv.ctrl_states.sp = { + name: "SP", + state: "BR.29", + is_pointer: true + } ; + sim.rv.ctrl_states.fp = { + name: "FP", + state: "BR.30", + is_pointer: true + } ; + sim.rv.ctrl_states.ir = { + name: "IR", + state: "REG_IR", + default_eltos: { + "co": { "begin": 0, "end": 5, "length": 6 }, + "cop": { "begin": 28, "end": 31, "length": 4 }, + "oc": { "begin": 0, "end": 6, "length": 7 }, + //"eoc": { "type": 1, "begin": 12, "end": 14, "length": 3 }, + "eoc": { "type": 2, "bits": [[12,14], [25,31]], "lengths": [3, 7], "length": 10 } + }, + is_pointer: false + } ; + sim.rv.ctrl_states.mpc = { + name: "mPC", + state: "REG_MICROADDR", + is_pointer: false + } ; + + + /* + * Internal States + */ + + sim.rv.internal_states.MC = {} ; + sim.rv.internal_states.ROM = {} ; + + sim.rv.internal_states.FIRMWARE = ws_empty_firmware ; + sim.rv.internal_states.io_hash = {} ; + sim.rv.internal_states.fire_stack = [] ; + + sim.rv.internal_states.tri_state_names = [] ; + sim.rv.internal_states.fire_visible = { 'databus': false, 'internalbus': false } ; + sim.rv.internal_states.filter_states = [ "REG_IR_DECO,col-12", "REG_IR,col-auto", "REG_PC,col-auto", + "REG_OUT,col-auto", "REG_MICROADDR,col-auto"] ; + sim.rv.internal_states.filter_signals = [ "CU,0", "ALUOP,0","M1,0", "M2,0", "M3,0", "M4,0", "JUMP,0", "PCWRITE,0", + "IMR,0", "IRWRITE,0", "RW,0", "WOUT,0", "DMR,0", "DMW,0", "WBE,0", "SE,0" ] ; + sim.rv.internal_states.alu_flags = { 'flag_n': 0, 'flag_z': 0 } ; + + /* + * States + */ + + /* REGISTER FILE STATES */ + sim.rv.states.BR = [] ; + sim.rv.states.BR[0] = { name:"R0", verbal: "Register 0", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[1] = { name:"R1", verbal: "Register 1", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[2] = { name:"R2", verbal: "Register 2", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[3] = { name:"R3", verbal: "Register 3", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[4] = { name:"R4", verbal: "Register 4", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[5] = { name:"R5", verbal: "Register 5", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[6] = { name:"R6", verbal: "Register 6", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[7] = { name:"R7", verbal: "Register 7", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[8] = { name:"R8", verbal: "Register 8", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[9] = { name:"R9", verbal: "Register 9", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[10] = { name:"R10", verbal: "Register 10", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[11] = { name:"R11", verbal: "Register 11", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[12] = { name:"R12", verbal: "Register 12", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[13] = { name:"R13", verbal: "Register 13", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[14] = { name:"R14", verbal: "Register 14", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[15] = { name:"R15", verbal: "Register 15", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[16] = { name:"R16", verbal: "Register 16", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[17] = { name:"R17", verbal: "Register 17", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[18] = { name:"R18", verbal: "Register 18", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[19] = { name:"R19", verbal: "Register 19", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[20] = { name:"R20", verbal: "Register 20", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[21] = { name:"R21", verbal: "Register 21", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[22] = { name:"R22", verbal: "Register 22", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[23] = { name:"R23", verbal: "Register 23", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[24] = { name:"R24", verbal: "Register 24", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[25] = { name:"R25", verbal: "Register 25", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[26] = { name:"R26", verbal: "Register 26", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[27] = { name:"R27", verbal: "Register 27", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[28] = { name:"R28", verbal: "Register 28", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[29] = { name:"R29", verbal: "Register 29", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[30] = { name:"R30", verbal: "Register 30", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states.BR[31] = { name:"R31", verbal: "Register 31", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + + sim.rv.states["REG_PC"] = { name:"PC", verbal: "Program Counter Register", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["REG_IR"] = { name:"IR", verbal: "Instruction Register", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["REG_OUT"] = { name:"OUT", verbal: "Out Register", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + + /* REGISTER PC (RELATED) STATES */ + sim.rv.states["M4_PC"] = { name:"M4_PC", verbal: "Input PCWrite via M4", + visible:false, nbits:"32", value:0, default_value:0, + draw_data: [] }; + + /* INSTRUCTION REGISTER (RELATED) STATES */ + sim.rv.states["RDATA"] = { name:"RDATA", verbal: "Read data form Instruction Memory (Input Instruction Register via Instruction Memory)", + visible:false, nbits:"32", value:0, default_value:0, + draw_data: [] }; + + /* ALU (RELATED) STATES */ + sim.rv.states["M2_ALU"] = { name:"M2_ALU", verbal: "Input ALU via M2", + visible:false, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["M3_ALU"] = { name:"M3_ALU", verbal: "Input ALU via M3", + visible:false, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["ALU_WOUT"] = { name:"ALU_WOUT", verbal: "Input of OUT Register", + visible:false, nbits:"32", value:0, default_value:0, + draw_data: [] }; + + sim.rv.states["FLAG_N"] = { name: "FLAG_N", verbal: "Negative Flag", + visible:true, nbits: "1", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["FLAG_Z"] = { name: "FLAG_Z", verbal: "Zero Flag", + visible:true, nbits: "1", value:0, default_value:0, + draw_data: [] }; + + /* (BLACKBOX) CONTROL UNIT */ + sim.rv.states["REG_MICROADDR"] = { name: "µADDR", verbal: "Microaddress Register", + visible:true, nbits: "12", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["REG_MICROINS"] = { name: "µINS", verbal: "Microinstruction Register", + visible:true, nbits: "77", value:{}, default_value:{}, + draw_data: [] }; + + sim.rv.states["FETCH"] = { name: "FETCH", verbal: "Input Fetch", + visible:false, nbits: "12", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["ROM_MUXA"] = { name: "ROM_MUXA", verbal: "Input ROM", + visible:false, nbits: "12", value:0, default_value:0, + draw_data: [] }; + + sim.rv.states["MUXA_MICROADDR"] = { name: "MUXA_MICROADDR", verbal: "Input microaddress", + visible:false, nbits: "12", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["MUXC_MUXB"] = { name: "MUXC_MUXB", verbal: "Output of MUX C", + visible:false, nbits: "1", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["INEX"] = { name: "INEX", verbal: "Illegal Instruction Exception", + visible:false, nbits: "1", value:0, default_value:0, + draw_data: [] }; + + /* DEVICES AND MEMORY */ + sim.rv.states["DM_BS"] = { name: "DM_BS", verbal: "From Data Memory to Byte/Word Selector", + visible:false, nbits: "32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["BS_M1"] = { name: "BS_M1", verbal: "From Byte/Word Selector to Mux 1", + visible:false, nbits: "32", value:0, default_value:0, + draw_data: [] }; + + /* MUX 3 (RELATED) STATES */ + + sim.rv.states["VAL_ZERO"] = { name: "VAL_ZERO", verbal: "Wired Zero", + visible:false, nbits: "1", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["VAL_ONE"] = { name: "VAL_ONE", verbal: "Wired One", + visible:false, nbits: "32", value:1, default_value:1, + draw_data: [] }; + sim.rv.states["VAL_FOUR"] = { name: "VAL_FOUR", verbal: "Wired Four", + visible:false, nbits: "32", value:4, default_value:4, + draw_data: [] }; + sim.rv.states["VAL_IMM"] = { name: "VAL_IMM", verbal: "Immediate Value Generator", + visible:false, nbits: "32", value:0, default_value:0, + draw_data: [] }; + + /* VIRTUAL */ + sim.rv.states["REG_IR_DECO"] = { name:"IR_DECO", verbal: "Instruction Decoded", + visible:true, nbits:"0", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["DECO_INS"] = { name:"DECO_INS", verbal: "Instruction decoded in binary", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["CLK"] = { name:"CLK", verbal: "Clock", + visible:false, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["ACC_TIME"] = { name:"ACC_TIME", verbal: "Accumulated CPU time", + visible:false, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.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.rv.states["ACC_PWR"] = { name:"ACC_PWR", verbal: "Accumulated Energy Consumption", + visible:false, nbits:"32", value:0, default_value:0, + draw_data: [] }; + + + /* + * Signals + */ + + /* CONTROL UNIT */ + sim.rv.signals["CU"] = { name: "CU", visible: true, type: "L", value: 0, default_value: 0, nbits: "3", + behavior: ["PLUS1 MUXA_MICROADDR REG_MICROADDR", + "CP_FIELD MUXA_MICROADDR REG_MICROINS/MADDR", + "MV MUXA_MICROADDR ROM_MUXA", + "MV MUXA_MICROADDR FETCH", + "JUMP_MADDR_N MUXA_MICROADDR REG_MICROINS/MADDR REG_MICROADDR 0", + "JUMP_MADDR_N MUXA_MICROADDR REG_MICROINS/MADDR REG_MICROADDR 1", + "JUMP_MADDR_Z MUXA_MICROADDR REG_MICROINS/MADDR REG_MICROADDR 0", + "JUMP_MADDR_Z MUXA_MICROADDR REG_MICROINS/MADDR REG_MICROADDR 1"], + depends_on: ["CLK"], + fire_name: ['svg_p:text7417'], + draw_data: [['svg_p:path7391', 'svg_p:path7393', 'svg_p:path7395', 'svg_p:path7397', 'svg_p:path7399', 'svg_p:path7401']], + draw_name: [['svg_p:path7357', 'svg_p:path7329', 'svg_p:path7331']] }; + + /* REGISTER LOAD */ + + /* PC REGISTER */ + sim.rv.signals["PCWRITE"] = { name: "PCWRITE", visible: true, type: "E", value: 0, default_value:0, nbits: "1", + behavior: ["NOP", "LOAD REG_PC M4_PC; UPDATEDPC"], + fire_name: ['svg_p:text7155'], + draw_data: [[]], + draw_name: [['svg_p:path7145', 'svg_p:path7125', 'svg_p:path7127']] }; + //Logic gates PC + sim.rv.signals["JUMP"] = { name: "JUMP", visible: true, type: "E", value: 0, default_value:0, nbits: "1", + behavior: ["NOP", "LOAD_J REG_PC M4_PC; UPDATEDPC_J"], + fire_name: ['svg_p:text7173'], + draw_data: [[]], + draw_name: [['svg_p:path7133', 'svg_p:path7143', 'svg_p:path7147', 'svg_p:path7135']] }; + + /* IR REGISTER */ + /* + //Read immediate value + sim.rv.signals["R_IMM"] = { name: "R_IMM", visible: true, type: "L", value: 0, default_value:20, nbits: "5", + behavior: ["NOP"], + fire_name: [], + draw_data: [[]], + draw_name: [[]] }; + sim.rv.signals["IRWRITE"] = { name: "IRWRITE", visible: true, type: "E", value: 0, default_value:0, nbits: "1", + behavior: ["NOP", "LOAD REG_IR RDATA; DECO; MBIT_SN R_IMM REG_IR REG_MICROINS/R_IMM 5; LOAD VAL_IMM R_IMM"], + fire_name: ['svg_p:text7309'], + draw_data: [['svg_p:path6711', 'svg_p_path:6713', 'svg_p:path6981', 'svg_p:path6903', 'svg_p:path6905']], + draw_name: [['svg_p:path7301']] }; + */ + + sim.rv.signals["IRWRITE"] = { name: "IRWRITE", visible: true, type: "E", value: 0, default_value:0, nbits: "1", + behavior: ["NOP", "LOAD REG_IR RDATA; DECO"], + fire_name: ['svg_p:text7309'], + draw_data: [['svg_p:path6711', 'svg_p_path:6713', 'svg_p:path6981', 'svg_p:path6903', 'svg_p:path6905']], + draw_name: [['svg_p:path7301']] }; + sim.rv.signals["SIZE"] = { name: "SIZE", visible: true, type: "L", value: 0, default_value:0, nbits: "5", + behavior: ["NOP"], + fire_name: [], + draw_data: [[]], + draw_name: [[]] }; + sim.rv.signals["GEN_IMM"] = { name: "GEN_IMM", visible: true, type: "L", value: 0, default_value:0, nbits: "1", + behavior: ["NOP", "MBITS VAL_IMM 0 REG_IR OFFSET SIZE 0 SE_IMM"], + fire_name: [], + draw_data: [[]], + draw_name: [[]] }; + sim.rv.signals["OFFSET"] = { name: "OFFSET", visible: true, type: "L", value: 0, default_value:0, nbits: "5", + behavior: ["NOP"], + fire_name: [], + draw_data: [[]], + draw_name: [[]] }; + sim.rv.signals["SE_IMM"] = { name: "SE", visible: true, type: "L", value: 0, default_value:0, nbits: "1", + behavior: ["NOP", "NOP"], + fire_name: [], + draw_data: [[]], + draw_name: [[]] }; + + /* OUT REGISTER */ + sim.rv.signals["WOUT"] = { name: "WOUT", visible: true, type: "E", value: 0, default_value:0, nbits: "1", + behavior: ["NOP", "LOAD REG_OUT ALU_WOUT"], + fire_name: ['svg_p:text7279'], + draw_data: [['svg_p:path6837', 'svg_p:path6839']], + draw_name: [['svg_p:path7271']] }; + + /* INSTRUCTION MEMORY */ + sim.rv.signals["IMR"] = { name: "IMR", visible: true, type: "E", value: 0, default_value:0, nbits: "1", + behavior: ["NOP", "READ_IM"], + fire_name: ['svg_p:text7213'], + draw_data: [['svg_p:path6691', 'svg_p:path6693']], + draw_name: [['svg_p:path7205']] }; + + /* REGISTER FILE */ + sim.rv.signals["REG_R1"] = { name: "REG_R1", visible: true, type: "L", value: 0, default_value:15, nbits: "5", + behavior: ["NOP"], + fire_name: [], + draw_data: [[]], + draw_name: [[]] }; + sim.rv.signals["REG_R2"] = { name: "REG_R2", visible: true, type: "L", value: 0, default_value:20, nbits: "5", + behavior: ["NOP"], + fire_name: [], + draw_data: [[]], + draw_name: [[]] }; + sim.rv.signals["REG_W2"] = { name: "REG_W2", visible: true, type: "L", value: 0, default_value:7, nbits: "5", + behavior: ["NOP"], + fire_name: [], + draw_data: [[]], + draw_name: [[]] }; + + sim.rv.states["M1_RW"] = { name:"M1_RW", verbal: "Input Register File via M1", + visible:false, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["W_DATA"] = { name:"W_DATA", verbal: "Write Data", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + + sim.rv.states["R_DATA1"] = { name:"R_DATA1", verbal: "Read Data 1", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + sim.rv.states["R_DATA2"] = { name:"R_DATA2", verbal: "Read Data 2", + visible:true, nbits:"32", value:0, default_value:0, + draw_data: [] }; + + sim.rv.signals["RW"] = { name: "RW", visible: true, type: "E", value: 0, default_value:0, nbits: "1", + behavior: ["MBIT_SN REG_R1 REG_IR REG_MICROINS/REG_R1 5; GET R_DATA1 BR REG_R1; MBIT_SN REG_R2 REG_IR REG_MICROINS/REG_R2 5; GET R_DATA2 BR REG_R2", + "MBIT_SN REG_W2 REG_IR REG_MICROINS/REG_W2 5; SET BR REG_W2 M1_RW"], + fire_name: ['svg_p:text7299'], + draw_data: [['svg_p:path6725', 'svg_p:path6727', 'svg_p:path6729', 'svg_p:path6731', 'svg_p:path6733', 'svg_p:path6735', 'svg_p:path6915', 'svg_p:path6913', 'svg_p:path6907', 'svg_p:path6909']], + draw_name: [['svg_p:path7291']] }; + + /* MUX. */ + sim.rv.signals["M2"] = { name: "M2", visible: true, type: "L", value: 0, default_value:0, nbits: "1", + behavior: ["MV M2_ALU REG_PC; FIRE ALUOP", "MV M2_ALU R_DATA1; FIRE ALUOP"], + depends_on: ["ALUOP"], + fire_name: ['svg_p:text7229'], + draw_data: [['svg_p:path6691-3', 'svg_p:path6987', 'svg_p:path6989', 'svg_p:path6983', 'svg_p:path6991', 'svg_p:path6775', 'svg_p:path6777'], ['svg_p:path6779', 'svg_p:path6781']], + draw_name: [[], ['svg_p:path7199']] }; + sim.rv.signals["M3"] = { name: "M3", visible: true, type: "L", value: 0, default_value:0, nbits: "2", + behavior: ["MV M3_ALU R_DATA2; FIRE ALUOP", "MV M3_ALU VAL_FOUR; FIRE ALUOP", "MV M3_ALU VAL_IMM; FIRE ALUOP", "NOP"], + fire_name: ['svg_p:text7237'], + depends_on: ["ALUOP"], + draw_data: [['svg_p:path6821', 'svg_p:path6823'], ['svg_p:path7001', 'svg_p:path7003'], ['svg_p:path7015', 'svg_p:path7013', 'svg_p:path6825', 'svg_p:path6827']], + draw_name: [[], ['svg_p:path7197']] }; + sim.rv.signals["M4"] = { name: "M4", visible: true, type: "L", value: 0, default_value:0, nbits: "1", + behavior: ["MV M4_PC REG_OUT", "MV M4_PC ALU_WOUT"], + depends_on: ["PCWRITE"], + fire_name: ['svg_p:text7289'], + draw_data: [['svg_p:path7075','svg_p:path7043','svg_p:path7045', 'svg_p:path7047', 'svg_p:path7123', 'svg_p:path7121', 'svg_p:path7041', 'svg_p:path7039', 'svg_p:path7035', 'svg_p:path7037'], ['svg_p:path6837-6', 'svg_p:path7073','svg_p:path7115','svg_p:path7117', 'svg_p:path7119', 'svg_p:path7123', 'svg_p:path7121', 'svg_p:path7041', 'svg_p:path7039', 'svg_p:path7035', 'svg_p:path7037']], + draw_name: [[], ['svg_p:path7281']] }; + + /* ALU */ + sim.rv.signals["ALUOP"] = { name: "ALUOP", visible: true, type: "L", value: 0, default_value:0, nbits: "5", + behavior: ["NOP_ALU; UPDATE_NZ", + "AND ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ", + "OR ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ", + "NOT ALU_WOUT M2_ALU; UPDATE_NZ", + "XOR ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ", + "SRL ALU_WOUT M2_ALU; UPDATE_NZ", + "SRA ALU_WOUT M2_ALU; UPDATE_NZ", + "SL ALU_WOUT M2_ALU; UPDATE_NZ", + "RR ALU_WOUT M2_ALU; UPDATE_NZ", + "RL ALU_WOUT M2_ALU; UPDATE_NZ", + "ADD ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ", + "SUB ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ", + "MUL ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ", + "DIV ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ", + "MOD ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ", + "LUI ALU_WOUT M2_ALU; UPDATE_NZ", + "ADDU ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ", + "SUBU ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ", + "MULU ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ", + "DIVU ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ", + "NOP_ALU", + "NOP_ALU", + "NOP_ALU", + "NOP_ALU", + "NOP_ALU", + "NOP_ALU", + "NOP_ALU", + "NOP_ALU", + "NOP_ALU", + "NOP_ALU", + "MV ALU_WOUT M2_ALU; UPDATE_NZ", + "MV ALU_WOUT M3_ALU; UPDATE_NZ"], + fire_name: ['svg_p:text7269'], + draw_data: [['svg_p:path6845', 'svg_p:path6847', 'svg_p:path6841', 'svg_p:path6843']], + draw_name: [['svg_p:path7249']] }; + + /* DATA MEMORY SIGNALS */ + sim.rv.signals.DMR = { name: "DMR", visible: true, type: "L", value: 0, default_value:0, nbits: "1", + behavior: ["MV DM_BS REG_OUT; FIRE WBE", + "MEM_READ M3_ALU DM_BS WBE CLK; FIRE WBE"], + fire_name: ['svg_p:text7589','svg_p:text7507'], + draw_data: [[], ['svg_p:path7525','svg_p:path6841-5', 'svg_p:path7577', 'svg_p:path7619', 'svg_p:path7623', 'svg_p:path7625', 'svg_p:path7571', 'svg_p:path7573']], + draw_name: [[], []] }; + sim.rv.signals.DMW = { name: "DMW", visible: true, type: "L", value: 0, default_value:0, nbits: "1", + behavior: ["NOP", + "MEM_WRITE M3_ALU DM_BS WBE CLK"], + fire_name: ['svg_p:text7597','svg_p:text7515'], + draw_data: [[], ['svg_p:path7527','svg_p:path6841-5', 'svg_p:path7577', 'svg_p:path7619', 'svg_p:path7623', 'svg_p:path7625', 'svg_p:path7571', 'svg_p:path7573']], + draw_name: [[], []] }; + + /* BYTE/WORD SELECTOR*/ + sim.rv.signals["WBE"] = { name: "WBE", visible: false, type: "L", value: 0, default_value: 0, nbits: "1", + behavior: ['MV BS_M1 DM_BS', + 'BWSEL BS_M1 DM_BS SE'], + depends_on: ["RW"], + fire_name: ['svg_p:text7555', 'svg_p:text7433'], + draw_data: [['svg_p:path7075-2', 'svg_p:path7043-6', 'svg_p:path7203', 'svg_p:path7579', 'svg_p:path7581', 'svg_p:path7567', 'svg_p:path7569', 'svg_p:path7421', 'svg_p:path7423']], + draw_name: [['svg_p:path7529', 'svg_p:path7425']] }; + sim.rv.signals["SE"] = { name: "SE", visible: true, type: "L", value: 0, default_value:0, nbits: "1", + verbal: ['If WBE is enabled, set the 24 superior bits of Word to 0.', + 'If WBE is enabled, extend byte sign to Word.'], + behavior: ["NOP", + "NOP"], + fire_name: ['svg_p:text7453'], + draw_data: [[]], + draw_name: [['svg_p:path7445']] }; + + //MUX1 MUST BE AFTER B/W SELECTOR + sim.rv.signals["M1"] = { name: "M1", visible: true, type: "L", value: 0, default_value:0, nbits: "1", + behavior: ["MV M1_RW BS_M1", "MV M1_RW FLAG_N"], + depends_on: ["RW"], + fire_name: ['svg_p:text7221'], + draw_data: [['svg_p:path7021','svg_p:path7023','svg_p:path7565', 'svg_p:path6911','svg_p:path6895','svg_p:path6897'], ['svg_p:path7621','svg_p:path7025','svg_p:path7017','svg_p:path7019', 'svg_p:path6899', 'svg_p:path6901']], + draw_name: [[], ['svg_p:path7195']] }; + + /* Virtual Signals, for UI */ + sim.rv.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", "MV FLAG_N VAL_ONE"], + depends_on: ["ALUOP"], + fire_name: ['svg_p:text7607', 'svg_p:text7185'], + draw_data: [['svg_p:path7251']], + draw_name: [['svg_p:path7157']] }; + sim.rv.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", "MV FLAG_Z VAL_ONE"], + depends_on: ["ALUOP"], + fire_name: ['svg_p:text7615', 'svg_p:text7193'], + draw_data: [['svg_p:path7617']], + draw_name: [['svg_p:path7165']] }; + + + /* + * Syntax of behaviors + */ + + sim.rv.behaviors["NOP"] = { nparameters: 1, + operation: function(s_expr) { }, + verbal: function(s_expr) { return "" ; } + }; + sim.rv.behaviors["NOP_ALU"] = { nparameters: 1, + operation: function(s_expr) + { + sim.rv.internal_states.alu_flags.flag_n = 0 ; + sim.rv.internal_states.alu_flags.flag_z = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + }, + verbal: function (s_expr) + { + return "" ; + } + }; + sim.rv.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.rv.behaviors["LOAD"] = { nparameters: 3, + types: ["X", "X"], + operation: function(s_expr) + { + var sim_elto_org = get_reference(s_expr[2]) ; + var sim_elto_dst = get_reference(s_expr[1]) ; + var 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.rv.behaviors["LOAD_J"] = { nparameters: 3, + types: ["X", "X"], + operation: function(s_expr) + { + if (!(get_value(sim.rv.states["FLAG_N"])) && !(get_value(sim.rv.states["FLAG_Z"]))) { + return ; + } + + var sim_elto_org = get_reference(s_expr[2]) ; + var sim_elto_dst = get_reference(s_expr[1]) ; + var 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 sim_elto_dst = get_reference(s_expr[1]) ; + var newval = get_value(sim_elto_org) ; + + return "Jump if N or Z (new value is '" + newval + "' )" ; + } + }; + sim.rv.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.rv.behaviors["JUMP_MADDR_N"] = { nparameters: 5, + types: ["X", "X", "E", "I"], + operation: function(s_expr) + { + if (get_value(sim.rv.states["FLAG_N"]) != parseInt(s_expr[4])) { + var a = get_value(sim.rv.states[s_expr[3]]) << 0 ; + var result = a + 1 ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + } else { + 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) + { + /* + if (!(get_value(sim.rv.states["FLAG_N"]))) { + var a = get_value(sim.rv.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) + "). " ; + } else { + 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 + "). " ; + } + */ + if (parseInt(s_expr[4])) { + return "Jump to REG_MICROINS/MADDR if Flag N = 1."; + } else { + return "Jump to REG_MICROINS/MADDR if Flag N = 0."; + } + } + }; + + sim.rv.behaviors["JUMP_MADDR_Z"] = { nparameters: 5, + types: ["X", "X", "E", "I"], + operation: function(s_expr) + { + if (get_value(sim.rv.states["FLAG_Z"]) != parseInt(s_expr[4])) { + var a = get_value(sim.rv.states[s_expr[3]]) << 0 ; + var result = a + 1 ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + } else { + 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) + { + /* + if (!(get_value(sim.rv.states["FLAG_Z"]))) { + var a = get_value(sim.rv.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) + "). " ; + } else { + 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 + "). " ; + } + */ + if (parseInt(s_expr[4])) { + return "Jump to REG_MICROINS/MADDR if Flag Z = 1."; + } else { + return "Jump to REG_MICROINS/MADDR if Flag Z = 0."; + } + } + }; + + sim.rv.behaviors["NOT_ES"] = { nparameters: 3, + types: ["S", "E"], + operation: function (s_expr) + { + set_value( sim.rv.signals[s_expr[1]], Math.abs(get_value(sim.rv.states[s_expr[2]]) - 1)); + }, + verbal: function (s_expr) + { + var value = Math.abs(get_value(sim.rv.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.rv.behaviors["GET"] = { nparameters: 4, + types: ["E", "E", "S"], + operation: function(s_expr) + { + set_value(sim.rv.states[s_expr[1]], get_value(sim.rv.states[s_expr[2]][ sim.rv.signals[s_expr[3]].value])); + }, + verbal: function (s_expr) + { + var value = get_value(sim.rv.states[s_expr[2]][sim.rv.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.rv.behaviors["SET"] = { nparameters: 4, + types: ["E", "S", "E"], + operation: function(s_expr) + { + set_value(sim.rv.states[s_expr[1]][ sim.rv.signals[s_expr[2]].value], get_value(sim.rv.states[s_expr[3]])); + }, + verbal: function (s_expr) + { + var value = get_value(sim.rv.states[s_expr[3]]) ; + var o_ref = sim.rv.states[s_expr[1]][sim.rv.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.rv.behaviors["AND"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var result = get_value(sim.rv.states[s_expr[2]]) & get_value(sim.rv.states[s_expr[3]]) ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + }, + verbal: function (s_expr) + { + var result = get_value(sim.rv.states[s_expr[2]]) & get_value(sim.rv.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.rv.behaviors["OR"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var result = get_value(sim.rv.states[s_expr[2]]) | get_value(sim.rv.states[s_expr[3]]) ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + }, + verbal: function (s_expr) + { + var result = get_value(sim.rv.states[s_expr[2]]) | get_value(sim.rv.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.rv.behaviors["NOT"] = { nparameters: 3, + types: ["E", "E"], + operation: function(s_expr) + { + var result = ~(get_value(sim.rv.states[s_expr[2]])) ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + }, + verbal: function (s_expr) + { + var result = ~(get_value(sim.rv.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.rv.behaviors["XOR"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var result = get_value(sim.rv.states[s_expr[2]]) ^ get_value(sim.rv.states[s_expr[3]]) ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + }, + verbal: function (s_expr) + { + var result = get_value(sim.rv.states[s_expr[2]]) ^ get_value(sim.rv.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.rv.behaviors["SRL"] = { nparameters: 3, + types: ["E", "E"], + operation: function(s_expr) + { + var result = (get_value(sim.rv.states[s_expr[2]])) >>> 1 ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + }, + verbal: function (s_expr) + { + var result = (get_value(sim.rv.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.rv.behaviors["SRA"] = { nparameters: 3, + types: ["E", "E"], + operation: function(s_expr) + { + var result = (get_value(sim.rv.states[s_expr[2]])) >> 1 ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + }, + verbal: function (s_expr) + { + var result = (get_value(sim.rv.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.rv.behaviors["SL"] = { nparameters: 3, + types: ["E", "E"], + operation: function(s_expr) + { + var result = (get_value(sim.rv.states[s_expr[2]])) << 1 ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = ((result) >>> 31) ; + }, + verbal: function (s_expr) + { + var result = (get_value(sim.rv.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.rv.behaviors["RR"] = { nparameters: 3, + types: ["E", "E"], + operation: function(s_expr) + { + var result = ((get_value(sim.rv.states[s_expr[2]])) >>> 1) | (((get_value(sim.rv.states[s_expr[2]])) & 1) << 31) ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + }, + verbal: function (s_expr) + { + var result = ((get_value(sim.rv.states[s_expr[2]])) >>> 1) | (((get_value(sim.rv.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.rv.behaviors["RL"] = { nparameters: 3, + types: ["E", "E"], + operation: function(s_expr) + { + var result = ((get_value(sim.rv.states[s_expr[2]])) << 1) | (((get_value(sim.rv.states[s_expr[2]])) & 0X80000000) >>> 31) ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + }, + verbal: function (s_expr) + { + var result = ((get_value(sim.rv.states[s_expr[2]])) << 1) | (((get_value(sim.rv.states[s_expr[2]])) & 0X80000000) >>> 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.rv.behaviors["ADD"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) << 0 ; + var b = get_value(sim.rv.states[s_expr[3]]) << 0 ; + var result = a + b ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_c = (a >>> 31) && (b >>> 31) ; + // + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // if ( (result < 0) && (a >= 0) && (b >= 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // if ( (result >= 0) && (a < 0) && (b < 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) << 0 ; + var b = get_value(sim.rv.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.rv.behaviors["SUB"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) << 0 ; + var b = get_value(sim.rv.states[s_expr[3]]) << 0 ; + var result = a - b ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_c = (a >>> 31) && (b >>> 31) ; + // + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // if ( (result < 0) && (a >= 0) && (b >= 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // if ( (result >= 0) && (a < 0) && (b < 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) << 0 ; + var b = get_value(sim.rv.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.rv.behaviors["MUL"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) << 0 ; + var b = get_value(sim.rv.states[s_expr[3]]) << 0 ; + var result = a * b ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + // + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // if ( (result < 0) && (a >= 0) && (b >= 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // if ( (result >= 0) && (a < 0) && (b < 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) << 0 ; + var b = get_value(sim.rv.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.rv.behaviors["DIV"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = (get_value(sim.rv.states[s_expr[2]]) << 0) ; + var b = (get_value(sim.rv.states[s_expr[3]]) << 0) ; + + if (0 == b) { + set_value(sim.rv.states[s_expr[1]], 0) ; + + sim.rv.internal_states.alu_flags.flag_n = 0 ; + sim.rv.internal_states.alu_flags.flag_z = 1 ; + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + return ; + } + + var result = Math.floor(a / b) ; + set_value(sim.rv.states[s_expr[1]], result) ; + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) << 0 ; + var b = get_value(sim.rv.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.rv.behaviors["MOD"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = (get_value(sim.rv.states[s_expr[2]]) << 0) ; + var b = (get_value(sim.rv.states[s_expr[3]]) << 0) ; + + if (0 == b) { + set_value(sim.rv.states[s_expr[1]], 0) ; + + sim.rv.internal_states.alu_flags.flag_n = 0 ; + sim.rv.internal_states.alu_flags.flag_z = 1 ; + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + return ; + } + + var result = a % b ; + set_value(sim.rv.states[s_expr[1]], result) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) << 0 ; + var b = get_value(sim.rv.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.rv.behaviors["LUI"] = { nparameters: 3, + types: ["E", "E"], + operation: function(s_expr) + { + var result = (get_value(sim.rv.states[s_expr[2]])) << 16 ; + set_value(sim.rv.states[s_expr[1]], result) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + }, + verbal: function (s_expr) + { + var result = (get_value(sim.rv.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.rv.behaviors["ADDU"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) >>> 0 ; + var b = get_value(sim.rv.states[s_expr[3]]) >>> 0 ; + var result = a + b ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + // + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // if ( (result < 0) && (a >= 0) && (b >= 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // if ( (result >= 0) && (a < 0) && (b < 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) >>> 0 ; + var b = get_value(sim.rv.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.rv.behaviors["SUBU"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) >>> 0 ; + var b = get_value(sim.rv.states[s_expr[3]]) >>> 0 ; + var result = a - b ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + // + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // if ( (result < 0) && (a >= 0) && (b >= 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // if ( (result >= 0) && (a < 0) && (b < 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) >>> 0 ; + var b = get_value(sim.rv.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.rv.behaviors["MULU"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) >>> 0 ; + var b = get_value(sim.rv.states[s_expr[3]]) >>> 0 ; + var result = a * b ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + // + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // if ( (result < 0) && (a >= 0) && (b >= 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // if ( (result >= 0) && (a < 0) && (b < 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) >>> 0 ; + var b = get_value(sim.rv.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.rv.behaviors["DIVU"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) >>> 0 ; + var b = get_value(sim.rv.states[s_expr[3]]) >>> 0 ; + + if (0 == b) { + set_value(sim.rv.states[s_expr[1]], 0) ; + + sim.rv.internal_states.alu_flags.flag_n = 0 ; + sim.rv.internal_states.alu_flags.flag_z = 1 ; + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + return ; + } + + var result = Math.floor(a / b) ; + set_value(sim.rv.states[s_expr[1]], result) ; + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) >>> 0 ; + var b = get_value(sim.rv.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.rv.behaviors["FADD"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) ; + var b = get_value(sim.rv.states[s_expr[3]]) ; + + var result = hex2float(a) + hex2float(b) ; + + set_value(sim.rv.states[s_expr[1]], float32_to_uint(result)) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0.0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0.0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + // + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // if ( (result < 0) && (a >= 0) && (b >= 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // if ( (result >= 0) && (a < 0) && (b < 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) ; + var b = get_value(sim.rv.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.rv.behaviors["FSUB"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) ; + var b = get_value(sim.rv.states[s_expr[3]]) ; + + var result = hex2float(a) - hex2float(b) ; + + set_value(sim.rv.states[s_expr[1]], float32_to_uint(result)) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0.0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0.0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + // + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // if ( (result < 0) && (a >= 0) && (b >= 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // if ( (result >= 0) && (a < 0) && (b < 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) ; + var b = get_value(sim.rv.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.rv.behaviors["FMUL"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) ; + var b = get_value(sim.rv.states[s_expr[3]]) ; + + var result = hex2float(a) * hex2float(b) ; + + set_value(sim.rv.states[s_expr[1]], float32_to_uint(result)) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0.0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0.0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + // + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // if ( (result < 0) && (a >= 0) && (b >= 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // if ( (result >= 0) && (a < 0) && (b < 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) ; + var b = get_value(sim.rv.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.rv.behaviors["FDIV"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) ; + var b = get_value(sim.rv.states[s_expr[3]]) ; + + var result = hex2float(a) / hex2float(b) ; // TODO + + set_value(sim.rv.states[s_expr[1]], float32_to_uint(result)) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0.0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0.0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + // + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // if ( (result < 0) && (a >= 0) && (b >= 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // if ( (result >= 0) && (a < 0) && (b < 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) ; + var b = get_value(sim.rv.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.rv.behaviors["FCVT"] = { nparameters: 4, + types: ["E", "E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) >>> 0 ; + var b = get_value(sim.rv.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.rv.states[s_expr[1]], result) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + // + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // if ( (result < 0) && (a >= 0) && (b >= 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // if ( (result >= 0) && (a < 0) && (b < 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) >>> 0 ; + var b = get_value(sim.rv.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.rv.behaviors["FCLASS"] = { nparameters: 3, + types: ["E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) >>> 0 ; + + // get float type + var result = float_class(a) ; + + set_value(sim.rv.states[s_expr[1]], result) ; + + sim.rv.internal_states.alu_flags.flag_n = (result < 0) ? 1 : 0 ; + sim.rv.internal_states.alu_flags.flag_z = (result == 0) ? 1 : 0 ; + // sim.rv.internal_states.alu_flags.flag_c = 0 ; + // + // sim.rv.internal_states.alu_flags.flag_v = 0 ; + // if ( (result < 0) && (a >= 0) && (b >= 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + // if ( (result >= 0) && (a < 0) && (b < 0) ) + // sim.rv.internal_states.alu_flags.flag_v = 1 ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.states[s_expr[1]]) >>> 0 ; + + // get float type + 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.rv.behaviors["PLUS1"] = { nparameters: 3, + types: ["E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) << 0 ; + var result = a + 1 ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.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.rv.behaviors["PLUS4"] = { nparameters: 3, + types: ["E", "E"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[2]]) << 0 ; + var result = a + 4 ; + set_value(sim.rv.states[s_expr[1]], result >>> 0) ; + }, + verbal: function (s_expr) + { + var a = get_value(sim.rv.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.rv.behaviors["SET_TT"] = { nparameters: 3, + types: ["E", "I"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[1]]) << 0 ; + var b = parseInt(s_expr[2]) ; + var m = Math.pow(2, b) ; + var r = a | m ; + set_value(sim.rv.states[s_expr[1]], r) ; + update_cpu_bus_fire(r, b) ; + }, + verbal: function (s_expr) + { + return "" ; + } + }; + sim.rv.behaviors["RST_TT"] = { nparameters: 3, + types: ["E", "I"], + operation: function(s_expr) + { + var a = get_value(sim.rv.states[s_expr[1]]) << 0 ; + var b = parseInt(s_expr[2]) ; + var m = Math.pow(2, b) ; + var r = a & ~m ; + set_value(sim.rv.states[s_expr[1]], r) ; + update_cpu_bus_fire(r, b) ; + }, + verbal: function (s_expr) + { + return "" ; + } + }; + sim.rv.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); // to binary + 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) ; // to binary + 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.rv.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.rv.states[s_expr[3]]); + else + if (typeof sim.rv.states[r[0]].value[r[1]] != "undefined") + base = sim.rv.states[r[0]].value[r[1]]; + // begin: REG_MICROINS/xxx by default is the default_value + else if (typeof sim.rv.signals[r[1]].default_value != "undefined") + base = sim.rv.signals[r[1]].default_value; + else if (typeof sim.rv.states[r[1]].default_value != "undefined") + base = sim.rv.states[r[1]].default_value; + // end: REG_MICROINS/xxx by default is the 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.rv.states[s_expr[2]]).toString(2); // to binary + var n2 = "00000000000000000000000000000000".substring(0, 32 - n1.length) + n1 ; + var n3 = n2.substr(31 - (base + offset - 1), offset) ; + + set_value( sim.rv.signals[s_expr[1]], parseInt(n3, 2)); + }, + verbal: function (s_expr) + { + // value + var base = 0; + var r = s_expr[3].split('/'); + if (1 == r.length) + base = get_value(sim.rv.states[s_expr[3]]); + else + if (typeof sim.rv.states[r[0]].value[r[1]] != "undefined") + base = sim.rv.states[r[0]].value[r[1]]; + // begin: REG_MICROINS/xxx by default is the default_value + else if (typeof sim.rv.signals[r[1]].default_value != "undefined") + base = sim.rv.signals[r[1]].default_value; + else if (typeof sim.rv.states[r[1]].default_value != "undefined") + base = sim.rv.states[r[1]].default_value; + // end: REG_MICROINS/xxx by default is the 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.rv.states[s_expr[2]]).toString(2); // to binary + var n2 = "00000000000000000000000000000000".substring(0, 32 - n1.length) + n1 ; + var n3 = n2.substr(31 - (base + offset - 1), offset) ; + + // name + var from_elto = "" ; + if (1 == r.length) + from_elto = show_verbal(s_expr[3]) ; + else from_elto = show_verbal(s_expr[2]) + "[" + r[1] + "] " ; + + // 0 1 2 3 4 + // E.g.: MBIT_SN RA REG_IR REG_MICROINS/SELA 5 + 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.rv.behaviors["SBIT_SIGNAL"] = { nparameters: 4, + types: ["X", "I", "I"], + operation: function (s_expr) + { + sim_elto_dst = get_reference(s_expr[1]) ; + + // 0 1 2 3 + // SBIT_SIGNAL A0A1 1 0 + var new_value = sim_elto_dst.value ; + var mask = (1 << s_expr[3]) ; + if (s_expr[2] == "1") + new_value = new_value | mask ; + else new_value = new_value & ~mask ; + + set_value(sim_elto_dst, (new_value >>> 0)); + }, + verbal: function (s_expr) + { + sim_elto_dst = get_reference(s_expr[1]) ; + + // return verbal of the compound signal/value + var new_value = sim_elto_dst.value ; + var mask = (1 << s_expr[3]) ; + if (s_expr[2] == "1") + new_value = new_value | mask ; + else new_value = new_value & ~mask ; + + return compute_signal_verbals(s_expr[1], (new_value >>> 0)) ; + } + }; + sim.rv.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]) ; + + // 0 1 2 3 + // UPDATE_FLAG SELP_M7 FLAG_U 0 + var new_value = (sim_elto_dst.value & ~(1 << s_expr[3])) | + (sim_elto_org.value << s_expr[3]); + set_value(sim_elto_dst, (new_value >>> 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.rv.behaviors["MBITS"] = { nparameters: 8, + types: ["E", "I", "E", "S", "S", "I", "S"], + operation: function(s_expr) + { + var offset = parseInt(sim.rv.signals[s_expr[4]].value) ; + var size = parseInt(sim.rv.signals[s_expr[5]].value) ; + + var n1 = get_value(sim.rv.states[s_expr[3]]).toString(2); // to binary + 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.rv.signals[s_expr[7]].value) && ("1" == n2.substr(0, 1))) + { // check signed-extension + n3 = "11111111111111111111111111111111".substring(0, 32 - n2.length) + n2; + } + + set_value(sim.rv.states[s_expr[1]], parseInt(n3, 2)); + }, + verbal: function (s_expr) + { + var offset = parseInt(sim.rv.signals[s_expr[4]].value) ; + var size = parseInt(sim.rv.signals[s_expr[5]].value) ; + + var n1 = get_value(sim.rv.states[s_expr[3]]).toString(2); // to binary + 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.rv.signals[s_expr[7]].value) && ("1" == n2.substr(0, 1))) + { // check signed-extension + 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.rv.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.rv.states[s_expr[4]]).toString(2); // to binary + 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.rv.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.rv.states[s_expr[4]]).toString(2); // to binary + 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.rv.behaviors["BWSEL"] = { nparameters: 4, + types: ["E", "E", "S"], + operation: function(s_expr) + { + // Pre-defined positions and length + var posd = 0 ; + var poso = 0 ; + var len = 8 ; + var sign_ext = sim.rv.signals[s_expr[3]].value; + + var n1 = get_value(sim.rv.states[s_expr[2]]).toString(2); // to binary + 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; + + if (sign_ext) { + //Extend byte sign to full Word + var s1 = n2 ; + var s2 = ("00000000000000000000000000000000".substring(0, 32 - s1.length) + s1) ; + var s3 = s2.substr(31 - 7, 31); + var s4 = s3; + if ("1" == s2[31 - 7]) { // check signed-extension + s4 = "11111111111111111111111111111111".substring(0, 32 - s3.length) + s4; + } + set_value(sim.rv.states[s_expr[1]], parseInt(s4, 2)); + } else { + //Add zeros to 24 superior bits + set_value(sim.rv.states[s_expr[1]], parseInt(n3, 2)); + } + }, + verbal: function (s_expr) + { + var posd = 0 ; + var poso = 0 ; + var len = 8 ; + var sign_ext = sim.rv.signals[s_expr[3]].value; + + var n1 = get_value(sim.rv.states[s_expr[2]]).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; + + if (sign_ext) { + var s1 = n2 ; + var s2 = ("00000000000000000000000000000000".substring(0, 32 - s1.length) + s1) ; + var s3 = s2.substr(31 - 7, 31); + var s4 = s3; + if ("1" == s2[31 - 7]) { + s4 = "11111111111111111111111111111111".substring(0, 32 - s3.length) + s4; + } + var value = parseInt(s4, 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(value) + + + " (copied " + len + " bits, from bit " + poso + " to bit " + (posd+8) + " with sign extension)." ; + } else { + return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2]) + + " (" + show_value(value) + ", " + len + " bits, from bit " + poso + + " of " + s_expr[2] + " to bit " + (posd+8) + " of " + s_expr[1] + "). " ; + } + } else { + var value = parseInt(n3, 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(value) + + + " (copied " + len + " bits, from bit " + poso + " to bit " + (posd+8) + " without sign extension)." ; + } else { + return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2]) + + " (" + show_value(value) + ", " + len + " bits, from bit " + poso + + " of " + s_expr[2] + " to bit " + (posd+8) + " of " + s_expr[1] + "). " ; + } + } + } + }; + + sim.rv.behaviors["EXT_SIG"] = { nparameters: 3, + types: ["E", "I"], + operation: function (s_expr) + { + var n1 = get_value(sim.rv.states[s_expr[1]]).toString(2); // to binary + 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]]) { // check signed-extension + n4 = "11111111111111111111111111111111".substring(0, 32 - n3.length) + n4; + } + + set_value(sim.rv.states[s_expr[1]], parseInt(n4, 2)); + }, + verbal: function (s_expr) + { + var n1 = get_value(sim.rv.states[s_expr[1]]).toString(2); // to binary + 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]]) { // check signed-extension + n4 = "11111111111111111111111111111111".substring(0, 32 - n3.length) + n4; + } + var n5 = parseInt(n4, 2) ; + + return "Sign Extension with value " + show_value(n5) + ". " ; + } + }; + sim.rv.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.rv.signals[s_expr[4]].value.toString(2); // to binary signal origin + n1 = ("00000000000000000000000000000000".substring(0, 32 - n1.length) + n1); + n1 = n1.substr(31 - poso - len + 1, len); + + var n2 = sim.rv.signals[s_expr[1]].value.toString(2); // to binary signal destiny + 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.rv.signals[s_expr[1]], parseInt(n3, 2)); + }, + verbal: function (s_expr) + { + return "" ; + } + }; + sim.rv.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.rv.states[s_expr[4]]).toString(2); // to state signal origin + n1 = ("00000000000000000000000000000000".substring(0, 32 - n1.length) + n1); + n1 = n1.substr(31 - poso - len + 1, len); + + var n2 = sim.rv.signals[s_expr[1]].value.toString(2); // to binary signal destiny + 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.rv.signals[s_expr[1]], parseInt(n3, 2)); + }, + verbal: function (s_expr) + { + return "" ; + } + }; + + sim.rv.behaviors["READ_IM"] = { nparameters: 1, + operation: function(s_expr) + { + var address = get_value(sim.rv.states['REG_PC']); + var clk = get_value(sim.rv.states['CLK']) ; + + var remain = get_value(sim.rv.internal_states.MP_wc); + if ( + (typeof sim.rv.events.mem[clk-1] != "undefined") && + (sim.rv.events.mem[clk-1] > 0) + ) { + remain = sim.rv.events.mem[clk-1] - 1; + } + var first_time = typeof sim.rv.events.mem[clk] == "undefined" ; + sim.rv.events.mem[clk] = remain; + if (remain > 0) { + return; + } + + address = address & 0xFFFFFFFC; + var value = main_memory_getvalue(sim.rv.internal_states.MP, + address) ; + var full_redraw = false ; + if (typeof value === "undefined") { + value = 0 ; + full_redraw = true ; + } + show_main_memory(sim.rv.internal_states.MP, address, full_redraw, false) ; + // cache + if (first_time && (sim.rv.internal_states.CM.length > 0)) { + cache_memory_access(sim.rv.internal_states.CM[0], address, "read", clk) ; + } + + var ins = main_memory_getvalue(sim.rv.internal_states.MP, address) ; + if (typeof ins === "undefined") + ins = 0 ; + set_value(sim.rv.states['RDATA'], ins); + }, + verbal: function (s_expr) + { + var verbal = "" ; + var address = get_value(sim.rv.states['REG_PC']); + var value = main_memory_getvalue(sim.rv.internal_states.MP, address) ; + + if (typeof value === "undefined") + value = 0 ; + + var verbose = get_cfg('verbal_verbose') ; + if (verbose !== 'math') { + verbal = "Try to read an instruction from Instruction Memory " + + "at address 0x" + address.toString(16) + " with value 0x" + value.toString(16) + ". " ; + return verbal ; + } + + verbal = "Memory output = 0x" + value.toString(16) + + " (Read an instruction from Instruction Memory" + + " at address 0x" + address.toString(16) + "). " ; + + return verbal ; + } + }; + + sim.rv.behaviors["DECO"] = { nparameters: 1, + operation: function(s_expr) + { + + sim.rv.states['INEX'].value = 0 ; + + // 1.- IR -> oi + var oi = decode_instruction(sim.rv.internal_states.FIRMWARE, + sim.rv.ctrl_states.ir, + get_value(sim.rv.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.rv.states['ROM_MUXA'].value = 0 ; + sim.rv.states['INEX'].value = 1 ; + return -1; + } + + // 2.- oi.oinstruction -> rom_addr + var rom_addr = oi.op_code << 6; + if (typeof oi.oinstruction.cop != "undefined") { + rom_addr = rom_addr + oi.cop_code ; + } + + // 2.- ! sim.rv.internal_states['ROM'][rom_addr] -> error + if (typeof sim.rv.internal_states['ROM'][rom_addr] == "undefined") + { + ws_alert('ERROR: undefined rom address ' + rom_addr + + ' in firmware') ; + sim.rv.states['ROM_MUXA'].value = 0 ; + return -1; + } + + // 3.- sim.rv.internal_states['ROM'][rom_addr] -> mc-start -> ROM_MUXA + sim.rv.states['ROM_MUXA'].value = sim.rv.internal_states['ROM'][rom_addr] ; + + // 4.- Statistics + var val = get_value(sim.rv.states['DECO_INS']) ; + set_value(sim.rv.states["DECO_INS"], val + 1); + + // 5.- Update UI + var pc = get_value(sim.rv.states['REG_PC']) - 4 ; + var decins = get_deco_from_pc(pc) ; + set_value(sim.rv.states['REG_IR_DECO'], decins) ; + show_dbg_ir(get_value(sim.rv.states['REG_IR_DECO'])); + }, + verbal: function (s_expr) + { + return "Decode instruction. " ; + } + }; + + sim.rv.behaviors["FIRE"] = { nparameters: 2, + types: ["S"], + operation: function (s_expr) + { + // 0.- avoid loops + if (sim.rv.internal_states.fire_stack.indexOf(s_expr[1]) != -1) { + return ; + } + + sim.rv.internal_states.fire_stack.push(s_expr[1]) ; + + // 1.- update draw + update_draw(sim.rv.signals[s_expr[1]], sim.rv.signals[s_expr[1]].value) ; + + // 2.- for Level signals, propage it + if ("L" == sim.rv.signals[s_expr[1]].type) + { + update_state(s_expr[1]) ; + } + + sim.rv.internal_states.fire_stack.pop(s_expr[1]) ; + }, + verbal: function (s_expr) + { + return "" ; + } + }; + + sim.rv.behaviors["FIRE_IFSET"] = { nparameters: 3, + types: ["S", "I"], + operation: function (s_expr) + { + if (get_value( sim.rv.signals[s_expr[1]]) != parseInt(s_expr[2])) { + return ; + } + + sim.rv.behaviors["FIRE"].operation(s_expr) ; + }, + verbal: function (s_expr) + { + return "" ; + } + }; + + sim.rv.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.rv.behaviors["FIRE"].operation(s_expr) ; + }, + verbal: function (s_expr) + { + return "" ; + } + }; + + sim.rv.behaviors["RESET_CHANGED"] = { nparameters: 2, + types: ["X"], + operation: function (s_expr) + { + sim_elto = get_reference(s_expr[1]) ; + sim_elto.changed = false ; // Disable by Default + }, + verbal: function (s_expr) + { + return "" ; + } + }; + + sim.rv.behaviors["CLOCK"] = { nparameters: 1, + operation: function(s_expr) + { + var new_maddr = null ; + var mcelto = null ; + + // measure time (1/2) + var t0 = performance.now() ; + + // 1.- Update counter + var val = get_value(sim.rv.states["CLK"]) ; + set_value(sim.rv.states["CLK"], val + 1); + set_value(sim.rv.states["TTCPU"], 0) ; + + // 2.- To treat the (Falling) Edge signals + new_maddr = get_value(sim.rv.states["REG_MICROADDR"]); + mcelto = sim.rv.internal_states['MC'][new_maddr]; + if ( (typeof mcelto !== "undefined") && + (false == mcelto.is_native) ) + { + for (var i=0; i. + * + */ + + + /* + * Memory + */ + + sim.rv.components.MEMORY = { + name: "MEMORY", + version: "1", + abilities: [ "MEMORY" ], + + // ui: details + details_name: [ "MEMORY", "MEMORY_CONFIG" ], + details_fire: [ ['svg_p:text7483'], [] ], + + // state: write_state, read_state, get_state + write_state: function ( vec ) { + if (typeof vec.MEMORY == "undefined") + vec.MEMORY = {} ; + + var key = 0 ; + var value = 0 ; + for (var index in sim.rv.internal_states.MP) + { + value = main_memory_getvalue(sim.rv.internal_states.MP, + index) ; + value = parseInt(value) ; + if (value != 0) + { + key = parseInt(index).toString(16) ; + vec.MEMORY["0x" + key] = {"type": "memory", + "default_value": 0x0, + "id": "0x" + key, + "op": "=", + "value": "0x" + value.toString(16)} ; + } + } + + return vec; + }, + read_state: 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": 0x0, + "id": "0x" + key, + "op": check.condition, + "value": "0x" + val} ; + return true ; + } + + return false ; + }, + get_state: function ( pos ) { + var index = parseInt(pos) ; + var value = main_memory_getvalue(sim.rv.internal_states.MP, + elto) ; + if (typeof value === "undefined") { + return null ; + } + return "0x" + parseInt(value).toString(16) ; + }, + + // native: get_value, set_value + get_value: function ( elto ) { + var value = main_memory_getvalue(sim.rv.internal_states.MP, + elto) ; + show_main_memory(sim.rv.internal_states.MP, elto, false,false) ; + return (value >>> 0) ; + }, + set_value: function ( elto, value ) { + // PC + 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.rv.internal_states.MP, + elto, + melto) ; + + show_main_memory(sim.rv.internal_states.MP, + elto, + (typeof valref === "undefined"), + true) ; + + return value ; + } + }; + + + /* + * Internal States + */ + + sim.rv.internal_states.segments = {} ; + sim.rv.internal_states.MP_wc = 0 ; + sim.rv.internal_states.MP = {} ; + + sim.rv.internal_states.CM_cfg = [] ; + sim.rv.internal_states.CM = [] ; + + /* + * Syntax of behaviors + */ + + sim.rv.behaviors.MEM_READ = { nparameters: 5, + types: ["E", "E", "S", "E"], + operation: function (s_expr) + { + var address = "0x" + get_value(sim.rv.states[s_expr[1]]).toString(16); + var dbvalue = get_value(sim.rv.states[s_expr[2]]); + var bw = sim.rv.signals[s_expr[3]].value; + var clk = get_value(sim.rv.states[s_expr[4]]) ; + + var remain = get_value(sim.rv.internal_states.MP_wc); + if ( + (typeof sim.rv.events.mem[clk-1] != "undefined") && + (sim.rv.events.mem[clk-1] > 0) + ) { + remain = sim.rv.events.mem[clk-1] - 1; + } + var first_time = typeof sim.rv.events.mem[clk] == "undefined" ; + sim.rv.events.mem[clk] = remain; + if (remain > 0) { + return; + } + + address = address & 0xFFFFFFFC; + var value = main_memory_getvalue(sim.rv.internal_states.MP, + address) ; + var full_redraw = false ; + if (typeof value === "undefined") { + value = 0 ; + full_redraw = true ; + } + + // BW -> See Tables in Help + if ( bw == 1 ) { + var byte_s = 0x0000; + dbvalue = main_memory_fusionvalues(dbvalue, value, byte_s) ; + } else { + dbvalue = value; + } + + set_value(sim.rv.states[s_expr[2]], dbvalue >>> 0); + show_main_memory(sim.rv.internal_states.MP, address, full_redraw, false) ; + + // cache + if (first_time && (sim.rv.internal_states.CM.length > 0)) { + cache_memory_access(sim.rv.internal_states.CM[0], address, "read", clk) ; + } + }, + verbal: function (s_expr) + { + var verbal = "" ; + + var address = "0x" + get_value(sim.rv.states[s_expr[1]]).toString(16); + var dbvalue = get_value(sim.rv.states[s_expr[2]]); + var bw = sim.rv.signals[s_expr[3]].value; + var clk = get_value(sim.rv.states[s_expr[4]]) ; + + var bw_type = "word" ; + if ( bw == 1 ) + bw_type = "byte" ; + + var value = main_memory_getvalue(sim.rv.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 " + address + " with value 0x" + value.toString(16) + ". " ; + } + + verbal = "Memory output = 0x" + value.toString(16) + + " (Read a " + bw_type + " from " + address + "). " ; + + return verbal ; + } + }; + + sim.rv.behaviors.MEM_WRITE = { nparameters: 5, + types: ["E", "E", "S", "E"], + operation: function (s_expr) + { + var address = "0x" + get_value(sim.rv.states[s_expr[1]]).toString(16); + var dbvalue = get_value(sim.rv.states[s_expr[2]]); + var bw = sim.rv.signals[s_expr[3]].value; + var clk = get_value(sim.rv.states[s_expr[4]]) ; + + var remain = get_value(sim.rv.internal_states.MP_wc); + if ( + (typeof sim.rv.events.mem[clk-1] != "undefined") && + (sim.rv.events.mem[clk-1] > 0) + ) { + remain = sim.rv.events.mem[clk-1] - 1; + } + var first_time = typeof sim.rv.events.mem[clk] == "undefined" ; + sim.rv.events.mem[clk] = remain; + if (remain > 0) { + return; + } + + address = address & 0xFFFFFFFC; + var value = main_memory_getvalue(sim.rv.internal_states.MP, + address) ; + var full_redraw = false ; + if (typeof value === "undefined") { + value = 0 ; + full_redraw = true ; + } + + // BW -> See Tables in Help + if ( bw == 1 ) { + var byte_s = 0x0000; + value = main_memory_fusionvalues(value, dbvalue, byte_s) ; + } else { + var byte_s = 0x000C; + value = main_memory_fusionvalues(value, dbvalue, byte_s) ; + } + + // PC + var origin = '' ; + var r_value = main_memory_get_program_counter() ; + if (r_value != null) { + origin = 'PC=0x' + r_value.toString(16) ; + } + + // set memory value+source + var melto = { + "value": (value >>> 0), + "source_tracking": [ origin ], + "comments": null + } ; + var valref = main_memory_set(sim.rv.internal_states.MP, + address, + melto) ; + + show_main_memory(sim.rv.internal_states.MP, address, full_redraw, true) ; + + // cache + if (first_time && (sim.rv.internal_states.CM.length > 0)) { + cache_memory_access(sim.rv.internal_states.CM[0], address, "write", clk) ; + } + }, + verbal: function (s_expr) + { + var verbal = "" ; + + var address = "0x" + get_value(sim.rv.states[s_expr[1]]).toString(16); + var dbvalue = get_value(sim.rv.states[s_expr[2]]); + var bw = sim.rv.signals[s_expr[3]].value; + var clk = get_value(sim.rv.states[s_expr[4]]) ; + + var bw_type = "word" ; + if ( bw == 1 ) + bw_type = "byte" ; + + var value = main_memory_getvalue(sim.rv.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 " + address + " with value " + value.toString(16) + ". " ; + } + + verbal = "Memory[" + address + "] = " + "0x" + value.toString(16) + + " (Write a " + bw_type + " to " + address + "). " ; + + return verbal ; + } + }; + + sim.rv.behaviors.MEMORY_RESET = { nparameters: 1, + operation: function (s_expr) + { + // reset events.mem + sim.rv.events.mem = {} ; + }, + verbal: function (s_expr) + { + return "Reset main memory (all values will be zeroes). " ; + } + }; + + + /* + * Model + * (Thanks to Juan Francisco Perez Carrasco for collaborating in the design of the following elements) + */ + + sim.rv.elements.memory = { + name: "Main memory", + description: "Main memory subsystem", + type: "subcomponent", + belongs: "MEMORY", + states: { + "addr": { + ref: "M3_ALU" + }, + "wdata": { + ref: "REG_OUT" + }, + "rdata": { + ref: "DM_BS" + } + }, + signals: { + "wbe": { + ref: "WBE" + }, + "dmr": { + ref: "DMR" + }, + "dmw": { + ref: "DMW" + } + }, + states_inputs: [ "addr", "wdata" ], + states_outputs: [ "rdata" ], + signals_inputs: [ "wbe", "dmr", "dmw" ], + signals_output: [ ] + } ; + diff --git a/sim_hw/sim_hw_rv/sim_rv.js b/sim_hw/sim_hw_rv/sim_rv.js new file mode 100644 index 000000000..bf50e0fb6 --- /dev/null +++ b/sim_hw/sim_hw_rv/sim_rv.js @@ -0,0 +1,45 @@ +/* + * Copyright 2015-2023 Felix Garcia Carballeira, Alejandro Calderon Mateos, Javier Prieto Cepeda, Saul Alonso Monsalve, Juan Banga Pardo + * + * This file is part of WepSIM. + * + * WepSIM is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * WepSIM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with WepSIM. If not, see . + * + */ + + + /* + * RISC-V Processor + */ + + var rv_def = { + sim_name: "RISC-V Processor", + sim_short_name: "rv", + sim_img_processor: "examples/hardware/rv/images/processor.svg", + sim_img_controlunit: "", + sim_img_cpu: "examples/hardware/rv/images/cpu.svg", + + components: {}, + states: {}, + signals: {}, + behaviors: {}, + elements: {}, + + internal_states: {}, + ctrl_states: {}, + events: {} + } ; + + simhw_add(rv_def) ; + diff --git a/wepsim_web/wepsim_uielto_cpusvg.js b/wepsim_web/wepsim_uielto_cpusvg.js index 223bc0e9b..a9ede90bf 100644 --- a/wepsim_web/wepsim_uielto_cpusvg.js +++ b/wepsim_web/wepsim_uielto_cpusvg.js @@ -118,7 +118,8 @@ * Drawing part */ - var DRAW_stop = false ; + var DRAW_stop = false ; + var is_dark_mode = false ; var cfg_color_background = 'white' ; var cfg_color_data_active = '#0066FF' ; @@ -139,9 +140,9 @@ cfg_size_inactive = get_cfg('size_inactive') ; // 2) modify because dark-mode - var is_black_mode = get_cfg("ws_skin_dark_mode") ; + is_dark_mode = get_cfg("ws_skin_dark_mode") ; - if (false == is_black_mode) { + if (false == is_dark_mode) { cfg_color_background = 'white' ; cfg_color_data_inactive = '#000000' ; cfg_color_name_inactive = '#000000' ; @@ -355,14 +356,29 @@ svg2.setAttribute('style', 'background-color:' + cfg_color_background); // 2) path - var elements = svg.querySelectorAll("path") ; - for (var i = 0; i < elements.length; i++) { - elements[i].style.fill = cfg_color_data_inactive ; - elements[i].setAttribute('stroke', cfg_color_data_inactive) ; + var def_color = null ; + var elements = svg.querySelectorAll("path") ; + for (var i = 0; i < elements.length; i++) + { + def_color = elements[i].getAttribute('wepsim:color') ; + if (def_color != null) + { + elements[i].style.fill = def_color ; + elements[i].style.stroke = def_color ; + // elements[i].setAttribute('fill', def_color) ; + // elements[i].setAttribute('stroke', def_color) ; + + continue ; + } + + elements[i].style.fill = cfg_color_data_inactive ; + elements[i].style.stroke = cfg_color_data_inactive ; + // elements[i].setAttribute('fill', cfg_color_data_inactive) ; + // elements[i].setAttribute('stroke', cfg_color_data_inactive) ; } // 3) text - var elements = svg.querySelectorAll("text") ; + elements = svg.querySelectorAll("text") ; for (var i = 0; i < elements.length; i++) { elements[i].style.fill = cfg_color_data_inactive ; } @@ -385,33 +401,11 @@ } } - function wepsim_svg_reload ( id_arr ) - { - var o = null ; - var a = null ; - - // set darkmode - wepsim_svg_update_drawing() ; - - // reload svg (just in case) - for (var i in id_arr) - { - o = document.getElementById(id_arr[i]) ; - if (o === null) continue ; - - o.onload = function(obj) { - wepsim_svg_apply_darkmode(obj.currentTarget.id) ; - } ; - - a = o.getAttribute('data') ; - o.setAttribute('data', a) ; - } - } - - function wepsim_svg_reload_full ( id_arr, img_arr ) + function wepsim_svg_reload ( id_arr, img_arr ) { var o = null ; var a = null ; + var d = "" ; // set darkmode wepsim_svg_update_drawing() ; @@ -420,7 +414,7 @@ for (var i in id_arr) { // skip empty image - if ( ('' == img_arr[i]) || (null == img_arr[i]) ) { + if (null == img_arr[i]) { continue ; } @@ -436,7 +430,13 @@ } ; // load image - o.setAttribute('data', img_arr[i]) ; + o.setAttribute('data', img_arr[i]) ; + + // hide empty image + if ("" != img_arr[i]) + d = "block" ; + else d = "none" ; + o.style.setProperty("display", d) ; } } diff --git a/wepsim_web/wepsim_web_api.js b/wepsim_web/wepsim_web_api.js index a59cb70e4..6ae257182 100644 --- a/wepsim_web/wepsim_web_api.js +++ b/wepsim_web/wepsim_web_api.js @@ -155,15 +155,19 @@ function wsweb_change_show_processor ( ) { - var id_arr = [ 'svg_p', 'svg_cu', 'svg_p2' ] ; - var o = null ; - var a = null ; + var ahw = null ; + var svg_arr = [ 'svg_p', 'svg_cu', 'svg_p2' ] ; + var img_arr = [ null, null, null ] ; $("#tab26").tab('show') ; - if (simhw_active() !== null) + + ahw = simhw_active() ; + if ( (typeof ahw != "undefined") && (ahw != null) ) { + img_arr = [ ahw.sim_img_processor, ahw.sim_img_controlunit, ahw.sim_img_cpu ] ; + // reload svg (just in case) - wepsim_svg_reload(id_arr) ; + wepsim_svg_reload(svg_arr, img_arr) ; // start drawing again wepsim_svg_start_drawing() ; diff --git a/wepsim_web/wepsim_web_simulator.js b/wepsim_web/wepsim_web_simulator.js index 45276dfd1..39284519a 100644 --- a/wepsim_web/wepsim_web_simulator.js +++ b/wepsim_web/wepsim_web_simulator.js @@ -334,7 +334,7 @@ // reload images var svg_arr = [ 'svg_p', 'svg_cu', 'svg_p2' ] ; var img_arr = [ ahw.sim_img_processor, ahw.sim_img_controlunit, ahw.sim_img_cpu ] ; - wepsim_svg_reload_full(svg_arr, img_arr) ; + wepsim_svg_reload(svg_arr, img_arr) ; // reload images event-handlers var a = document.getElementById("svg_p"); diff --git a/ws_dist/examples/examples_set/rv32/default.json b/ws_dist/examples/examples_set/rv32/default.json index 5cc56f294..7840d5f9e 100644 --- a/ws_dist/examples/examples_set/rv32/default.json +++ b/ws_dist/examples/examples_set/rv32/default.json @@ -933,5 +933,269 @@ "assembly": "s7e2", "description": "Simple example with fetch, arithmetic instructions, and basic .text segment.", "testing": true + }, + { + "id": "R1E1", + "title": "Instructions", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e1", + "description": "Simple example with fetch, arithmetic instructions, and basic .text segment.", + "testing": true + }, + { + "id": "R1E2", + "title": "Memory access", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e2", + "description": "Simple example with fetch, memory access, and basic .text/.data segment.", + "testing": true + }, + { + "id": "R1E3", + "title": "Looping", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e3", + "description": "Simple example with fetch, branch, and basic .text segment.", + "testing": true + }, + { + "id": "R1E5", + "title": "If-Then, If-Then-Else", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e5", + "description": "If-Then and If-Then-Else.", + "testing": true + }, + { + "id": "R1E4", + "title": "Vector", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e4", + "description": "Simple example with fetch, branch, and basic .text/.data segment.", + "testing": true + }, + { + "id": "R2E3", + "title": "Masks & shift", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e3", + "description": "More extended example with masks, shift, and basic .text/.data segment.", + "testing": true + }, + { + "id": "R2E4", + "title": "Matrix", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e4", + "description": "Extended example with subrutine and matrix.", + "testing": true + }, + { + "id": "R5E3", + "title": "Array of strings", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e3", + "description": "Array of strings.", + "testing": true + }, + { + "id": "R2E5", + "title": "Simple stack conv.", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e5", + "description": "Example with simple stack convention.", + "testing": true + }, + { + "id": "R2E2", + "title": "Subrutine", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e2", + "description": "Simple example with fetch, branch, and basic .text segment.", + "testing": true + }, + { + "id": "R2E6", + "title": "Fibonacci", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e6", + "description": "Fibonacci.", + "testing": true + }, + { + "id": "R3E1", + "title": "Interruptions", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s3e1", + "description": "Example with interruptions support: fetch, RETI, and .ktext/.kdata.", + "testing": true + }, + { + "id": "R3E2", + "title": "System call", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s3e2", + "description": "Example with system call support.", + "testing": true + }, + { + "id": "R3E3", + "title": "Exception", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s3e3", + "description": "Example with floating point exception.", + "testing": true + }, + { + "id": "R4E1", + "title": "Int. + syscall + except.", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e1", + "description": "Advanced example with interruption, system call, and exception.", + "testing": true + }, + { + "id": "R2E1", + "title": "I/O", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e1", + "description": "Example with programmed I/O access, and basic .text/.data segment.", + "testing": false + }, + { + "id": "R4E2", + "title": "SC 1, 4-5, 8, 11-12", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e2", + "description": "Example of syscall for printing/reading integer and string.", + "testing": true + }, + { + "id": "R5E2", + "title": "3D-Led", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e1", + "description": "Example for 3D-Led.", + "testing": true + }, + { + "id": "R5E4", + "title": "Led Matrix (movement)", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e2", + "description": "Example for Led Matrix.", + "testing": true + }, + { + "id": "R5E5", + "title": "Led Matrix (colors)", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e4", + "description": "Example for Led Matrix.", + "testing": true + }, + { + "id": "R4E3", + "title": "Threads", + "type": "Extra", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e3", + "description": "Example of threads.", + "testing": true + }, + { + "id": "R4E5", + "title": "Side-channel attack", + "type": "Extra", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e5", + "description": "Example of side-channel attack.", + "testing": true + }, + { + "id": "R5E1", + "title": "Dummy instruction", + "type": "Special", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s6e1", + "description": "Test example.", + "testing": true + }, + { + "id": "R5E2", + "title": "IEEE 754 (32 bits)", + "type": "Special", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s6e7", + "description": "Simple example with fetch, arithmetic instructions, and basic .text segment.", + "testing": true } ] diff --git a/ws_dist/examples/examples_set/rv32/es_rv.json b/ws_dist/examples/examples_set/rv32/es_rv.json new file mode 100644 index 000000000..68bc899db --- /dev/null +++ b/ws_dist/examples/examples_set/rv32/es_rv.json @@ -0,0 +1,266 @@ +[ + { + "id": "R1E1", + "title": "Instructions", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e1", + "description": "Simple example with fetch, arithmetic instructions, and basic .text segment.", + "testing": true + }, + { + "id": "R1E2", + "title": "Memory access", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e2", + "description": "Simple example with fetch, memory access, and basic .text/.data segment.", + "testing": true + }, + { + "id": "R1E3", + "title": "Looping", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e3", + "description": "Simple example with fetch, branch, and basic .text segment.", + "testing": true + }, + { + "id": "R1E5", + "title": "If-Then, If-Then-Else", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e5", + "description": "If-Then and If-Then-Else.", + "testing": true + }, + { + "id": "R1E4", + "title": "Vector", + "type": "Initial", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s1e4", + "description": "Simple example with fetch, branch, and basic .text/.data segment.", + "testing": true + }, + { + "id": "R2E3", + "title": "Masks & shift", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e3", + "description": "More extended example with masks, shift, and basic .text/.data segment.", + "testing": true + }, + { + "id": "R2E4", + "title": "Matrix", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e4", + "description": "Extended example with subrutine and matrix.", + "testing": true + }, + { + "id": "R5E3", + "title": "Array of strings", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e3", + "description": "Array of strings.", + "testing": true + }, + { + "id": "R2E5", + "title": "Simple stack conv.", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e5", + "description": "Example with simple stack convention.", + "testing": true + }, + { + "id": "R2E2", + "title": "Subrutine", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e2", + "description": "Simple example with fetch, branch, and basic .text segment.", + "testing": true + }, + { + "id": "R2E6", + "title": "Fibonacci", + "type": "Intermediate", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e6", + "description": "Fibonacci.", + "testing": true + }, + { + "id": "R3E1", + "title": "Interruptions", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s3e1", + "description": "Example with interruptions support: fetch, RETI, and .ktext/.kdata.", + "testing": true + }, + { + "id": "R3E2", + "title": "System call", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s3e2", + "description": "Example with system call support.", + "testing": true + }, + { + "id": "R3E3", + "title": "Exception", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s3e3", + "description": "Example with floating point exception.", + "testing": true + }, + { + "id": "R4E1", + "title": "Int. + syscall + except.", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e1", + "description": "Advanced example with interruption, system call, and exception.", + "testing": true + }, + { + "id": "R2E1", + "title": "I/O", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s2e1", + "description": "Example with programmed I/O access, and basic .text/.data segment.", + "testing": false + }, + { + "id": "R4E2", + "title": "SC 1, 4-5, 8, 11-12", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e2", + "description": "Example of syscall for printing/reading integer and string.", + "testing": true + }, + { + "id": "R5E2", + "title": "3D-Led", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e1", + "description": "Example for 3D-Led.", + "testing": true + }, + { + "id": "R5E4", + "title": "Led Matrix (movement)", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e2", + "description": "Example for Led Matrix.", + "testing": true + }, + { + "id": "R5E5", + "title": "Led Matrix (colors)", + "type": "Advanced", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s5e4", + "description": "Example for Led Matrix.", + "testing": true + }, + { + "id": "R4E3", + "title": "Threads", + "type": "Extra", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e3", + "description": "Example of threads.", + "testing": true + }, + { + "id": "R4E5", + "title": "Side-channel attack", + "type": "Extra", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s4e5", + "description": "Example of side-channel attack.", + "testing": true + }, + { + "id": "R5E1", + "title": "Dummy instruction", + "type": "Special", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s6e1", + "description": "Test example.", + "testing": true + }, + { + "id": "R5E2", + "title": "IEEE 754 (32 bits)", + "type": "Special", + "modes": "newbie,intro,rv", + "hardware": "rv", + "microcode": "rv_base", + "assembly": "s6e7", + "description": "Simple example with fetch, arithmetic instructions, and basic .text segment.", + "testing": true + } +] diff --git a/ws_dist/examples/hardware/ep/hw_def.json b/ws_dist/examples/hardware/ep/hw_def.json index 08790f3a9..b7335ca21 100644 --- a/ws_dist/examples/hardware/ep/hw_def.json +++ b/ws_dist/examples/hardware/ep/hw_def.json @@ -1 +1 @@ -{"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":{"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(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(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>>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>>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>>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 @@ -107,7 +109,8 @@ id="path2997" /> @@ -141,49 +144,57 @@ id="tspan4063">Address Bus @@ -200,7 +211,8 @@ id="text3025">ALU @@ -228,7 +240,8 @@ id="text3031">File @@ -245,7 +258,8 @@ id="text3035">MAR @@ -262,7 +276,8 @@ id="text3039">IR @@ -310,13 +325,15 @@ @@ -333,62 +350,72 @@ id="text3053">MBR @@ -416,31 +443,36 @@ id="text3079">C1 @@ -457,25 +489,29 @@ id="text3091">Ta @@ -514,43 +550,50 @@ id="text3107">RA @@ -589,55 +632,64 @@ id="text3127">LC @@ -665,13 +717,15 @@ id="text3149">T10 @@ -734,7 +791,8 @@ id="text3175">PC @@ -751,7 +809,8 @@ id="text3179">C2 @@ -777,20 +836,23 @@ id="path3185" /> @@ -807,7 +869,8 @@ id="text3223">MUX @@ -854,13 +917,15 @@ id="text3235">MUX @@ -877,7 +942,8 @@ id="text3155">A @@ -888,41 +954,47 @@ id="path3163" /> @@ -939,62 +1011,72 @@ id="text3303">Cop @@ -1011,13 +1093,15 @@ id="text3335">4 @@ -1041,26 +1125,30 @@ id="text3343">SELEC @@ -1077,25 +1165,29 @@ id="text3353">5 @@ -1118,25 +1210,29 @@ transform="matrix(1.0001417,0,0,0.77930839,-20.094415,58.087533)"> @@ -1166,13 +1262,15 @@
@@ -1189,7 +1287,8 @@ id="text3439">C3 @@ -1327,15 +1426,17 @@ id="text3483">6 @@ -1383,13 +1484,15 @@ id="text3501">A0 @@ -1400,13 +1503,15 @@ id="path3517" /> @@ -1417,13 +1522,15 @@ id="path3537" /> @@ -1434,19 +1541,22 @@ id="path3543" /> @@ -1457,7 +1567,8 @@ id="path3569" /> @@ -1468,20 +1579,23 @@ id="path3573" /> @@ -1498,31 +1612,36 @@ id="text3593">SE @@ -1550,13 +1669,15 @@ id="text3657">T8 @@ -1573,7 +1694,8 @@ id="text3665">MUX @@ -1590,7 +1712,8 @@ id="text3673">M7 @@ -1607,33 +1730,38 @@ id="text3679">SR @@ -1669,13 +1797,15 @@ id="path3815" /> @@ -1691,7 +1821,8 @@ id="text3823">KBDR @@ -1725,13 +1856,15 @@ id="path3831" /> @@ -1748,7 +1881,8 @@ id="text3839">DDR @@ -1775,7 +1909,8 @@ id="text3845">Display @@ -1786,7 +1921,8 @@ id="path3849" /> @@ -1797,13 +1933,15 @@ id="path3853" /> @@ -1814,19 +1952,22 @@ id="path3859" /> @@ -1837,7 +1978,8 @@ id="path3867" /> @@ -1848,13 +1990,15 @@ id="path3883" /> @@ -1865,7 +2009,8 @@ id="path3903" /> @@ -1874,7 +2019,8 @@ stroke-width="0.03px" d="m 641.86661,167.51097 v 63.43231 h -1.60343 v -63.43231 z m 4.07774,59.38584 -4.87956,7.85768 -5.04287,-8.02098 z" inkscape:connector-curvature="0" - style="stroke:#000000;stroke-linejoin:round" + style="stroke-linejoin:round" + stroke="#000000" sodipodi:nodetypes="ccccccccc" /> + style="stroke-linejoin:round" /> + stroke="#000000" 1 @@ -2048,7 +2202,8 @@ stroke-width="1.00002">W @@ -2123,13 +2278,15 @@ id="g5295"> @@ -2156,7 +2313,8 @@ stroke-width="1.00002">IOR @@ -2167,7 +2325,8 @@ id="path3875" /> @@ -2236,14 +2395,16 @@ transform="matrix(0.85999684,0,0,0.86176366,104.19746,31.454579)"> @@ -2342,25 +2505,29 @@ stroke-width="1.00002">D31- @@ -2384,7 +2551,8 @@ id="tspan4426">T11 @@ -2462,19 +2630,22 @@ id="tspan5205">N @@ -2502,19 +2673,22 @@ id="text3007">Control Bus @@ -2535,7 +2709,8 @@ y="582.60175">28 @@ -2556,7 +2731,8 @@ y="257.81976">RT1 @@ -2577,19 +2753,22 @@ y="249.36784">C4 @@ -2600,13 +2779,15 @@ id="path3543-7" /> @@ -2620,13 +2801,15 @@ id="path3745" /> @@ -2637,13 +2820,15 @@ id="path3751" /> @@ -2684,7 +2869,8 @@ id="path3763" /> @@ -2695,13 +2881,15 @@ id="path3767" /> @@ -2727,7 +2915,8 @@ id="text3775">I/O @@ -2743,7 +2932,8 @@ id="text3779">IOSR @@ -2764,25 +2954,29 @@ id="path3787" /> @@ -2793,7 +2987,8 @@ id="path3797" /> @@ -2804,25 +2999,29 @@ id="path3801" /> @@ -2833,13 +3032,15 @@ id="path3811" /> @@ -2850,7 +3051,8 @@ id="path3899" /> @@ -2991,7 +3193,8 @@ id="path3543-3" /> @@ -3002,7 +3205,8 @@ id="path3185-1" /> @@ -3013,13 +3217,15 @@ id="path3537-0" /> @@ -3030,7 +3236,8 @@ id="path3569-8" /> diff --git a/ws_dist/examples/hardware/rv/images/cpu.svg b/ws_dist/examples/hardware/rv/images/cpu.svg new file mode 100644 index 000000000..08421afc2 --- /dev/null +++ b/ws_dist/examples/hardware/rv/images/cpu.svg @@ -0,0 +1,2230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +53232IRWrite + + + + + + + + + + + + + + + + + + + + + + + + + +WBESEWOutDMRDMW + + +Word/Byte BEWDataRWord/Byte BEWBE + + + + + + + + + + + + + +Sign ExtAluOpM231 0'sM34RWM1M4IMRPCControlUnitALUInstructionMemoryInstructionRegisterOUTMUXMUXDataMemoryByte/WordSelectorRegister FileImm. Gen.PCWritejumpZNWAddrAddrRDataR01111RDataRead Reg 1ReadData 1ReadData 2ControlSignalsRead Reg 2Write Reg 2Write DataIR[19:15]IR[24:20]IR[11:7]MUXMUX0002ZZNN diff --git a/ws_dist/examples/hardware/rv/images/index.html b/ws_dist/examples/hardware/rv/images/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/ws_dist/examples/hardware/rv/images/processor.svg b/ws_dist/examples/hardware/rv/images/processor.svg new file mode 100644 index 000000000..08421afc2 --- /dev/null +++ b/ws_dist/examples/hardware/rv/images/processor.svg @@ -0,0 +1,2230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +53232IRWrite + + + + + + + + + + + + + + + + + + + + + + + + + +WBESEWOutDMRDMW + + +Word/Byte BEWDataRWord/Byte BEWBE + + + + + + + + + + + + + +Sign ExtAluOpM231 0'sM34RWM1M4IMRPCControlUnitALUInstructionMemoryInstructionRegisterOUTMUXMUXDataMemoryByte/WordSelectorRegister FileImm. Gen.PCWritejumpZNWAddrAddrRDataR01111RDataRead Reg 1ReadData 1ReadData 2ControlSignalsRead Reg 2Write Reg 2Write DataIR[19:15]IR[24:20]IR[11:7]MUXMUX0002ZZNN diff --git a/ws_dist/examples/hardware/rv/index.html b/ws_dist/examples/hardware/rv/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/ws_dist/examples/microcode/rv32/rv_base.mc b/ws_dist/examples/microcode/rv32/rv_base.mc new file mode 100644 index 000000000..f8b8c0511 --- /dev/null +++ b/ws_dist/examples/microcode/rv32/rv_base.mc @@ -0,0 +1,471 @@ +# +# WepSIM (https://wepsim.github.io/wepsim/) +# + +begin +{ + fetch: # IR <- MP[PC] + (IMR), + # Decode, PC <- PC + 4 + (AluOp=1010, M3=01, M4, PCWrite, IRWrite), + # Control Unit signal + (CU=10) + +} + + +# LUI rd,imm Load Upper Immediate rd ← imm << 12 +lui rd inm { + co=111111, + nwords=1, + rd=reg(25,21), + inm=inm(15,0), + help='rd = (inm << 15)', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M2, M3=10, AluOp=11111, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# AUIPC rd,offset Add Upper Immediate to PC rd ← pc + (offset << 12) +auipc rd offset { + co=111111, + nwords=1, + rd=reg(25,21), + offset=inm(19,0), + help='rd = pc + (offset << 12)', + { + (SE_IMM=1, OFFSET=0, SIZE=10011, GEN_IMM=1, M2=0, M3=10, AluOp=1010, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# +# LOAD/STORE +# + +lw reg addr { + co=000100, + nwords=1, + reg=reg(25,21), + addr=address(15,0)abs, + help='r1 = (MEM[addr] ... MEM[addr+3])', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M3=10, DMR), + (REG_W2=10101, RW, CU=11) + } +} + +sw reg addr { + co=000101, + nwords=1, + reg=reg(25,21), + addr=address(15,0)abs, + help='MEM[addr] = r1', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10101), + (M2, M3=10, AluOp=11110, WOut), + (DMW, CU=11) + } +} + +lb reg addr { + co=001000, + nwords=1, + reg=reg(25,21), + addr=address(15,0)abs, + help='r1 = MEM[addr]', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M3=10, WBE, DMR), + (REG_W2=10101, RW, CU=11) + } +} + +sb reg addr { + co=001001, + nwords=1, + reg=reg(25,21), + addr=address(15,0)abs, + help='MEM[addr] = r1', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10101), + (M2, M3=10, AluOp=11110, WOut), + (WBE, DMW, CU=11) + } +} + +# AND rd,rs1,rs2 And rd ← ux(rs1) ∧ ux(rs2) +and reg1 reg2 reg3 { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + reg3=reg(15,11), + help='r1 = r2 & r3', + { + (REG_R1=10000, REG_R2=1011), + (M2, M3=0, AluOp=0001, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# ANDI rd,rs1,imm And Immediate rd ← ux(rs1) ∧ ux(imm) +andi reg1 reg2 inm { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + inm=inm(15,0), + help='rd = rs1 & inm', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10000), + (M2, M3=10, AluOp=0001, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# OR rd,rs1,rs2 Or rd ← ux(rs1) ∨ ux(rs2) +or reg1 reg2 reg3 { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + reg3=reg(15,11), + help='r1 = r2 | r3', + { + (REG_R1=10000, REG_R2=1011), + (M2, M3=0, AluOp=0010, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# ORI rd,rs1,imm Or Immediate rd ← ux(rs1) ∨ ux(imm) +ori reg1 reg2 inm { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + inm=inm(15,0), + help='rd = rs1 | inm', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10000), + (M2, M3=10, AluOp=0010, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# XOR rd,rs1,rs2 Xor rd ← ux(rs1) ⊕ ux(rs2) +xor reg1 reg2 reg3 { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + reg3=reg(15,11), + help='r1 = r2 ^ r3', + { + (REG_R1=10000, REG_R2=1011), + (M2, M3=0, AluOp=0100, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# XORI rd,rs1,imm Xor Immediate rd ← ux(rs1) ⊕ ux(imm) +xori reg1 reg2 inm { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + inm=inm(15,0), + help='rd = ux(rs1) ^ ux(inm)', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10000), + (M2, M3=10, AluOp=0100, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# ADD rd,rs1,rs2 Add rd ← sx(rs1) + sx(rs2) +add reg1 reg2 reg3 { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + reg3=reg(15,11), + help='r1 = r2 + r3', + { + (REG_R1=10000, REG_R2=1011), + (M2, M3=0, AluOp=1010, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# ADDI rd,rs1,imm Add Immediate rd ← rs1 + sx(imm) +addi reg1 reg2 inm { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + inm=inm(15,0), + help='rd = rs1 + SignEx(inm)', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10000), + (M2, M3=10, AluOp=1010, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# SUB rd,rs1,rs2 Subtract rd ← sx(rs1) - sx(rs2) +sub reg1 reg2 reg3 { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + reg3=reg(15,11), + help='r1 = r2 - r3', + { + (REG_R1=10000, REG_R2=1011), + (M2, M3=0, AluOp=1011, WOut), + (REG_W2=10101, RW, CU=11) + } +} + + +# SUBI rd,rs1,imm Sub Immediate rd ← rs1 - sx(imm) +subi reg1 reg2 inm { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + inm=inm(15,0), + help='rd = rs1 - SignEx(inm)', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10000), + (M2, M3=10, AluOp=1011, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# MUL rd,rs1,rs2 Multiply rd ← ux(rs1) × ux(rs2) +mul reg1 reg2 reg3 { + co=111111, + nwords=1, + reg1=reg(25,21), + reg2=reg(20,16), + reg3=reg(15,11), + help='reg1 = reg2 * reg3', + { + (REG_R1=10000, REG_R2=1011), + (M2, M3=0, AluOp=1100, WOut), + (REG_W2=10101, RW, CU=11) + } +} + +# +# b* +# + +b offset { + co=001100, + nwords=1, + offset=address(15,0)rel, + help='pc = pc + offset', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M2=0, M3=10, AluOp=1010, M2, M4, PCWrite, CU=11) + } +} + +# BEQ rs1,rs2,offset Branch Equal if rs1 = rs2 then pc ← pc + offset +beq rs1 rs2 offset { + co=001101, + nwords=1, + rs1=reg(25,21), + rs2=reg(20,16), + offset=address(15,0)rel, + help='if ($r1 == $r2) pc += offset', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M2=0, M3=10, AluOp=1010, WOut), + (REG_R1=10101, REG_R2=10000), + (M2, M3=0, AluOp=1011), + (CU=111, MADDR=bck2ftch), + (CU=11), +bck2ftch: (PCWrite, CU=11) + } +} + +# BNE rs1,rs2,offset Branch Not Equal if rs1 ≠ rs2 then pc ← pc + offset +bne rs1 rs2 offset { + co=111111, + nwords=1, + rs1=reg(25,21), + rs2=reg(20,16), + offset=address(15,0)rel, + help='if ($r1 != $r2) pc += offset', + { + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M2=0, M3=10, AluOp=1010, WOut), + (REG_R1=10101, REG_R2=10000), + (M2, M3=0, AluOp=1011), + (CU=110, MADDR=bck3ftch), + (CU=11), +bck3ftch: (PCWrite, CU=11) + } +} + +# BGE rs1,rs2,offset Branch Greater than Equal if rs1 ≥ rs2 then pc ← pc + offset +bge rs1 rs2 offset { + co=111111, + nwords=1, + rs1=reg(25,21), + rs2=reg(20,16), + offset=address(15,0)rel, + help='if (rs1 >= rs2) pc += offset', + { + (OFFSET=0, SIZE=10000, GEN_IMM=1, M2=0, M3=10, AluOp=1010, WOut), + (REG_R1=10000, REG_R2=10101), + (M2, M3=0, AluOp=1011, jump, CU=11) + } +} + +# JAL rd,offset Jump and Link rd ← pc + length(inst) +# pc ← pc + offset +jal rd offset { + co=111111, + nwords=1, + rd=reg(25,21), + offset=address(19,0)rel, + help='rd = pc; pc = pc + sext(offset)', + { + (M2=0, AluOp=11110, WOut), + (REG_W2=10101, RW), + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, M2=0, M3=10, AluOp=1010, M4, PCWrite, CU=11) + } +} + +# JALR rd,rs1,offset Jump and Link Register rd ← pc + length(inst) +# pc ← (rs1 + offset) & -2 +jalr rd rs1 offset { + co=111111, + nwords=1, + rd=reg(25,21), + rs1=reg(20,16), + offset=address(15,0)rel, + help='rd = pc; pc = rs1 + offset', + { + (M2=0, AluOp=11110, WOut), + (REG_W2=10101, RW), + (SE_IMM=1, OFFSET=0, SIZE=10000, GEN_IMM=1, REG_R1=10000, M2, M3=10, AluOp=1010, M4, PCWrite, CU=11) + } +} + +pseudoinstructions +{ + # nop addi zero,zero,0 No operation + nop + { + addi zero zero 0 + } + + # li rd, expression (several expansions) Load immediate + li rd=reg, expression=inm + { + lui rd, sel(31,12,expression) + addu rd, rd, sel(11,0,expression) + } + + # j offset jal x0, offset Jump + j offset=inm + { + jal zero, offset + } + + # jal offset jal x1, offset Jump register + #jal offset=inm + #{ + # jal ra, offset + #} + + # jr rs jalr x0, rs, 0 Jump register + jr rs=reg + { + jalr zero, rs, 0 + } + + # ret jalr x0, x1, 0 Return from subroutine + ret + { + jalr zero, ra, 0 + } +} + +# +# Register naming +# + +# ABI Name Description Saver +#0 zero Hard-wired zero -- +#1 ra Return address Caller +#2 sp Stack pointer Callee +#3 gp Global pointer -- +#4 tp Thread pointer -- +#5 t0 Temporaries Caller +#6 t1 Temporaries Caller +#7 t2 Temporaries Caller +#8 s0/fp Saved register/frame pointer Caller +#9 s1 Saved register Callee +#10 a0 Function arguments/return values Caller +#11 a1 Function arguments/return values Caller +#12 a2 Function arguments Caller +#13 a3 Function arguments Caller +#14 a4 Function arguments Caller +#15 a5 Function arguments Caller +#16 a6 Function arguments Caller +#17 a7 Function arguments Caller +#18 s2 Saved registers Callee +#19 s3 Saved registers Callee +#20 s4 Saved registers Callee +#21 s5 Saved registers Callee +#22 s6 Saved registers Callee +#23 s7 Saved registers Callee +#24 s8 Saved registers Callee +#25 s9 Saved registers Callee +#26 s10 Saved registers Callee +#27 s11 Saved registers Callee +#28 t3 Temporaries Caller +#29 t4 Temporaries Caller +#30 t5 Temporaries Caller +#31 t6 Temporaries Caller + +registers +{ + 0=(zero, x0), + 1=(ra, x1), + 2=(sp, x2) (stack_pointer), + 3=(gp, x3), + 4=(tp, x4), + 5=(t0, x5), + 6=(t1, x6), + 7=(t2, x7), + 8=(s0, x8), + 9=(s1, x9), + 10=(a0, x10), + 11=(a1, x11), + 12=(a2, x12), + 13=(a3, x13), + 14=(a4, x14), + 15=(a5, x15), + 16=(a6, x16), + 17=(a7, x17), + 18=(s2, x18), + 19=(s3, x19), + 20=(s4, x20), + 21=(s5, x21), + 22=(s6, x22), + 23=(s7, x23), + 24=(s8, x24), + 25=(s9, x25), + 26=(s10, x26), + 27=(s11, x27), + 28=(t3, x28), + 29=(t4, x29), + 30=(t5, x30), + 31=(t6, x31) +} diff --git a/ws_dist/images/author_juanbanpar.png b/ws_dist/images/author_juanbanpar.png index d65d3f2d15f0f79fe93cb8cac2c5a3b77bfebdcd..fc9e3e32e6ece06209b2e2d0e86c440d8e6e7ab2 100644 GIT binary patch literal 14413 zcmb7qWmp``*6!f$8rLBrtg4#71965Iy{3mSq;aQEOIf=h6hpux!y2o8e`ce3|B z=ljmN&;4<$=IQCxU0vPpT2;%co|d0}0Ps~5lobF72mpW*yaJxK07mk@j`je6x;lUZ z005u^5D^FgNboZRcm+f{0+9bY2LM>${{R3|KEnUp%}4y#T?Al0(!bBe|1^B+0}!Ai zh$8@z5EuZ61PDk32u}k5T6n)G2!EA7jo<|d5g7pmfQp8Wfr$lg(2oy5K!RUGLPkYK zLq$eM^*}%bAQ2!F(xdPbG2o+0YYPxtxiO-J&?U-{6zB-nGg?I(ZIe51M?XL z8#{-HsF;$nilLFQiNkBhH$J|8{t=N;(J={W=^39g^Giz0$}1}Cnp;}i+BgJ=l@2z3Xp}%4)MrCJq!*5MrFJ};lY%ntK<05jlr4pqHn4#x-BnO4gT+{c8clvVCc4% zLv5#-Q;^=8%PDr}`tXzP#$&*k^YXXEshoedYmT?(MnLzZnX_bAX6(BY<5kMHRsU5< zG%tJ#Ks#e!?SxpJ(|L$ccU+_5)Hm=qa0=Ig{j`{4a&F86tkzuS#x3$h<3#Z5l%s`fgD zy@yUMwzu3dExcG?3vllL&;H!0!B|$<8CWmpB_BOwYoISI!e#H>O8(tq@AIz&A9Wi5ISyAZ~6ScYmd)^ z!P|?ePu|(-FJN(NeougWcW)y}=L?$1ca&dn3&RJhD~t*~gXy!aT@JdU4?1l2ue}U% zvV*P;bDe&gff`#@U;gj@T0R@w(}R2l?;;6?7d#G|ggbK#HH^OROgpGYeUZ??QZ-@W z)Y`|C8K{(`?MRzCFkB~ba3TBRL)>cipxZLzz0&f(Y5~VC!9#3li{0SD;pex$8-caX zzGaN&6E|5RW`SyJUu#~Os9K?VStt&51%FQi-|JXgIHz+XotG=6jZZ?|e z;m{^f@|QFB<+xcqf57O`)=SQqP4S?qcnT2(6rYhp}}t_=lM#@_yjd!?ksXI zt1j-21d&T$*0-&a|20W;j3q}wv*~ra58cx5j%Yl5mg^@P=h8}#pvOdC^ab;;)0%4q zeT*Ao()t=!-#L|S3Ab*)ZN&Lc@%}~C*u1}@rTKBB8#8ly)8aJMq)xMVbWA;m`=Q80 z{5iY+l-WMb`^-zcBW{1+yXe)G^Z%6Vzhs=eACx)FErGHV5oB2Wi1XHUGxudqz+3nI zoSB8ke46bK=_b&|=3};wJl&C;Rv(uC!t;+3aNfyOxG;EsAd#m|y5QUx^mCKUKl4%( zGUnuDp|P%)!}@Yj@+Hd6%jvr=+vAS9{~QYcP`K&itJ=1p$?mTQol}~hoR%BZ+tR<% zd2p}1YKwn92kayXA>a#~Kl>V4c0eknF{yu;{I>bOY9^LJPN7DHv*=_Jomx_i6vOfJQDe$%&>Jo$OoEj#&XwJPe>>k8Q+fh;=Bg5tS7 zep8x?PaobkzOsxJ2&v8v)7jUu6QToT##Wvx8SwtlX%R={=ByrB9?HItwQv7gnDp7> zeW?_3RHB{+p_R6Bbc}&Yr8P@8T%V)EttJ8r;u8SOEX|<4ILlH?u*~!XQ1Lz>eYE12 znPUJi93}FX-Vdg=lpYMF>x!?RD95yl8r1shWPb^@ahqaTBlAfcTamEgdyzi9!TM<2 zbz8dmT4Sfn{AAW9xs<2Axw@lNihDXgmYBU}1DPEo8nxfgtUAjuW=6~=QK0NmcNs90(_m#ruvcO!Fx32~Q zVu157<_+~i-ggWw=38AnKFqzw6Vd#BN8?=IW;~+F5H!3#vxvV(!`&^ozSs@nB~-I++8A`E7gF*y7#A4mP;IZIxkG z?_m4fTEQ1bR3$50M4go5xbpF1ob+!H(KJ`HB+*MCgqKu$a)k$CsAj&{5gUZz==h7= zrdd3#i?T1wsH*wUA{>toT;9qSeodJTO31%Sq zBw;L0>!Uo~2xT8X>0;-V(egQdI)US_Nb~;Y0R5z)&sx#iUyVvfcitf=f8X9c?uG!# zR%87@BBHI#*q2c!v*ews>gTF*KbbkJIIT3QC!*3lVp#9&1uA&;jeM|42t((#??Km( zWv_6O&Y73N<(;xYRpJ4w?PZGLJFpiD>F253d`bm(lEx-2g9^vv2_igwnaown?!07P z98o5gZF=4W;?D;rDh-^i_{#?BJziva)?NlpO*S{zCyc#?6`c7rx;dv7_1Ejz-AjbL zTAlySqCUE%{mLbsOkib|=laIlTpk>uf)9t&r7m}eR6Vd8fF(Ta9vgwX`j(7w>u3ql1oR+gLM>2||B7uASNHza2-f?=8eZ#%72^_$C>#K}AO~ z?97gK7wP!~AZUv-K8__658s~c@m)v}MNOAnXb4JL_T+j)WEh4~RAzhDW=>j9@7~F# z#TI{s0})MYtl%HE;|mSgQheqH>F0S%bQMb!X{E#|%#ltilY63KB>{j9b@=RY;!z)z+KtF<;|tT3=YKY!V*A45C$C0~r^(-!a6+0qqrQWy{&Q;_(^vZJFjr=@hA_z9r*&T;6(s#2Xo zZ;AWab02n%KW@d*SG^*xZs*MQ`ML|T+HsNu|%Q|t2o0+!;+?7EL_LkMtz%9hQ61=sTLZp zq^e>zN?6>Nt&;)$xI%zz0m=H}xz_vgGf7XOYpNk#8)V73aOb`BptatQCW7Y_Snrek zVhG+=U>e?4`XOs?s#v%E{3QGgWp&M#Fn>;wCXUz(S3h{ZySSN}l!Erk07@@kvo)Vz zgjt-Rl29U}?R$LU;Wi@msfTc5rqa660r9{DAOF_`-d*LbM|PCfn~=)o=Dw0=ggRBq z1I`xK;qSP8>{M3iOrxU_g+$WBsDSejEmhMKd8ZEJ3n>!&7i~SD@Xt9l&-t5%hNf_= zSFM!exLm6~HkbuzRf;_UDs0o@1xib_*oR*Kb`~{Di&PP+qmV@?2|dqW**UCrEhT{! zCMozT4r$BRQK+`9%4F`aacJZVp(0_}C>ZJ@JGix5?H-x`m}`0040F#HW&TxzzT=wP z&0i#CqsYaUZTi+pc33Zy&s;OMEn%at-uAB67&P_NrmSdGczO4lOly$Yb`75 z7;MgyF&nD!w<7{3&ULTUhW(!ae3B253IVL`yi+6KFRefG>TEhk*+Y>-NLK|88ey)1 zQ-4`!cq|V@xDzq~)*-weIz}i>#?J_{(8KZ#I|PU(r90V+ru`&rRY7c7rrTONBiQqkw-716R=#yJ^xRX;rP8nCe) zC)3NP=M|BE%ETd0VVG7CdNE_yr?AtXS1MA-3VozW2+4Sr9k|#dSSLB}(z5FQ4mK4@ z^V`5vHbQ*&Y8XlvNM&D2_0XeBmXd-a8fzy>lOFxfABv=ZDP6dn?aaq^&|so@+IGGZ zyf=}&miov^KV+1{MHkWQI36_rsHPafy!TN&u(&5qkhT@l_ezy?St-&_`C-=dqR~Rn z&k>!wxMbqCt9)yiyZ5u`5^(!&`P`X{^;vVpy-iy~+78&1P=XKgl4&5?otEmWg4q+` z^<#_xW1qX)Bkf--gl9zHEPO%Te~svvW-%g|__i(@f0!A1*B~z6xvRiCalL(SwS4aw zZIdu?9tPF``xRsU&VD=0A+9+qNzS5og4agC_ew471X<;~8xtk1LJ+yH11I;FM5b>o zudH~CMV-GXQfLBi7MFPml*ah5GPfC`GQTW)9j9Jvd#@Y1NzNX-sh zW+ra22$TBa(`1Aa(nuh?E1`EUMee&kJOMCl_R?}GTa@UUgz|PTySnAhGcwZ5!WpIa zMD_%G++;296g;q1ezwU5egBO`6)NOln`0JvVZ+r zA!RWKxOLZf5aG7s$=F!>0Mz;^5*?w%|0`5F;{ETYScgz3cA;VppUvtGZ3$Rv zfR=5T;1c|gUx*6);}?o$N>)WZ0VujRY3rF`Pk<}QtdzhGu@Y(7d2knIg*4-QL&lV- z1ukwPvf`OnnzDmoq3Wy{-kxNB?YZI|uRIs%5R%MprLCqDgjt0C1yTE6Hnv)IYzy|8 zU2{(Jo^fpdJV{M=H}mjn=@?d4SuT;=@n9YmsC@4mDV37`OWT4~KPgh%m6)8rI>zt4 znCT4bby8nKem-dUu6%V>Ir>Khux+$?=|XTK1&jffRR=m5mPqzo#i9KQbi?%TE=o^5 z4_dKR-7Zgsq|0*)mOVz%l*lle*OYZI=5nCVm`Nm5ZJJ0`>auA{EZo@6zjyi6Rbq*q3$pdVkU5cg-IQC zWfgV~wt?cci4PRhNSLF^0O!M-ohoB5Z_x&q>d~5m4$v%w%T|tdVYs=0k-thpwG)ak zsqpSTs<<(d1|nU0el`!S4V#w4hG!wu;}nV#fvF^0=O)kT5O+j zi2Ae7zy4`PRgLU9pDtTCGPXNi;s*C2q_5i+Uv>dMuT`et#*bVwKED%XW>&@6i3q7+ z`$!dB!$HCv+hruLjFw)2O;}@%ha%>8)2{=xD?wNB)vHYPKGfu}9qTL7>a&-Qb~t@7 zs;L&8dq`_g%%bJJq9EDFA-|L=No_^*_op?$a5(uidG=K!T={jg_*~xB$rE$W(wyqdFpI)|q-wfaez7RN$t= zp*)C8+g;*ae+dQ2!A-@k$W760;NDS`6hN}X@zft&;WR2A=;k56OQL=AdY&xb5b-RN z&Wd$aF(Y%%*P?gxAgTsf8p8nEy8JOT9C(SF&7HH#nq99#;keV4}e zAr>_oxL_w=9+?D2MZdNv3!=E;2|s)UFT|9Un3>5+R_oQ_=2XIX)!BwvVG&uNy{=J`*p!uF5iROdRCXxeG7 z6h6#1h+i;L)8yt&=zoeQIfa5N4#n9MZv^^SQNJ5V4ul-;i3m@e3H#;x`cQ z%IbA0Lld#q6*jwAe7A|#T}03)6`Ekd7gfm%{&SC})P0H#0HJ#bV;t@BY;$InSpboTm*7-T>7kQ~4J^^oQ0GKKXlZ!mI-XZQ(F+OaRo5E{sS)(GSIK-I z8hHfvJafJ48ta!%QU$^iTBJ=~k{8?@#x^&JL5d-1ZG=?Mz)s8`%%xeceC+}v&ny8l zbS+8=S3sYvU*b;yuUmRUc z{msTFz|1PM>-Vl&Zxz3Y{)6EK>z6pggUKAw*I)2DD${9jkmQV6FuyLB-Cn z?qVA|t}_j#;P#d7QE9zZB(1&`B!dSL4>BoXCgS!`4eoao*jH@n0L?}Aw#tqVzQg_1 zE$as0ml${gs88A?i?YLIQE5QO_4IF-poPBWT61@G-+rwsr8P&&E6 zcs|+$vP*Ccxj9dogWaC=!Nk$dnX5>~z5Y9+Cjih;BGU_f4jPjsDSTUq7>^j0+#}lQ zN-$$C4otO_K_f2v8kdX7FKA!pS?D2&_vbs~8qWNt9y_>@k9BEdB{7K*2DPF$e%{2} zC`_~sG%{9Tf(LoM)tm3b*?d5;=$-nhBF@UW#=>38VH3Dec^{j z_Kc5g)^X=lvRn4wF2)s!fUt-kM7W^6@dh2w<9gLOONL1mX*syR*}LL8b8R#+h8eSn zBl2F+61Y&Cf@`xca9*MD@aKh=mgzOXjwI)M+q1jki1X!c#h5l7x#fuf2az%ul6A^_ z1Ef!HMR>_GRs?TKnBRj|_JJd<$88hNgkT*oP3b`8j$i6Z%G7m@l^N5ThbHk{runE& z*HUDqRjSO2TRl74((QZ@HeKNGT_azJVow?T!2nwhm#w_W2QvG#l|3ODa377cvZe4x zBboD9z8TO0F60$i%qS02=`8}yY_T846)hyhd@~CO3ttYC5dIG4HX`L@F>IP-QwDRA zDoc1s^=1NM)bEc{3j`W;VGFug1(5Pgv0YQSz?#qDImPrC6N&c2xWz)B_y~@C;dAIv zR*LQ&m*lql2t!Ur@Qy=HTKiVaZ#utPQcceF4E8IEfoLuS;gPmwHFK7SVz4*hz7w{& zKzR%2;x+)L}J;b zjnPD9c$Tuf)y20nH5-;b8XO;+>Zd)0yj5brxCiH6en0rQ8)}6MxEsZvOo1e0nAlT8 zoe|1Vl%lL{hpK1sN4#ftdp@N_qrQ;!G}X{Y7TMdatk(V(PwCMvDv5K9kT0{{7_-0s zioVYDVHvHxz80RQxWlrg(fkP-G8wy~Y=t3Hb5M+(NmgV0xNvZlm?rO3@xtNlP~`~D zE|vuEt#zlbb2{7xR}oEI&cO99X`Nv?*e-9+zJi+CvK=x>EX41#roihgnwu8`4p&A&wK zEKRO{Sge7^@C#$!6F@eTn!<*+TwAGd-cu$Xe9;Kp6JHqHZ&KpY@}5&nx2freY-fY} z-dOrZ9k2<&#wdW?@$jdVD+&F=7h%lI5a)z?!=#a^OmpxC>)?nvS~u_o9rl@d{!!y& zIU`nj+=qzJ+fA&byxiI+K(VhIGRWr%U_S;t{3)f8MNG6+UJ!@06dV8P$4NoK7aOWg zyVR4yE*dNXIQX#hs5cEb?+NCFeo#x8$78$_;^_feECeUJK|c!^Nd|ECIB-7P7wzLx zX?D05pTWxAXf(-C5^i!U;A*7UUJwJS7nO=w?MEqLe8e>iILet8fAFmz=P?*SD*nFx z*u{$;pw|86yV8-`<0jK>8`DANn;gB@lfXyjS~1T^9BCs8wzdL}eY*S@_w`Bn-o&ca z^NKLmiGBAA&}BaM@`hsC_~9V`1?3aqryQP6=kvUT0W`9ig#^aEPE}H*%p?r)H!CT> zw2F7$@a2d+0U}IZO@22WwY~69aJ_;*0|t=rC3!ke1*OsDZ#c{KZC|i7^A9rCXt?+k zMI^HVV=AHObvpbsz(?MuqDM}0*L8O4)Fg6RLTG3FODa-h0qcRw+kBm8gDyd#Q$_{XPI_uIm1%+fLV4I;X;|*#CGw(cv z#^kxcX0mXkM`WmoUmW`3t%G3+7|jKTUnE@+Q)uQ&b1>cfRR>TT1|`J4USxxyj~m+X zFbZUo){Bg^T{#G$>%xBm!2M{T%6quP4EU!e$Qn45e4175pp^VG^QOut-*lWvo&cwS zvG=MR6=(haN6`HwhQaLu`F*$<$sgW5ZnroK$Z|2T9{iY+MkDXKgh{iA>DcxJm{i?s zK<@Qs1tvcMJj1X#>WTBq>kU_?J~)!HQ2`%@Grqq8ugY!^zE+&fB~{@(E?9pl*Oe*T zD=JbnnxdC&wr5p*2nu*}%z8eQ^#l-w6tVAuzwvs_ei|eO_s~88$m42<-n@j*GVJA; zo&`=qcr-73v9?^VR(b|v8Qbys24zdm0%TD$y9RVFADz}1hNizsJ%Evee{@cZ*BO~{ zv9|+ZL^~7j^b3T_Yf0tEP81*Bq-41#2|WQ4o49mJ?yh6#PPw4YRA8K27Zj4kPk!An z)b6uNXLD!x01f$|zdCsXUvXLb=wt@tMXIO`K{z#kh2J{}JYIURqT|lbkGU-C*?J!j zUHAPuoB9NZ^M&(~77F*<{%0{B|F5kN00v*Rzfb-g5t*6jFU~FhxqzTo`z$TBGFIwu z8sVkIt#_zBd>#LTi+~>Y)4yYXafV{uFqT2N)Tx zW4}ff`t+W5jP5zUOgAeqb)`4_~CqQs4R#wIjlnS+v z&n9h#!H+Mj$W_krgj}k^KIHCrCR05D_HoP_xIt4uw#DxY1y6uciuXgjN^Z)dt2k$Y z6}YOxT>Mk8m)cu5QB;0NOt)PFl*le@4%mWl8C$k9{gSp^V|dpHcVBOFM)DbRk(8K{ zd%G~_p8#iqo3=Qgw|hf8lCZ`=rRc%%5wYz6cWb#^MVj8JIS((nx<pexwLL0 z6$A2Gp8%xFS9uE`Pe4OVzF24(10%O$Es*V&m9kK}nguwd;79t)Rfw-8zEict4kOcK zS&UDY&B)Bs6M!*)ubj&``4eM5W&1}48dVEerp?d&_FA?aJYibQw33&g`-N6~YHJ|>r7Je}p$#|00dL*=CUy_Ra0IoL< za|*;2XSzNy-PUC)9%Zr7QGhQrc%slqSNA_`A)~=nMjjp!US2hIX~LNx*8Y70hWmH8 zN+kKH|K)R@Kxa^8kp06Pb+N>h0-UQ9Cz#|7(3VxM_EQn?8AU!*Q;R^rsN>h2BqKEV zB8EJ@pW6jrN_)2I9*B&+siyyVQ;@#Q1QI{{RBwJP8-?s+umBgR?1Oaz~KXc zFQ+d07#-*5&KqL~z5(w}@`Q=(C6uX{OotdXVI9t$7i6}`kYiU>@ZGeV5X)Mtfk)Tt zS1wNg)@bgG<>(EE+_FJ>f><6+%G0^tN_#c}d}KHh9et zHnaK!6}MR|yxxAViuVNOiD z-+n`b7{W{%;(R^t`+_No8DvgJ?to<2OS+)*3yBmR8S-xdR=n*-)P=rcZD${o0;=E| z^zzekgI|HJQSydsJVu}a+i3w_0_Qa?3IqACPoQF;wY^Y~%_B-xMQ<_gtZu2RJ$H1q;6Ew}Jw%A*%IAN`G%E#gfFW zU*k3flG23piK69ZIm$|8reJ7vp)dNVtq$lq2&G zWEs9sxuN42x!0K zFOpMnAgU=t zc2~V1c_puQxwVZ~EWv!Ku!;0=Uz|X4yjZ}Gt=diET!1IQ5(un}K+L8p9)>i;bD0ku zKm=DUxj(ROLLZD9@ag=Ofx6&mPC+8MLmS!egDF}N|Hg_W!E-k|dfAN2Wh7sn?yk`} z^bJtQ*PG`?$7M9)r^(PFDjlXgSX91l-hKu$5wjLhF8nva`oNtc($a!KBQuhkfqeL^ zW;%U91eWF1!{;!rAJm}O&3&N$5L!e( z*aOrMZC*tvjj-D=ym4l!yh!tgT(x_F;qa|;St7119`wpYuK$CU;nHqwZtyRX4X0<= zd9e57x>g}1zHImPr-&JNYxnU{4WDyp7E2OPekQe*hRa7a5D`oPyNSJIe8o53M9}4G zN&p*zAPc;LJ8T47SkuXmDG~d$TTg&ko#-N>cG`6wt)sJTi$Q_JOpmi41;&-Xyi!4;CIVn8dBr_1;Gt_qnZq;Zh|AXZ~Qj)8If3NMCzOoS>Z9@S4e0I zJ*S)m^3-*sgWV@L=t-bCA`}S?(&j6ibzz6jGc5V2oy`Repgl0~Q|(D1%KKPB9{1Yj znPjnj1`~F~(1;}eZGCk#Ra`poO97!;y6ekhU%VqQ7;-VSn15y`4T|9@->V%d!I#vk zxPVo+Pbo}YJ0{Wv!xgGPRpNLA)XkC#1D6;lNZbhW=aP1R7CNx1I z`j!vKcxBCMk4py@jt(aE)kNC{J~zz#fFcgnIFgbGcBn!G*cwYZQ(?-|9<*KZ;_`AmkMc{`&=?ThIFMp*Dqo|xpWnMTMQQ9@Gc?wdzAKT~IYl(e6RD@q(vWW9`w21Y%a(_7 zMQkNYdrlKvmC6ouf99XAN;5Bw3!Z9C!G-=pD&#`sagdmJ>>~#LJ?2j)RIZUHz#ic} z_?8&r^BiIsW1kYAU@EN(?+~pKj2QD7`+8|* zFb-F)<*O2D8=_+0SkHe%Cdp^6l#uFQH<1x%^`@YfXmyOtzs*jXk1PttwluE)l`@e6 z+!39oq}=wc6BkO|wSDBE^5CdpEhSpSf9tG_;b-yqs2hW?dSxYNh8)RH8xJy+3>W32 zq!lFY-F=NWo_%Ez?7{~Y0B0MI8p#_&Z_a3mzs(U%pdeQ<8$$Buh=4+O0nJFe(icXl z&$6Cx*`hyiWUi7&i!yy|>uP0)k4RLcoGZ9Z%1_NM=SVCd_o`P%k|@V#-HUfKCWyv0 zN|Lm@HvY!uHp;#<2v={1)Js%TSm8gOEl0*vLhIWS5Rz7gZk1vj+CEz&MSbOcVRZI}@so_III0qVm)(#go@gf(U*nV$` zZTae1z!x`qJw3?T@f!;?jl7O|kcK;S7`USh&Qls^vy8mjd*TAZ3~PiS<%fAs;%9p{ zkJ49mVd+jG-7*amBmMVRx zNn^&rOO@KH#S*_EiQFl=0+xvpQK+n4z zL>D5XuIv&vt)M)p(xL+6GJKW@-qWrM?Z7|HxT(7c_$6T;Z#AV=(J!hvA_)?iqi@TuH>5;-gvc3yTwCS&>ChY4PWMlvhrLF5RJ zrq)VZNe(%YGz{b$Qb+txqoFvW+K4GA5<;I4%#$WDDs^8J zHG}oYw|GL2ilm}8LZ#&khWy*--A*3DG2ObG}FQu@z3w4Hy5G_EUu(k z5E-IYMm`=|q3_ps_H$)Gorp79NRe`1T}B)B^~k6ce65j`~qA>{O`cSFOZT&PV)xT@B1fHU+6HQa=tS* zdjwTnki8)rP-ngpH^77zM5pf$9RxTUyq2+dRM=PivCBHI=cHj)8m#hR^ELohjf)T} z`AQ_T)|{;!qh1_jq%-0F0b4Qc)Yq(*7WU!H8>2r*7WT8|nKwg6KaYo;E}=S|BfDTO zyYp`YJCY=3F+T7YB)&eV)je(IcS&n^;#pobYbK&Qj>m+sDPT0(b{U(ywaD1RZU=I4 z;HSr!AcyZUXHxGPd{i?`uc*PEJ-|o0eWjj#Dq2wBJbE?K+|cco<9oZkn6A2FPX{6B zUhK45^7P15$DT%NJw8R)%>8S7Tg(XZjpUKrPFF6c4>^8iCCf@gC&Hh~_{demZ%6li z9Zd7Ic!M(VjwK$|H;6-(PLc!YuR7&dLKp|KCG1{cP-Jfal>9zDdnATWk6Glknc_q7 zE2hT9C@R3a=n%l< zN=(|O-^uipPjY>@GLmCPNn@SzOT}i6g4?!{_zC1~T(dzDxb&kNISiL^X(wcnNKs&{ z`*{CVHS*^Ep<0vs4I;IH+CNkh|u}DBGb2lUJFyb0y-daaNx3KcsNeu z=_$x(44oPY@5-7clGp<-2ffeLNxzjf=?=-;lIKQ#7AUhfMCo~YwD2=<=yC~Vu>@Zv zJ_4VMNvUTm2c?Y$Yfoa^1uAuWgZ2q$-0+qP?awOFW z0Og5X^yL8e3RCZx!g>OM4~|_+*8QP61Seydu;9}TnL6NbW-{8yc9c?CLU~A9G0OWa zNWv&)pVVIG58FdL>5J9gb0azg0DLD0%XtV{-NT}`uEcy%WJJl*(PxAkrBomc0iNV% z{D3vWIHu_GTpr-^!gkO%o)vns&4dUK`LXcc$PC`Z^q!uZrIlTZPzrezVBpnn*W*hb z;W-E?4G%6Dc%qDb#M?U*g*TRr=}zB;bt1@=Y>zYPV%Q~DZF2clh_GfIB<~OQny8g~ z7nBlp9a_5-H-K-mI5^y)&AutnGQtbBF+QppfeV{gfE!ct9lsp3V%Sj#6BYoYiF!lL zxZ4HW(asJT4{yz-kG1l*izwNxo1)0Dsd>e@hc2o}WiH<;dZ80k`mw8g?0F#0Z{2g? zj*wCJ$|9>`FHzHqloAtUc9PZBfdq$@RvI32XL>Uw~^`g^Amum2kzcy zab~S|{|Gzh9m55w=y?#VxyEB@KSQb-sD;J9@C>6@12M7T`fPw#2zYFMh1%m_w0|fqEL9cf zuR73Y>oe4YhgI$7KJImmEPDbb(#RHo__!wy?>-1+h#mR zeWq}o9+H|%GT2lWJ*>3U8@O}eY-(3T(_}itIS9*iW#PJI;ij)MUUmz6O<#Crc#I`I zxc>tKaBFFNmcf4iTez_kd|jEeXyE_Q%6;rcrNvaki6rXU|*x1u3V}(G`~4Lm0mQL4t_& z_yT}reX1@w$-B2)d2FKZhcwudb5Hz@BS&qWXMNJiT&yp8Y(9ywKNwV7e!gyV#NOS1 zo0N559ee z$L7Q8Zq=rMq{mmYdzQvuGo9EAhn_VQ5BNG=4e96X9S?g=*>MApcNahBQM-T5-tmY! z-A_hV6*mu`X1ktbwS~Aw{s$Itx2D?pf ztM-H2{sRO6syO6&UO7KvU`vl-?$&2kXNEt`EWSgd9kt%kU&@ZF4kAy#H0dAB9Mda0 z&9E*x;dFC(ku@Cs??C{7lklylU2y3WP9(-5q{mkq29Mo}JzzOEKWcc{mO*t5>kjgl zy5d^zz5vowCJ)>#>f6Uw!xhK>?BTm%=_PbRz%UBbgFZk_K zuQC6`G9K)qeUxGC)yy;1V0r$$yXgDB#6i+dJH7yLZlUrzws{yu2W0y`f7n7?aje)l z-|GrDRp68qY-Oh()(lr90=U-hKqUT`FmPYC>E;Q?_2KJO_BQk4q27~RzB_L*8}4;$ zKk|#{1(9=Yigyc1?uMi1wc+SQ^X1+D`gEec^d~A35o*jA-hF&LFD=>)Is{SNOpe`b z84lK_xqVaNNH=mFPWKhtCvN2h4Q8V-1w}aHB#Dv#**uV7V+eK`rgdwShEeG3W)7~X zIwpDY2`8(|eflc|Pyc3B0<`K+6)9^gjcf6Rs}DZ9CQc5!gJA~;ZU4gX{&Ld8Fa_(G zdI?2%btUm{NZ>f4bhOrTm5o75Yci>y2BA?X#?_VM(*&&f(zEvyy3SOo={o7~n)f&| zhO-qM^v#zy%}v8FmeCJMg|tOai4?jLO4U*%h8fyavzclD0Ha=*iWG~oH_ebybBffu zceAkZaQvwLu*M?3jvJd~)k6AlHEtkZq_^Tgg0A_kJLOwn$Fc;YagVw;5=#|gyKi$N zv=VKZj}}G-^{#XWXrPvqkgm zZohf{wu4Jdgt1MVqWyUn$Ag78ME-DP<%1giAfq?vQc@wMa})ZeU{dql7%h{sd4hRq z7Nx<>0Vh5VoA*$RvDzdZ>cP50!q3W4Ld-k4AWk%@#3B35daJX3IqZS2KsHy|79}2jUfOO z3<((#g$SGxm6(BF4g!skgh_yunT$oy?%PU2ej869FyJr1U7xe|LiJw4bG@^wPF{Uu zMT}>z$qbON3Rt55do~aVcrt*Wx!)&w3u*HfAsO|jf*G2yS5Tr;v|M|H*e*PG5y@(5lcl!f1&>C&r!T;&1$#E zuxLMv${nCNi;`4qW9%KFAa$QQFO+CzfY=1>cng7{s%=FN_a-&>J1!T? z;PoHzv{Y*ZS9R8bcc=<;PN)=4%R+PKpB<$yjlYKD)VeOq{Nq;y| zntM5;@`Y6-ZMdhdabO5ok!-~Nup#JpjP$B|F&iGxRA-6T=wB1>Q1UT@4_k2F#3pZQ zpD+-a5TzU2q2*f6@l0=i{v*}4XEy_4rqa@vpDLFMjT|7~M0r0xO^@3o%1>FXY_?72 z<#Gl!r#Cw4czUy%3F1=U?RiEo&r@)0tQp)}^T}izE9o>%HA*+G!%91Npls|RP5PF* zUiF-8!|LkDtVnvb6gP{C7sS!+riS#D5rDaq;@SN;Pr!)QoS56~a;Xs;B(; z*tk`{0K5~8V3w62ll_0MQ}_+@Vg9yxl6SPU`IZfI!(@~`Ph#F>VOhKlir`2rK?0V; zVy{p}e&>nhd&RA&4FG0(!85TF%w}tJi-DZepyTWi|aJ19zU(K9^vS6)LvJH&VS8d)Aeq4VAGhOiuzO{^=Xo zR(b}lqwcU$)dqd76;j-Gsa{UtbtRdBw?y4Qw8Pl(qVwG(pI22P2VT&~jiZO=B0z$P z3QMQk{;T~rH!U(s1lL9h&Oe{KQ^WGEx~TSMZ33GwVVIW6C`F)wJ3}1m?BBJv2k_*q zmucm=-onVXf0_OE)dk59H&RDGMmOK58lyA=5@`~fw6|OjEl?w_dDN;%vic2J9BX+J zK1=tY)2z%squQ4r;Z*>GUjAjh--@!g#fcAJp;3_$Fpd_3&fxR~&>c>z-mN}#rH;*A z?5>`(Nc%hEw8&nq%<0JRlS%_ZTkO{*No$$?-4JPQdpx%Z9?kCnHv(y+MTpnHvuuq` z?7w;6i!yFP$7gZXz-B$>35E!$I+W8MSJz>_7$p6O$t~jvncEiTLTZ_FXP@Ui_lC25 zk?>Iykw#LDS~6M$;eQy>6^X1LJ2V>GvUNV8S9(YN&^)WM9m^Ja=~(OvRHfQ_O;=o! zH7lJF!u1WtK7sQoF#Yov*IdNV{_gNjP4cL<<;43lw?H0`VDAc%yXZAR_&WE@(u0Q- zpX9VW-Zmg*yV#Y2VWp(QGi|X&cQ2<{C9^PlA*87dL*83ontv`Ux?zG)=Gq~vHFmLm zIqp4Yki_Y?F+M~Si&voTEo9|l%$4O?B;V!FxG^wSkl|Ooa)wOvg|!Wo{j;jyb#g7y zEz8=Y$O?gcj5seJxsAN#`4Dpq)d;WvEiey+CSdGxblIZ*<*@5 z;Op>yN{)K6?T_Xa#nymB80rd&6ne{Zx6|LUz6Shw=Q9M_&@IN$VnS*`xqg(DeVlQl zaA`{R&RYHgKywUsDPt|q>Wer_co5yc!};Xl4Txp@hJcEWzS|Lrm%ArmozBBC(xGYQCp5$h9@2+HaG+gJLg8u)-dPpQMx!nLaGd*Nx_ zere79P~16VE;TZW8Wq}f;|*Gg>`Y_dd%IONia=*HVWTn7(^RlH@0N8~TZu&S^P@oW z3ky@=&hdb_Yr}V8J625C?t~j`L*iQ`bF_IUK6oH$4ICtLaAn1*-A|~emQTVkcWs5$ zF@Hx^i3641QOwL}Ksi)VkQoVZ*eDH0`eXH)&{43pi&u`TTBR0d-|bH|SZ%Zv*`_#W zr<1%o%(o$VyOl>{lBVokNID$?7nS_;8c^ zG172_#x|9}7*C%!V7;r5QiptC;guHk9`AuxlGs6IamR*&LdVAQ%XU{}?}~V%iGV76 z&Ib>>^<=Pmux;{T-{q&bm$*_Q8<7svMr|YY;u+s?4D@_(Xp;G~*k}K@#wq`$@o$BL z{+G7-c2bcLk%<@>3Hb#;QHYrYV1ARr5g9Grc?fgJd?H7d-S%>1eq4 z)mB+OcW~qt8y)ct%b3zmF@l4SC(aUM2$vda2rxS_M~V<>R$dMDKgqmhWSVO zYT1dNPq=*u!KCCAq(HjZ96Y>@CEkya=FM065gboNM#mkMnW=!H5c)tK~ ze}reNne1^Da|#y*6+h}eW>G_nx8v8`shR2*QBI8A7M~KEUpwRiEP|DBGt=RRX;k^= z-5lMTd@j}2H*<(CQhlL?edW&S_DP3QSTHv3lzkl&HE2H z3z{F)Wm8sJP7(E7PZl#_P!42MZH@vNRWjA5>Y{GCLhnPW)MsO-B20qEi|J@Sn%olP z=ft0uT2&>1mG|P9Ak{OV4)bFKpFOElGbyhiIch>qytA@2ZYj#V>4=3MbwSHrM`crJ z_SIiy5E~5p_o7o@1JHgr;{IHFm=2dBx4>UHBQ-(vD8dqbQ|@~XCQRef_I5_Fa^@=K zcM1}_xo)(G5T_N%Y(lUdg}7f;YLhT@hul_kT;umkQ{cD)ja)YH5;;O6&xoGC+y29A z>@2WW-Jt#kla!tfJ#>b`VE|@!`vtJ=2A2oylK;}K07v}AP=+!n5e3zxBE)Z7T1x?DA)55WkaLeNZ6$QVpHt zDU3QdCTTGnb=@L2sh^W|G&A@VKMqmpt>`b4q?&t^9bh zbnT9ibtf6B!k*&b0)wE$%OV;zw+_M$M)=ULr5?pSfkQW0kH@JN_B+6~#cePYD#D!u z`By-q1&ape*UXE8Hm`gLXXOmf3HqYDGH%+2p%xD~mp`O55aCw)BHUV5KzRa!t)bb8 zMc?Z7Z9#%EjEL4#-?up@yBC>d}$9y-92*=;nfHq?sK`+Qp?Sf~G+N zl;$~1;Pp{8hB$Uic4!J+wGeITiQG5@y9_q>%u_Sh9H?<{{5H{Mta=WrHu1&eJDoR8 zg60coV#()}d4&nDC}hz>&=zD%5?nHIS$l**K{C~S2rCxfV}II7uaI+6UTE3&TAe&X zlp~lSjUt{3DuHso;AC8zAYs?5Yn2iibx`+JVlY?WxE+^L+{w(gamlGqRZvURwNJvT zpLI{_WmIa(#t-8zVW^LcF{k)A^81y#Q>Xn^PE^_n)Jk&BY7(48uWYArcW0zbVwXYL zASaPyD%hfM7GzGcw>nOT!?K9Z7W0-Ve$UL3eu+Lzi8!dfzR8apryxhN$h^C6XrLb1Ef)I`Hfl zEqS*&Krycs(jbKU+}v^F+&u9#mS&E0*lWWxNFoZasE7Vrdfv7rHRB+f@L89WdVL9V z4`VXsxd!y(zI<)&d&( z+2Lr*Nz2K#iTDBH)ENTOwV9`UNvm12t#XVx{MM45zELo^99bLgTa zZKqtN{6ZPuo;~}AyoO5xmcAa}@*9y(RC&w2T2KtqxI^|4aS`0mIn--H%I4x~X2$Pu zu;voQ5R!5-bDSSoHLiAS*g+=GaM?d8uJ~_S$mWwvH}no_kJ#}v1PCSdqEi;xRWe5# zEFi>6zW~_#!6*B}geCs?75Na^r^+4U&K&0Hj9&niY@(Ylz#>iq)~y^yK2Ak9;C@- zKLP;(kcb!s5aspl{RsKv^6KPzXLoNHZvP>(_=vs$hrYCy%X#6wTf?WmY^5B=pTF9- zx8=jnBV}9e@jW06Pd3awPpGekoR1K8CgX88aVS*HJasQ2?%TXiYJooCe~W|iXRZ4n z8v5sK9C4CgzNMuB-H}{F$-fIxAgHY>A9P2&4K7}VzfPmn`3#`@ZRpY}V*(=feZPE(?igs+UyNz?5swPj_CA# zvu~kZO`blHE*)(xOG-#U)2}w_=P$@z*H`w%kGjH)pbV^baA|ykElHj8>vJw$5ivV% zDSrSpt2CeG<97r!QzGZgu*!Hr#7&mBOiCr*6N>L8Bs%25Q-)_hO0J=9|1#X#Gt~3h z={LJFl@hBbJiy8D26R-AA3g3d>u9zj6{+ia|MJ^94JX{wi}@Sca>WIq9IWN_6p-8i zj)1)9vQ_N>$7w+lw&A;aCid(sf6#onVlRJXzMiECr!|3{Cy4GvvWVOo4U+UIFTLi+>c@z%6t0|Vq zwx^Bcq5no7_S;gXJdh;+YAV8XobbM-mo_1daqo-e?I8pGAY(GUAn#FYvd5Sgtilt+ z(aYpF*=0E)a9w_eRWHgPuF!1h367xPz@6aG~P+f_%zgx5q2 zt?M=YU^$fH8TqT12{)B{D{uqrE@)}5@&?zH$^isZEQM^AvN{GG`OMW@_re%^h#v!D zo8KCK(K;D+ox%cCLX2C8G#KOfr!hXNSs0w~5LWL`e*k@lYvdnz_wMtjz?l(`Num2( z^~I`o8>AX`pPPZ}>bk?!h4#Ee%PWDzx#r1JF$hX@T39th7t7U^DLIp>!I_PWXD@5%N^=3OO*o zBYk2>!O+(jtrQXCDbq^npv~uUP3!c|?wrC16-*A`4EpwXJBD_E4pC`1;y8E{Pw9Yzk< zXb?xM|8yQlSoAzYFeNsZAa;p6(hqKWIB7)lnI+PPln#%&5KJ$58os-vykAsAHMBj!NhkH*I(qD11}2*pTc6@LMqC_6V_qWAT6@&M04_4DNw zF3HXNp?{6lpFC_3J;N6N=EM`bVmUJ;wi^2?iyex*tTp`Z`XpSKAP}0UeIAHNpoe9{ zya&HA-lNJW0tBC3;s8$;MS3tATtQ?aS6!hqQi%`$G&g8Z(HZ>cayfg7nZUI2uUXRd zB$I*L1FQBhwGO3RLO@K#LkA}s1Iiz@M4cclwr27R3bGad*y)2d*?7O|ptW_&cZZLY zswTm|`9b&5jT(9Yw(a-~dbe(i9o zqC?hhbOMtSY0(h2X%ech$he2jox%edfP5{#a_^nMOxMrUhTps^-+MpcgFEpGW->g7 zJW@I&yAeYFK`Oghs5 ztI$jdsmY9{uY6eIC1mAkVoC5DXqlRBJM}&FYechrT&8->lZoC!S$i_|X5?ous|$jQ z(!iC7m(XPYL>1_yQDu&L610cJEJAqHat`vP08%?)zr2%>KeXHe$K@X~deaksuoR*# zW6VTo_*4?kwu-{OSJ6DC(k(R(bVG<@$RR8@h?`7}0D0M{SGof0z+S-p7E$f(7HgE5 zgd;lnOPeZY?PQ;ha=SN(f2{T^0bVGF*RjyFQsuvS-=?FUH5_3Bh3bUA0ax&T!M9*HE$jPPd2^b)__|_8i1SKVb`(euo>F z#*|TQ)bN8K_cPtk9Plmn0?D!a;g+(}2z9|t{0LLpqwMHm${__`Dz?D`R+VC84aj905M@yBN=|;jL zL}TB|_{<(4D+JpZ+7h<)1<1uQPVdEW0+l1WG2xq8HVRK8RfaYh+%*S#x=2JQO{@kwXO z;f=2@KbPmEdHX*044Gm$<_c;y89AdL|3i=fEU=A9WMJgvaUcm&ksboJV`0!?#~U5; zrfEd&fuy|ar#GIE{em;>Lx-$SBFsf3rzJlBep? zX|;J<+L7_2^3&&R!zq)sB$P9ZlMh6}d~~FvHubAE-#3Bu?|du($T!W3ct6ek|5f`D z{_jH*ICEOh^Z$GPXbq~Wd`puw~O5P}x!zbk&vru7P~ zVgY*pN9?z{wiUWJ@~B)7@PChTLmsBdO2r z9Ad-C(iztrdF<*YhV+MNg$;f5xQPM>yE^a@UYi?IN%9xxJrxd(+UV4Vy5BS-1=7Fc zHPG*n?f)?9|BlxX8NMk-Lj5>7`&qxdy55_A*mT4Xb2Q}3el_1gD-lZ+$5pO;v<36R zS0d|iw*Y={EcF#%?>bw0w87%smlV3-0$H8H@D*~nz@)|wj4(5jT7r1CSZF9k#d8X0 zhy{c&K{WMNqY2a!O&6?yAw5K5EIBc5xXDdx2JK&t{&jZ5!uw1G369=YC}jb}UZP>e z#;JQ`)vyg%Ua`MZ8!8pAx?ww0hI4W5p^`qg$Y=#R#8x_acT)}U)G6^0HLNk7&-Hn7 z1_1r2k}5>f@e@!6gh~Q1MWDUH=@6e}Te)8VZ+-iGGMsk5Pz*#myaFucvf}(Q6x}0l zzh%tNc!~i(R5p&JHorLD8$WsLmbwlSc;d3uY_(!flHvNQ4rQhVy*}7ktZ5*B78hlv ztRL~r<1&cz7Zs@GP}mlb78)iBbyQ+TwcfvPDXgXQdJE&IZH@Y>3mkHHlq?jgLSal(|H>%+SCU13rGK^E%J6@ zJ^Um7Y7R|O?~ejq*y5&7G;j2ZT_`#*6n1PWb33V7onRwgRiA!BqC5&S^g#YaM7Gq$ z>lP$1d09t3#`Ay((JS>A7|K*<1c)sy1Q-x+dJ&2>a*|J*I~8myZ?2n2Go{ievI7aq zEqm$F0g(egu(=8ZLuxn<5s(`Xpsn^AgEquK)^NJthE+n120WipqBw?Fkm8+=9W8HA z<#b_Oc{&mrmDY&KQ3%vd8u?`Oz~-NxlLA;XC14$Kz5R(A!FLAKe`i{^>X%@Yj2nbR zVUT}`JlMWMdWc?wn9YmJB9ySme5n2*O+h{fd=H6^(;SnQ|gKD zV;5rW{Hl&zY3bU)>Og+-@nBhFj47D&Ma8j8ywvm$u32Zv{Qi)h;poTTpln37-zQ4_e>f9RAh7?F9Q!|< z$-gL*Z^GmTk^h@BA>6%X_%COI_)S5KA>%0{>WQI;GowzO&^O|I(w@Ru$O%SG1t~7% zP|%-@vfVghCu?=fKM*Tirip1ut;6`wA4NPytaE;wdM!Dxp3b;46Gi4Nn4&%%3;YQQ zV%RA9kOSSDb73b9+7h%#k9dlq@wB~a zcScp=sXt?cg4ZAHowOJsVo3cOE_L@fzLbUjSa@hh`nWa?^`-O$lqjGm4b<-Rm5%WK zAexx2tw!hWT;R*5&w_VUs6b673OH}c>t&WJdijfqNlPKFZ-A`H7zsa$M~;mKjM`KW z?GFQ|Yo*7+>Q>0n*j&^l`39a5VHH)Z`f<^hbI{toR<2||{46z~sU5l+!(s$=2jDy+ z)1LwBkqL0v+jYINiii{@i+J_;s&m9ONiI5w`RDotp*05JajLQ;qjJb^nBI`y?*ep0 z29EF0vsRAuA=!$W=Zj0{46#ZrJZNfRl_^AJS8rQxLBKWw$ssueVd}H`>o-7oQ8u+DxKw;ES8tlR=E4%@A6yrKrzAF zJF-g_DDD>Bxd?Reb~yxgj_dB>@xLFBOO{`w7|l2+yCZ_fl#AF)js{fyhW&3pJcg|O z@yaQ4^JtKe8MQL^nYN2ENP^yyHX^WWSR~n5_-K^6c87ra1K2Uwscm~z#D=dUvmxcQ zqHY!?#meDzh4N}_l5pp)Xv&Tm)(CHDwJMZyl!0?k^8Q?ZPEpm)j!S!gU&&6;d{Pi0j(t=*?z$u4Ui@D`|yVZa0-#d@%@Atn4SYcpCYBGtGel# z>6;NF?LI533y98zN!23`3JS7G0-w{)rmk^KZzmnyDUy|A$cp|A0EfzFL%h?|b^`Xa0y z1(v-${sO2iy$D4ty;; z*W;FQ1zTa}Xa3w%=0lqY2(9nXy>bHHeW^21-rF4Rk$;6Z?C%4K4mgY*A5?5E7H)pK zlng>Ll|pN|ic*G?WwTciMjc#-0kkmGzHs6(bL-oCpz^(@<_})UHPh=J3(%ns3GpCy zP9asW2jikf9O)3W*0K<(a;O}s#K&Y-zv5E6?I270a-dRc_kFS^$}|7qAWB{AkFzas z%v?0*FTjd+yXxX^(+NQ=B_2K0WU^I2aqW!sCsrtf|4@;iH-ftM%Qd^ah>2ku+;@Ue zfg^R7exM0Gtib623AlOLl+6W)vu=*UF0{F6=#x)wqaBw?m`~DGU}0djZ4O_j6C0ru z_`8u~>MV3qJA+Nb zty+3p?JTvOTI7T}G&6=-t=*r7<>*giZ!^Nh6(hGkgvw@LaQ?$DK#lk`G&GNOw@g;W z-^xbBK@bMYnY~G%hzs&4yBdN_G4x58(IqED_jDYp7DUX3Jq1{$5%{*?KiEggQ=El$ z9d3l#DP95r@x)PB?m;R^vykC>Q8f03%Ba%VH*~VokI}J+)JY2O0rZm8bQFHapRYZn z2a@FoTTNQ760~1{1)MX#av+}TGpvRXFr2AS|2g#uBis7D{01XJi$9XPo~Nv;GPUI9 zf~!GbxC3Q$?Hh%Q$E5IoQm9i;k-E4AFkFX-h4jzqC6PpqXlf;HC{F{HfQI>PPax{v zE|;VGLQNkl;7^ZKE3AnVNTMv---MC0Ycx`m9IvTK>I}^4Dy9YOVlqhp!?F&L8x9Fk>UH9H@MFT%;2~(xSCcrqk_1H>9+ zk<(uKAtF1AT}KJ(yMZ+dz(`Rk`ii|v_*iGQ9%aM1?~y?p%}>dP^w8$f(3?_A<(>Fg zL5#_W`25#m_(O4UP%qVcG_e67J3uNdR}c@X%XC=H@C?GKcG55Op1z7!-pgme@)^ z^ONT9Q{j{W=U|r*7?^3wjHM;;!XX~CJ7NUd)lvfi$H}3rqd1#F!D%I;fNwg%A zRcex$)Z37%h3V46{icl4{ROQs0>Y$xeaO;aI(q;10FgueI-aN`<32EbP1Iep|8OMA`e(X71$VC3p)X*;I2S`^F-*&<5#+fXQVaz18Y!_w%u#(}D3X6>#a zTIr!4?u4Q!PcR^K6kG&LqGzMv_MmE#h<_irqJ?+&;pdo?BbQFibvwTDvxhEkeHpe$ zeQe&+2VrDE&%Q!sM|2*}Z3Mas6)FxkwH%`+-5Yp^MGF#Udj6j%b?neFcS?(PQh1AQwyXTKomk?;6x?6D!U{6&CmdPoWFq$!r181GWie8wa5?E zdOh_z-v!{5k@vbE0@}ci_6f_=-xm8fQjD}toRg+M1<(i`Xk_$8jocUimYG&{?~h=q8gXZoWt5-<0R{jny2=0k!=g8r_1HrBzleA z9H3=wM8MQWpW?dZ!p8y64HDRbA4;c<~E z3u)}u>@1Aw;GxCTxM|Z}cIBk`#WI$K0sSexv}%S^BDr|bZLPOfW^o7YehkBOR(5xA z)*Vt7w#i@5H|&t5U!>$LRN6$Rs9Q#h5}K$`g)=n`h$b=`{3)Hm5>|}jkqqA=TEWP>2{nuB%ZOuutW#GG_>8llZq6C zubEDZ@nw}B2S54(oKiC4R)T9c_`jAD7lnBNfp2g)iRPm)eF2oZF|xv@w0pqi=4%MD zj9rAlOsMW}A*}(Q$dQRavA4UQdGlgJ#nu`lP8oVTt)+Qp*8?4Ee%((hRIB9`Q`fT* zqF`i4(;q>RaTwYO_wQxUiTR-;Y7C^swf=qu+tb>Dea&%#RJN}fkl{mqpJ@9aX>)0A zfjxlt4N|y=Zb*^-phb^Qdl-D7%03|D&fSo51`7a94Bqd<{#{VzPR_v*`e5P!;Mv6M zzj%vO?XK;%Tj!yby}m=uPP%vC?9iWR%XK9YaN<`;3xtHDE2=s&)E#QDyfC>0Mf853-D9oaEc6G|-kPN&oC3!UHt>~*;8)ovGB znufsIp((1PuGR5NMIB8@$J zai5;xm&0Aj``vJpCP-TVx8gY`LK|JNB>m^m3zl`!=E7FTQ9FMeu6{&a#DzpX8cF2G z5{7K<)-3`y3ka2`!1M_G*cTwyR<~C#poJm(9p06G*5{7>f zxHGDpYjo-!DM|i%Z#pkjG>}W3(rWhOK5qt$APaE`$K;0rrZ`@?En0IE(5hXncH4D0 z&ksmK#vHSaQq@iq6_($w2+5uUxM`*MrzgGL+qC?YAuTn()M+cylM}?2;Lect3+Q5W zZEM`dm!gxXlnon;I5>MHmfeDfrsi3;1mQwJ`I&{yoOJZt;;ryO4LU?5*i?=J`9*X4f^#us0&-ekF6~nG4OOIW zVvCY8CT6vr?Umd!X(S}O5o>lF25Eh*Q~CN*XLm(1 zR|hc_hF|>LSXUC3;gO#}V^C;FMuIR1u4z-IE7N4*^rl4E}l_K!*?It&3*x-ph$ZF6hBy;-b8U0ph-+c5fIGaDUTFx zB5^7Emvo~j{bU-Td~RecY@b*MxCZ6q7m+0uC&#u6h?Wqghr`um*fEwX^|7TT5F~@s zC(N{(V`-V|KN3jWQN}}abRin(5Y1U+Nuc53XNlLlst+SdWUo4aYzzBKG`3&TA*~yo zLjzr+<>+ELqC^)X<_s>+sb-96j-2$0@?D9ZOcDGp?J@{HcgP4Yt?tqA=yZC=30v`0 z=_<}4D#$uwuB^;dbMX{GPVR9EccTRNp!}FScT>!eYN%mf@6VZkgIZtct`fq-Nx!J! zUzkD$<+3dI25@`#R??S|#+K#$T!m5`!o2E(fEOEPi8X46&C0PWS2xpsI5Ipjgp<U$VyWGtg& zrE>cf!)=iNBrNsY=))-Y(+8;`DCX||y$}mC@UgKoa2IvhQ)mw#c#>uPld3lJ&R-h5 zi5;O>eh3@QAiv2u6_Kr1u4;)9)q_Ad?aJpeAJi@z$&7a*X17Jy+%55(hN zgxF<3jyqcrij95tlKhib>=Y-^-hNaO*-v{Y)w|5@5)HSvs7K1e0hS=u+~tq!cELKo z-9Tr)-~%-;tV^?D`p6*Q4;x6gxi*?hWDJcqfts&bD3t~d8~dH_NNXJr= ztSeLEfzb`BV}(ySKDoX{{3jTHSdJ`v1}H@`(?YF2P9+#*G9e80p0ny&)f7uC$j8UVDBLCvKuJEO)zx0a9whLB4DxSRkW{kN1GSG!)f;Px-4GzK4HTz;Q%fTeRZDNTYe}+lXWz*DJD{q+;e@TyMFEF?Y3d&h_I*yCG zR>xgopabyYF!iF{ldtp>#mp!oJABg8jX!-C#$ahZhtN|b%N!04_yn;GLYe>{Uj6%* zp;uN&ct+68_nfX#BF2Yg=#FfJHEy;Orx<8(J@q)u0M4YOGWChSWeo~vS%-P?oL+qu zIfZ"+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 +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},oc:{begin:0,end:6,length:7}},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},oc:{begin:0,end:6,length:7}},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;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.rv.states["REG_"+r_reg]!="undefined"){value=get_value(sim.rv.states["REG_"+r_reg])>>>0;return"0x"+value.toString(16)}r_reg=r_reg.replace("R","");var index=parseInt(r_reg);if(typeof sim.rv.states.BR[index]!="undefined"){value=get_value(sim.rv.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.rv.ctrl_states.pc={name:"PC",state:"REG_PC",is_pointer:true};sim.rv.ctrl_states.sp={name:"SP",state:"BR.29",is_pointer:true};sim.rv.ctrl_states.fp={name:"FP",state:"BR.30",is_pointer:true};sim.rv.ctrl_states.ir={name:"IR",state:"REG_IR",default_eltos:{co:{begin:0,end:5,length:6},cop:{begin:28,end:31,length:4},oc:{begin:0,end:6,length:7},eoc:{type:2,bits:[[12,14],[25,31]],lengths:[3,7],length:10}},is_pointer:false};sim.rv.ctrl_states.mpc={name:"mPC",state:"REG_MICROADDR",is_pointer:false};sim.rv.internal_states.MC={};sim.rv.internal_states.ROM={};sim.rv.internal_states.FIRMWARE=ws_empty_firmware;sim.rv.internal_states.io_hash={};sim.rv.internal_states.fire_stack=[];sim.rv.internal_states.tri_state_names=[];sim.rv.internal_states.fire_visible={databus:false,internalbus:false};sim.rv.internal_states.filter_states=["REG_IR_DECO,col-12","REG_IR,col-auto","REG_PC,col-auto","REG_OUT,col-auto","REG_MICROADDR,col-auto"];sim.rv.internal_states.filter_signals=["CU,0","ALUOP,0","M1,0","M2,0","M3,0","M4,0","JUMP,0","PCWRITE,0","IMR,0","IRWRITE,0","RW,0","WOUT,0","DMR,0","DMW,0","WBE,0","SE,0"];sim.rv.internal_states.alu_flags={flag_n:0,flag_z:0};sim.rv.states.BR=[];sim.rv.states.BR[0]={name:"R0",verbal:"Register 0",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[1]={name:"R1",verbal:"Register 1",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[2]={name:"R2",verbal:"Register 2",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[3]={name:"R3",verbal:"Register 3",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[4]={name:"R4",verbal:"Register 4",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[5]={name:"R5",verbal:"Register 5",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[6]={name:"R6",verbal:"Register 6",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[7]={name:"R7",verbal:"Register 7",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[8]={name:"R8",verbal:"Register 8",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[9]={name:"R9",verbal:"Register 9",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[10]={name:"R10",verbal:"Register 10",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[11]={name:"R11",verbal:"Register 11",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[12]={name:"R12",verbal:"Register 12",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[13]={name:"R13",verbal:"Register 13",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[14]={name:"R14",verbal:"Register 14",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[15]={name:"R15",verbal:"Register 15",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[16]={name:"R16",verbal:"Register 16",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[17]={name:"R17",verbal:"Register 17",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[18]={name:"R18",verbal:"Register 18",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[19]={name:"R19",verbal:"Register 19",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[20]={name:"R20",verbal:"Register 20",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[21]={name:"R21",verbal:"Register 21",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[22]={name:"R22",verbal:"Register 22",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[23]={name:"R23",verbal:"Register 23",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[24]={name:"R24",verbal:"Register 24",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[25]={name:"R25",verbal:"Register 25",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[26]={name:"R26",verbal:"Register 26",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[27]={name:"R27",verbal:"Register 27",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[28]={name:"R28",verbal:"Register 28",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[29]={name:"R29",verbal:"Register 29",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[30]={name:"R30",verbal:"Register 30",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states.BR[31]={name:"R31",verbal:"Register 31",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["REG_PC"]={name:"PC",verbal:"Program Counter Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["REG_IR"]={name:"IR",verbal:"Instruction Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["REG_OUT"]={name:"OUT",verbal:"Out Register",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["M4_PC"]={name:"M4_PC",verbal:"Input PCWrite via M4",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["RDATA"]={name:"RDATA",verbal:"Read data form Instruction Memory (Input Instruction Register via Instruction Memory)",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["M2_ALU"]={name:"M2_ALU",verbal:"Input ALU via M2",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["M3_ALU"]={name:"M3_ALU",verbal:"Input ALU via M3",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["ALU_WOUT"]={name:"ALU_WOUT",verbal:"Input of OUT Register",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["FLAG_N"]={name:"FLAG_N",verbal:"Negative Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.rv.states["FLAG_Z"]={name:"FLAG_Z",verbal:"Zero Flag",visible:true,nbits:"1",value:0,default_value:0,draw_data:[]};sim.rv.states["REG_MICROADDR"]={name:"µADDR",verbal:"Microaddress Register",visible:true,nbits:"12",value:0,default_value:0,draw_data:[]};sim.rv.states["REG_MICROINS"]={name:"µINS",verbal:"Microinstruction Register",visible:true,nbits:"77",value:{},default_value:{},draw_data:[]};sim.rv.states["FETCH"]={name:"FETCH",verbal:"Input Fetch",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.rv.states["ROM_MUXA"]={name:"ROM_MUXA",verbal:"Input ROM",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.rv.states["MUXA_MICROADDR"]={name:"MUXA_MICROADDR",verbal:"Input microaddress",visible:false,nbits:"12",value:0,default_value:0,draw_data:[]};sim.rv.states["MUXC_MUXB"]={name:"MUXC_MUXB",verbal:"Output of MUX C",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.rv.states["INEX"]={name:"INEX",verbal:"Illegal Instruction Exception",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.rv.states["DM_BS"]={name:"DM_BS",verbal:"From Data Memory to Byte/Word Selector",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["BS_M1"]={name:"BS_M1",verbal:"From Byte/Word Selector to Mux 1",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["VAL_ZERO"]={name:"VAL_ZERO",verbal:"Wired Zero",visible:false,nbits:"1",value:0,default_value:0,draw_data:[]};sim.rv.states["VAL_ONE"]={name:"VAL_ONE",verbal:"Wired One",visible:false,nbits:"32",value:1,default_value:1,draw_data:[]};sim.rv.states["VAL_FOUR"]={name:"VAL_FOUR",verbal:"Wired Four",visible:false,nbits:"32",value:4,default_value:4,draw_data:[]};sim.rv.states["VAL_IMM"]={name:"VAL_IMM",verbal:"Immediate Value Generator",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["REG_IR_DECO"]={name:"IR_DECO",verbal:"Instruction Decoded",visible:true,nbits:"0",value:0,default_value:0,draw_data:[]};sim.rv.states["DECO_INS"]={name:"DECO_INS",verbal:"Instruction decoded in binary",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["CLK"]={name:"CLK",verbal:"Clock",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["ACC_TIME"]={name:"ACC_TIME",verbal:"Accumulated CPU time",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.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.rv.states["ACC_PWR"]={name:"ACC_PWR",verbal:"Accumulated Energy Consumption",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.signals["CU"]={name:"CU",visible:true,type:"L",value:0,default_value:0,nbits:"3",behavior:["PLUS1 MUXA_MICROADDR REG_MICROADDR","CP_FIELD MUXA_MICROADDR REG_MICROINS/MADDR","MV MUXA_MICROADDR ROM_MUXA","MV MUXA_MICROADDR FETCH","JUMP_MADDR_N MUXA_MICROADDR REG_MICROINS/MADDR REG_MICROADDR 0","JUMP_MADDR_N MUXA_MICROADDR REG_MICROINS/MADDR REG_MICROADDR 1","JUMP_MADDR_Z MUXA_MICROADDR REG_MICROINS/MADDR REG_MICROADDR 0","JUMP_MADDR_Z MUXA_MICROADDR REG_MICROINS/MADDR REG_MICROADDR 1"],depends_on:["CLK"],fire_name:["svg_p:text7417"],draw_data:[["svg_p:path7391","svg_p:path7393","svg_p:path7395","svg_p:path7397","svg_p:path7399","svg_p:path7401"]],draw_name:[["svg_p:path7357","svg_p:path7329","svg_p:path7331"]]};sim.rv.signals["PCWRITE"]={name:"PCWRITE",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_PC M4_PC; UPDATEDPC"],fire_name:["svg_p:text7155"],draw_data:[[]],draw_name:[["svg_p:path7145","svg_p:path7125","svg_p:path7127"]]};sim.rv.signals["JUMP"]={name:"JUMP",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD_J REG_PC M4_PC; UPDATEDPC_J"],fire_name:["svg_p:text7173"],draw_data:[[]],draw_name:[["svg_p:path7133","svg_p:path7143","svg_p:path7147","svg_p:path7135"]]};sim.rv.signals["IRWRITE"]={name:"IRWRITE",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_IR RDATA; DECO"],fire_name:["svg_p:text7309"],draw_data:[["svg_p:path6711","svg_p_path:6713","svg_p:path6981","svg_p:path6903","svg_p:path6905"]],draw_name:[["svg_p:path7301"]]};sim.rv.signals["SIZE"]={name:"SIZE",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["NOP"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.rv.signals["GEN_IMM"]={name:"GEN_IMM",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MBITS VAL_IMM 0 REG_IR OFFSET SIZE 0 SE_IMM"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.rv.signals["OFFSET"]={name:"OFFSET",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["NOP"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.rv.signals["SE_IMM"]={name:"SE",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","NOP"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.rv.signals["WOUT"]={name:"WOUT",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","LOAD REG_OUT ALU_WOUT"],fire_name:["svg_p:text7279"],draw_data:[["svg_p:path6837","svg_p:path6839"]],draw_name:[["svg_p:path7271"]]};sim.rv.signals["IMR"]={name:"IMR",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["NOP","READ_IM"],fire_name:["svg_p:text7213"],draw_data:[["svg_p:path6691","svg_p:path6693"]],draw_name:[["svg_p:path7205"]]};sim.rv.signals["REG_R1"]={name:"REG_R1",visible:true,type:"L",value:0,default_value:15,nbits:"5",behavior:["NOP"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.rv.signals["REG_R2"]={name:"REG_R2",visible:true,type:"L",value:0,default_value:20,nbits:"5",behavior:["NOP"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.rv.signals["REG_W2"]={name:"REG_W2",visible:true,type:"L",value:0,default_value:7,nbits:"5",behavior:["NOP"],fire_name:[],draw_data:[[]],draw_name:[[]]};sim.rv.states["M1_RW"]={name:"M1_RW",verbal:"Input Register File via M1",visible:false,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["W_DATA"]={name:"W_DATA",verbal:"Write Data",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["R_DATA1"]={name:"R_DATA1",verbal:"Read Data 1",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.states["R_DATA2"]={name:"R_DATA2",verbal:"Read Data 2",visible:true,nbits:"32",value:0,default_value:0,draw_data:[]};sim.rv.signals["RW"]={name:"RW",visible:true,type:"E",value:0,default_value:0,nbits:"1",behavior:["MBIT_SN REG_R1 REG_IR REG_MICROINS/REG_R1 5; GET R_DATA1 BR REG_R1; MBIT_SN REG_R2 REG_IR REG_MICROINS/REG_R2 5; GET R_DATA2 BR REG_R2","MBIT_SN REG_W2 REG_IR REG_MICROINS/REG_W2 5; SET BR REG_W2 M1_RW"],fire_name:["svg_p:text7299"],draw_data:[["svg_p:path6725","svg_p:path6727","svg_p:path6729","svg_p:path6731","svg_p:path6733","svg_p:path6735","svg_p:path6915","svg_p:path6913","svg_p:path6907","svg_p:path6909"]],draw_name:[["svg_p:path7291"]]};sim.rv.signals["M2"]={name:"M2",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M2_ALU REG_PC; FIRE ALUOP","MV M2_ALU R_DATA1; FIRE ALUOP"],depends_on:["ALUOP"],fire_name:["svg_p:text7229"],draw_data:[["svg_p:path6691-3","svg_p:path6987","svg_p:path6989","svg_p:path6983","svg_p:path6991","svg_p:path6775","svg_p:path6777"],["svg_p:path6779","svg_p:path6781"]],draw_name:[[],["svg_p:path7199"]]};sim.rv.signals["M3"]={name:"M3",visible:true,type:"L",value:0,default_value:0,nbits:"2",behavior:["MV M3_ALU R_DATA2; FIRE ALUOP","MV M3_ALU VAL_FOUR; FIRE ALUOP","MV M3_ALU VAL_IMM; FIRE ALUOP","NOP"],fire_name:["svg_p:text7237"],depends_on:["ALUOP"],draw_data:[["svg_p:path6821","svg_p:path6823"],["svg_p:path7001","svg_p:path7003"],["svg_p:path7015","svg_p:path7013","svg_p:path6825","svg_p:path6827"]],draw_name:[[],["svg_p:path7197"]]};sim.rv.signals["M4"]={name:"M4",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M4_PC REG_OUT","MV M4_PC ALU_WOUT"],depends_on:["PCWRITE"],fire_name:["svg_p:text7289"],draw_data:[["svg_p:path7075","svg_p:path7043","svg_p:path7045","svg_p:path7047","svg_p:path7123","svg_p:path7121","svg_p:path7041","svg_p:path7039","svg_p:path7035","svg_p:path7037"],["svg_p:path6837-6","svg_p:path7073","svg_p:path7115","svg_p:path7117","svg_p:path7119","svg_p:path7123","svg_p:path7121","svg_p:path7041","svg_p:path7039","svg_p:path7035","svg_p:path7037"]],draw_name:[[],["svg_p:path7281"]]};sim.rv.signals["ALUOP"]={name:"ALUOP",visible:true,type:"L",value:0,default_value:0,nbits:"5",behavior:["NOP_ALU; UPDATE_NZ","AND ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ","OR ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ","NOT ALU_WOUT M2_ALU; UPDATE_NZ","XOR ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ","SRL ALU_WOUT M2_ALU; UPDATE_NZ","SRA ALU_WOUT M2_ALU; UPDATE_NZ","SL ALU_WOUT M2_ALU; UPDATE_NZ","RR ALU_WOUT M2_ALU; UPDATE_NZ","RL ALU_WOUT M2_ALU; UPDATE_NZ","ADD ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ","SUB ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ","MUL ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ","DIV ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ","MOD ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ","LUI ALU_WOUT M2_ALU; UPDATE_NZ","ADDU ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ","SUBU ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ","MULU ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ","DIVU ALU_WOUT M2_ALU M3_ALU; UPDATE_NZ","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","NOP_ALU","MV ALU_WOUT M2_ALU; UPDATE_NZ","MV ALU_WOUT M3_ALU; UPDATE_NZ"],fire_name:["svg_p:text7269"],draw_data:[["svg_p:path6845","svg_p:path6847","svg_p:path6841","svg_p:path6843"]],draw_name:[["svg_p:path7249"]]};sim.rv.signals.DMR={name:"DMR",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV DM_BS REG_OUT; FIRE WBE","MEM_READ M3_ALU DM_BS WBE CLK; FIRE WBE"],fire_name:["svg_p:text7589","svg_p:text7507"],draw_data:[[],["svg_p:path7525","svg_p:path6841-5","svg_p:path7577","svg_p:path7619","svg_p:path7623","svg_p:path7625","svg_p:path7571","svg_p:path7573"]],draw_name:[[],[]]};sim.rv.signals.DMW={name:"DMW",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["NOP","MEM_WRITE M3_ALU DM_BS WBE CLK"],fire_name:["svg_p:text7597","svg_p:text7515"],draw_data:[[],["svg_p:path7527","svg_p:path6841-5","svg_p:path7577","svg_p:path7619","svg_p:path7623","svg_p:path7625","svg_p:path7571","svg_p:path7573"]],draw_name:[[],[]]};sim.rv.signals["WBE"]={name:"WBE",visible:false,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV BS_M1 DM_BS","BWSEL BS_M1 DM_BS SE"],depends_on:["RW"],fire_name:["svg_p:text7555","svg_p:text7433"],draw_data:[["svg_p:path7075-2","svg_p:path7043-6","svg_p:path7203","svg_p:path7579","svg_p:path7581","svg_p:path7567","svg_p:path7569","svg_p:path7421","svg_p:path7423"]],draw_name:[["svg_p:path7529","svg_p:path7425"]]};sim.rv.signals["SE"]={name:"SE",visible:true,type:"L",value:0,default_value:0,nbits:"1",verbal:["If WBE is enabled, set the 24 superior bits of Word to 0.","If WBE is enabled, extend byte sign to Word."],behavior:["NOP","NOP"],fire_name:["svg_p:text7453"],draw_data:[[]],draw_name:[["svg_p:path7445"]]};sim.rv.signals["M1"]={name:"M1",visible:true,type:"L",value:0,default_value:0,nbits:"1",behavior:["MV M1_RW BS_M1","MV M1_RW FLAG_N"],depends_on:["RW"],fire_name:["svg_p:text7221"],draw_data:[["svg_p:path7021","svg_p:path7023","svg_p:path7565","svg_p:path6911","svg_p:path6895","svg_p:path6897"],["svg_p:path7621","svg_p:path7025","svg_p:path7017","svg_p:path7019","svg_p:path6899","svg_p:path6901"]],draw_name:[[],["svg_p:path7195"]]};sim.rv.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","MV FLAG_N VAL_ONE"],depends_on:["ALUOP"],fire_name:["svg_p:text7607","svg_p:text7185"],draw_data:[["svg_p:path7251"]],draw_name:[["svg_p:path7157"]]};sim.rv.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","MV FLAG_Z VAL_ONE"],depends_on:["ALUOP"],fire_name:["svg_p:text7615","svg_p:text7193"],draw_data:[["svg_p:path7617"]],draw_name:[["svg_p:path7165"]]};sim.rv.behaviors["NOP"]={nparameters:1,operation:function(s_expr){},verbal:function(s_expr){return""}};sim.rv.behaviors["NOP_ALU"]={nparameters:1,operation:function(s_expr){sim.rv.internal_states.alu_flags.flag_n=0;sim.rv.internal_states.alu_flags.flag_z=0},verbal:function(s_expr){return""}};sim.rv.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.rv.behaviors["LOAD"]={nparameters:3,types:["X","X"],operation:function(s_expr){var sim_elto_org=get_reference(s_expr[2]);var sim_elto_dst=get_reference(s_expr[1]);var 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.rv.behaviors["LOAD_J"]={nparameters:3,types:["X","X"],operation:function(s_expr){if(!get_value(sim.rv.states["FLAG_N"])&&!get_value(sim.rv.states["FLAG_Z"])){return}var sim_elto_org=get_reference(s_expr[2]);var sim_elto_dst=get_reference(s_expr[1]);var 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 sim_elto_dst=get_reference(s_expr[1]);var newval=get_value(sim_elto_org);return"Jump if N or Z (new value is '"+newval+"' )"}};sim.rv.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.rv.behaviors["JUMP_MADDR_N"]={nparameters:5,types:["X","X","E","I"],operation:function(s_expr){if(get_value(sim.rv.states["FLAG_N"])!=parseInt(s_expr[4])){var a=get_value(sim.rv.states[s_expr[3]])<<0;var result=a+1;set_value(sim.rv.states[s_expr[1]],result>>>0)}else{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){if(parseInt(s_expr[4])){return"Jump to REG_MICROINS/MADDR if Flag N = 1."}else{return"Jump to REG_MICROINS/MADDR if Flag N = 0."}}};sim.rv.behaviors["JUMP_MADDR_Z"]={nparameters:5,types:["X","X","E","I"],operation:function(s_expr){if(get_value(sim.rv.states["FLAG_Z"])!=parseInt(s_expr[4])){var a=get_value(sim.rv.states[s_expr[3]])<<0;var result=a+1;set_value(sim.rv.states[s_expr[1]],result>>>0)}else{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){if(parseInt(s_expr[4])){return"Jump to REG_MICROINS/MADDR if Flag Z = 1."}else{return"Jump to REG_MICROINS/MADDR if Flag Z = 0."}}};sim.rv.behaviors["NOT_ES"]={nparameters:3,types:["S","E"],operation:function(s_expr){set_value(sim.rv.signals[s_expr[1]],Math.abs(get_value(sim.rv.states[s_expr[2]])-1))},verbal:function(s_expr){var value=Math.abs(get_value(sim.rv.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.rv.behaviors["GET"]={nparameters:4,types:["E","E","S"],operation:function(s_expr){set_value(sim.rv.states[s_expr[1]],get_value(sim.rv.states[s_expr[2]][sim.rv.signals[s_expr[3]].value]))},verbal:function(s_expr){var value=get_value(sim.rv.states[s_expr[2]][sim.rv.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.rv.behaviors["SET"]={nparameters:4,types:["E","S","E"],operation:function(s_expr){set_value(sim.rv.states[s_expr[1]][sim.rv.signals[s_expr[2]].value],get_value(sim.rv.states[s_expr[3]]))},verbal:function(s_expr){var value=get_value(sim.rv.states[s_expr[3]]);var o_ref=sim.rv.states[s_expr[1]][sim.rv.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.rv.behaviors["AND"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])&get_value(sim.rv.states[s_expr[3]]);set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])&get_value(sim.rv.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.rv.behaviors["OR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])|get_value(sim.rv.states[s_expr[3]]);set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])|get_value(sim.rv.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.rv.behaviors["NOT"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=~get_value(sim.rv.states[s_expr[2]]);set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var result=~get_value(sim.rv.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.rv.behaviors["XOR"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])^get_value(sim.rv.states[s_expr[3]]);set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])^get_value(sim.rv.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.rv.behaviors["SRL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])>>>1;set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var result=get_value(sim.rv.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.rv.behaviors["SRA"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])>>1;set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var result=get_value(sim.rv.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.rv.behaviors["SL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])<<1;set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var result=get_value(sim.rv.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.rv.behaviors["RR"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])>>>1|(get_value(sim.rv.states[s_expr[2]])&1)<<31;set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])>>>1|(get_value(sim.rv.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.rv.behaviors["RL"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])<<1|(get_value(sim.rv.states[s_expr[2]])&2147483648)>>>31;set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])<<1|(get_value(sim.rv.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.rv.behaviors["ADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])<<0;var b=get_value(sim.rv.states[s_expr[3]])<<0;var result=a+b;set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])<<0;var b=get_value(sim.rv.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.rv.behaviors["SUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])<<0;var b=get_value(sim.rv.states[s_expr[3]])<<0;var result=a-b;set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])<<0;var b=get_value(sim.rv.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.rv.behaviors["MUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])<<0;var b=get_value(sim.rv.states[s_expr[3]])<<0;var result=a*b;set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])<<0;var b=get_value(sim.rv.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.rv.behaviors["DIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])<<0;var b=get_value(sim.rv.states[s_expr[3]])<<0;if(0==b){set_value(sim.rv.states[s_expr[1]],0);sim.rv.internal_states.alu_flags.flag_n=0;sim.rv.internal_states.alu_flags.flag_z=1;return}var result=Math.floor(a/b);set_value(sim.rv.states[s_expr[1]],result);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])<<0;var b=get_value(sim.rv.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.rv.behaviors["MOD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])<<0;var b=get_value(sim.rv.states[s_expr[3]])<<0;if(0==b){set_value(sim.rv.states[s_expr[1]],0);sim.rv.internal_states.alu_flags.flag_n=0;sim.rv.internal_states.alu_flags.flag_z=1;return}var result=a%b;set_value(sim.rv.states[s_expr[1]],result);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])<<0;var b=get_value(sim.rv.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.rv.behaviors["LUI"]={nparameters:3,types:["E","E"],operation:function(s_expr){var result=get_value(sim.rv.states[s_expr[2]])<<16;set_value(sim.rv.states[s_expr[1]],result);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var result=get_value(sim.rv.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.rv.behaviors["ADDU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])>>>0;var b=get_value(sim.rv.states[s_expr[3]])>>>0;var result=a+b;set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])>>>0;var b=get_value(sim.rv.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.rv.behaviors["SUBU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])>>>0;var b=get_value(sim.rv.states[s_expr[3]])>>>0;var result=a-b;set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])>>>0;var b=get_value(sim.rv.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.rv.behaviors["MULU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])>>>0;var b=get_value(sim.rv.states[s_expr[3]])>>>0;var result=a*b;set_value(sim.rv.states[s_expr[1]],result>>>0);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])>>>0;var b=get_value(sim.rv.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.rv.behaviors["DIVU"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])>>>0;var b=get_value(sim.rv.states[s_expr[3]])>>>0;if(0==b){set_value(sim.rv.states[s_expr[1]],0);sim.rv.internal_states.alu_flags.flag_n=0;sim.rv.internal_states.alu_flags.flag_z=1;return}var result=Math.floor(a/b);set_value(sim.rv.states[s_expr[1]],result);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])>>>0;var b=get_value(sim.rv.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.rv.behaviors["FADD"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]]);var b=get_value(sim.rv.states[s_expr[3]]);var result=hex2float(a)+hex2float(b);set_value(sim.rv.states[s_expr[1]],float32_to_uint(result));sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]]);var b=get_value(sim.rv.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.rv.behaviors["FSUB"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]]);var b=get_value(sim.rv.states[s_expr[3]]);var result=hex2float(a)-hex2float(b);set_value(sim.rv.states[s_expr[1]],float32_to_uint(result));sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]]);var b=get_value(sim.rv.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.rv.behaviors["FMUL"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]]);var b=get_value(sim.rv.states[s_expr[3]]);var result=hex2float(a)*hex2float(b);set_value(sim.rv.states[s_expr[1]],float32_to_uint(result));sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]]);var b=get_value(sim.rv.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.rv.behaviors["FDIV"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]]);var b=get_value(sim.rv.states[s_expr[3]]);var result=hex2float(a)/hex2float(b);set_value(sim.rv.states[s_expr[1]],float32_to_uint(result));sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]]);var b=get_value(sim.rv.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.rv.behaviors["FCVT"]={nparameters:4,types:["E","E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])>>>0;var b=get_value(sim.rv.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.rv.states[s_expr[1]],result);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])>>>0;var b=get_value(sim.rv.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.rv.behaviors["FCLASS"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])>>>0;var result=float_class(a);set_value(sim.rv.states[s_expr[1]],result);sim.rv.internal_states.alu_flags.flag_n=result<0?1:0;sim.rv.internal_states.alu_flags.flag_z=result==0?1:0},verbal:function(s_expr){var a=get_value(sim.rv.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.rv.behaviors["PLUS1"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])<<0;var result=a+1;set_value(sim.rv.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.rv.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.rv.behaviors["PLUS4"]={nparameters:3,types:["E","E"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[2]])<<0;var result=a+4;set_value(sim.rv.states[s_expr[1]],result>>>0)},verbal:function(s_expr){var a=get_value(sim.rv.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.rv.behaviors["SET_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a|m;set_value(sim.rv.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.rv.behaviors["RST_TT"]={nparameters:3,types:["E","I"],operation:function(s_expr){var a=get_value(sim.rv.states[s_expr[1]])<<0;var b=parseInt(s_expr[2]);var m=Math.pow(2,b);var r=a&~m;set_value(sim.rv.states[s_expr[1]],r);update_cpu_bus_fire(r,b)},verbal:function(s_expr){return""}};sim.rv.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.rv.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.rv.states[s_expr[3]]);else if(typeof sim.rv.states[r[0]].value[r[1]]!="undefined")base=sim.rv.states[r[0]].value[r[1]];else if(typeof sim.rv.signals[r[1]].default_value!="undefined")base=sim.rv.signals[r[1]].default_value;else if(typeof sim.rv.states[r[1]].default_value!="undefined")base=sim.rv.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.rv.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.rv.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.rv.states[s_expr[3]]);else if(typeof sim.rv.states[r[0]].value[r[1]]!="undefined")base=sim.rv.states[r[0]].value[r[1]];else if(typeof sim.rv.signals[r[1]].default_value!="undefined")base=sim.rv.signals[r[1]].default_value;else if(typeof sim.rv.states[r[1]].default_value!="undefined")base=sim.rv.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.rv.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.rv.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.rv.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.rv.behaviors["MBITS"]={nparameters:8,types:["E","I","E","S","S","I","S"],operation:function(s_expr){var offset=parseInt(sim.rv.signals[s_expr[4]].value);var size=parseInt(sim.rv.signals[s_expr[5]].value);var n1=get_value(sim.rv.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.rv.signals[s_expr[7]].value&&"1"==n2.substr(0,1)){n3="11111111111111111111111111111111".substring(0,32-n2.length)+n2}set_value(sim.rv.states[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){var offset=parseInt(sim.rv.signals[s_expr[4]].value);var size=parseInt(sim.rv.signals[s_expr[5]].value);var n1=get_value(sim.rv.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.rv.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.rv.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.rv.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.rv.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.rv.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.rv.behaviors["BWSEL"]={nparameters:4,types:["E","E","S"],operation:function(s_expr){var posd=0;var poso=0;var len=8;var sign_ext=sim.rv.signals[s_expr[3]].value;var n1=get_value(sim.rv.states[s_expr[2]]).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;if(sign_ext){var s1=n2;var s2="00000000000000000000000000000000".substring(0,32-s1.length)+s1;var s3=s2.substr(31-7,31);var s4=s3;if("1"==s2[31-7]){s4="11111111111111111111111111111111".substring(0,32-s3.length)+s4}set_value(sim.rv.states[s_expr[1]],parseInt(s4,2))}else{set_value(sim.rv.states[s_expr[1]],parseInt(n3,2))}},verbal:function(s_expr){var posd=0;var poso=0;var len=8;var sign_ext=sim.rv.signals[s_expr[3]].value;var n1=get_value(sim.rv.states[s_expr[2]]).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;if(sign_ext){var s1=n2;var s2="00000000000000000000000000000000".substring(0,32-s1.length)+s1;var s3=s2.substr(31-7,31);var s4=s3;if("1"==s2[31-7]){s4="11111111111111111111111111111111".substring(0,32-s3.length)+s4}var value=parseInt(s4,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(value)+ +" (copied "+len+" bits, from bit "+poso+" to bit "+(posd+8)+" with sign extension)."}else{return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(value)+", "+len+" bits, from bit "+poso+" of "+s_expr[2]+" to bit "+(posd+8)+" of "+s_expr[1]+"). "}}else{var value=parseInt(n3,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(value)+ +" (copied "+len+" bits, from bit "+poso+" to bit "+(posd+8)+" without sign extension)."}else{return show_verbal(s_expr[1])+" = "+show_verbal(s_expr[2])+" ("+show_value(value)+", "+len+" bits, from bit "+poso+" of "+s_expr[2]+" to bit "+(posd+8)+" of "+s_expr[1]+"). "}}}};sim.rv.behaviors["EXT_SIG"]={nparameters:3,types:["E","I"],operation:function(s_expr){var n1=get_value(sim.rv.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.rv.states[s_expr[1]],parseInt(n4,2))},verbal:function(s_expr){var n1=get_value(sim.rv.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.rv.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.rv.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.rv.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.rv.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.rv.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.rv.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.rv.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.rv.signals[s_expr[1]],parseInt(n3,2))},verbal:function(s_expr){return""}};sim.rv.behaviors["READ_IM"]={nparameters:1,operation:function(s_expr){var address=get_value(sim.rv.states["REG_PC"]);var clk=get_value(sim.rv.states["CLK"]);var remain=get_value(sim.rv.internal_states.MP_wc);if(typeof sim.rv.events.mem[clk-1]!="undefined"&&sim.rv.events.mem[clk-1]>0){remain=sim.rv.events.mem[clk-1]-1}var first_time=typeof sim.rv.events.mem[clk]=="undefined";sim.rv.events.mem[clk]=remain;if(remain>0){return}address=address&4294967292;var value=main_memory_getvalue(sim.rv.internal_states.MP,address);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}show_main_memory(sim.rv.internal_states.MP,address,full_redraw,false);if(first_time&&sim.rv.internal_states.CM.length>0){cache_memory_access(sim.rv.internal_states.CM[0],address,"read",clk)}var ins=main_memory_getvalue(sim.rv.internal_states.MP,address);if(typeof ins==="undefined")ins=0;set_value(sim.rv.states["RDATA"],ins)},verbal:function(s_expr){var verbal="";var address=get_value(sim.rv.states["REG_PC"]);var value=main_memory_getvalue(sim.rv.internal_states.MP,address);if(typeof value==="undefined")value=0;var verbose=get_cfg("verbal_verbose");if(verbose!=="math"){verbal="Try to read an instruction from Instruction Memory "+"at address 0x"+address.toString(16)+" with value 0x"+value.toString(16)+". ";return verbal}verbal="Memory output = 0x"+value.toString(16)+" (Read an instruction from Instruction Memory"+" at address 0x"+address.toString(16)+"). ";return verbal}};sim.rv.behaviors["DECO"]={nparameters:1,operation:function(s_expr){sim.rv.states["INEX"].value=0;var oi=decode_instruction(sim.rv.internal_states.FIRMWARE,sim.rv.ctrl_states.ir,get_value(sim.rv.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.rv.states["ROM_MUXA"].value=0;sim.rv.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.rv.internal_states["ROM"][rom_addr]=="undefined"){ws_alert("ERROR: undefined rom address "+rom_addr+" in firmware");sim.rv.states["ROM_MUXA"].value=0;return-1}sim.rv.states["ROM_MUXA"].value=sim.rv.internal_states["ROM"][rom_addr];var val=get_value(sim.rv.states["DECO_INS"]);set_value(sim.rv.states["DECO_INS"],val+1);var pc=get_value(sim.rv.states["REG_PC"])-4;var decins=get_deco_from_pc(pc);set_value(sim.rv.states["REG_IR_DECO"],decins);show_dbg_ir(get_value(sim.rv.states["REG_IR_DECO"]))},verbal:function(s_expr){return"Decode instruction. "}};sim.rv.behaviors["FIRE"]={nparameters:2,types:["S"],operation:function(s_expr){if(sim.rv.internal_states.fire_stack.indexOf(s_expr[1])!=-1){return}sim.rv.internal_states.fire_stack.push(s_expr[1]);update_draw(sim.rv.signals[s_expr[1]],sim.rv.signals[s_expr[1]].value);if("L"==sim.rv.signals[s_expr[1]].type){update_state(s_expr[1])}sim.rv.internal_states.fire_stack.pop(s_expr[1])},verbal:function(s_expr){return""}};sim.rv.behaviors["FIRE_IFSET"]={nparameters:3,types:["S","I"],operation:function(s_expr){if(get_value(sim.rv.signals[s_expr[1]])!=parseInt(s_expr[2])){return}sim.rv.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.rv.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.rv.behaviors["FIRE"].operation(s_expr)},verbal:function(s_expr){return""}};sim.rv.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.rv.behaviors["CLOCK"]={nparameters:1,operation:function(s_expr){var new_maddr=null;var mcelto=null;var t0=performance.now();var val=get_value(sim.rv.states["CLK"]);set_value(sim.rv.states["CLK"],val+1);set_value(sim.rv.states["TTCPU"],0);new_maddr=get_value(sim.rv.states["REG_MICROADDR"]);mcelto=sim.rv.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.rv.internal_states.MP,elto,melto);show_main_memory(sim.rv.internal_states.MP,elto,typeof valref==="undefined",true);return value}};sim.rv.internal_states.segments={};sim.rv.internal_states.MP_wc=0;sim.rv.internal_states.MP={};sim.rv.internal_states.CM_cfg=[];sim.rv.internal_states.CM=[];sim.rv.behaviors.MEM_READ={nparameters:5,types:["E","E","S","E"],operation:function(s_expr){var address="0x"+get_value(sim.rv.states[s_expr[1]]).toString(16);var dbvalue=get_value(sim.rv.states[s_expr[2]]);var bw=sim.rv.signals[s_expr[3]].value;var clk=get_value(sim.rv.states[s_expr[4]]);var remain=get_value(sim.rv.internal_states.MP_wc);if(typeof sim.rv.events.mem[clk-1]!="undefined"&&sim.rv.events.mem[clk-1]>0){remain=sim.rv.events.mem[clk-1]-1}var first_time=typeof sim.rv.events.mem[clk]=="undefined";sim.rv.events.mem[clk]=remain;if(remain>0){return}address=address&4294967292;var value=main_memory_getvalue(sim.rv.internal_states.MP,address);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}if(bw==1){var byte_s=0;dbvalue=main_memory_fusionvalues(dbvalue,value,byte_s)}else{dbvalue=value}set_value(sim.rv.states[s_expr[2]],dbvalue>>>0);show_main_memory(sim.rv.internal_states.MP,address,full_redraw,false);if(first_time&&sim.rv.internal_states.CM.length>0){cache_memory_access(sim.rv.internal_states.CM[0],address,"read",clk)}},verbal:function(s_expr){var verbal="";var address="0x"+get_value(sim.rv.states[s_expr[1]]).toString(16);var dbvalue=get_value(sim.rv.states[s_expr[2]]);var bw=sim.rv.signals[s_expr[3]].value;var clk=get_value(sim.rv.states[s_expr[4]]);var bw_type="word";if(bw==1)bw_type="byte";var value=main_memory_getvalue(sim.rv.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 "+address+" with value 0x"+value.toString(16)+". "}verbal="Memory output = 0x"+value.toString(16)+" (Read a "+bw_type+" from "+address+"). ";return verbal}};sim.rv.behaviors.MEM_WRITE={nparameters:5,types:["E","E","S","E"],operation:function(s_expr){var address="0x"+get_value(sim.rv.states[s_expr[1]]).toString(16);var dbvalue=get_value(sim.rv.states[s_expr[2]]);var bw=sim.rv.signals[s_expr[3]].value;var clk=get_value(sim.rv.states[s_expr[4]]);var remain=get_value(sim.rv.internal_states.MP_wc);if(typeof sim.rv.events.mem[clk-1]!="undefined"&&sim.rv.events.mem[clk-1]>0){remain=sim.rv.events.mem[clk-1]-1}var first_time=typeof sim.rv.events.mem[clk]=="undefined";sim.rv.events.mem[clk]=remain;if(remain>0){return}address=address&4294967292;var value=main_memory_getvalue(sim.rv.internal_states.MP,address);var full_redraw=false;if(typeof value==="undefined"){value=0;full_redraw=true}if(bw==1){var byte_s=0;value=main_memory_fusionvalues(value,dbvalue,byte_s)}else{var byte_s=12;value=main_memory_fusionvalues(value,dbvalue,byte_s)}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.rv.internal_states.MP,address,melto);show_main_memory(sim.rv.internal_states.MP,address,full_redraw,true);if(first_time&&sim.rv.internal_states.CM.length>0){cache_memory_access(sim.rv.internal_states.CM[0],address,"write",clk)}},verbal:function(s_expr){var verbal="";var address="0x"+get_value(sim.rv.states[s_expr[1]]).toString(16);var dbvalue=get_value(sim.rv.states[s_expr[2]]);var bw=sim.rv.signals[s_expr[3]].value;var clk=get_value(sim.rv.states[s_expr[4]]);var bw_type="word";if(bw==1)bw_type="byte";var value=main_memory_getvalue(sim.rv.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 "+address+" with value "+value.toString(16)+". "}verbal="Memory["+address+"] = "+"0x"+value.toString(16)+" (Write a "+bw_type+" to "+address+"). ";return verbal}};sim.rv.behaviors.MEMORY_RESET={nparameters:1,operation:function(s_expr){sim.rv.events.mem={}},verbal:function(s_expr){return"Reset main memory (all values will be zeroes). "}};sim.rv.elements.memory={name:"Main memory",description:"Main memory subsystem",type:"subcomponent",belongs:"MEMORY",states:{addr:{ref:"M3_ALU"},wdata:{ref:"REG_OUT"},rdata:{ref:"DM_BS"}},signals:{wbe:{ref:"WBE"},dmr:{ref:"DMR"},dmw:{ref:"DMW"}},states_inputs:["addr","wdata"],states_outputs:["rdata"],signals_inputs:["wbe","dmr","dmw"],signals_output:[]};function frm_nextToken(context){var tok="";var first="";var last="";var token_type="";while("# \t\n\r".indexOf(context.text[context.t])!=-1&&context.t0)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 97409c9e2..e2ac75e1e 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: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)}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 '