A lightweight RISC-V emulator, written in C99.
This emulator uses the RISC-V RV32I Instruction set. Support for extensions will be added in future versions.
- CMake ≥ 3.20
- C99 compiler
Clone this repository:
git clone git@github.com:youriai/RISC-V.git
cd RISC-VThen use CMake and compile:
cmake -S . -B build
cmake --build buildLastly run the executable with an argument to the path of the binary file:
./build/risc-v programs/fibonacci.binFor assembling RISC-V binaries, I personally use bronzebeard.
All these programs are in the programs folder
- Fibonacci sequence:
fibonacci.asm - No duplicate instruction print challenge:
hey.asm
- Support every RV32I instructions
- Support most Linux Kernal syscalls
- Support both 32-bit and 64-bit architectures
- Support most RV32/RV64 extension
- Allow for multi threaded code
- Graphical calls and interrupts
- Customize memory size
- Example programs
- A full C99 assembler (maybe?)
This repository is licensed under the MIT License.