News › 2025 › December 2025
mini-rv32ima, a few hundred lines of RISC-V
Project2025-12-14
mini-rv32ima is a single C header that emulates RV32IMA well enough to boot Linux, with no libc dependency.
mini-rv32ima by cnlohr is a single C header, about 400 lines, that emulates a RISC-V RV32IMA core with Zifencei and Zicsr, plus a CLINT and memory-mapped I/O. It does not depend on libc.
A demo wrapper of about 250 lines adds a UART, a device tree and kernel loading, and compiles to a binary of roughly 18 KB. The author describes the core as fast enough to reach about half of QEMU on a laptop CoreMark run, and incomplete on purpose: it implements the part of the specification that Linux actually uses.