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.
You can run Linux on the emulator in your browser: online demo is here
- Emulates RISC-V
RV64GC_Zba_Zicondprocessor and peripheral devices (PLIC, CLINT, virtio block device and a UART) - Targets native and WASM
- RV64IMAC
- RV64FD (PARTIALLY: flags/rounding modes not complete for all insns)
- RV64Zifencei
- RV64Zicsr
- Svnapot
- Zba (part of "B", RVA22)
- Zbb (part of "B", RVA22)
- Zbs (part of "B", RVA22)
- Zicond
- CSR (nearly complete)
- Sv39, Sv48, Sv57
- Privileged instructions
- [-] PMP (this is intensionally not implemented as it will negatively affect performance)
The emulator supports all instructions listed above but some (like many FP instructions) are not 100% to the spec.
- Boots Buildroot and Debian Trixie
- Linux OpenSBI and legacy BBL boot support
- Newer Linux kernel have issues with VirtIO block devices (initramfs works)
- U-boot loads but hangs before hand-off; might be an issue with ELF loading
-
Snapshot and resume
-
Disk support without an in-memory copy (can WASM support this?)
-
Improve the disassembler to recognize pseudo ops like li, mv, ret, etc. (This requires a structural change).
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.elf -f linux/rootfs.imgor
$ cargo r -r -- -c linux/opensbi/fw_jump.elf,0x80000000 linux/vmlinux,0x80200000 -f linux/rootfs.imgAllocate 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.elf initrd2+gdb.cpio,0xa0000000)$ ./run-riscv-tests.shSee wasm/web
See wasm/npm

