All Projects → takahirox → Riscv Rust

takahirox / Riscv Rust

Licence: mit
RISC-V processor emulator written in Rust+WASM

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Riscv Rust

Darkriscv
opensouce RISC-V cpu core implemented in Verilog from scratch in one night!
Stars: ✭ 1,062 (+319.76%)
Mutual labels:  cpu, risc-v, riscv, processor
Neorv32
A small and customizable full-scale 32-bit RISC-V soft-core CPU and SoC written in platform-independent VHDL.
Stars: ✭ 106 (-58.1%)
Mutual labels:  cpu, risc-v, riscv, processor
vrcpu
Code, documentation, schematics, notes for my Ben Eater inspired breadboard computer and emulator
Stars: ✭ 98 (-61.26%)
Mutual labels:  emulator, cpu, webassembly, wasm
Unicorn
Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, X86)
Stars: ✭ 4,934 (+1850.2%)
Mutual labels:  cpu, emulator, riscv
Cores Swerv
SweRV EH1 core
Stars: ✭ 406 (+60.47%)
Mutual labels:  risc-v, riscv, processor
Cores Swerv El2
SweRV EL2 Core
Stars: ✭ 79 (-68.77%)
Mutual labels:  risc-v, riscv, processor
Gameboy
🎮 Game Boy emulator written in Rust
Stars: ✭ 17 (-93.28%)
Mutual labels:  webassembly, emulator, wasm
Riscv Fs
F# RISC-V Instruction Set formal specification
Stars: ✭ 173 (-31.62%)
Mutual labels:  cpu, risc-v, riscv
Ustc Rvsoc
FPGA-based RISC-V CPU+SoC.
Stars: ✭ 77 (-69.57%)
Mutual labels:  cpu, risc-v, riscv
tree-core-cpu
A series of RISC-V soft core processor written from scratch. Now, we're using all open-source toolchain( chisel, mill, verilator, NEMU, AM and difftest framework, etc) to design and verify.
Stars: ✭ 22 (-91.3%)
Mutual labels:  cpu, processor, riscv
sedna
Sedna - a pure Java RISC-V emulator.
Stars: ✭ 52 (-79.45%)
Mutual labels:  emulator, riscv, risc-v
Nes Rust
NES emulator written in Rust + WASM
Stars: ✭ 141 (-44.27%)
Mutual labels:  webassembly, emulator, wasm
Gbemu
WebAssembly based Gameboy Emulator
Stars: ✭ 120 (-52.57%)
Mutual labels:  webassembly, emulator, wasm
Wasmboy
Game Boy / Game Boy Color Emulator Library, 🎮written for WebAssembly using AssemblyScript. 🚀Demos built with Preact and Svelte. ⚛️
Stars: ✭ 963 (+280.63%)
Mutual labels:  webassembly, emulator, wasm
ravel
A RISC-V simulator
Stars: ✭ 24 (-90.51%)
Mutual labels:  emulator, riscv, risc-v
riscv em
Simple risc-v emulator, able to run linux, written in C.
Stars: ✭ 51 (-79.84%)
Mutual labels:  emulator, riscv, risc-v
Rustynes
👾 An NES emulator by Rust and WebAssembly
Stars: ✭ 399 (+57.71%)
Mutual labels:  webassembly, emulator, wasm
yatcpu
Yet another toy CPU.
Stars: ✭ 42 (-83.4%)
Mutual labels:  cpu, riscv, risc-v
rv32emu
RISC-V RV32I[MAC] emulator with ELF support
Stars: ✭ 61 (-75.89%)
Mutual labels:  emulator, riscv, risc-v
arv
ARV: Asynchronous RISC-V Go High-level Functional Model
Stars: ✭ 18 (-92.89%)
Mutual labels:  processor, riscv, risc-v

riscv-rust

Build Status Crate npm version

riscv-rust is a RISC-V processor and peripheral devices emulator project written in Rust and compiled to WebAssembly. You can import RISC-V emulator into your Rust or JavaScript project. Refer to the Slides for more detail.

Online Demo

You can run Linux or xv6 on the emulator in your browser. Online demo is here

Screenshots

animation debugger

Documents

Features

  • Emulate RISC-V processor and peripheral devices
  • Stable as Linux and xv6-riscv run on it
  • Linux OpenSBI and legacy BBL boot support
  • Runnable locally
  • Also runnable in browser with WebAssembly
  • Debugger
  • You can import RISC-V emulator into your Rust or JavaScript project

Instructions/Features support status

  • [x] RV32/64I
  • [x] RV32/64M
  • [x] RV32/64F (almost)
  • [x] RV32/64D (almost)
  • [ ] RV32/64Q
  • [x] RV32/64A (almost)
  • [x] RV64C/32C (almost)
  • [x] RV32/64Zifencei (almost)
  • [x] RV32/64Zicsr (almost)
  • [x] CSR (almost)
  • [x] SV32/39
  • [ ] SV48
  • [x] Privileged instructions (almost)
  • [ ] PMP

etc...

The emulator supports almost all instructions listed above but some instructions which are not used in Linux or xv6 are not implemented yet. Your contribution is very welcome.

How to import into your Rust project

The emulator module is released at crates.io. Add the following line into Cargo.toml of your Rust project.

[dependencies]
riscv_emu_rust = "0.2.0"

Refer to Document for the API.

How to build core library locally

$ git clone https://github.com/takahirox/riscv-rust.git
$ cd riscv-rust
$ cargo build --release

How to run Linux or xv6 as desktop application

$ cd riscv-rust/cli
# Run Linux
$ cargo run --release ../resources/linux/opensbi/fw_payloag.elf -f ../resources/linux/rootfs.img
# Run xv6
$ cargo run --release ../resources/xv6/kernel -f ../resources/xv6/fs.img

How to run riscv-tests

Prerequirements

$ cd riscv-rust/cli
$ cargo run $path_to_riscv_tets/isa/rv32ui-p-add -n

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

Links

Linux RISC-V port

Running 64- and 32-bit RISC-V Linux on QEMU

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.

Specifications

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].