Skip to content

hidetatz/rv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Dec 26, 2022
981b337 · Dec 26, 2022
May 4, 2022
May 23, 2022
May 3, 2022
May 3, 2022
Oct 16, 2022
Oct 16, 2022
Dec 16, 2022
Dec 17, 2022
Oct 18, 2022
Mar 23, 2022
Nov 27, 2022
Dec 26, 2022
Dec 26, 2022
Dec 17, 2022
Dec 16, 2022

Repository files navigation

rv

rv is a 64-bit RISC-V emulator written in Go.

Limitation

  • 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.

Installation

go install github.com/hidetatz/rv@latest

Usage

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).

Test

rv uses riscv-tests as its E2E test. You can run that by following command:

go test -v ./...

Supported instructions

  • RV64G ISA
    • RV64I
    • RV64M
    • RV64A
    • RV64F
    • RV64D
    • Zifencei
    • Zicsr
  • RV64C ISA
  • Privileged ISA

For the full list of the implemented instructions, see instruction.go.

LICENSE

MIT