Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
Mention experimental system emulation and explain how to build custom
Linux image. In addition, introduce the ablation study features for
performance analysis.
  • Loading branch information
ChinYikMing committed Dec 15, 2024
1 parent 8a0deae commit 0c6ffb5
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,34 @@ If you don't want the JIT compilation feature, simply build with the following:
$ make
```

### Experimental system emulation
Device Tree compiler (dtc) is required. To install it on Debian/Ubuntu Linux, enter the following command:
```
$ sudo apt install device-tree-compiler
```
For macOS, use the following command:
```
$ brew install dtc
```

#### Build and run system emulation
Build and run using default images (the default images will be fetched from [rv32emu-prebuilt](https://github.com/sysprog21/rv32emu-prebuilt) before running):
```shell
$ make ENABLE_SYSTEM=1 system
```

Build using run using specified images:
```shell
$ make ENABLE_SYSTEM=1
$ build/rv32emu -k <kernel_img_path> -i <rootfs_img_path> -b <dtb_path>
```

#### Build Linux image
An automated build script is provided to compile the RISC-V cross-compiler, Busybox, and Linux kernel from source. Please note that it only supports the Linux host environment. It can be found at tools/build-linux-image.sh.
```
$ make build-linux-img
```

### Verify with prebuilt RISC-V ELF files

Run sample RV32I[M] programs:
Expand Down Expand Up @@ -98,7 +126,9 @@ The image containing all the necessary tools for development and testing can be
* `ENABLE_FULL4G` : Full access to 4 GiB address space
* `ENABLE_SDL` : Experimental Display and Event System Calls
* `ENABLE_JIT` : Experimental JIT compiler
* `ENABLE_SYSTEM` : Experimental system emulation, allowing booting Linux kernel
* `ENABLE_SYSTEM`: Experimental system emulation, allowing booting Linux kernel. To enable this feature, additional features must also be enabled. However, by default, when `ENABLE_SYSTEM` is enabled, CSR, fence, integer multiplication/division, and atomic Instructions are automatically enabled
* `ENABLE_MOP_FUSION` : Macro-operation fusion
* `ENABLE_BLOCK_CHAINING` : Block chaining of translated blocks

e.g., run `make ENABLE_EXT_F=0` for the build without floating-point support.

Expand Down Expand Up @@ -145,7 +175,7 @@ For macOS users, installing `sdiff` might be required:
$ brew install diffutils
```

To run the tests for specific extension, set the environmental variable `RISCV_DEVICE` to one of `I`, `M`, `A`, `F`, `C`, `Zifencei`, `privilege`.
To run the tests for specific extension, set the environmental variable `RISCV_DEVICE` to one of `I`, `M`, `A`, `F`, `C`, `Zifencei`, `privilege`, `SYSTEM`.
```shell
$ make arch-test RISCV_DEVICE=I
```
Expand Down

0 comments on commit 0c6ffb5

Please sign in to comment.