Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Commit c06b6f4

Browse files
author
f74064054@mail.ncku.edu.tw
committed
Merge branch 'master' of github.com:kksweet8845/rv32emu
2 parents 3a1033a + 6d9ad52 commit c06b6f4

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# RISC-V RV32I[MA] emulator with ELF support
1+
# RISC-V RV32I[MAC] emulator with ELF support
22

33
Emulator was originally created by Fabrice Bellard and then modified and shared on Hackaday by Frank Buss
44
as a single C-file. Shaos added some additional statistics and macros.
@@ -12,20 +12,20 @@ How to compile it:
1212
```shell
1313
$ gcc -O3 -Wall -lelf emu-rv32i.c -o emu-rv32i
1414
```
15+
or
16+
```shell
17+
$ make emu-rv32i
18+
```
1519

1620
Passed RV32I compliance tests from https://github.com/riscv/riscv-compliance
21+
- Must install the [risc-v toolchain](https://xpack.github.io/riscv-none-embed-gcc/)
1722
```shell
1823
$ make RISCV_TARGET=spike RISCV_DEVICE=rv32i TARGET_SIM=/full/path/emulator variant
1924
```
2025

2126
Compiling and running simple code:
2227
```shell
23-
$ riscv32-unknown-elf-gcc -O3 -nostdlib test1.c -o test1
24-
```
25-
26-
or
27-
```shell
28-
$ riscv64-unknown-elf-gcc -march=rv32i -mabi=ilp32 -O3 -nostdlib test1.c -o test1
28+
$ make test1
2929
```
3030

3131
then
@@ -34,8 +34,17 @@ $ ./emu-rv32i test1
3434
Hello RISC-V!
3535
```
3636

37-
RV32M and RV32A instructions may be enabled by commenting `#define STRICT_RV32I`.
37+
- RV32M and RV32A instructions may be enabled by commenting `#define STRICT_RV32I`.
38+
39+
40+
Passed RV32C compliance tests from https://github.com/riscv/riscv-compliance
41+
```shell
42+
make C-ADDI.log
43+
```
44+
If there is no accident, it will output the `TEST PASSED`
45+
3846

47+
- RV32C instructions can be enabled by commenting `#define RV32C`
3948
## How to build RISC-V toolchain from scratch
4049

4150
https://github.com/riscv/riscv-gnu-toolchain

0 commit comments

Comments
 (0)