RISC-V is an open instruction set used in teaching, research and real chips. RV32I is the 32-bit base integer set, M adds multiply and divide, and C adds 16-bit compressed forms of common instructions. This tool takes a small C program, compiles it to RV32IMC, encodes every instruction and runs it, recording the 32 registers after each step.
Reading the output
Each C line is followed by the instructions generated for it. addi sp, sp, -16 makes room on the stack, sw and lw move values between registers and memory, and ret returns to the caller. By the calling convention, arguments go in a0–a7, the return value comes back in a0, and ra holds the return address.
The C extension
Turn on Compressed to see which instructions get a 16-bit form: c.addi, c.li, c.mv, c.lwsp, c.beqz and others. Code usually shrinks by 25 to 30 %, which saves instruction memory and fetch power.
Testing your own RISC-V core
The export card writes the program as a $readmemh image in 32, 16 or 8-bit entries, an objdump-style listing, and a Spike-style commit log with one line per retired instruction. Load the hex into your core's instruction memory, print the same log format from your RTL and diff the two files: the first differing line is the first wrong instruction. A small reference testbench is included.
Disassembler
Paste hex from a waveform or memory dump to decode it. Each instruction is shown with its format (R, I, S, B, U, J or compressed), a coloured bit-field breakdown and its meaning. It also understands fence, fence.i and CSR instructions.