rv is a 64-bit RISC-V emulator written in Go.
- 32-bit, 128-bit aren't supported.
- Only RV39 is supported as memory translation.
- Multi-core emulation isn't supported.
- release/acquire bits are not handled in AMO instructions.
- rv currently emulates only one hart, so this is not really a problem.
- fence instructions do nothing.
- rv currently does not apply any optimizations and no out-of-order execution occurs, so it should be fine.
go install github.com/hidetatz/rv@latest
Pass an ELF program to run to rv
.
rv -p ./hello
Debug log will be enabled if -d
option is passed (note that this dumps all the executed instructions and some other information).
rv uses riscv-tests as its E2E test. You can run that by following command:
go test -v ./...
- RV64G ISA
- RV64I
- RV64M
- RV64A
- RV64F
- RV64D
- Zifencei
- Zicsr
- RV64C ISA
- Privileged ISA
For the full list of the implemented instructions, see instruction.go.
MIT