Skip to content

Commit c826216

Browse files
committed
[doc,design] Mention the need to run cmdgen
When generating top and top-dependent IPs it is necessary to run cmdgen. Add a mention of this in doc/contributing/doc/README.md and doc/contributing/hw/design.md. Signed-off-by: Guillermo Maturana <[email protected]>
1 parent 68f74f7 commit c826216

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

doc/contributing/doc/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Commonly one will run the following, which will go through every markdown file i
3333
./util/cmdgen.py -u '**/*.md'
3434
```
3535

36-
If run, the following snippet will have the register tables of the AES block (output by `util/regtool.py -d ./hw/ip/aes/data/aes.hjson`) inserted into it.
36+
For example, when cmdgen is run with the '-u' flag, the following snippet will result in the insertion of the AES register tables between the BEGIN and END lines.
3737

3838
````md
3939
# Registers
@@ -46,7 +46,11 @@ If run, the following snippet will have the register tables of the AES block (ou
4646
*Note, one should remove the `#` before the commands.
4747
This is there so that `CMDGEN` doesn't generate registers in this file.*
4848

49-
The `CMDGEN` tool can also be invoked by the `./hw/Makefile` using the target `cmdgen`.
49+
The `CMDGEN` tool can also be invoked by the `./hw/Makefile` using the target `cmdgen`, from the top of the repo
50+
51+
```sh
52+
make -C hw cmdgen
53+
```
5054

5155
[mdBook]: https://rust-lang.github.io/mdBook/
5256
[rustdoc]: https://doc.rust-lang.org/rustdoc/index.html

doc/contributing/hw/design.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,24 @@ The sections below show how to do items 2-4.
107107
$ make -C hw top
108108
```
109109

110-
After you revise the IP `.hjson`, IP top module, IP register interface, and DV testbench `tb.sv`, you can re-generate top-levels with the command above.
110+
After you revise the IP `.hjson`, IP top module, IP register interface, and DV testbench `tb.sv`, you can re-generate top-levels and some top-dependent IPs with the commands above.
111111
This reads the `.hjson` file and updates the interrupt signal and re-generates the PLIC module if needed.
112112

113+
### Update MD Files
114+
115+
Some `*.md` files generate contents using the `util/cmdgen.py` tool described at [CMDGEN](../doc/README.md##cmdgen).
116+
These files are generated using cmdgen via make.
117+
118+
```console
119+
$ make -C hw cmdgen
120+
```
121+
122+
Generating both top and cmdgen can be done conveniently with
123+
124+
```console
125+
$ make -C hw top_and_cmdgen
126+
```
127+
113128
### New DIF
114129

115130
Unfortunately, re-generating TOP does not resolve everything.

0 commit comments

Comments
 (0)