Skip to content

Commit 56496f3

Browse files
authored
Merge pull request #4409 from vvbandeira/docs-fix-orphans-and-links
docs: fix orphan pages, dead links and the metrics guide
2 parents 9768f0f + 67dcd33 commit 56496f3

15 files changed

Lines changed: 166 additions & 55 deletions

‎docs/README.md‎

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,68 @@
1-
# OpenROAD Documentation
1+
# OpenROAD-flow-scripts Documentation
22

3-
This documentation is available at [https://openroad.readthedocs.io/en/latest/](https://openroad.readthedocs.io/en/latest/)
3+
This is the source for the OpenROAD-flow-scripts (ORFS) documentation, published
4+
at [https://openroad-flow-scripts.readthedocs.io/en/latest/](https://openroad-flow-scripts.readthedocs.io/en/latest/).
5+
6+
The documentation for the OpenROAD application itself lives in a different
7+
repository and is published at
8+
[https://openroad.readthedocs.io/en/latest/](https://openroad.readthedocs.io/en/latest/).
49

510
## Build locally
611

7-
### Requires:
8-
- Python 3.x
9-
- Pip
10-
- `virtualenv`
12+
### Requires
13+
14+
- Python 3.10 — the version Read the Docs builds with (see `.readthedocs.yaml`).
15+
The pinned Sphinx release does not run on Python 3.13 or newer.
16+
- `pip`
17+
- `virtualenv` (or the standard-library `venv`)
18+
19+
### Install prerequisites
1120

12-
### Install prerequisites:
21+
Run from the repository root:
1322

1423
``` shell
1524
virtualenv .venv
1625
source .venv/bin/activate
17-
pip install -r requirements.txt
26+
pip install -r docs/requirements_lock.txt
1827
```
1928

20-
### Build:
29+
`docs/requirements_lock.txt` is the hash-pinned lock file that Read the Docs
30+
installs, so a local build matches the published one. The direct dependencies
31+
are listed in `docs/requirements.in`; after editing that file, regenerate the
32+
lock with:
2133

2234
``` shell
35+
pip-compile --generate-hashes --output-file=docs/requirements_lock.txt docs/requirements.in
36+
```
37+
38+
### Build
39+
40+
``` shell
41+
cd docs
2342
make html
2443
```
2544

26-
### Check for broken links:
45+
The generated site is in `docs/build/html`; open `docs/build/html/index.html`.
46+
47+
### Check for broken links
2748

2849
``` shell
50+
cd docs
2951
make checklinks
3052
```
53+
54+
The report is written to `docs/build/output.txt` (and `docs/build/output.json`).
55+
It exits non-zero when any link is unreachable.
56+
57+
### Notes
58+
59+
- The build needs network access: `docs/conf.py` downloads three files from the
60+
OpenROAD repository at build time.
61+
- Building writes generated pages into the source tree: `index2.md`,
62+
`SupportedOS.md`, `Manpage.md`, `mainREADME.md`, and — because it is fetched
63+
rather than authored here — the tracked file `contrib/GitGuide.md`. Do not
64+
commit those changes; `git checkout docs/contrib/GitGuide.md` after a build.
65+
- Always `rm -rf docs/build` before rebuilding. The output directory is
66+
`build/`, but `conf.py`'s `exclude_patterns` only excludes `_build`, so a
67+
second run picks up the Markdown files written under `build/html/` as if they
68+
were source pages.

‎docs/contrib/Metrics.md‎

Lines changed: 100 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,128 @@ repository contains source files (e.g., LEF/DEF, Verilog, SDC, Liberty,
55
RC extraction) and configuration files (e.g. `config.mk`) that enable the user to run
66
a small set of example designs through our complete RTL-to-GDS flow.
77

8-
To keep track of the quality of the results, we maintain inside each
9-
design folder two files:
8+
To keep track of the quality of the results, each design directory holds a
9+
rules file that gates the flow:
1010

11-
1. `metadata-base-ok.json` which contains all the relevant
12-
information extracted from the "golden" execution of the flow (i.e.,
13-
last known good result).
11+
``` text
12+
flow/designs/<platform>/<design>/rules-base.json
13+
```
14+
15+
The file name comes from `RULES_JSON`, defined in
16+
[`flow/util/utils.mk`](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/util/utils.mk):
17+
18+
``` makefile
19+
export RULES_JSON ?= $(DESIGN_DIR)/rules-$(FLOW_VARIANT).json
20+
```
21+
22+
`FLOW_VARIANT` defaults to `base`, which is why the committed file is
23+
`rules-base.json`. A run with a non-default `FLOW_VARIANT` looks for
24+
`rules-<variant>.json`, or you can point `RULES_JSON` at any file explicitly.
25+
26+
Each entry in the rules file is a metric name, a reference value, and a
27+
comparison operator. For example:
28+
29+
``` json
30+
{
31+
"synth__design__instance__area__stdcell": {
32+
"value": 43.1,
33+
"compare": "<="
34+
},
35+
"detailedplace__design__violations": {
36+
"value": 0,
37+
"compare": "=="
38+
}
39+
}
40+
```
1441

15-
2. `rules.json` which holds a set of rules that we use to
16-
evaluate new executions when a change is made.
42+
An entry may also carry `"level": "warning"`, which reports a mismatch without
43+
failing the build.
1744

18-
## Checking against golden
45+
The values a run is measured against are collected by
46+
`flow/util/genMetrics.py` into `$(REPORTS_DIR)/metadata.json`
47+
(`reports/<platform>/<design>/<variant>/metadata.json`). That file is generated
48+
output — it is not committed. `flow/util/checkMetadata.py` compares it against
49+
the rules file.
1950

20-
The evaluation checks for key metrics (e.g., worst slack, number of
21-
DRCs) to ensure that changes do not degrade too much with respect to the
22-
"golden" values.
51+
## Checking against the rules
2352

24-
After you make a significant change, e.g., fixing a bug in a piece of
25-
code, or changing some configuration variable
26-
(`PLACE_DENSITY`), you should review the results and compare
27-
them with the "golden". To perform the check, you will need to run the
28-
following command:
53+
The evaluation checks key metrics (e.g., worst slack, number of DRCs) to
54+
ensure that changes do not degrade the results.
55+
56+
After you make a significant change — e.g., fixing a bug in a piece of code, or
57+
changing a configuration variable such as `PLACE_DENSITY` — review the results
58+
and compare them against the rules. To perform the check, run:
2959

3060
``` shell
3161
cd OpenROAD-flow-scripts/flow
32-
# the clean_metadata is only required if you need to re-run
62+
# clean_metadata is only required if you need to re-run the check
3363
make [clean_metadata] metadata
3464
```
3565

36-
If the command above yields any error message, please review to
37-
make sure the change in metrics is expected and justifiable. If so,
38-
proceed to the next section to update the "golden" reference.
66+
`make metadata` runs three steps in order: `finish` (the full flow),
67+
`metadata-generate` (write `metadata.json`), and `metadata-check` (compare it
68+
against `RULES_JSON`). The check log is written to
69+
`$(REPORTS_DIR)/metadata-check.log`.
70+
71+
If you only changed synthesis, you can gate a synthesis-only run against the
72+
synthesis subset of the same rules file, without running the rest of the flow:
73+
74+
``` shell
75+
make metadata-synth
76+
```
77+
78+
If the check reports any error, review it to make sure the change in metrics is
79+
expected and justifiable. If so, proceed to the next section to update the
80+
reference values.
3981

4082
## Update process
4183

42-
Update of the reference files is mandatory if any metrics became worse
43-
than the values limited by the `rules.json` (see previous
44-
section on how to perform the check). Also, it is a good idea to update
45-
the "golden" files if your changes have improved a metric, to ensure that
46-
the improvement will not be lost in the future.
84+
Updating the rules file is mandatory if a metric became worse than the value
85+
allowed by `rules-base.json` (see the previous section on how to perform the
86+
check). It is also a good idea to update it when your change improves a metric,
87+
so that the improvement is not silently lost later.
4788

48-
To update all the reference files:
89+
To update the rules file for a design, from a tree that has just been measured
90+
(so `metadata.json` exists):
4991

5092
``` shell
5193
cd OpenROAD-flow-scripts/flow
5294
make update_ok
5395
```
5496

55-
In case you have a special reason to only update one of the files, you
56-
can do so with the following commands:
97+
`update_ok` is an alias for `update_rules`. It runs `flow/util/genRuleFile.py`
98+
with `--failing --tighten`, which:
99+
100+
- relaxes rules the current run fails, using the measured value plus a margin,
101+
so that small run-to-run variation does not break the flow; and
102+
- tightens rules the current run passes by a wide margin, so improvements are
103+
locked in.
104+
105+
The new file is written to `$(REPORTS_DIR)/rules.json` and then copied over
106+
`$(RULES_JSON)` — that copy is the file you commit.
107+
108+
If you need to overwrite every rule from the current run rather than only the
109+
failing and improved ones, use:
57110

58111
``` shell
59-
# update metadata-base-ok.json file for the design
60-
make update_metadata
112+
make update_rules_force
113+
```
114+
115+
This runs `genRuleFile.py --update`. Prefer `make update_ok`; use the forced
116+
variant only when the metric set itself changed.
61117

62-
# update rules.json file for the design
63-
# this will use the current (+ a padding) metadata-base-ok.json
64-
# the padding ensures that small changes do not break the flow
65-
make update_rules
118+
## Reference metadata (`metadata-<variant>-ok.json`)
119+
120+
There is a second, optional file per design:
121+
122+
``` shell
123+
# writes flow/designs/<platform>/<design>/metadata-base-ok.json
124+
make update_metadata
66125
```
126+
127+
This copies the current `metadata.json` next to the design as
128+
`metadata-$(FLOW_VARIANT)-ok.json`. It is **not** what gates the flow — nothing
129+
in `make metadata` reads it. It is consumed only by
130+
`flow/util/genReportTable.py` when building the golden-vs-current report table,
131+
and almost no design commits one. Update the rules file, not this one, unless
132+
you are specifically working on that report.

‎docs/contrib/PlatformBringUp.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ They include :
4040
Adding a new platform additionally requires the following:
4141

4242
* A validated installation of the OpenROAD flow scripts is available. See
43-
instructions [here](../index.md#build-or-installing-orfs-dependencies).
43+
instructions [here](../index2.md#build-or-installing-orfs-dependencies).
4444
* A general knowledge of VLSI design and RTL to GDS flows. OpenROAD
4545
implements a fully-automated RTL-GDSII but it requires familiarity with
4646
the OpenROAD flow scripts to debug problems.

‎docs/images/ORFS_Flow.svg‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎docs/toc.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ entries:
1717
title: Build Locally
1818
- file: user/BuildWithWSL.md
1919
title: Build Using WSL
20+
- file: user/AddingNewDesign.md
21+
title: Adding New Designs to the ORFS
2022
- file: user/FlowVariables.md
2123
title: Flow Variables
2224
- file: user/AutoMemories.md
2325
title: Generated Memory Macros (AUTO_MEMORIES)
26+
- file: user/LargeDesigns.md
27+
title: Tips on building large design
2428
- file: contrib/Metrics.md
2529
title: Metrics
2630
- file: user/InstructionsForAutoTuner.md
@@ -37,6 +41,10 @@ entries:
3741
entries:
3842
- file: contrib/GitGuide.md
3943
title: Git Quickstart
44+
- file: contrib/PlatformBringUp.md
45+
title: Guide to Integrate a New Platform into the OpenROAD Flow
46+
- file: contrib/CI.md
47+
title: CI Guide
4048

4149
- file: contrib/CODE_OF_CONDUCT.md
4250
title: Code of Conduct
@@ -49,6 +57,8 @@ entries:
4957
entries:
5058
- file: tutorials/FlowTutorial
5159
title: Flow Tutorial
60+
- file: tutorials/SetRC.md
61+
title: Correlating RC Values for PDKs
5262
- file: tutorials/Notebooks
5363
title: Running the OpenROAD Flow in Google Colab
5464

‎docs/tutorials/FlowTutorial.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This is intended for:
1515
- Beginners or new users with some understanding of basic VLSI
1616
design flow. Users will learn the basics of installation to use
1717
OpenROAD-flow-scripts for the complete RTL-to-GDS flow from
18-
[here](../index.md#getting-started-with-openroad-flow-scripts).
18+
[here](../index2.md#getting-started-with-openroad-flow-scripts).
1919
- Users already familiar with the OpenROAD application and flow but would
2020
like to learn more about specific features and commands.
2121

@@ -522,6 +522,7 @@ View clock tree structure below, the user needs to disable the metal
522522
From the top Toolbar, click on the `Windows` menu to select/hide different
523523
view options of Scripting, Display control, etc.
524524

525+
(content:heat:maps)=
525526
### Using Heat Maps
526527

527528
From the Menu Bar, Click on `Tools` -> `Heat Maps` -> `Placement Density` to view
@@ -939,7 +940,7 @@ cd ../tools/OpenROAD/src/pdn/test
939940
openroad -gui
940941
```
941942

942-
Run [core_grid_snap.tcl](.(https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pdn/test/core_grid_snap.tcl)
943+
Run [core_grid_snap.tcl](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pdn/test/core_grid_snap.tcl)
943944
to generate power grid for `gcd` design.
944945

945946
```tcl
-394 KB
Binary file not shown.
-548 KB
Binary file not shown.
-65.7 KB
Binary file not shown.
-54.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)