Goal: Run and print the final state.
For example: 'run' the 's1e1.asm' assembly for the 'ep' architecture with the 'ep_base.mc' microcode, and print the final state:
./wepsim.sh -a run -m ep -f ./examples/microcode/mips/ep_base.mc -s ./examples/assembly/mips/s1e1.asm
register R2 = 0x2; register R3 = 0x1; register R5 = 0x1; register R29 = 0xfffff; register PC = 0x8018; memory 0x8000 = 0x8400002; memory 0x8004 = 0x8600001; memory 0x8008 = 0xa21809; memory 0x800c = 0x8400002; memory 0x8010 = 0x8600001; memory 0x8014 = 0xa2180a;
Goal: Run step by step and print the modified elements on each step.
For example: 'run' 'step by step' the 's1e1.asm' assembly for the 'ep' architecture with the 'ep_base.mc' microcode, and print for each assembly instruction the state elements that modify its value:
./wepsim.sh -a stepbystep -m ep -f ./examples/microcode/mips/ep_base.mc -s ./examples/assembly/mips/s1e1.asm
pc, instruction, changes_from_zero_or_current_value
pc = 0x8000, li $2 2, register R2 = 0x2; register R29 = 0xfffff; register PC = 0x8004
pc = 0x8004, li $3 1, register R3 = 0x1; register PC = 0x8008
pc = 0x8008, add $5 $2 $3, register R5 = 0x3; register PC = 0x800c
...
Goal: Run microstep by microstep and print the modified elements on each step.
For example: 'run' 'microstep by microstep' the 's1e1.asm' assembly for the 'ep' architecture with the 'ep_base.mc' microcode, and print for each microinstruction the state elementes that modify its value:
./wepsim.sh -a microstepbymicrostep -m ep -f ./examples/microcode/mips/ep_base.mc -s ./examples/assembly/mips/s1e1.asm
micropc, microcode, changes_from_zero_or_current_value
micropc = 0x0, T2 C0,
micropc = 0x1, TA R BW=11 M1 C1,
micropc = 0x2, M2 C2 T1 C3, register PC = 0x8004
micropc = 0x3, A0 B=0 C=0,
micropc = 0xd3, SE OFFSET=0 SIZE=10000 T3 LC MR=0 SELC=10101 A0 B C=0,register R2 = 0x2; register R29 = 0xfffff
...
Goal: Run and check that state at the end of the execution is the same as the one stored on a file.
For example: 'run' the 's1e1.asm' assembly for the 'ep' architecture with the 'ep_base.mc' microcode (and if it matchs the expected state then the output is going to be):
./wepsim.sh -a check -m ep -f ./examples/microcode/mips/ep_base.mc -s ./examples/assembly/mips/s1e1.asm -r ./examples/checklist/mips/cl-s1e1.txt
OK: Execution: no error reported
Goal: Run and check that state at the end of the execution is not the same as the one stored on a file.
For example: 'run' the 's1e1.asm' assembly for the 'ep' architecture with the 'ep_base.mc' microcode (and if it fails to match the expected state then the output is going to be):
./wepsim.sh -a check -m ep -f ./examples/microcode/mips/ep_base.mc -s ./examples/assembly/mips/s1e1.asm -r ./examples/checklist/mips/cl-s1e1.txt
ERROR: Execution: different results: cpu[R1]='0' (expected '0xf'), cpu[R2]='0x2' (expected '0xf'), memory[0x1000]='0' (expected '0xa07ff0f'), memory[0x1004]='0' (expected '0x10061'), memory[0x1008]='0' (expected '0x7ffff'),
...
And least but not less, it is possible to execute microstep by microstep but with a more descriptive output (and from a checkpoint too):
./wepsim.sh -a microstepverbalized --verbal math --checkpoint ./examples/checkpoint/tutorial_1.txt
Micropc at 0x0. Activated signals are: A0 B C. Associated actions are: Input microaddress = Microaddress Register + 1 (0x1). A1 = Output of MUX C (0x0). Output of MUX C = INT (0x0, 1 bits from bit 0). MADDR is 5.
Micropc at 0x1. Activated signals are: T2 C0. Associated actions are: Internal Bus = Program Counter Register (0x8000). Memory Address Register = Internal Bus (0x8000).
Micropc at 0x2. Activated signals are: TA R BW M1 C1. Associated actions are: Address Bus = Memory Address Register (0x8000). Memory output = 0xc801000 (Read a word from 0x8000). Select the full Word. Input of Memory Data Register = from Memory (0xc801000). Memory Data Register = Input of Memory Data Register (0xc801000).
...