riscv-emu is a RV64GC(I, M, A, F, D Extensions) emulator made with purpose of running linux. It emulates UART, CLINT and PLIC devices too. (virtio yet to be implemented) Currently only supports sv39 MMU.
- clang (works well for gcc too)
- Makefile
$ git clone https://github.com/rft0/riscv-emu
$ cd riscv-emu
$ git submodule update --init --recursive
$ makeBuild riscv-tests
Run tests.py with arguments <emulator_path> <tests_dir>
Arguments:
--dtb <path>, Path to device tree blob to load--sbi <path>, Path to SBI elf file to load--kernel <path>, Path to kernel image to load--initrd <path>, Path to initial file system to load--test <path>, Path toriscv-testself file to load
Note: --test argument is only expected if program is compiled with EMU_TESTS_ENABLED.
Another Note: Emulator currently doesn't support virtio devices so kernel and initial filesystem must be compatible with this setup.
- Add virtio for disk and network support.
- Possibly add instruction tlbs for address translation.
- Mimic GPU behavior (emulate VRAM in system memory, then transfer via SDL_Texture)