RISC-V execution lab
Step through RV32I instructions to see how array sums and function calls change registers and memory.
The problem
What happens to the program counter, registers and memory while a line of C executes?
My role
AI-assisted instruction emulator
Technology choices
GCC and objdump provide machine code and source-line mappings. QEMU provides an independent reference for checking the browser emulator.
Implementation & decisions
Compiled fixed examples to RV32I and displayed their source lines alongside instruction state. The project’s verifier compares execution against a QEMU trace of the same ELF.
Result
The sum, stack, byte-copy and edge-case examples exit with 21, 29, 6 and 42 respectively. Each can be paused to inspect register values and its output buffer.
Evidence
Fixed example source, QEMU comparison verifier and the RV32I specification
My contribution
The portfolio publishes the fixed examples and a verifiable execution tool. Instruction semantics follow the RISC-V specification.
AI collaboration
The original project notes credit AI with implementing the emulator and comparing its behavior with QEMU.
Limitations
Verification covers the user-mode paths exercised by four RV32I examples. Operating-system boot, uploaded binaries and additional instruction sets are outside its scope.
Next steps
Extending coverage would require examples exercising additional instruction paths and matching independent traces.