simmerv

Rust

Simmerv

Simmerv is a RISC-V SoC emulator written in Rust and compilable to WebAssembly. It began as a fork of Takahiro’s riscv-rust emulator, but has by now been extensively rewritten, making it far more complete and much faster. Ultimately, we expect it to become substantially faster, but this work is delayed until we are able to run standard benchmarks and off-the-shelf Linux distributions.

Online Demo

You can run Linux on the emulator in your browser: online demo is here

Screenshots (somewhat out of date)

animation debugger

Features

Instructions/Features support status

RVA22 profile (complete)

The emulator supports all instructions listed above.

How to run Linux with VirtIO Block Device (/dev/vda)

VERY IMPORTANT: images are stored with git LFS. Install LFS (don’t forget git lfs install also) and recheckout if needed. Otherwise the images will be small files with LFS pointers.

$ cargo r -r -- linux/fw_payload.bin,0x80000000 -f linux/rootfs.img

or

$ cargo r -r -- -c linux/opensbi/fw_jump.elf,0x80000000 linux/vmlinux,0x80200000 -f linux/rootfs.img

How to run Linux with initramfs (/dev/ram)

Allocate 2 GiB, use a device tree with initramfs at 0xa0000000 and load the initrd2+gdb.cpio binary at that address.

$ (cd linux;cargo r -r -- -m 2048 -d with-initrd.dtb fw_payload.bin,0x80000000 initrd2+gdb.cpio,0xa0000000)

How to run riscv-tests

$ ./run-riscv-tests.sh

How to import and use WebAssembly RISC-V emulator in a web browser

See wasm/web

How to install and use WebAssembly RISC-V emulator npm package

See wasm/npm

Linux RISC-V port

Running 64-bit RISC-V Linux on QEMU

Specifications