Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 48 additions & 10 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,68 @@
# OpenROAD Documentation
# OpenROAD-flow-scripts Documentation

This documentation is available at [https://openroad.readthedocs.io/en/latest/](https://openroad.readthedocs.io/en/latest/)
This is the source for the OpenROAD-flow-scripts (ORFS) documentation, published
at [https://openroad-flow-scripts.readthedocs.io/en/latest/](https://openroad-flow-scripts.readthedocs.io/en/latest/).

The documentation for the OpenROAD application itself lives in a different
repository and is published at
[https://openroad.readthedocs.io/en/latest/](https://openroad.readthedocs.io/en/latest/).

## Build locally

### Requires:
- Python 3.x
- Pip
- `virtualenv`
### Requires

- Python 3.10 — the version Read the Docs builds with (see `.readthedocs.yaml`).
The pinned Sphinx release does not run on Python 3.13 or newer.
- `pip`
- `virtualenv` (or the standard-library `venv`)

### Install prerequisites

### Install prerequisites:
Run from the repository root:

``` shell
virtualenv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -r docs/requirements_lock.txt
```

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

``` shell
pip-compile --generate-hashes --output-file=docs/requirements_lock.txt docs/requirements.in

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To run pip-compile, the user needs to have pip-tools installed. It would be helpful to mention installing pip-tools (e.g., via pip install pip-tools) before instructing them to run pip-compile.

```

### Build

``` shell
cd docs
make html
Comment on lines +41 to 42

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Instead of instructing the user to change directory to docs (cd docs) for building and checking links, consider running the make commands from the repository root using the -C flag (e.g., make -C docs html and make -C docs checklinks).\n\nIf the user changes directory to docs/, several subsequent paths in the README become incorrect relative to their working directory:\n- docs/build/html/index.html (line 45) would need to be build/html/index.html\n- docs/build/output.txt (line 54) would need to be build/output.txt\n- git checkout docs/contrib/GitGuide.md (line 64) would fail because git pathspecs are relative to the current directory (it would need to be git checkout contrib/GitGuide.md)\n- rm -rf docs/build (line 65) would need to be rm -rf build\n\nUsing make -C docs keeps the user at the repository root, making all these documented paths 100% correct and consistent.

```

### Check for broken links:
The generated site is in `docs/build/html`; open `docs/build/html/index.html`.

### Check for broken links

``` shell
cd docs
make checklinks
```

The report is written to `docs/build/output.txt` (and `docs/build/output.json`).
It exits non-zero when any link is unreachable.

### Notes

- The build needs network access: `docs/conf.py` downloads three files from the
OpenROAD repository at build time.
- Building writes generated pages into the source tree: `index2.md`,
`SupportedOS.md`, `Manpage.md`, `mainREADME.md`, and — because it is fetched
rather than authored here — the tracked file `contrib/GitGuide.md`. Do not
commit those changes; `git checkout docs/contrib/GitGuide.md` after a build.
- Always `rm -rf docs/build` before rebuilding. The output directory is
`build/`, but `conf.py`'s `exclude_patterns` only excludes `_build`, so a
second run picks up the Markdown files written under `build/html/` as if they
were source pages.
134 changes: 100 additions & 34 deletions docs/contrib/Metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,128 @@ repository contains source files (e.g., LEF/DEF, Verilog, SDC, Liberty,
RC extraction) and configuration files (e.g. `config.mk`) that enable the user to run
a small set of example designs through our complete RTL-to-GDS flow.

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

1. `metadata-base-ok.json` which contains all the relevant
information extracted from the "golden" execution of the flow (i.e.,
last known good result).
``` text
flow/designs/<platform>/<design>/rules-base.json
```

The file name comes from `RULES_JSON`, defined in
[`flow/util/utils.mk`](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/util/utils.mk):

``` makefile
export RULES_JSON ?= $(DESIGN_DIR)/rules-$(FLOW_VARIANT).json
```

`FLOW_VARIANT` defaults to `base`, which is why the committed file is
`rules-base.json`. A run with a non-default `FLOW_VARIANT` looks for
`rules-<variant>.json`, or you can point `RULES_JSON` at any file explicitly.

Each entry in the rules file is a metric name, a reference value, and a
comparison operator. For example:

``` json
{
"synth__design__instance__area__stdcell": {
"value": 43.1,
"compare": "<="
},
"detailedplace__design__violations": {
"value": 0,
"compare": "=="
}
}
```

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

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

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

After you make a significant change, e.g., fixing a bug in a piece of
code, or changing some configuration variable
(`PLACE_DENSITY`), you should review the results and compare
them with the "golden". To perform the check, you will need to run the
following command:
The evaluation checks key metrics (e.g., worst slack, number of DRCs) to
ensure that changes do not degrade the results.

After you make a significant change — e.g., fixing a bug in a piece of code, or
changing a configuration variable such as `PLACE_DENSITY` — review the results
and compare them against the rules. To perform the check, run:

``` shell
cd OpenROAD-flow-scripts/flow
# the clean_metadata is only required if you need to re-run
# clean_metadata is only required if you need to re-run the check
make [clean_metadata] metadata
```

If the command above yields any error message, please review to
make sure the change in metrics is expected and justifiable. If so,
proceed to the next section to update the "golden" reference.
`make metadata` runs three steps in order: `finish` (the full flow),
`metadata-generate` (write `metadata.json`), and `metadata-check` (compare it
against `RULES_JSON`). The check log is written to
`$(REPORTS_DIR)/metadata-check.log`.

If you only changed synthesis, you can gate a synthesis-only run against the
synthesis subset of the same rules file, without running the rest of the flow:

``` shell
make metadata-synth
```

If the check reports any error, review it to make sure the change in metrics is
expected and justifiable. If so, proceed to the next section to update the
reference values.

## Update process

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

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

``` shell
cd OpenROAD-flow-scripts/flow
make update_ok
```

In case you have a special reason to only update one of the files, you
can do so with the following commands:
`update_ok` is an alias for `update_rules`. It runs `flow/util/genRuleFile.py`
with `--failing --tighten`, which:

- relaxes rules the current run fails, using the measured value plus a margin,
so that small run-to-run variation does not break the flow; and
- tightens rules the current run passes by a wide margin, so improvements are
locked in.

The new file is written to `$(REPORTS_DIR)/rules.json` and then copied over
`$(RULES_JSON)` — that copy is the file you commit.

If you need to overwrite every rule from the current run rather than only the
failing and improved ones, use:

``` shell
# update metadata-base-ok.json file for the design
make update_metadata
make update_rules_force
```

This runs `genRuleFile.py --update`. Prefer `make update_ok`; use the forced
variant only when the metric set itself changed.

# update rules.json file for the design
# this will use the current (+ a padding) metadata-base-ok.json
# the padding ensures that small changes do not break the flow
make update_rules
## Reference metadata (`metadata-<variant>-ok.json`)

There is a second, optional file per design:

``` shell
# writes flow/designs/<platform>/<design>/metadata-base-ok.json
make update_metadata
```

This copies the current `metadata.json` next to the design as
`metadata-$(FLOW_VARIANT)-ok.json`. It is **not** what gates the flow — nothing
in `make metadata` reads it. It is consumed only by
`flow/util/genReportTable.py` when building the golden-vs-current report table,
and almost no design commits one. Update the rules file, not this one, unless
you are specifically working on that report.
2 changes: 1 addition & 1 deletion docs/contrib/PlatformBringUp.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ They include :
Adding a new platform additionally requires the following:

* A validated installation of the OpenROAD flow scripts is available. See
instructions [here](../index.md#build-or-installing-orfs-dependencies).
instructions [here](../index2.md#build-or-installing-orfs-dependencies).
* A general knowledge of VLSI design and RTL to GDS flows. OpenROAD
implements a fully-automated RTL-GDSII but it requires familiarity with
the OpenROAD flow scripts to debug problems.
Expand Down
4 changes: 0 additions & 4 deletions docs/images/ORFS_Flow.svg

This file was deleted.

10 changes: 10 additions & 0 deletions docs/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ entries:
title: Build Locally
- file: user/BuildWithWSL.md
title: Build Using WSL
- file: user/AddingNewDesign.md
title: Adding New Designs to the ORFS
- file: user/FlowVariables.md
title: Flow Variables
- file: user/AutoMemories.md
title: Generated Memory Macros (AUTO_MEMORIES)
- file: user/LargeDesigns.md
title: Tips on building large design
- file: contrib/Metrics.md
title: Metrics
- file: user/InstructionsForAutoTuner.md
Expand All @@ -37,6 +41,10 @@ entries:
entries:
- file: contrib/GitGuide.md
title: Git Quickstart
- file: contrib/PlatformBringUp.md
title: Guide to Integrate a New Platform into the OpenROAD Flow
- file: contrib/CI.md
title: CI Guide

- file: contrib/CODE_OF_CONDUCT.md
title: Code of Conduct
Expand All @@ -49,6 +57,8 @@ entries:
entries:
- file: tutorials/FlowTutorial
title: Flow Tutorial
- file: tutorials/SetRC.md
title: Correlating RC Values for PDKs
- file: tutorials/Notebooks
title: Running the OpenROAD Flow in Google Colab

Expand Down
5 changes: 3 additions & 2 deletions docs/tutorials/FlowTutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This is intended for:
- Beginners or new users with some understanding of basic VLSI
design flow. Users will learn the basics of installation to use
OpenROAD-flow-scripts for the complete RTL-to-GDS flow from
[here](../index.md#getting-started-with-openroad-flow-scripts).
[here](../index2.md#getting-started-with-openroad-flow-scripts).
- Users already familiar with the OpenROAD application and flow but would
like to learn more about specific features and commands.

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

(content:heat:maps)=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The anchor (content:heat:maps)= is defined here, but please note that the reference to it at line 2022 ([here](content:heat:maps)) is missing the # prefix. It should be updated to [here](#content:heat:maps) to resolve correctly as an internal anchor link in Sphinx/MyST.

### Using Heat Maps

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

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

```tcl
Expand Down
Binary file removed docs/tutorials/images/congestion_setup.png
Binary file not shown.
Binary file removed docs/tutorials/images/coyote_pad_ring.png
Binary file not shown.
Binary file removed docs/tutorials/images/detail_route_gcd.webp
Binary file not shown.
Binary file removed docs/tutorials/images/fix_congestion_error.webp
Binary file not shown.
Binary file removed docs/tutorials/images/gcd_pdn_gui.png
Binary file not shown.
Binary file removed docs/tutorials/images/halo_aligned.png
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/user/BuildWithDocker.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ please refer to the [Docker Shell](./DockerShell.md) documentation.
- For this method you only need to install
[Docker](https://docs.docker.com/engine/install) on your machine.
- Ensure that you have sufficient memory allocated to the Virtual Machine (VM)
as per our system [requirements](../index.md#system-requirements). Refer to
as per our system [requirements](../index2.md#system-requirements). Refer to
this [Docker guide](https://docs.docker.com/config/containers/resource_constraints/) for setting CPU cores and memory limits.

:::{Warning}
Expand Down
4 changes: 2 additions & 2 deletions docs/user/LargeDesigns.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Behavioral models of memories are used in simulation and FPGA tools oftentimes a

Before deciding how to set up a flow, it is useful to do a "screening build". All we're intersted in here is to know which modules we have and their relative sizes. This can help us identify memories that have not been successfully inferred by Yosys, which will manifest itself as very long synthesis times and appear in the OpenROAD hierarchical view with a large number of instances.

The [minimal build configuration](flow/designs/asap7/minimal/README.md)
The [minimal build configuration](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/asap7/minimal/README.md)
can be useful to do a screening build.

Options useful for a screening build are, check out [config.mk](flow/designs/asap7/minimal/config.mk):
Options useful for a screening build are, check out [config.mk](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/asap7/minimal/config.mk):

- `SYNTH_HIERARCHICAL=1` and `SYNTH_MINIMUM_KEEP_SIZE=0`, to see all modules in the hierarchical OpenROAD view
- `SYNTH_MEMORY_MAX_BITS=1024`, set a low threshold initially to get an error with list of memories in the system that will need to be dealt with in some way
Expand Down
2 changes: 1 addition & 1 deletion docs/user/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The two main directories are:

## Setup

See [Getting Started](../index.md#getting-started-with-openroad-flow-scripts) guide.
See [Getting Started](../index2.md#getting-started-with-openroad-flow-scripts) guide.

## Using the OpenROAD Flow

Expand Down