riscv-rust is a RISC-V processor and peripheral devices emulator project written in Rust and compiled to WebAssembly. You can import RISC-V emulator into your Rust or JavaScript project.

 

Features

  • Emulate RISC-V processor and peripheral devices
  • Stable as Linux and xv6-riscv run on it
  • Linux OpenSBI and legacy BBL boot support
  • Runnable locally
  • Also runnable in browser with WebAssembly
  • Debugger
  • You can import RISC-V emulator into your Rust or JavaScript project

Instructions/Features support status

  •  RV32/64I
  •  RV32/64M
  •  RV32/64F (almost)
  •  RV32/64D (almost)
  •  RV32/64Q
  •  RV32/64A (almost)
  •  RV64C/32C (almost)
  •  RV32/64Zifencei (almost)
  •  RV32/64Zicsr (almost)
  •  CSR (almost)
  •  SV32/39
  •  SV48
  •  Privileged instructions (almost)
  •  PMP

The emulator supports almost all instructions listed above but some instructions which are not used in Linux or xv6 are not implemented yet.

You can download riscv-rust here