Skip to content

Commit

Permalink
[doc] update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Clo91eaf committed Jun 11, 2024
1 parent 1b291bc commit d544224
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,8 @@ To install HEMU, you will need to have Rust installed on your machine. You can d

Once Rust is installed, you can clone the HEMU repository from Github:

```sh
git clone --recurse-submodules https://github.com/Clo91eaf/hemu.git
```

or

```sh
git clone https://github.com/Clo91eaf/hemu.git
git submodule update --init --recursive
```

### Runing
Expand All @@ -37,22 +30,39 @@ cargo run -- -k ./dependencies/tests/bin/am-tests/add

#### Difftest

if you want to run difftest, you can use the following command:
Verilator file should be placed in the `./dependencies/rtl` directory.
then you can use the following command:

```sh
cargo run -- -k ./dependencies/tests/bin/am-tests/add --diff
cargo clean && cargo run -- -k ./dependencies/tests/bin/am-tests/add --diff
```

To build the verilator file and ffi, cargo clean is necessary when you change the verilator file.

#### Difftest With Tui

if you want to run difftest with TUI, you can use the following command:

```sh
cargo run -- -k ./dependencies/tests/bin/am-tests/add --diff --tui
cargo clean && cargo run -- -k ./dependencies/tests/bin/am-tests/add --diff --tui
```

In Tui, you can press 'c' to continue, 's' to step, 'q' to quit.

#### CLI usage

Usage: hemu [OPTIONS] --kernel <KERNEL>

Options:
-k, --kernel <KERNEL> A kernel ELF image without headers
-f, --file <FILE> A raw disk image
-l, --log <LOG> specify the log level. Including "error", "warn", "info", "debug", "trace" [default: info]
-d, --diff Enable difftest
--tui Enable tui
--trace Enable wave trace
-h, --help Print help
-v, --version Print version

#### Run opensbi

You should run HEMU first to generate the dtb with whatever binary. Then you can run HEMU with opensbi, you can use the following command:
Expand Down

0 comments on commit d544224

Please sign in to comment.