/Nemu-rust

RISC-V emulator in rust

Primary LanguageRustGNU General Public License v3.0GPL-3.0

Nemu-rust

RISC-V emulator in rust, capable to boot linux kernel(v5.4) with initramfs.

inspired by https://github.com/NJU-ProjectN/ics-pa#/

microbench: 475 Marks (vs i9-9900K@3.60GHz's 100000 Marks)
PAL running at ~10 fps.
Coremark 1.0 inside kernel: 34.998688 (vs local AMD Ryzen 7 3700X(16)@3.600GHz's 29662.5)

~ # coremark
2K performance run parameters for coremark.
CoreMark Size    : 0o
Total ticks      : 0n
Total time (secs): 11.429000
Iterations/Sec   : 34.998688
Iterations       : 0X
Compiler version : GCC14.2.0
Compiler flags   : -O2 -march=rv64ima -mabi=lp64 -static  -lrt
Memory location  : Please put data memory location here
			(e.g. code in flash, data on heap etc)
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0x25b5
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 34.998688 / GCC14.2.0 -O2 -march=rv64ima -mabi=lp64 -static  -lrt / Heap

Usage

  1. clone linux v5.4 to ./linux/linux/
  2. build linux with ./linux.config
  3. build rootfs with busybox to ./linux/rootfs/
  4. clone opensbi 1.6 to ./opensbi-1.6/
  5. make build_linux && make linux