Skip to content

Commit 324bccb

Browse files
committed
Enhance README with example
Signed-off-by: Paul A. Clarke <[email protected]>
1 parent 2b90139 commit 324bccb

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,42 @@
22

33
A tool to extract information from the sail-riscv spec.
44

5-
## Usage
5+
## Build
66

77
```
88
make
99
```
10-
then run
10+
This will build a `riscv_decode.cmxs` for use as a `sail` plugin.
11+
Example use below.
12+
13+
## Usage
14+
15+
In general:
1116
```
1217
sail -plugin riscv_decode.cmxs -riscv_decode <files>
1318
```
19+
20+
A specific example follows. To ensure the various RISC-V Sail files are
21+
all included and in the correct order, leverage the `sail-riscv/Makefile`:
22+
23+
1. Clone the sail-riscv repository:
24+
```
25+
$ git clone https://github.com/riscv/sail-riscv.git
26+
```
27+
28+
1. Add a `decode` target to the `Makefile`, providing the path to the plugin
29+
built above:
30+
```
31+
@@ -178,6 +178,10 @@ endif
32+
33+
.PHONY:
34+
35+
+decode: $(SAIL_SRCS) model/main.sail Makefile
36+
+ sail -dno_cast -no_warn -plugin $(replace with path to)/riscvdecode/riscv_decode.cmxs -riscv_decode $(SAIL_SRCS)
37+
+
38+
```
39+
40+
1. Run it:
41+
```
42+
$ make decode
43+
```

0 commit comments

Comments
 (0)