RISC-V core written in 600 lines of C89

The RV RISC-V CPU core is a user-level implementation written in ANSI C that passes all supported tests in riscv-tests and uses no integer types larger than 32 bits, even for multiplication. With a simple API that requires only two functions and two memory callback functions, it boasts a tiny codebase of approximately 600 lines. The code contains a list of instructions and sample usage code to help get started. The only caveat is that it is written in C89 and doesn’t fully comply with C89/99 standards, but a fix is in the works.

https://github.com/mnurzia/rv

To top