diff --git a/docs/README.md b/docs/README.md index 4a4d4ae1bd..81cddb3edd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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 +``` + +### Build + +``` shell +cd docs make html ``` -### 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. diff --git a/docs/contrib/Metrics.md b/docs/contrib/Metrics.md index 41d13094f5..477a4c209e 100644 --- a/docs/contrib/Metrics.md +++ b/docs/contrib/Metrics.md @@ -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///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-.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////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--ok.json`) + +There is a second, optional file per design: + +``` shell +# writes flow/designs///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. diff --git a/docs/contrib/PlatformBringUp.md b/docs/contrib/PlatformBringUp.md index 152fe1fde6..af154c8c6a 100644 --- a/docs/contrib/PlatformBringUp.md +++ b/docs/contrib/PlatformBringUp.md @@ -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. diff --git a/docs/images/ORFS_Flow.svg b/docs/images/ORFS_Flow.svg deleted file mode 100644 index 20b841ed23..0000000000 --- a/docs/images/ORFS_Flow.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -
RTL-GDSII
Using
OpenROAD-flow-scripts
RTL-GDSII...
Synthesis
Synthesis
Tool: Yosys
Tool: Yosys
Input files
Input files
RTL
RTL
SDC
SDC
.lib files
.lib files
Mapping files, etc.,
Mapping files, etc.,
Output files
Output files
Netlist
Netlist
SDC
SDC
Import all necessary files (Netlist, .sdc, etc.,) and check initial timing report
Import all necessary files (Ne...
Translate .v to .odb/
Floorplan Initialization
Translate .v to .odb/...
IO placement (random)
IO placement (random)
Timing-driven mixed-size placement
Timing-driven mixed-size place...
Macro placement/
Hier-RTLMP
Macro placement/...
Tapcell and well tie insertion
Tapcell and well tie insertion
PDN generation
PDN generation
Floorplan .odb and .sdc file generation
Floorplan .odb and .sdc file g...
Floorplan
Floorplan
Global placement without placed IOs (Timing and routability driven)
Global placement without placed IOs (Timi...
IO placement (non-random)
IO placement (non-random)
Global placement with placed IOs (Timing and routability driven)
Global placement with placed IOs (Timing...
Resizing and buffering
Resizing and buffering
Detailed placement
Detailed placement
Placement
Placement
Clock tree synthesis
Clock tree synthesis
Timing optimization
Timing optimization
Filler cell insertion
Filler cell insertion
CTS
CTS
Global routing
Global routing
Detail routing
Detail routing
Routing
Routing
Generate GDSII Tool: KLayout
Generate GDSII Tool: KL...
Metal fill insertion
Metal fill insertion
Signoff timing report
Signoff timing report
DRC/LVS check Tool:KLayout
DRC/LVS check Tool:KLay...
Finish
Finish
Automatic partitioning
Automatic partitioning
Text is not SVG - cannot display
\ No newline at end of file diff --git a/docs/toc.yml b/docs/toc.yml index be479807e0..18baefd3fd 100644 --- a/docs/toc.yml +++ b/docs/toc.yml @@ -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 @@ -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 @@ -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 diff --git a/docs/tutorials/FlowTutorial.md b/docs/tutorials/FlowTutorial.md index ecd403461b..d7f1f9e011 100644 --- a/docs/tutorials/FlowTutorial.md +++ b/docs/tutorials/FlowTutorial.md @@ -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. @@ -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)= ### Using Heat Maps From the Menu Bar, Click on `Tools` -> `Heat Maps` -> `Placement Density` to view @@ -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 diff --git a/docs/tutorials/images/congestion_setup.png b/docs/tutorials/images/congestion_setup.png deleted file mode 100644 index c5a5a2e8f8..0000000000 Binary files a/docs/tutorials/images/congestion_setup.png and /dev/null differ diff --git a/docs/tutorials/images/coyote_pad_ring.png b/docs/tutorials/images/coyote_pad_ring.png deleted file mode 100644 index 35f01d93e1..0000000000 Binary files a/docs/tutorials/images/coyote_pad_ring.png and /dev/null differ diff --git a/docs/tutorials/images/detail_route_gcd.webp b/docs/tutorials/images/detail_route_gcd.webp deleted file mode 100644 index c3f1903617..0000000000 Binary files a/docs/tutorials/images/detail_route_gcd.webp and /dev/null differ diff --git a/docs/tutorials/images/fix_congestion_error.webp b/docs/tutorials/images/fix_congestion_error.webp deleted file mode 100644 index eb874d813d..0000000000 Binary files a/docs/tutorials/images/fix_congestion_error.webp and /dev/null differ diff --git a/docs/tutorials/images/gcd_pdn_gui.png b/docs/tutorials/images/gcd_pdn_gui.png deleted file mode 100644 index a7756d1144..0000000000 Binary files a/docs/tutorials/images/gcd_pdn_gui.png and /dev/null differ diff --git a/docs/tutorials/images/halo_aligned.png b/docs/tutorials/images/halo_aligned.png deleted file mode 100644 index 1654396434..0000000000 Binary files a/docs/tutorials/images/halo_aligned.png and /dev/null differ diff --git a/docs/user/BuildWithDocker.md b/docs/user/BuildWithDocker.md index 96bd329b48..efc2f8ea86 100644 --- a/docs/user/BuildWithDocker.md +++ b/docs/user/BuildWithDocker.md @@ -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} diff --git a/docs/user/LargeDesigns.md b/docs/user/LargeDesigns.md index b3926905c8..cb77b86fb4 100644 --- a/docs/user/LargeDesigns.md +++ b/docs/user/LargeDesigns.md @@ -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 diff --git a/docs/user/UserGuide.md b/docs/user/UserGuide.md index 6bb1ad0a36..60ed6611ac 100644 --- a/docs/user/UserGuide.md +++ b/docs/user/UserGuide.md @@ -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