Skip to content

Commit 6c0fe8f

Browse files
committed
docs: flow variables background
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 932c578 commit 6c0fe8f

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

docs/user/FlowVariables.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,33 @@
1-
# Environment Variables for the OpenROAD Flow Scripts
1+
# Variables for the OpenROAD Flow Scripts
22

3-
4-
Environment variables are used in the OpenROAD flow to define various
3+
Variables are used in the OpenROAD flow to define various
54
platform, design and tool specific variables to allow finer control and
6-
user overrides at various flow stages. These are defined in the
7-
`config.mk` file located in the platform and design specific directories.
5+
user overrides at various flow stages.
6+
7+
These are normally defined in the `config.mk` file located in the platform and design-specific directories, but can also be defined on the command line or via environment variables. For example:
8+
9+
- Command line: `make PLACE_DENSITY=0.5`
10+
- Environment variable: `export PLACE_DENSITY=0.5`
11+
12+
This works provided that `config.mk` has defined it as a default value using the `export PLACE_DENSITY?=0.4` syntax.
13+
14+
The actual value used is determined by the priority rules set by `make`:
15+
16+
1. **Makefile Definitions**: Variables defined in the `Makefile` or included files are used when they are defined using the no-override `=` operator, `export PLACE_DENSITY=0.4` syntax. The priority within the included files is the `DESIGN_CONFIG` file, then `Makefile` definitions and finally platform(PDK) defined variables.
17+
2. **Command Line**: Variables defined on the command line take the highest priority in overriding defaults.
18+
3. **Environment Variables**: Variables exported in the shell environment are used if not overridden by the command line.
19+
4. **Default Values**: Variables defined with the `?=` operator in the `Makefile` are used only if the variable is not already defined elsewhere.
20+
21+
## Types of variables
22+
23+
Variables values are set in ORFS scripts or `config.mk` files and are kept in source control together with configuration files and RTL.
24+
25+
| Category | Definition | User Involvement | Examples | Automation Potential | Notes |
26+
|--------------------|----------------------------------------------------------------------------|----------------------------------------|-----------------------------------------|-----------------------------|-----------------------------------------------------------------------|
27+
| **Trivial** | Automatically determined by tool with near-optimal results. | None (unless debugging) | Buffer sizing, default layers | **High** – can be hidden | Best if invisible; surfaced only in debug or verbose mode. |
28+
| **Easy** | Requires input, but easy to tune using reports or visuals. | Moderate – copy/edit from reports | `PLACE_DENSITY` | **Medium–High** | Smooth response curves, intuitive tuning. |
29+
| **Nasty** | Affects randomness or non-determinism; results vary by run. | High – requires multiple runs/sweeps | `CTS_DISTANCE_BUF` | **Low–Medium** | Needs scripted sweeps and statistical evaluation. |
30+
| **Pinata Nightmare**| No clear mental model between value and effect, no accurate way to communicate intent; tuning is long turnaround time guesswork. | Very High – frustrating trial-and-error, few users, if any, can even attempt to succeed | RTLMP_FENCE_LX | **Very Low** | Should be deprecated, automated, or hidden from normal usage. |
831

932
## Platform
1033

@@ -20,7 +43,7 @@ variable. For OpenROAD Flow Scripts we have the following public platforms:
2043
- `nangate45`
2144
- `asap7`
2245

23-
## Platform Specific Environment Variables
46+
## Platform Specific Variables
2447

2548

2649
The table below lists the complete set of variables used in each of the

0 commit comments

Comments
 (0)