This page contains resources about RISC-V emulators, simulators, available distributions and simple and cheap solution to have displayed output
There are a lot of possibilities in this, inluding, for hardware RISC−V display, some LCD screen, HDMI output with closed driver or open driver, with often limited GPU support (work in progress). There are some FGPA based solution with open sources solution.
- Writing this, I found after few months a page with similar resource and goal here: RISC-V Guide, seem to not be not updodate, but still have some interesting information to get.
Main emulators
- Fabrice Bellard's TinyEmu (see also: BareBox for RISC-V on TinyEmu in WASM BareDoom, BareDoom WASM demo), RV32, RV64, RV128, previously known as "riscvemu". RISCV-EMU is a build system for TinyEMU. buildroot parched for RISC-V
- Fabrice Bellard's Qemu (RV64 and RV32). He also created VFsync to allow to share VM data between web and hosts
- LeKKit RVVM RV64 and RV32, very fast, manage lot of features, still no sounbd in december 2024.
- fwsGonzo libriscv RV64 and RV32, very fast, low latency, for game emulation purpose, rvscript, RISC-V based scripting backend, benchmarks tools
- WASM RISC-V emulator RV32 only
- JuiceVM minimalistic RV64 VM that support M/U/S modes, minimal UART, MMU and interrupts. Can run freertos and rt-thread embedded OS.
- riscv-rust, wrote in Rust, emulate most specs, with WASM backend
- rvemu wrote in Rust, emulate all first specs (still miss User-level CSRs) and VirtIO, CLI only, with WASM backend.
HDL implementations for FPGA
- LiteX is a light very portable HDL implementation and LiteX runs on a bunch of FPGA. BareBox has undocumented LiteX/RISC-V build on 2024.12, but Linux on LiteX vexriscv has far less target, but still a lot (due to number of gates needed to that).
Simulators for RISC−V assembly prupose
- MARSS-RISCV Micro-Architectural System Simulator for RISC-V, build on top on TinyEMU.
- Angel Browser-based RISC-V ISA simulator
- RISC-V-Web-Simulator WebAssembly/WASM simulator (clean Online Demo, without external/spying dependencies \o/)
- Spike RV64 and RV32 simulator, manage most if not all extensions
- RISC-V Interpreter, light and dynamic web interface for simulating RISC-V
- QtRvSim WebAssembly RISC-V CPU simulator for education (Online demo)
- MSIM (sources) RISC-V (RV32, multicore, Supervisor and User mode) and MIPS simulator. Try to be compatible instead of fast, simulate several peripherals.
- Ripes, (|online demo](https://ripes.me/)), web based (using Qt for WebAssembly) RV64 and RV32 5-stage RISC-V pipeline simulator, with logical unit, cache and memory visualisation.
- Jupiter, RV32IMF Assembler and Runtime Simulator
- Venus (frontend, online demo) browser and JVM RV32IM simulator for education with integrated CodeMirror editor.
- RISC-V Online Assembler
-Not toally complete basic function ones but can help to train in bases of RISC-V*
- RARS, Java application derived from MIPS simulator, MARS, it contains a limited RISC-V subset instructions, looks like no more maintained, mainly for education purpose, contain a small SPIKE and Linux like API, to display integer, floats etc values, and better understand. Follow Archlinux PKGBUILD to understand how to install it, as there is no documentation about this.
Embedded
- RV51 A RISC-V (RV32IM) emulator for the 8051 (MCS-51) microcontroller.
ESP32-VGA
A minimal interesting solution is to connect RISC−V version of ESP32 with VGA connector as done with this ESP32-S3 (this model is not RISC-V, ESP32-C2, C3, all the H* models and the far more expansive P4, are RISC-V):
- Inst1ructables recipe, JPR Alves version (640x350 pixels)
- Bitulini's ESP32Lib, Bitulini's ready product Hack a Day article, Adafruit article (up to 16-bit 1024×768 pixels)
- Lilygo most compact and cheap version with audio Jack and 2 PS/2 after Bitulini's one
- aready made FabGL product documentation, this one support sounds and ps/2 controllers, but is (Out of stock)
Desktop and server operating systems:
Simple way to have a desktop Linux simulation is with TinyEmu, here with Barbox:
BareBox_V=2024.12.0
curl -oR https://git.pengutronix.de/cgit/barebox/snapshot/barebox-${BareBox_V}.tar.gz
tar xf barebox-${BareBox_V}.tar.gz
cd barebox-${BareBox_V}/
make ARCH=riscv rv64i_defconfig # for building tdt-2nd (Tinyemu), HiFive, D1, Enzo (Qemu) images
ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- make #-j4 for 4 cores compilation don't need cross compile if you compile on RISC-V OS
make ARCH=riscv litex_linux_defconfig # for building LiteX image
ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- make #-j4 for 4 cores compilation don't need cross compile if you compile on RISC-V OS
# get bootloaders from bellard.org
wget https://bellard.org/tinyemu/diskimage-linux-riscv-2018-09-23.tar.gz
tar xf diskimage-linux-riscv-2018-09-23.tar.gz
cp -a diskimage-linux-riscv-2018-09-23/bbl{32,64}.bin .
cat >tinyemu_gfx.cfg <<EOF
{
version: 1,
machine: "riscv64",
memory_size: 256,
bios: "bbl64.bin",
kernel: "images/barebox-dt-2nd.img",
display0: { device: "simplefb", width: 800, height: 600 },
input_device: "virtio",
}
EOF
sudo pacman -S tinyemu
temu tinyemu_gfx.cfg
Linux
GNU/Linux
- JSLinux gives different TinyEmu ready configurations
- RVVM test (prebuilt files, live demo)
- RevyOS (mirrors outside China) Debian derivated dedicated to XuanTie TH1520 SoC, have all dedicated drivers, including closed sources ones if needed
- Arch Linux RISC-V The best general distro for desktop
- Debian RISC-V The first distro I was able to use on RISC-V
- Gentoo RISC−V (Qemu setup), a time and CPU conssuming distribution, that is said as each one have optimal version for its own architecture.
- OpenSUSE RISC-V A less popular but good distro too)
- Ubuntu RISC-V I tend to not use anymore Ubuntu due to their usage of Snap, I prefer the original Debian, that make most of the work)
Autres
- Haiku Page around available RISC-V img
- FreeBSD for RISC-V
- BareBox, a ~bare metal OS BareBox sources Targets for RISC-V
- XV6 for RISC-V
- Plan9 for RISC-V
Embedded systems:
- Apache NuttX NuttX manage a bunch of SoC now NuutX for OX64 (BL808) and NuttX for SG2000 (T-Head C906 / Milk-V Duo S) Lup Yuen Lee port to TinyEmu, and here a tutorial about emulating Sophgo SG2000 in TinyEmu. I also made a tutorial ESP32-C3 part1 - Installing Apache NuttX POSIX embedded OS on RISC-V based ESP32-C3 with Arch Linux on my older blog
- FreeRTOS: ESP-IDF (Espressif IoT Development Framework) (documentation) is a complete SDK with nice API by Espressif works on both their RISC−V and Tencillia models. Used it a bit on ESP32-C3 part2 - Playing with button and LEDs on RISC-V based ESP32-C3 NodeMCU board with ESP-IDF (FreeRTOS) ESP32-C3 Part3 - RISC-V based ESP32c3 with ESP-IDF part 3, OLED screen, and potentiometer. See also an interesting RISC-V Bytes: Exploring a Custom ESP32 Bootloader by Daniel Mangum.
Assembly courses
- Project F have several RISC-V Assembler courses, including Arithmetic, Logical, Jump and Function and a RISC-V Assembler Cheat Sheet
- Twilco's blog contains 4 fundamentals courses called RISC-V from scratch, 1. Introduction, toolchain setup, and hello world!, 2.Hardware layouts, linker scripts, and C runtimes, 3. Writing a UART driver in assembly (1/2), 4. Creating a function prologue for our UART driver (2/3).
- Robert Twinkler RISC-V book, to use with RARS simulator and its included system like library, with more spcecialized output functions.
- An assembler Programmer's Manual by P. Dabbelt, M. Clark and A. Bradbury
- A RISC-V Assembler Reference by Michael J. Clark
- imperial Violet's RISC-V Assembly
- My own courses on Syscall with RISC-V Assembly (need to update some parts of the syntax, due to more restrictive syntax in GCC 14)
- SSE2RVV is SEE SIMD to RISC-V vector processor extenton converter
- RISC-V Page Table I about how work Pages tables management on RV32 (Sv32) and RV64 (Sv39 and Sv48)