11# RISC-V RV32I[ MAC] emulator with ELF support
22
3- Emulator was originally created by Fabrice Bellard and then modified and shared on Hackaday by Frank Buss
4- as a single C-file. Shaos added some additional statistics and macros .
3+ This is a RISC-V emulator for the RV32I architecture, based on [ TinyEMU ] ( https://bellard.org/tinyemu/ )
4+ and stripped down for RV32I only .
55
66Requires libelf-dev:
77``` shell
@@ -19,8 +19,13 @@ $ make emu-rv32i
1919
2020Passed RV32I compliance tests from https://github.com/riscv/riscv-compliance
2121- Must install the [ risc-v toolchain] ( https://xpack.github.io/riscv-none-embed-gcc/ )
22+
23+ Run RV32I compliance tests.
24+ Assume ` emu-rv32i ` in ` $PATH ` environment variable.
2225``` shell
23- $ make RISCV_TARGET=spike RISCV_DEVICE=rv32i TARGET_SIM=/full/path/emulator variant
26+ $ git clone https://github.com/riscv/riscv-compliance
27+ $ cd riscv-compliance
28+ $ make RISCV_PREFIX=riscv-none-embed- RISCV_DEVICE=rv32i TARGET_SIM=emu-rv32i variant
2429```
2530
2631Compiling and running simple code:
@@ -36,15 +41,14 @@ Hello RISC-V!
3641
3742- RV32M and RV32A instructions may be enabled by commenting ` #define STRICT_RV32I ` .
3843
39-
4044Passed RV32C compliance tests from https://github.com/riscv/riscv-compliance
4145``` shell
4246make C-ADDI.log
4347```
4448If there is no accident, it will output the ` TEST PASSED `
4549
4650
47- - RV32C instructions can be enabled by commenting ` #define RV32C `
51+ - RV32C instructions can be enabled by uncommenting ` #define RV32C `
4852## How to build RISC-V toolchain from scratch
4953
5054https://github.com/riscv/riscv-gnu-toolchain
0 commit comments