You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user/FlowVariables.md
+44-6Lines changed: 44 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,48 @@
1
-
# Environment Variables for the OpenROAD Flow Scripts
1
+
# Variables for the OpenROAD Flow Scripts
2
2
3
-
4
-
Environment variables are used in the OpenROAD flow to define various
3
+
Variables are used in the OpenROAD flow to define various
5
4
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:
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
+
## Effects of variables
22
+
23
+
The variables for ORFS are not fully independent and can interact in complex ways. Small changes to a combination of variables can have large consequences, such as on macro placement, which can lead to vastly different quality of results.
24
+
25
+
Due to the large number of variables, some of which are continuous and require long runtimes, other discrete, it is not feasible to perform an exhaustive end-to-end search for the best combination of variables.
26
+
27
+
Instead, the following approaches are used to determine reasonable values, up to a point of diminishing returns:
28
+
29
+
-**Experience**: Leveraging domain expertise to set initial values.
30
+
-**AI**: Using machine learning techniques to explore variable combinations.
31
+
-**Parameter Sweeps**: Testing a smaller subset of variables to identify optimal ranges.
32
+
33
+
These values are then set in configuration files and kept under source control alongside the RTL input.
34
+
35
+
## Types of variables
36
+
37
+
Variables values are set in ORFS scripts or `config.mk` files and are kept in source control together with configuration files and RTL.
38
+
39
+
It is an ongoing effort to move variables upwards in the categories below.
|**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. |
44
+
|**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. |
45
+
|**Complex**| Small changes in values may result in large effects. | High – requires multiple runs/sweeps |`CTS_DISTANCE_BUF`, small changes can have large effects on skew and quality of results. Small changes to independent inputs, such as RTL, can invalidate earlier "good values". |**Low–Medium**| Needs scripted sweeps and statistical evaluation. |
8
46
9
47
## Platform
10
48
@@ -20,7 +58,7 @@ variable. For OpenROAD Flow Scripts we have the following public platforms:
20
58
-`nangate45`
21
59
-`asap7`
22
60
23
-
## Platform Specific Environment Variables
61
+
## Platform Specific Variables
24
62
25
63
26
64
The table below lists the complete set of variables used in each of the
0 commit comments