Skip to content

RISC-V simulation, from instruction to system

SimRV

Explore RV32 and RV64 systems with fast architectural simulation, cycle-accurate pipelines, custom SoCs, and full-system Linux.

Build and Test Docs CI License Profile RVA23 Target ACT Suite

Key Highlights

SimRV boots unmodified RISC-V Linux kernels and OpenSBI using a supplied Flattened Device Tree (FDT), patched for the configured RAM size and hart count. It features VirtIO block storage, 16550A UART, CLINT/ACLINT timers, PLIC/AIA interrupt controllers, and an Alpine/JWM graphical path with an idempotent Games menu.

Features inlined per-cycle transition kernels for 3-stage and 5-stage pipelines with an authoritative hardware register scoreboard (tracking INT, FP, and Vector dependencies), configurable branch predictors (Bimodal, GShare, Tournament), and multi-level L1/L2/L3 MESI directory cache coherence.

Supports optional parity target plugins through a versioned C ABI, with editable platform models and trace comparison.

Interactive split-screen terminal monitor displaying live register files, pipeline stages, cache tags, hazard graphs, disassembly explainers, and an interactive Linux PTY console. Includes student guidance and instruction-level explanation.


Quickstart

Download the portable archive or native package bundle from GitHub Releases, then follow the installation guide. Build from source when developing SimRV itself.

1. Build from Source

Linux release archives target x86-64 and AArch64, including 64-bit Raspberry Pi OS. Native macOS source builds are smoke-tested on macOS 26 for Apple silicon and Intel, but macOS packages are not published yet. VirtIO-FS directory sharing remains Linux-only. User-mode networking uses libslirp on Linux and macOS. SimRV relies on POSIX terminal I/O, file-descriptor, polling, and process APIs that Windows does not provide natively, so a native Windows port would require substantial rework. WSL2 is the practical compatibility option: it runs a real Linux kernel and userland and is readily available on Windows.

SimRV requires a modern C++23 compiler (Clang 22+ or GCC 16+), CMake 3.31+, and Ninja.

git clone https://github.com/archlab-sciencetokyo/SimRV.git
cd SimRV

# Configure and build RV64 release target
cmake --preset rv64-release
cmake --build --preset rv64-release -j$(nproc)
git clone https://github.com/archlab-sciencetokyo/SimRV.git
cd SimRV

# Configure and build RV32 release target
cmake --preset rv32-release
cmake --build --preset rv32-release -j$(nproc)

2. Run Your First Workload

# Launch interactive terminal workbench
./build/rv64-release/simrv -m examples/isa/bin/demo.elf
# Fast instruction simulation
./build/rv64-release/simrv --cli -m examples/isa/bin/demo.elf -b

# Cycle-accurate simulation with 5-stage pipeline
./build/rv64-release/simrv --cli --mode cycle-accurate --pipeline 5stage -m examples/isa/bin/demo.elf
# Boot Linux with its supplied device tree
./build/rv64-release/simrv --cli \
  -m images/rv64/alpine-gui/opensbi-linux-payload.elf \
  --dtb images/rv64/alpine-gui/devicetree.dtb \
  -D images/rv64/alpine-gui/rootfs.img \
  -s 20000000

Documentation Navigation

  • Install SimRV


    Pick a package, install SimRV, and run your first program.

  • Boot a Linux guest


    Buildroot and Alpine images, firmware handoff, root filesystems, and SMP boot.

  • Extend a CPU or SoC


    Configure CPU presets, add MMIO devices, or map custom hardware ranges.

  • Validate a model


    Compare architectural or cycle behavior, then tune latency and predictor settings.


Citation

If you use SimRV in academic work, use GitHub’s Cite this repository option to generate a citation from CITATION.cff. Cite the exact release tag used for your work so readers can identify the version.