NOTE: As for now, JIT is being actively reworked, and so it slow af. Consider compiling with USE_JIT=0
A software emulator for the RISC-V instruction set architecture (ISA) written in C++. This project aims to provide a functional emulator, capable of running XV6, OpenSBI, U-Boot, and so on. The emulator supports RV64GC ISA, privileged ISA and peripheral devices. See the "Features List" section section for the details of features.
Available arguments are:
--bios: File with Machine Level program (bootloader)
--kernel: File with Supervisor Level program
--image: File with Image file that will put on VirtIO-BLK
--dtb: Use specified FDT instead of auto-generated
--dumpdtb: Dumps auto-generated FDT to file
--gdb: Starts GDB Stub on port 1512
--append: Append command line arguments
--harts (-S): Set custom harts count (Default is 1)
--framebuffer (-fb): Enables framebuffer with defined size (F.e. 640x480)
--memsize (-M): Set custom memory size (Default is 512 MB)
The emulator supports the following features:
- RV64G ISA
- RV64I
- RV64M
- RV64A (No atomicity for now)
- RV64F
- RV64D
- Zifencei
- Zicsr
- RV64C
- Bit manipulations
- Zba
- Zbb
- Zbc
- Zbs
- Zbkb
- Other instruction sets
- Zicboz (for faster memory zeroing)
- Privileged ISA
- Control and status registers (CSRs)
- Machine-level CSRs
- Supervisor-level CSRs
- User-level CSRs
- Devices
- UART: universal asynchronous receiver-transmitter
- CLINT: core local interruptor
- PLIC: platform level interrupt controller
- Virtio-BLK: virtual I/O Block Device
- Framebuffer: virtual simple screen
- OpenCores I2C: Inter-Integrated Circuit
- HID-over-I2C: Human Interface Device over Inter-Integrated Circuit
- Boot keyboard: Basic usable keyboard(for now without Numpad support)
- FDT
git clone https://github.com/Spalishe/rv64-vm
cd rv64-vm
makeOutput program will be located in corresponding target and architecture folder(f.e. build.linux.x86_64/)
You can also compile emulator as lib:
git clone https://github.com/Spalishe/rv64-vm
cd rv64-vm
make libAnd static lib as well:
git clone https://github.com/Spalishe/rv64-vm
cd rv64-vm
make slibSee Getting Started with libraries and API Reference
You can install all required dependencies using:
Arch:
sudo pacman -S make gcc gitUbuntu:
sudo apt install make gcc gitThis project is licensed under the Apache 2.0 License – see the LICENSE