| Crates.io | rv64emu |
| lib.rs | rv64emu |
| version | 0.1.1 |
| created_at | 2023-08-30 15:46:16.458037+00 |
| updated_at | 2023-08-31 08:06:54.295657+00 |
| description | A riscv64 emulator written in rust,it can run on Linux, Windows and MacOS. Even on the embedded device, such as `ESP32` and `STM32` which support Embeded RUST |
| homepage | |
| repository | https://github.com/leesum1/RV64emu-rs |
| max_upload_size | |
| id | 959069 |
| size | 359,716 |

RV64emu is a riscv64 emulator written in rust,It can run CoreMark,RT-thread and Linux now. And it is easy to add new devices and support new instructions. The rv64emu is now as a crate, you can use it in your project. Due to RUST's cross-platform feature, it can run on Linux, Windows and MacOS.Even on the embedded device, such as ESP32 and STM32 which support Embeded RUST.
ISA Specification:
Caches:
Devices
The simplest example of using rv64emu as a crate.You can find it in examples directory.
simple_system : the simplest example, only have uart and dram
ysyx_am_system : support AM environment, use ebread to terminate emulation
linux_system : support linux, you can run linux directly
features
| Name | Function | Comment |
|---|---|---|
| device_sdl2 | support sdl2 device, | such vga and keyboard |
| support_am | support AM environment, use ebread to terminate emulation | AM github AM pdf |
| caches | support caches,including inst_cache and decode_cache | |
| rv_debug_trace | support debug trace,including itrace and ftrace | the log file is in /tmp |
Run abstract machine applications
The following command will run hello.bin ,which is a simple application in ready_to_run directory. And for details of ysyx_am_system example, please refer to examples/ysyx_am_system.rs.
cargo run --release --example=ysyx_am_system --features="std device_sdl2" -- --img ready_to_run/hello.bin
Apart from hello.bin, there are other applications in ready_to_run directory:
These applications above were build for AM environment.
Run linux
cargo run --release --example=linux_system -- --img ready_to_run/linux.elf
Please refer to rv64emu-sdk for details.
test with riscv-tests
cargo riscv-tests
test with riscof
todo!
What a magic feature of rust! You can run rv64emu on the embedded device, such as ESP32 and STM32 which support embeded rust.
But before build your embeded project, you need to disable some features, such as device_sdl2,rv_debug_trace.
device_sdl2: because the embedded device does not support sdl2,and some devices, such as vga and keyboard are based on sdl2.
rv_debug_trace: because it used crossbeam-channel crate,which is not support no_std. More over, the embedded device does not support file system,and the log file is too large to store.
caches: because the embedded device does not have enough memory
nostd_esp32s3 :A no_std example about how to use rv64emu in esp32s3.