riscv-rust
riscv-rust is a RISC-V processor emulator project written in Rust.
Demo
You can run Linux or xv6 on the emulator in your browser. Online demo is here
Screenshots
Documents
Features
- Emulate RISC-V processor and peripheral devices
- Stable as Linux and xv6-riscv run on it
- Runnable locally
- Also runnable in browser with WebAssembly
- Debugger
Instructions/Features support status
- RV32/64I
- RV32/64M
- RV32/64F (partially)
- RV32/64D (partially)
- RV32/64Q
- RV32/64A (partially)
- RV64C/32C (partially)
- RV32/64Zifencei (partially)
- RV32/64Zicsr (partially)
- CSR (partially)
- SV32/39
- SV48
- Privileged instructions (partially)
- PMP
etc...
How to import into your Rust project
This module is released at crates.io. Add the following line into Cargo.toml of your Rust project.
[dependencies]
riscv_emu_rust = "0.1.0"
Refer to cli/src/main.rs as sample code.
How to build core library
How to run Linux or xv6 as CLI application
# Run Linux
# Run xv6
How to build WebAssembly and run in the browser
Prerequirements
- Install wasm-bindgen client
# boot local server and access riscv-rust/wasm/web/index.html
How to install WebAssembly npm package
How to run riscv-tests
Prerequirements
- Install riscv-gnu-toolchain
- Install riscv-tests
Links
Linux RISC-V port
xv6-riscv
xv6-riscv is the RISC-V port of xv6 which is UNIX V6 rewritten by MIT for x86 in the current C language.