Skip to content

takeoverjp/rrvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What's RRVM

RISC-V emulator. Supprts rv64imc.

Required environment variable

  • RISCV
    • Riscv tool install path as the following:
$ export RISCV=/opt/riscv/

Howto build

$ cargo build

Howto unit test

$ cargo test

Howto regression test

Build and install riscv-tests

$ git clone --recursive https://github.com/riscv/riscv-tests
$ mkdir -p riscv-tests/build
$ cd riscv-tests/build
$ ../configure --prefix=${RISCV}/target
$ make
$ make install

Run regression tests

$ cargo run ${RISCV}/target/share/riscv-tests/isa/rv64ui-p-addi.bin

Run all regression tests

find ${RISCV}/target/share/riscv-tests/isa/ | grep -v dump | grep rv64  | xargs -I@@@ cargo run @@@

Howto integration test

Install dependencies

  • Cross compiler and standard libraries
$ git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
$ cd riscv-gnu-toolchain
$ ./configure --prefix=${RISCV}
$ make -j`getconf _NPROCESSORS_ONLN`

Run integration test

$ make -C test
$ cargo run test/hello.bin

Howto compare with spike trace log

$ cargo run ${RISCV}/target/share/riscv-tests/isa/rv64ui-p-addi.bin -o 0x80000000 -s -l error > rrvm.log
$ spike --isa=rv64gc -l  ${RISCV}/target/share/riscv-tests/isa/rv64ui-p-addi 2>&1 | cut -d")" -f 1 > spike.log
$ diff -u spike.log rrvm.log

Howto build documentation

$ cargo doc --no-deps --open --document-private-items

About

Rust Risc-V Mimic

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages