palaniappan-r commited on
Commit
f16fc45
·
1 Parent(s): bc5b297

initlal commit

Browse files
Files changed (42) hide show
  1. data/.DS_Store +0 -0
  2. data/json/OR-github_discussions.txt +0 -0
  3. data/json/OR-github_issues.txt +0 -0
  4. data/markdown/ORFS_docs/ORFS-faqs.md +57 -0
  5. data/markdown/ORFS_docs/ORFS-flow_tutorial.md +2086 -0
  6. data/markdown/ORFS_docs/ORFS-getting_involved.md +101 -0
  7. data/markdown/ORFS_docs/ORFS-git_guide.md +207 -0
  8. data/markdown/ORFS_docs/ORFS-notebooks.md +19 -0
  9. data/markdown/ORFS_docs/ORFS-userguide.md +44 -0
  10. data/markdown/OR_docs/OR_getting_involved.md +87 -0
  11. data/markdown/OR_docs/OR_install_instructions.md +385 -0
  12. data/markdown/OR_docs/OR_readme.md +80 -0
  13. data/markdown/OR_docs/OR_userguide.md +193 -0
  14. data/markdown/OR_userguide/OR_README.md +193 -0
  15. data/markdown/OR_userguide/OR_ant_README.md +78 -0
  16. data/markdown/OR_userguide/OR_cts_README.md +162 -0
  17. data/markdown/OR_userguide/OR_dpl_README.md +177 -0
  18. data/markdown/OR_userguide/OR_drt_README.md +239 -0
  19. data/markdown/OR_userguide/OR_fin_README.md +92 -0
  20. data/markdown/OR_userguide/OR_gpl_README.md +243 -0
  21. data/markdown/OR_userguide/OR_grt_README.md +489 -0
  22. data/markdown/OR_userguide/OR_gui_README.md +507 -0
  23. data/markdown/OR_userguide/OR_ifp_README.md +159 -0
  24. data/markdown/OR_userguide/OR_mpl2_README.md +151 -0
  25. data/markdown/OR_userguide/OR_mpl_README.md +86 -0
  26. data/markdown/OR_userguide/OR_odb_OR_codeGenerator_README.md +11 -0
  27. data/markdown/OR_userguide/OR_odb_README.md +169 -0
  28. data/markdown/OR_userguide/OR_odb_doc_OpenDB-AddFieldsInDbObjects.md +15 -0
  29. data/markdown/OR_userguide/OR_odb_test_unitTestsPython_README.md +139 -0
  30. data/markdown/OR_userguide/OR_pad_README.md +406 -0
  31. data/markdown/OR_userguide/OR_par_README.md +582 -0
  32. data/markdown/OR_userguide/OR_pdn_README.md +493 -0
  33. data/markdown/OR_userguide/OR_ppl_README.md +321 -0
  34. data/markdown/OR_userguide/OR_psm_README.md +148 -0
  35. data/markdown/OR_userguide/OR_psm_doc_VOR_description.md +26 -0
  36. data/markdown/OR_userguide/OR_rcx_README.md +297 -0
  37. data/markdown/OR_userguide/OR_rcx_doc_calibration.md +63 -0
  38. data/markdown/OR_userguide/OR_rmp_README.md +91 -0
  39. data/markdown/OR_userguide/OR_rsz_README.md +372 -0
  40. data/markdown/OR_userguide/OR_stt_OR_flt_README.md +19 -0
  41. data/markdown/OR_userguide/OR_tap_README.md +196 -0
  42. data/markdown/OR_userguide/OR_upf_README.md +185 -0
data/.DS_Store ADDED
Binary file (6.15 kB). View file
 
data/json/OR-github_discussions.txt ADDED
The diff for this file is too large to render. See raw diff
 
data/json/OR-github_issues.txt ADDED
The diff for this file is too large to render. See raw diff
 
data/markdown/ORFS_docs/ORFS-faqs.md ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OpenRoad FAQs
2
+
3
+ If you cannot find your question/answer here, please file a GitHub issue to
4
+ the appropriate repository or start a discussion.
5
+
6
+ - Issues and bugs:
7
+ - OpenROAD Flow: <https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/issues>
8
+ - OpenROAD with OpenROAD Flow Scripts: <https://github.com/The-OpenROAD-Project/OpenROAD/issues>
9
+ - Discussions:
10
+ - OpenROAD Flow: <https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/discussions>
11
+
12
+ ## How can I contribute?
13
+
14
+ Thank you for your willingness to contribute. Please see the
15
+ [Getting Involved](../contrib/GettingInvolved) guide.
16
+
17
+ ## How do I update OpenROAD-flow-scripts?
18
+
19
+ Depending on how you installed OpenROAD-flow-scripts, there are different ways of updating. Regardless, here are the common first steps:
20
+
21
+ ```shell
22
+ cd OpenROAD-flow-scripts
23
+ git checkout master
24
+ git pull
25
+ ```
26
+
27
+ Now your local copy of ORFS should be up-to-date. The next step is to build it again with the following command:
28
+
29
+ For WSL/docker based installation, run:
30
+ ```shell
31
+ ./build_openroad.sh --clean
32
+ ```
33
+
34
+ For local installation, run:
35
+ ```shell
36
+ ./build_openroad.sh --local --clean
37
+ ```
38
+
39
+ For pre-built binaries, you can run the flow after `git pull` is done.
40
+
41
+ :::{tip}
42
+ For development purposes, it is a good practice to work on branches and leave master untouched.
43
+ - If the branch already exists: `git checkout <BRANCH> && git merge master`
44
+ - If the branch does not exist: `git checkout -b <BRANCH> && git merge master`
45
+ :::
46
+
47
+ ## How do I update the design reference files?
48
+
49
+ See how to update using the Metrics [guide](../contrib/Metrics.md).
50
+
51
+ ## How do I get better search results?
52
+
53
+ As quoted from [ReadTheDocs](https://docs.readthedocs.io/en/stable/server-side-search/syntax.html#special-queries), this documentation is powered by [Simple Query String](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html#) from [Elasticsearch](https://www.elastic.co/elasticsearch/). Here are some helpful patterns:
54
+
55
+ - Exact phrase search: `"global_route"`
56
+ - Prefix query: `GRT-*`, `BUF*`, `report_*`
57
+ - Fuzziness: `~N` (tilde followed by a number) after a word indicates edit distance. Helpful if the exact spelling is unknown. For example: `test~2`, `reportfilename~2`
data/markdown/ORFS_docs/ORFS-flow_tutorial.md ADDED
@@ -0,0 +1,2086 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OpenROAD Flow Scripts Tutorial
2
+
3
+ ## Introduction
4
+
5
+ This document describes a tutorial to run the complete
6
+ OpenROAD flow from RTL-to-GDS using [OpenROAD Flow
7
+ Scripts](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts).
8
+ It includes examples of useful design and manual usage in key flow
9
+ stages to help users gain a good understanding of the
10
+ [OpenROAD](https://openroad.readthedocs.io/en/latest/main/README.html)
11
+ application flow, data organization, GUI and commands.
12
+
13
+ This is intended for:
14
+
15
+ - Beginners or new users with some understanding of basic VLSI
16
+ design flow. Users will learn the basics of installation to use
17
+ OpenROAD-flow-scripts for the complete RTL-to-GDS flow from
18
+ [here](../index.md#getting-started-with-openroad-flow-scripts).
19
+ - Users already familiar with the OpenROAD application and flow but would
20
+ like to learn more about specific features and commands.
21
+
22
+ ## User Guidelines
23
+
24
+ - This tutorial requires a specific directory structure built by
25
+ OpenROAD-flow-scripts (ORFS). Do not modify this structure or
26
+ underlying files since this will cause problems in the flow execution.
27
+ - User can run the full RTL-to-GDS flow and learn specific flow
28
+ sections independently. This allows users to learn the flow and tool
29
+ capabilities at their own pace, time and preference.
30
+ - Results shown, such as images or outputs of reports and logs, could
31
+ vary based on release updates. However, the main flow and command
32
+ structure should generally apply.
33
+
34
+ Note: Please submit any problem found under Issues in the GitHub repository
35
+ [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/issues).
36
+
37
+ ## Getting Started
38
+
39
+ This section describes the environment setup to build OpenROAD-flow-scripts
40
+ and get ready to execute the RTL-to-GDS flow of the open-source
41
+ design `ibex` using the `sky130hd` technology.
42
+
43
+ `ibex` is a 32 bit RISC-V CPU core (`RV32IMC/EMC`) with a two-stage
44
+ pipeline.
45
+
46
+ ### Setting Up The Environment
47
+
48
+ Use the `bash` shell to run commands and scripts.
49
+
50
+ #### OpenROAD-flow-scripts Installation
51
+
52
+ To install OpenROAD-flow-scripts, refer to the
53
+ [Build or installing ORFS Dependencies](https://openroad-flow-scripts.readthedocs.io/en/latest/#build-or-installing-orfs-dependencies)
54
+ documentation.
55
+
56
+ In general, we recommend using `Docker` for an efficient user
57
+ experience. Install OpenROAD-flow-scripts using a docker as described
58
+ here [Build from sources using Docker](../user/BuildWithDocker.md).
59
+
60
+ :::{Note}
61
+ If you need to update an existing OpenROAD-flow-scripts installation,
62
+ follow instructions from [here](../user/FAQS.md#how-do-i-update-openroad-flow-scripts).
63
+ :::
64
+
65
+ OpenROAD-flow-scripts installation is complete.
66
+
67
+ #### Running OpenROAD-flow-scripts inside the Docker
68
+
69
+ Launch the docker with OpenROAD-flow-scripts container as follows:
70
+
71
+ ```shell
72
+ docker run --rm -it -u $(id -u ${USER}):$(id -g ${USER}) -v $(pwd)/flow:/OpenROAD-flow-scripts/flow openroad/flow-ubuntu22-builder
73
+ ```
74
+
75
+ :::{seealso}
76
+ To launch OpenROAD GUI inside the docker, based on the OS, use the command from [here](../user/BuildWithDocker.md#enable-gui-support).
77
+ :::
78
+
79
+ Once you are entered into OpenROAD-flow-scripts container run:
80
+
81
+ ```shell
82
+ source env.sh
83
+ ```
84
+
85
+ If your installation is successful, you will see the following message:
86
+
87
+ ```
88
+ OPENROAD: /OpenROAD-flow-scripts/tools/OpenROAD
89
+ ```
90
+
91
+ #### Verifying the Docker based Installation
92
+
93
+ To verify the installation run the built-in example design as follows:
94
+
95
+ ```shell
96
+ cd flow
97
+ make
98
+ ```
99
+
100
+ A successful run end with the log:
101
+
102
+ ```
103
+ [INFO] Writing out GDS/OAS 'results/nangate45/gcd/base/6_1_merged.gds'
104
+ Elapsed time: 0:10.44[h:]min:sec. CPU time: user 2.17 sys 0.54 (26%). Peak memory: 274184KB.
105
+ cp results/nangate45/gcd/base/6_1_merged.gds results/nangate45/gcd/base/6_final.gds
106
+ Log Elapsed seconds
107
+ 1_1_yosys 2
108
+ 3_3_place_gp 1
109
+ 4_1_cts 8
110
+ 5_2_route 10
111
+ 6_1_merge 10
112
+ 6_report 3
113
+ ```
114
+
115
+ ## Configuring The Design
116
+
117
+ This section shows how to set up the necessary platform and design
118
+ configuration files to run the complete RTL-to-GDS flow using
119
+ OpenROAD-flow-scripts for `ibex` design.
120
+
121
+ ```shell
122
+ cd flow
123
+ ```
124
+
125
+ ### Platform Configuration
126
+
127
+ View the platform configuration file setup for default variables for
128
+ `sky130hd`.
129
+
130
+ ```shell
131
+ less ./platforms/sky130hd/config.mk
132
+ ```
133
+
134
+ The `config.mk` file has all the required variables for the `sky130`
135
+ platform and hence it is not recommended to change any variable
136
+ definition here. You can view the `sky130hd` platform configuration
137
+ [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/platforms/sky130hd/config.mk).
138
+
139
+ Refer to the [Flow variables](../user/FlowVariables.md) document for
140
+ details on how to use platform and design specific environment variables
141
+ in OpenROAD-flow-scripts to customize and configure your design flow.
142
+
143
+ ### Design Configuration
144
+
145
+ View the default design configuration of `ibex` design:
146
+
147
+ ```shell
148
+ less ./designs/sky130hd/ibex/config.mk
149
+ ```
150
+
151
+ You can view `ibex` design `config.mk`
152
+ [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/sky130hd/ibex/config.mk).
153
+
154
+ :::{Note} The following design-specific configuration variables are required
155
+ to specify main design inputs such as platform, top-level design name and
156
+ constraints. We will use default configuration variables for this tutorial.
157
+ :::
158
+
159
+ | Variable Name | Description |
160
+ |--------------------|------------------------------------------------------------------------------------------------------------------------------------------|
161
+ | `PLATFORM` | Specifies Process design kit. |
162
+ | `DESIGN_NAME` | The name of the top-level module of the design |
163
+ | `VERILOG_FILES` | The path to the design Verilog files |
164
+ | `SDC_FILE` | The path to design `.sdc` file |
165
+ | `CORE_UTILIZATION` | The core utilization percentage. |
166
+ | `PLACE_DENSITY` | The desired placement density of cells. It reflects how spread the cells would be on the core area. 1 = closely dense. 0 = widely spread |
167
+
168
+ :::{Note} To add a new design to the `flow`, refer to the document
169
+ [here](../user/AddingNewDesign.md). This step is for advanced users.
170
+ If you are a beginner, first understand the flow by completing this
171
+ tutorial and come back to this step later to add a new design.
172
+ :::
173
+
174
+ ### Timing Constraints
175
+
176
+ View timing constraints specified in the `.sdc` file
177
+ [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/sky130hd/ibex/constraint.sdc).
178
+
179
+ ```shell
180
+ less ./designs/sky130hd/ibex/constraint.sdc
181
+ ```
182
+
183
+ For `ibex` design, we simply use the clock definition as follows as a
184
+ minimum required timing constraint.
185
+
186
+ ```tcl
187
+ create_clock -name core_clock -period 17.4 [get_ports {clk_i}]
188
+ ```
189
+
190
+ ### Design Input Verilog
191
+
192
+ The Verilog input files are located in `./designs/src/ibex/`
193
+
194
+ The design is defined in `ibex_core.v` available
195
+ [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/src/ibex/ibex_core.v).
196
+
197
+ Refer to the `ibex` design `README.md`
198
+ [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/src/ibex/README.md).
199
+
200
+ ## Running The Automated RTL-to-GDS Flow
201
+
202
+ This section describes the complete execution of the design flow from
203
+ RTL-to-GDS. The OpenROAD application executes the entire autonomous flow
204
+ using Tcl scripts that invoke open-sourced tools, from synthesis to the final
205
+ `.gds` file creation, without requiring human intervention. However, in this
206
+ tutorial, the user will learn both the automated and a few interactive ways
207
+ to run Tcl commands for important flow stages.
208
+
209
+ From the OpenROAD-flow-scripts directory, users can access individual flow
210
+ stages, respective tools and the corresponding `README.md` for tool commands,
211
+ configuration examples using the Tcl interface and other such details.
212
+
213
+ - [Synthesis](https://github.com/The-OpenROAD-Project/yosys/blob/master/README.md)
214
+ - [Database](https://openroad.readthedocs.io/en/latest/main/src/odb/README.html)
215
+ - [Floorplanning](https://openroad.readthedocs.io/en/latest/main/src/ifp/README.html)
216
+ - [Pin Placement](https://openroad.readthedocs.io/en/latest/main/src/ppl/README.html)
217
+ - [Chip-level Connections](https://openroad.readthedocs.io/en/latest/main/src/pad/README.html)
218
+ - [Macro Placement](https://openroad.readthedocs.io/en/latest/main/src/mpl/README.html)
219
+ - [Tapcell insertion](https://openroad.readthedocs.io/en/latest/main/src/tap/README.html)
220
+ - [PDN Analysis](https://openroad.readthedocs.io/en/latest/main/src/pdn/README.html)
221
+ - [IR Drop Analysis](https://openroad.readthedocs.io/en/latest/main/src/psm/README.html)
222
+ - [Global Placement](https://openroad.readthedocs.io/en/latest/main/src/gpl/README.html)
223
+ - [Timing Analysis](https://openroad.readthedocs.io/en/latest/main/src/sta/README.html)
224
+ - [Detailed Placement](https://openroad.readthedocs.io/en/latest/main/src/dpl/README.html)
225
+ - [Timing Optimization using Resizer](https://openroad.readthedocs.io/en/latest/main/src/rsz/README.html)
226
+ - [Clock Tree Synthesis](https://openroad.readthedocs.io/en/latest/main/src/cts/README.html)
227
+ - [Global Routing](https://openroad.readthedocs.io/en/latest/main/src/grt/README.html)
228
+ - [Antenna Rule Checker](https://openroad.readthedocs.io/en/latest/main/src/ant/README.html)
229
+ - [Detail Routing](https://openroad.readthedocs.io/en/latest/main/src/drt/README.html)
230
+ - [Metall Fill](https://openroad.readthedocs.io/en/latest/main/src/fin/README.html)
231
+ - [Parasitics Extraction](https://openroad.readthedocs.io/en/latest/main/src/rcx/README.html)
232
+ - [Layout Generation](https://www.klayout.de/)
233
+
234
+ ### Design Goals
235
+
236
+ Run the `ibex` design in OpenROAD-flow-scripts automated flow from
237
+ RTL-to-GDS using `sky130hd`. Find `ibex` design details
238
+ [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/src/ibex/README.md)
239
+ and the design goals are:
240
+
241
+ - Area
242
+
243
+ ```
244
+ Minimum Required Die size: 0 0 798 800 (in micron)
245
+ Core size: 2 2 796 798 (in micron)
246
+ ```
247
+
248
+ - Timing
249
+
250
+ ```
251
+ Clock period to meet timing: 17.4 (in ns)
252
+ ```
253
+
254
+ `ibex` takes approximately 8 minutes on a machine with 8-cores and 16GB RAM.
255
+ The runtime will vary based on your configuration.
256
+
257
+ Change your current directory to the `flow` directory.
258
+
259
+ ```shell
260
+ cd flow
261
+ ```
262
+
263
+ Run the complete flow with:
264
+
265
+ ```shell
266
+ make DESIGN_CONFIG=./designs/sky130hd/ibex/config.mk
267
+ ```
268
+
269
+ As the flow executes, check out the OpenROAD-flow-scripts directory contents and their
270
+ significance.
271
+
272
+ OpenROAD-flow-scripts can generally restart from a previous partial run. If you have errors which prevent restarting the flow, you may try deleting all generated files and start a fresh run. Errors can occur if a tool crashes or is killed while writing a file. The files for `sky130hd/ibex` as an example can be deleted with:
273
+
274
+ ```shell
275
+ make clean_all DESIGN_CONFIG=./designs/sky130hd/ibex/config.mk
276
+ ```
277
+
278
+ You can also delete files related to individual stages of RTL to GDSII conversion like synthesis, floorplanning, macro placement, clock tree synthesis, routing and layout generation with `clean_synth`, `clean_floorplan`, `clean_place`, `clean_cts`, `clean_route`, and `clean_finish`, respectively.
279
+
280
+
281
+ ### Viewing OpenROAD-flow-scripts Directory Structure And Results
282
+
283
+ Open a new tab in the terminal and explore the directory structure in
284
+ `flow` by typing `ls` command to view its contents:
285
+
286
+ ```shell
287
+ designs logs Makefile objects platforms reports results scripts test util
288
+ ```
289
+
290
+ Navigate through each of the sub-directories above to understand how
291
+ underlying files are organized.
292
+
293
+ - `designs/sky130hd/ibex`
294
+ Files include: designs make file and SDC file for the `sky130hd`
295
+ platform and other files for autotuner and metrics.
296
+
297
+ ```
298
+ autotuner.json config.mk constraint_doe.sdc constraint.sdc metadata-base-ok.json rules.json
299
+ ```
300
+
301
+ - `platforms`
302
+ Includes public PDKs supported by OpenROAD flow
303
+
304
+ ```
305
+ asap7 nangate45 sky130hd sky130hs sky130io sky130ram
306
+ ```
307
+
308
+ - `objects/sky130hd/ibex/base`
309
+ Includes ABC constraints and all the temporary library files used
310
+ for the completion flow
311
+
312
+ ```
313
+ abc.constr klayout.lyt klayout_tech.lef lib
314
+ ```
315
+
316
+ - `logs/sky130hd/ibex/base`
317
+ Logs directory, which contains log files for each flow stage.
318
+
319
+ | `logs` | | |
320
+ |------------------------|------------------------|-----------------------|
321
+ | `1_1_yosys.log` | `3_1_place_gp.log` | `5_2_route.log` |
322
+ | `2_1_floorplan.log` | `3_2_place_iop.log` | `6_1_merge.log` |
323
+ | `2_2_floorplan_io.log` | `3_3_resizer.log` | `6_report.log` |
324
+ | `2_3_tdms_place.log` | `3_4_opendp.log` | |
325
+ | `2_4_floorplan_macro.log` | `4_1_cts.log` | |
326
+ | `2_5_floorplan_tapcell.log` | `4_2_cts_fillcell.log` | |
327
+ | `2_6_floorplan_pdn.log` | `5_1_grt.log` | |
328
+
329
+
330
+ - `results/sky130hd/ibex/base`
331
+ Results directory which contains `.v/.sdc/.odb/.def/.spef` files
332
+
333
+ | `results` | | |
334
+ |-----------------------------|-------------------------|--------------------|
335
+ | `1_1_yosys.v` | `3_1_place_gp.odb` | `5_route.sdc` |
336
+ | `1_synth.sdc` | `3_2_place_iop.odb` | `6_1_fill.odb` |
337
+ | `1_synth.v` | `3_3_place_resized.odb` | `6_1_fill.sdc` |
338
+ | `2_1_floorplan.odb` | `3_4_place_dp.odb` | `6_1_merged.gds` |
339
+ | `2_2_floorplan_io.odb` | `3_place.odb` | `6_final.odb` |
340
+ | `2_3_floorplan_tdms.odb` | `3_place.sdc` | `6_final.gds` |
341
+ | `2_4_floorplan_macro.odb` | `4_1_cts.odb` | `6_final.sdc` |
342
+ | `2_5_floorplan_tapcell.odb` | `4_2_cts_fillcell.odb` | `6_final.spef` |
343
+ | `2_6_floorplan_pdn.odb` | `4_cts.odb` | `6_final.v` |
344
+ | `2_floorplan.odb` | `4_cts.sdc` | `output_guide.mod` |
345
+ | `2_floorplan.sdc` | `4_cts.v` | `route.guide` |
346
+ | `2_floorplan.v` | `5_route.odb` | `updated_clks.sdc` |
347
+
348
+
349
+ - `reports/sky130hd/ibex/base`
350
+ Reports directory, which contains congestion report, DRC
351
+ report, design statistics and antenna log for reference.
352
+
353
+ | `reports` | | |
354
+ |-------------------|---------------------|------------------------|
355
+ | `congestion.rpt` | `VDD.rpt` | `VSS.rpt` |
356
+ | `5_route_drc.rpt` | `final_clocks.webp` | `final_placement.webp` |
357
+ | `antenna.log` | `final_clocks.webp` | `final.webp` |
358
+ | `synth_stat.txt` | `synth_check.txt` | `final_resizer.webp` |
359
+
360
+ The table below briefly describes the reports directory files.
361
+
362
+ | File Name | Description |
363
+ |------------------------|----------------------------------------------------------|
364
+ | `congestion.rpt` | Gloabl routing congestion if occurred. |
365
+ | `5_route_drc.rpt` | DRC violations if occurred. |
366
+ | `final_clocks.webp` | OR extracted image reference after clock tree synthesis. |
367
+ | `final_resizer.webp` | OR extracted image reference after resizer. |
368
+ | `synth_check.txt` | Synthesis warning/error messages. |
369
+ | `antenna.log` | Antenna check log report. |
370
+ | `final_placement.webp` | Extracted image after final placement. |
371
+ | `final.webp` | Extracted image after routing. |
372
+ | `synth_stat.txt` | Post synthesis design statistics log saved here. |
373
+
374
+ The flow completes with the message below by creating a merged final GDS file.
375
+
376
+ ```
377
+ [INFO] Writing out GDS/OAS
378
+ 'results/sky130hd/ibex/base/6_1_merged.gds'
379
+ cp results/sky130hd/ibex/base/6_1_merged.gds
380
+ results/sky130hd/ibex/base/6_final.gds
381
+ ```
382
+
383
+ ## Viewing Results And Logs
384
+
385
+ OpenROAD-flow-scripts prepends a prefix to each flow stage, as shown below, to
386
+ indicate the position in the RTL-GDS flow. This makes it easier to
387
+ understand and debug each flow stage in case of failure.
388
+
389
+ View `ibex` design logs:
390
+
391
+ ```shell
392
+ ls logs/sky130hd/ibex/base/
393
+ ```
394
+
395
+ The log structure is as follows:
396
+
397
+ | `logs` | | |
398
+ |------------------------|------------------------|-----------------------|
399
+ | `1_1_yosys.log` | `3_1_place_gp.log` | `5_2_route.log` |
400
+ | `2_1_floorplan.log` | `3_2_place_iop.log` | `6_1_merge.log` |
401
+ | `2_2_floorplan_io.log` | `3_3_resizer.log` | `6_report.log` |
402
+ | `2_3_tdms_place.log` | `3_4_opendp.log` | |
403
+ | `2_4_floorplan_macro.log` | `4_1_cts.log` | |
404
+ | `2_5_floorplan_tapcell.log` | `4_2_cts_fillcell.log` | |
405
+ | `2_6_floorplan_pdn.log` | `5_1_grt.log` | |
406
+
407
+ ### Area
408
+
409
+ View design area and its core utilization:
410
+
411
+ ```
412
+ make gui_final
413
+ report_design_area
414
+ ```
415
+
416
+ View the resulting area as:
417
+
418
+ ```
419
+ Design area 191262 u^2 30% utilization.
420
+ ```
421
+
422
+ ### Timing
423
+
424
+ Users can view flow results using the command interface from the shell or
425
+ the OpenROAD GUI to visualize further and debug. Learn more about the
426
+ [GUI](https://openroad.readthedocs.io/en/latest/main/README.html#gui).
427
+
428
+ ```shell
429
+ make gui_final
430
+ ```
431
+
432
+ Use the following commands in the `Tcl Commands` section of GUI:
433
+
434
+ ```tcl
435
+ report_worst_slack
436
+ report_tns
437
+ report_wns
438
+ ```
439
+
440
+ Note the worst slack, total negative slack and worst negative slack:
441
+
442
+ ```
443
+ worst slack -0.99
444
+ tns -1.29
445
+ wns -0.99
446
+ ```
447
+
448
+ Learn more about visualizing and tracing time paths across the design
449
+ hierarchy refer to the OpenROAD [GUI](https://openroad.readthedocs.io/en/latest/main/README.html#gui).
450
+
451
+ ### Power
452
+
453
+ Use the report command to view individual power components i.e.
454
+ sequential, combinational, macro and power consumed by I/O pads.
455
+
456
+ ```tcl
457
+ report_power
458
+ ```
459
+
460
+ The power output is as follows:
461
+
462
+ ```
463
+ --------------------------------------------------------------------------
464
+ Group Internal Switching Leakage Total
465
+ Power Power Power Power
466
+ ----------------------------------------------------------------
467
+ Sequential 5.58e-03 6.12e-04 1.67e-08 6.19e-03 19.0%
468
+ Combinational 9.23e-03 1.71e-02 4.90e-08 2.63e-02 81.0%
469
+ Macro 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.0%
470
+ Pad 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.0%
471
+ ----------------------------------------------------------------
472
+ Total 1.48e-02 1.77e-02 6.57e-08 3.25e-02 100.0%
473
+ 45.6% 54.4% 0.0%
474
+ ```
475
+
476
+ ## OpenROAD GUI
477
+
478
+ The GUI allows users to select, control, highlight and navigate the
479
+ design hierarchy and design objects (nets, pins, instances, paths, etc.)
480
+ through detailed visualization and customization options. Find details
481
+ on how to use the [GUI](https://openroad.readthedocs.io/en/latest/main/README.html#gui). All the windows
482
+ aside from the layout are docking windows that can be undocked. Also it
483
+ can be closed and reopened from the Windows menu.
484
+
485
+
486
+ Note: When you are using remote access, you will need to include -Y (or -X) option in your command to
487
+ enable X11 applications to function properly over the network. By using the command "ssh -Y" followed
488
+ by the remote servers' address or hostname, you can establish a secure connection and activate X11 forwarding.
489
+ This feature enables you to run graphical programs on the remote server and have their windows display
490
+ on your local machines desktop environment.
491
+
492
+
493
+ In this section, learn how to:
494
+
495
+ 1. Visualize design hierarchy
496
+ 2. Load ODB files for floorplan and layout visualization
497
+ 3. Trace the synthesized clock tree to view hierarchy and buffers
498
+ 4. Use heat maps to view congestion and observe the effect of placement
499
+ 5. View and trace critical timing paths
500
+ 6. Set display control options
501
+ 7. Zoom to object from inspector
502
+
503
+ If you have completed the RTL-GDS flow, then proceed to view the final
504
+ GDS file under results directory `./results/sky130hd/ibex/base/`
505
+
506
+ For the `ibex` design uncomment the `DESIGN_CONFIG`
507
+ variable in the `Makefile` available [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/Makefile).
508
+
509
+ ```
510
+ # DESIGN_CONFIG=./designs/sky130hd/gcd/config.mk
511
+ DESIGN_CONFIG=./designs/sky130hd/ibex/config.mk
512
+ # DESIGN_CONFIG=./designs/sky130hd/aes/config.mk
513
+ ```
514
+
515
+ ```shell
516
+ make gui_final
517
+ ```
518
+
519
+ ### Viewing Layout Results
520
+
521
+ The `make gui_final` command target successively reads and loads the
522
+ technology `.odb` files and the parasitics and invokes the
523
+ GUI in these steps:
524
+
525
+ - Reads and loads `.odb` files.
526
+ - Loads `.spef` (parasitics).
527
+
528
+ The figure below shows the post-routed DEF for the `ibex` design.
529
+
530
+ ![ibex_final_db](./images/ibex_final_db.webp)
531
+
532
+ ### Visualizing Design Objects And Connectivity
533
+
534
+ Note the `Display Control` window on the LHS that shows buttons
535
+ for color, visibility and selection options for various design
536
+ objects: Layers, Nets, Instances, Blockages, Heatmaps, etc.
537
+
538
+ The Inspector window on the RHS allows users to inspect details of
539
+ selected design objects and the timing report.
540
+
541
+ Try selectively displaying (show/hide) various design objects through
542
+ the display control window and observing their impact on the display.
543
+
544
+ ### Tracing The Clock Tree
545
+
546
+ View the synthesized clock tree for `ibex` design:
547
+ - From the top Toolbar Click `Windows` -> `Clock Tree Viewer`
548
+
549
+ ![cts_viewer](./images/CTV_update.webp)
550
+
551
+ On RHS, click `Clock Tree Viewer` and top right corner, click
552
+ `Update` to view the synthesized clock tree of your design.
553
+
554
+ View clock tree structure below, the user needs to disable the metal
555
+ `Layers` section on LHS as shown below.
556
+
557
+ ![ibex_clock_tree](./images/ibex_clock_tree.webp)
558
+
559
+ From the top Toolbar, click on the `Windows` menu to select/hide different
560
+ view options of Scripting, Display control, etc.
561
+
562
+ ### Using Heat Maps
563
+
564
+ From the Menu Bar, Click on `Tools` -> `Heat Maps` -> `Placement Density` to view
565
+ congestion selectively on vertical and horizontal layers.
566
+
567
+ Expand `Heat Maps` -> `Placement Density` from the Display Control window
568
+ available on LHS of OpenROAD GUI.
569
+
570
+ View congestion on all layers between 50-100%:
571
+
572
+ In the `Placement density` setup pop-up window, Select `Minimum` -> `50.00%`
573
+ `Maximum` -> `100.00%`
574
+
575
+ ![placement_heat_map](./images/placement_heatmap.webp)
576
+
577
+ From `Display Control`, select `Heat Maps` -> `Routing Congestion` as
578
+ follows:
579
+
580
+ ![routing_heat_map](./images/routing_heatmap.webp)
581
+
582
+ From `Display Control`, select `Heat Maps` -> `Power Density` as
583
+ follows:
584
+
585
+ ![power_heat_map](./images/power_heatmap.webp)
586
+
587
+ ### Viewing Timing Report
588
+
589
+ Click `Timing` -> `Options` to view and traverse specific timing paths.
590
+ From Toolbar, click on the `Timing` icon, View `Timing Report` window added
591
+ at the right side (RHS) of GUI as shown below.
592
+
593
+ ![Timing report option](./images/ibex_final_db.webp)
594
+
595
+ In `Timing Report` Select `Paths` -> `Update`, `Paths` should be integer
596
+ numbers. The number of timing paths should be displayed in the current
597
+ window as follows:
598
+
599
+ ![Clock Path Update](./images/clock_path_update.webp)
600
+
601
+ Select `Setup` or `Hold` tabs and view required arrival times and
602
+ slack for each timing path segment.
603
+
604
+ For each `Setup` or `Hold` path group, path details have a specific `pin
605
+ name, Time, Delay, Slew and Load` value with the clock to register, register
606
+ to register and register to output data path.
607
+
608
+ ### Using Rulers
609
+
610
+ A ruler can measure the distance between any two objects in the design or
611
+ metal layer length and width to be measured, etc.
612
+
613
+ Example of how to measure the distance between VDD and VSS power grid click on:
614
+
615
+ `Tools` -> `Ruler K`
616
+
617
+ ![Ruler Tool](./images/ruler_tool.png)
618
+
619
+ Distance between VDD and VSS layer is `11.970`
620
+
621
+ ### DRC Viewer
622
+
623
+ You can use the GUI to trace DRC violations and fix them.
624
+
625
+ View DRC violations post routing:
626
+
627
+ ```shell
628
+ less ./reports/sky130hd/ibex/base/5_route_drc.rpt
629
+ ```
630
+
631
+ Any DRC violations are logged in the `5_route_drc.rpt` file, which is
632
+ empty otherwise.
633
+
634
+ From OpenROAD GUI, Enable the menu options `Windows` -> `DRC Viewer`. A
635
+ `DRC viewer` window is added on the right side (RHS) of the GUI. From
636
+ `DRC Viewer` -> `Load` navigate to `5_route_drc.rpt`
637
+
638
+ ![DRC Report Load](./images/drc_report_load.webp)
639
+
640
+ By selecting DRC violation details, designers can analyze and fix them. Here
641
+ user will learn how a DRC violation can be traced with the `gcd` design. Refer
642
+ to the following OpenROAD test case for more details.
643
+
644
+ ```shell
645
+ cd ./flow/tutorials/scripts/drt/
646
+ openroad -gui
647
+ ```
648
+
649
+ In the `Tcl Commands` section of GUI:
650
+
651
+ ```tcl
652
+ source drc_issue.tcl
653
+ ```
654
+
655
+ Post detail routing in the log, you can find the number of violations left
656
+ in the design:
657
+
658
+ ```
659
+ [INFO DRT-0199] Number of violations = 7.
660
+ ```
661
+
662
+ Based on `DRC Viewer` steps load `results/5_route_drc.rpt`. GUI as
663
+ follows
664
+
665
+ ![gcd DRC issue load](./images/gcd_drc_issue.webp)
666
+
667
+ `X mark` in the design highlights DRC violations.
668
+
669
+ From `DRC Viewer` on RHS `expand` -> `Short`
670
+
671
+ This shows the number of `violations` in the design. Zoom the design
672
+ for a clean view of the violation:
673
+
674
+ ![View DRC Violation](./images/view_violation.webp)
675
+
676
+ `output53` has overlaps and this causes the `short violation`.
677
+
678
+ Open the input DEF file `drc_cts.def` to check the source of the
679
+ overlap.
680
+
681
+ Note the snippet of DEF file where `output51` and `output53` have
682
+ the same placed coordinates and hence cause the placement violation.
683
+
684
+ ```
685
+ - output51 sky130_fd_sc_hd__clkbuf_1 + PLACED ( 267260 136000 ) N ;
686
+ - output53 sky130_fd_sc_hd__clkbuf_1 + PLACED ( 267260 136000 ) N ;
687
+ ```
688
+
689
+ Use the test case provided in `4_cts.def` with the changes applied for
690
+ updated coordinates as follows:
691
+
692
+ ```
693
+ - output51 sky130_fd_sc_hd__clkbuf_1 + PLACED ( 267260 136000 ) N ;
694
+ - output53 sky130_fd_sc_hd__clkbuf_1 + PLACED ( 124660 266560 ) N ;
695
+ ```
696
+
697
+ Close the current GUI and re-load the GUI with the updated DEF to see
698
+ fixed DRC violation in the design:
699
+
700
+ ```shell
701
+ openroad -gui
702
+ source drc_fix.tcl
703
+ ```
704
+
705
+ In the post detail routing log, the user can find the number of violations
706
+ left in the design:
707
+
708
+ ```
709
+ [INFO DRT-0199] Number of violations = 0.
710
+ ```
711
+
712
+ Routing completed with 0 violations.
713
+
714
+ ### Tcl Command Interface
715
+
716
+ Execute OpenROAD-flow-scripts Tcl commands from the GUI. Type `help`
717
+ to view Tcl Commands available. In OpenROAD GUI, at the bottom,
718
+ `TCL commands` executable space is available to run the commands.
719
+ For example
720
+
721
+ View `design area`:
722
+
723
+ ```tcl
724
+ report_design_area
725
+ ```
726
+
727
+ Try the below timing report commands to view timing results interactively:
728
+
729
+ ```tcl
730
+ report_wns
731
+ report_tns
732
+ report_worst_slack
733
+ ```
734
+
735
+ ### Customizing The GUI
736
+
737
+ Customize the GUI by creating your own widgets such as menu bars,
738
+ toolbar buttons, dialog boxes, etc.
739
+
740
+ Refer to the [GUI](https://openroad.readthedocs.io/en/latest/main/README.html#gui).
741
+
742
+ Create `Load_LEF` toolbar button in GUI to automatically load
743
+ specified `.lef` files.
744
+
745
+ ```shell
746
+ openroad -gui
747
+ ```
748
+
749
+ ![Default GUI](./images/default_gui.webp)
750
+
751
+ To view `load_lef.tcl`, run the command:
752
+
753
+ ```shell
754
+ less ./flow/tutorials/scripts/gui/load_lef.tcl
755
+ ```
756
+
757
+ ```tcl
758
+ proc load_lef_sky130 {} {
759
+ set FLOW_PATH [exec pwd]
760
+ read_lef $FLOW_PATH/../../../platforms/sky130hd/lef/sky130_fd_sc_hd.tlef
761
+ read_lef $FLOW_PATH/../../../platforms/sky130hd/lef/sky130_fd_sc_hd_merged.lef
762
+ }
763
+ create_toolbar_button -name "Load_LEF" -text "Load_LEF" -script {load_lef_sky130} -echo
764
+ ```
765
+
766
+ From OpenROAD GUI `Tcl commands`:
767
+
768
+ ```tcl
769
+ cd ./flow/tutorials/scripts/gui/
770
+ source load_lef.tcl
771
+ ```
772
+
773
+ `Load_LEF` toolbar button added as follows:
774
+
775
+ ![Load LEF toolbar button](./images/Load_LEF_button.webp)
776
+
777
+ From Toolbar menus, Click on `Load_LEF.` This loads the specified `sky130`
778
+ technology `.tlef` and `merged.lef` file in the current OpenROAD GUI
779
+ as follows:
780
+
781
+ ![sky130 LEF file load](./images/sky130_lef_load.webp)
782
+
783
+ ## Understanding and Analyzing OpenROAD Flow Stages and Results
784
+
785
+ The OpenROAD flow is fully automated and yet the user can usefully intervene
786
+ to explore, analyze and optimize your design flow for good PPA.
787
+
788
+ In this section, you will learn specific details of flow stages and
789
+ learn to explore various design configurations and optimizations to
790
+ target specific design goals, i.e., PPA (area, timing, power).
791
+
792
+ ### Synthesis Explorations
793
+
794
+ #### Area And Timing Optimization
795
+
796
+ Explore optimization options using synthesis options: `ABC_AREA` and `ABC_SPEED`.
797
+
798
+ Set `ABC_AREA=1` for area optimization and `ABC_SPEED=1` for timing optimization.
799
+ Update design `config.mk` for each case and re-run the flow to view impact.
800
+
801
+ To view `ibex` design [config.mk](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/sky130hd/ibex/config.mk).
802
+
803
+ ```
804
+ #Synthesis strategies
805
+ export ABC_AREA = 1
806
+ ```
807
+
808
+ Run `make` command from `flow` directory as follows:
809
+
810
+ ```shell
811
+ make DESIGN_CONFIG=./designs/sky130hd/gcd/config.mk
812
+ ```
813
+
814
+ The `gcd` design synthesis results for area and speed optimizations are shown below:
815
+
816
+ | Synthesis Statistics | ABC_SPEED | ABC_AREA |
817
+ |-----------------------|--------------------------------------|--------------------------------------|
818
+ | `Number of wires` | 224 | 224 |
819
+ | `Number of wire bits` | 270 | 270 |
820
+ | `Number of cells` | 234 | 234 |
821
+ | `Chip area` | 2083.248000 | 2083.248000 |
822
+ | `Final Design Area` | Design area 4295 u^2 6% utilization. | Design area 4074 u^2 6% utilization. |
823
+
824
+ Note: Results for area optimization should be ideally checked after
825
+ floorplanning to verify the final impact. First, relax the `.sdc` constraint
826
+ and re-run to see area impact. Otherwise, the repair design command will
827
+ increase the area to meet timing regardless of the netlist produced earlier.
828
+
829
+ ### Floorplanning
830
+
831
+ This section describes OpenROAD-flow-scripts floorplanning and
832
+ placement functions using the GUI.
833
+
834
+ #### Floorplan Initialization Based On Core And Die Area
835
+
836
+ Refer to the following OpenROAD built-in examples
837
+ [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ifp/test/init_floorplan1.tcl).
838
+
839
+ Run the following commands in the terminal in OpenROAD tool root directory to build and view the created
840
+ floorplan.
841
+
842
+ ```shell
843
+ cd ../tools/OpenROAD/src/ifp/test/
844
+ openroad -gui
845
+ ```
846
+
847
+ In `Tcl Commands` section GUI:
848
+
849
+ ```tcl
850
+ source init_floorplan1.tcl
851
+ ```
852
+
853
+ View the resulting die area "0 0 1000 1000" and core area "100 100 900 900"
854
+ in microns shown below:
855
+
856
+ ![Absolute Floorplan](./images/absolute_die.webp)
857
+
858
+ #### Floorplan Based On Core Utilization
859
+
860
+ Refer to the following OpenROAD built-in examples
861
+ [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ifp/test/init_floorplan2.tcl).
862
+
863
+ Run the following commands in the terminal in OpenROAD tool root directory to view how the floorplan
864
+ initialized:
865
+
866
+ ```shell
867
+ cd ../tools/OpenROAD/src/ifp/test/
868
+ openroad -gui
869
+ ```
870
+
871
+ In the `Tcl Commands` section of the GUI:
872
+
873
+ ```tcl
874
+ source init_floorplan2.tcl
875
+ ```
876
+
877
+ View the resulting core utilization of 30 created following floorplan:
878
+
879
+ ![Relative Floorplan](./images/core_util.webp)
880
+
881
+ ### IO Pin Placement
882
+
883
+ Place pins on the boundary of the die on the track grid to minimize net
884
+ wirelengths. Pin placement also creates a metal shape for each pin using
885
+ min-area rules.
886
+
887
+ For designs with unplaced cells, the net wirelength is computed considering
888
+ the center of the die area as the unplaced cells position.
889
+
890
+ Find pin placement document [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ppl/README.md).
891
+
892
+ Refer to the built-in examples [here](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/ppl/test).
893
+
894
+ Launch openroad GUI by running the following command(s) in the terminal in OpenROAD tool root directory:
895
+
896
+ ```shell
897
+ cd ../tools/OpenROAD/src/ppl/test/
898
+ openroad -gui
899
+ ```
900
+
901
+ Run [place_pin4.tcl](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ppl/test/place_pin4.tcl) script to view
902
+ pin placement.
903
+
904
+ From the GUI `Tcl commands` section:
905
+
906
+ ```tcl
907
+ source place_pin4.tcl
908
+ ```
909
+
910
+ View the resulting pin placement in GUI:
911
+
912
+ ![place_pin](./images/place_pin.webp)
913
+
914
+ In OpenROAD GUI to enlarge `clk` pin placement, hold mouse right button
915
+ as follows and draw sqaure box in specific location:
916
+
917
+ ![pin_zoom](./images/pin_zoom_RC.webp)
918
+
919
+ Now `clk` pin zoom to clear view as follows:
920
+
921
+ ![pin_zoomed](./images/pin_zoomed.webp)
922
+
923
+
924
+ ### Chip Level IO Pad Placement
925
+
926
+ In this section, you will generate an I/O pad ring for the `coyote` design
927
+ using a Tcl script.
928
+
929
+ ICeWall is a utility to place IO cells around the periphery of a design,
930
+ and associate the IO cells with those present in the netlist of the
931
+ design.
932
+
933
+ For I/O pad placement using ICeWall refer to the readme file
934
+ [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pad/README.md).
935
+
936
+ Refer to the built-in examples [here](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/pad/test).
937
+
938
+ Launch openroad GUI by running the following command(s) in the terminal in OpenROAD tool root directory:
939
+
940
+ ```shell
941
+ cd ../tools/OpenROAD/src/pad/test/
942
+ openroad -gui
943
+ ```
944
+
945
+ Run [skywater130_coyote_tc.tcl](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pad/test/skywater130_coyote_tc.tcl) script
946
+ to view IO pad placement.
947
+
948
+ From the GUI `Tcl commands` section:
949
+
950
+ ```tcl
951
+ source skywater130_coyote_tc.tcl
952
+ ```
953
+
954
+ View the resulting IO pad ring in GUI:
955
+
956
+ ![coyote pad ring](./images/coyote_pad_ring.webp)
957
+
958
+ ### Power Planning And Analysis
959
+
960
+ In this section, you will use the design `gcd` to create a
961
+ power grid and run power analysis.
962
+
963
+ Pdngen is used for power planning. Find the document [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pdn/README.md).
964
+
965
+ Refer to the built-in examples [here](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/pdn/test).
966
+
967
+ Launch openroad GUI by running the following command(s) in the terminal in OpenROAD tool root directory:
968
+
969
+ ```shell
970
+ cd ../tools/OpenROAD/src/pdn/test
971
+ openroad -gui
972
+ ```
973
+
974
+ Run [core_grid_snap.tcl](.(https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pdn/test/core_grid_snap.tcl)
975
+ to generate power grid for `gcd` design.
976
+
977
+ ```tcl
978
+ source core_grid_snap.tcl
979
+ ```
980
+ View the resulting power plan for `gcd` design:
981
+
982
+ ![gcd PDN GUI](./images/gcd_pdn_gui.webp)
983
+
984
+ #### IR Drop Analysis
985
+ IR drop is the voltage drop in the metal wires constituting the power
986
+ grid before it reaches the power pins of the standard cells. It becomes
987
+ very important to limit the IR drop as it affects the speed of the cells
988
+ and overall performance of the chip.
989
+
990
+ PDNSim is an open-source static IR analyzer.
991
+
992
+ Features:
993
+
994
+ - Report worst IR drop.
995
+ - Report worst current density over all nodes and wire segments in
996
+ the power distribution network, given a placed and PDN-synthesized design.
997
+ - Check for floating PDN stripes on the power and ground nets.
998
+ - Spice netlist writer for power distribution network wire segments.
999
+
1000
+ Refer to the built-in examples [here](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/psm/test).
1001
+
1002
+ Launch openroad by running the following command(s) in the terminal in OpenROAD tool root directory:
1003
+
1004
+ ```shell
1005
+ cd ../tools/OpenROAD/src/psm/test
1006
+ openroad
1007
+ ```
1008
+
1009
+ Run [gcd_test_vdd.tcl](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/psm/test/gcd_test_vdd.tcl)
1010
+ to generate IR drop report for `gcd` design.
1011
+
1012
+ ```tcl
1013
+ source gcd_test_vdd.tcl
1014
+ ```
1015
+
1016
+ Find the IR drop report at the end of the log as follows:
1017
+ ```
1018
+ ########## IR report #################
1019
+ Worstcase voltage: 1.10e+00 V
1020
+ Average IR drop : 1.68e-04 V
1021
+ Worstcase IR drop: 2.98e-04 V
1022
+ ######################################
1023
+ ```
1024
+
1025
+ ### Tapcell insertion
1026
+
1027
+ Tap cells are non-functional cells that can have a well tie, substrate
1028
+ tie or both. They are typically used when most or all of the standard
1029
+ cells in the library contain no substrate or well taps. Tap cells help
1030
+ tie the VDD and GND levels and thereby prevent drift and latch-up.
1031
+
1032
+ The end cap cell or boundary cell is placed at both the ends of each
1033
+ placement row to terminate the row. They protect the standard cell
1034
+ gate at the boundary from damage during manufacturing.
1035
+
1036
+ Tap cells are placed after the macro placement and power rail creation.
1037
+ This stage is called the pre-placement stage. Tap cells are placed in a
1038
+ regular interval in each row of placement. The maximum distance between
1039
+ the tap cells must be as per the DRC rule of that particular technology library.
1040
+
1041
+ The figures below show two examples of tapcell insertion. When only the
1042
+ `-tapcell_master` and `-endcap_master` masters are given, the tapcell placement
1043
+ is similar to Figure 1. When the remaining masters are give, the tapcell
1044
+ placement is similar to Figure 2.
1045
+
1046
+ Refer to the GUI figures to highlight well tap and end cap cells. The image
1047
+ does not differentiate and just shows a bunch of rectangles.
1048
+
1049
+ | <img src="./images/tapcell_example1.svg" width=450px> | <img src="./images/tapcell_example2.svg" width=450px> |
1050
+ |:--:|:--:|
1051
+ | Figure 1: Tapcell insertion representation | Figure 2: Tapcell insertion around macro representation |
1052
+
1053
+ Refer to the following built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/tap/test/gcd_nangate45.tcl)
1054
+ to learn about Tap/endcap cell insertion.
1055
+
1056
+ To view this in OpenROAD GUI by running the following command(s) in the terminal in OpenROAD tool root directory:
1057
+
1058
+ ```shell
1059
+ cd ../tools/OpenROAD/src/tap/test/
1060
+ openroad -gui
1061
+ ```
1062
+
1063
+ In the `Tcl Commands` section of GUI
1064
+
1065
+ ```tcl
1066
+ source gcd_nangate45.tcl
1067
+ ```
1068
+
1069
+ View the resulting tap cell insertion as follows:
1070
+
1071
+ ![Tap_Cell_Insertion](./images/tapcell_insertion_view.webp)
1072
+
1073
+ ### Tie Cells
1074
+
1075
+ The tie cell is a standard cell, designed specially to provide the high
1076
+ or low signal to the input (gate terminal) of any logic gate.
1077
+ Where ever netlist is having any pin connected to 0 logic or 1 logic
1078
+ (like .A(1'b0) or .IN(1'b1), a tie cell gets inserted there.
1079
+
1080
+ Refer to the following built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ifp/test/tiecells.tcl)
1081
+ to learn about Tie cell insertion.
1082
+
1083
+ To check this in OpenROAD tool root directory:
1084
+
1085
+ ```shell
1086
+ cd ../tools/OpenROAD/src/ifp/test/
1087
+ openroad
1088
+ source tiecells.tcl
1089
+ ```
1090
+
1091
+ Refer the following verilog code which have tie high/low net.
1092
+ [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ifp/test/tiecells.v)
1093
+ ```
1094
+ AND2_X1 u2 (.A1(r1q), .A2(1'b0), .ZN(u2z0));
1095
+ AND2_X1 u3 (.A1(u1z), .A2(1'b1), .ZN(u2z1));
1096
+ ```
1097
+ With following `insert_tiecells` command:
1098
+ ```
1099
+ insert_tiecells LOGIC0_X1/Z -prefix "TIE_ZERO_"
1100
+ insert_tiecells LOGIC1_X1/Z
1101
+ ```
1102
+ During floorplan stage, those nets converted to tiecells as follows
1103
+ based on library(This is Nangate45 specific):
1104
+ ```
1105
+ [INFO IFP-0030] Inserted 1 tiecells using LOGIC0_X1/Z.
1106
+ [INFO IFP-0030] Inserted 1 tiecells using LOGIC1_X1/Z.
1107
+ ```
1108
+
1109
+ ### Macro or Standard Cell Placement
1110
+
1111
+ #### Macro Placement
1112
+
1113
+ In this section, you will explore various placement options for macros
1114
+ and standard cells and study the impact on area and timing.
1115
+
1116
+ Refer to the following built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/gpl/test/macro01.tcl)
1117
+ to learn about macro placement.
1118
+
1119
+ Placement density impacts how widely standard cells are placed in the
1120
+ core area. To view this in OpenROAD GUI run the following command(s) in the terminal in OpenROAD tool root directory:
1121
+
1122
+ ```shell
1123
+ cd ../tools/OpenROAD/src/gpl/test/
1124
+ openroad -gui
1125
+ ```
1126
+
1127
+ In the `Tcl Commands` section of GUI
1128
+
1129
+ ```tcl
1130
+ source macro01.tcl
1131
+ ```
1132
+
1133
+ Read the resulting macro placement with a complete core view:
1134
+
1135
+ | <img src="./images/macro_place_full_view.webp" width=450px> | <img src="./images/macro_place_close_view.webp" width=450px> |
1136
+ |:--:|:--:|
1137
+ | Figure 1: With density 0.7 | Figure 2: Zoomed view of macro and std cell placement|
1138
+
1139
+ Reduce the placement density and observe the impact on placement, by
1140
+ running below command in `Tcl Commands` section of GUI:
1141
+
1142
+ ```tcl
1143
+ global_placement -density 0.6
1144
+ ```
1145
+
1146
+ Read the resulting macro placement with a complete core view:
1147
+
1148
+ | <img src="./images/placement_density_06_full.webp" width=450px> | <img src="./images/placement_density_06_zoomed.webp" width=450px> |
1149
+ |:--:|:--:|
1150
+ | Figure 1: With density 0.6 | Figure 2: Zoomed view of macro and std cell placement |
1151
+
1152
+ ##### Macro Placement With Halo Spacing
1153
+
1154
+ Explore macro placement with halo spacing, refer to the example
1155
+ [here]((https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/mpl/test/).
1156
+
1157
+ Launch GUI by running the following command(s) in the terminal in OpenROAD tool root directory:
1158
+ ```shell
1159
+ cd ../tools/OpenROAD/src/mpl/test
1160
+ openroad -gui
1161
+ ```
1162
+
1163
+ In the `Tcl Commands` section of GUI:
1164
+
1165
+ ```tcl
1166
+ source helpers.tcl
1167
+ source level3.tcl
1168
+ global_placement
1169
+ ```
1170
+
1171
+ DEF file without halo spacing
1172
+
1173
+ ![gcd without halo spacing](./images/without_halo.webp)
1174
+
1175
+ Now increase the halo width for better routing resources.
1176
+
1177
+ In the `Tcl Commands` section of GUI:
1178
+
1179
+ ```tcl
1180
+ macro_placement -halo {0.5 0.5}
1181
+ ```
1182
+
1183
+ Overlapping macros placed `0.5` micron H/V halo around macros.
1184
+
1185
+ ![gcd with halo spacing](./images/with_halo.webp)
1186
+
1187
+ #### Defining Placement Density
1188
+
1189
+ To learn on placement density strategies for `ibex` design, go to
1190
+ `OpenROAD-flow-scripts/flow`. Type:
1191
+
1192
+ ```shell
1193
+ openroad -gui
1194
+ ```
1195
+
1196
+ Enter the following commands in the `Tcl Commands` section of GUI
1197
+
1198
+ ```tcl
1199
+ read_lef ./platforms/sky130hd/lef/sky130_fd_sc_hd.tlef
1200
+ read_lef ./platforms/sky130hd/lef/sky130_fd_sc_hd_merged.lef
1201
+ read_def ./results/sky130hd/ibex/base/3_place.def
1202
+ ```
1203
+ ![ibex placement density 60](./images/ibex_pl_60.webp)
1204
+
1205
+ Change `CORE_UTILIZATION` and `PLACE_DENSITY` for the `ibex` design
1206
+ `config.mk` as follows.
1207
+
1208
+ View `ibex` design `config.mk`
1209
+ [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/sky130hd/ibex/config.mk).
1210
+
1211
+ ```
1212
+ export CORE_UTILIZATION = 40
1213
+ export PLACE_DENSITY_LB_ADDON = 0.1
1214
+ ```
1215
+
1216
+ Re-run the `ibex` design with the below command:
1217
+
1218
+ ```shell
1219
+ make DESIGN_CONFIG=./designs/sky130hd/ibex/config.mk
1220
+ ```
1221
+
1222
+ View the `ibex` design placement density heat map as shown below:
1223
+
1224
+ ![ibex placement density 50](./images/ibex_pl_50.webp)
1225
+
1226
+ So from above, GUI understood that change in `CORE_UTILIZATION` from 20
1227
+ to 40 and placement density default 0.60 to 0.50 changes standard cell
1228
+ placement became widely spread.
1229
+
1230
+ ### Timing Optimizations
1231
+
1232
+ #### Timing Optimization Using repair_design
1233
+
1234
+ The `repair_design` command inserts buffers on nets to repair `max
1235
+ slew, max capacitance and max fanout` violations and on long wires to
1236
+ reduce RC delay. It also resizes gates to normalize slews. Use
1237
+ `estimate_parasitics -placement` before `repair_design` to account
1238
+ for estimated post-placement parasitics.
1239
+
1240
+ Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/rsz/test/repair_slew1.tcl).
1241
+
1242
+ Launch GUI by running the following command(s) in the terminal in OpenROAD tool root directory:
1243
+
1244
+ ```shell
1245
+ cd ../tools/OpenROAD/src/rsz/test/
1246
+ openroad -gui
1247
+ ```
1248
+
1249
+ Copy and paste the below commands in the `Tcl Commands` section of GUI.
1250
+
1251
+ ```tcl
1252
+ source "helpers.tcl"
1253
+ source "hi_fanout.tcl"
1254
+ read_liberty Nangate45/Nangate45_typ.lib
1255
+ read_lef Nangate45/Nangate45.lef
1256
+ set def_file [make_result_file "repair_slew1.def"]
1257
+ write_hi_fanout_def $def_file 30
1258
+ read_def $def_file
1259
+
1260
+ create_clock -period 1 clk1
1261
+ set_wire_rc -layer metal3
1262
+
1263
+ estimate_parasitics -placement
1264
+ set_max_transition .05 [current_design]
1265
+
1266
+ puts "Found [sta::max_slew_violation_count] violations"
1267
+ ```
1268
+
1269
+ The number of violations log as:
1270
+
1271
+ ```
1272
+ Found 31 violations
1273
+ ```
1274
+
1275
+ These violations were fixed by:
1276
+
1277
+ ```tcl
1278
+ repair_design
1279
+ ```
1280
+
1281
+ The log is as follows:
1282
+
1283
+ ```
1284
+ [INFO RSZ-0058] Using max wire length 853um.
1285
+ [INFO RSZ-0039] Resized 1 instance.
1286
+ ```
1287
+
1288
+ To view violation counts again:
1289
+
1290
+ ```tcl
1291
+ puts "Found [sta::max_slew_violation_count] violations"
1292
+ ```
1293
+
1294
+ The log follows:
1295
+
1296
+ ```
1297
+ Found 0 violations
1298
+ ```
1299
+
1300
+ `repair_design` fixed all 31 violations.
1301
+
1302
+ #### Timing Optimization Using repair_timing
1303
+
1304
+ The `repair_timing` command repairs setup and hold violations. It was
1305
+ run after clock tree synthesis with propagated clocks.
1306
+
1307
+ While repairing hold violations, buffers are not inserted since that may
1308
+ cause setup violations unless '-allow_setup_violations' is specified.
1309
+ Use `-slack_margin` to add additional slack margin.
1310
+
1311
+ #### Timing Optimization Based On Multiple Corners
1312
+
1313
+ OpenROAD supports multiple corner analysis to calculate worst-case setup
1314
+ and hold violations.
1315
+
1316
+ Setup time optimization is based on the slow corner or the best case when
1317
+ the launch clock arrives later than the data clock.
1318
+ Hold time optimization is based on the fast corner or the best case when
1319
+ the launch clock arrives earlier than the capture clock.
1320
+
1321
+ Refer to the following `gcd` design on `repair_timing` with fast and slow
1322
+ corners.
1323
+
1324
+ Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/test/gcd_sky130hd_fast_slow.tcl).
1325
+
1326
+ Run the following commands in the terminal:
1327
+ ```shell
1328
+ cd ../../test/
1329
+ openroad
1330
+ source gcd_sky130hd_fast_slow.tcl
1331
+ ```
1332
+
1333
+ The resulting `worst slack`, `TNS`:
1334
+
1335
+ ```
1336
+ report_worst_slack -min -digits 3
1337
+ worst slack 0.321
1338
+ report_worst_slack -max -digits 3
1339
+ worst slack -16.005
1340
+ report_tns -digits 3
1341
+ tns -529.496
1342
+ ```
1343
+
1344
+ #### Fixing Setup Violations
1345
+
1346
+ To fix setup timing path violations, use `repair_timing -setup.`
1347
+
1348
+ Refer to the following built-in example to learn more about fixing setup
1349
+ timing violations.
1350
+
1351
+ Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/rsz/test/repair_setup4.tcl).
1352
+
1353
+ Launch OpenROAD in an interactive mode by running the following command(s) in the terminal in OpenROAD tool root directory:
1354
+
1355
+ ```shell
1356
+ cd ../tools/OpenROAD/src/rsz/test/
1357
+ openroad
1358
+ ```
1359
+
1360
+ Copy and paste the following Tcl commands.
1361
+
1362
+ ```tcl
1363
+ define_corners fast slow
1364
+ read_liberty -corner slow Nangate45/Nangate45_slow.lib
1365
+ read_liberty -corner fast Nangate45/Nangate45_fast.lib
1366
+ read_lef Nangate45/Nangate45.lef
1367
+ read_def repair_setup1.def
1368
+ create_clock -period 0.3 clk
1369
+ set_wire_rc -layer metal3
1370
+ estimate_parasitics -placement
1371
+ report_checks -fields input -digits 3
1372
+ ```
1373
+
1374
+ View the generated timing report with the slack violation.
1375
+
1376
+ ```
1377
+ Startpoint: r1 (rising edge-triggered flip-flop clocked by clk)
1378
+ Endpoint: r2 (rising edge-triggered flip-flop clocked by clk)
1379
+ Path Group: clk
1380
+ Path Type: max
1381
+ Corner: slow
1382
+
1383
+ Delay Time Description
1384
+ -----------------------------------------------------------
1385
+ 0.000 0.000 clock clk (rise edge)
1386
+ 0.000 0.000 clock network delay (ideal)
1387
+ 0.000 0.000 ^ r1/CK (DFF_X1)
1388
+ 0.835 0.835 ^ r1/Q (DFF_X1)
1389
+ 0.001 0.836 ^ u1/A (BUF_X1)
1390
+ 0.196 1.032 ^ u1/Z (BUF_X1)
1391
+ 0.001 1.033 ^ u2/A (BUF_X1)
1392
+ 0.121 1.154 ^ u2/Z (BUF_X1)
1393
+ 0.001 1.155 ^ u3/A (BUF_X1)
1394
+ 0.118 1.273 ^ u3/Z (BUF_X1)
1395
+ 0.001 1.275 ^ u4/A (BUF_X1)
1396
+ 0.118 1.393 ^ u4/Z (BUF_X1)
1397
+ 0.001 1.394 ^ u5/A (BUF_X1)
1398
+ 0.367 1.761 ^ u5/Z (BUF_X1)
1399
+ 0.048 1.809 ^ r2/D (DFF_X1)
1400
+ 1.809 data arrival time
1401
+
1402
+ 0.300 0.300 clock clk (rise edge)
1403
+ 0.000 0.300 clock network delay (ideal)
1404
+ 0.000 0.300 clock reconvergence pessimism
1405
+ 0.300 ^ r2/CK (DFF_X1)
1406
+ -0.155 0.145 library setup time
1407
+ 0.145 data required time
1408
+ -----------------------------------------------------------
1409
+ 0.145 data required time
1410
+ -1.809 data arrival time
1411
+ -----------------------------------------------------------
1412
+ -1.664 slack (VIOLATED)
1413
+
1414
+ ```
1415
+
1416
+ Fix setup violation using:
1417
+
1418
+ ```tcl
1419
+ repair_timing -setup
1420
+ ```
1421
+
1422
+ The log is as follows:
1423
+
1424
+ ```
1425
+ [INFO RSZ-0040] Inserted 4 buffers.
1426
+ [INFO RSZ-0041] Resized 16 instances.
1427
+ [WARNING RSZ-0062] Unable to repair all setup violations.
1428
+ ```
1429
+
1430
+ Reduce the clock frequency by increasing the clock period to `0.9` and re-run
1431
+ `repair_timing` to fix the setup violation warnings. Such timing violations
1432
+ are automatically fixed by the `resizer` `post CTS` and `global routing.`
1433
+
1434
+ ```yvl
1435
+ create_clock -period 0.9 clk
1436
+ repair_timing -setup
1437
+ ```
1438
+
1439
+ To view timing logs post-repair timing, type:
1440
+
1441
+ ```tcl
1442
+ report_checks -fields input -digits 3
1443
+ ```
1444
+
1445
+ The log is as follows:
1446
+
1447
+ ```
1448
+ Startpoint: r1 (rising edge-triggered flip-flop clocked by clk)
1449
+ Endpoint: r2 (rising edge-triggered flip-flop clocked by clk)
1450
+ Path Group: clk
1451
+ Path Type: max
1452
+ Corner: slow
1453
+
1454
+ Delay Time Description
1455
+ -----------------------------------------------------------
1456
+ 0.000 0.000 clock clk (rise edge)
1457
+ 0.000 0.000 clock network delay (ideal)
1458
+ 0.000 0.000 ^ r1/CK (DFF_X1)
1459
+ 0.264 0.264 v r1/Q (DFF_X1)
1460
+ 0.002 0.266 v u1/A (BUF_X4)
1461
+ 0.090 0.356 v u1/Z (BUF_X4)
1462
+ 0.003 0.359 v u2/A (BUF_X8)
1463
+ 0.076 0.435 v u2/Z (BUF_X8)
1464
+ 0.003 0.438 v u3/A (BUF_X8)
1465
+ 0.074 0.512 v u3/Z (BUF_X8)
1466
+ 0.003 0.515 v u4/A (BUF_X8)
1467
+ 0.077 0.592 v u4/Z (BUF_X8)
1468
+ 0.005 0.597 v u5/A (BUF_X16)
1469
+ 0.077 0.674 v u5/Z (BUF_X16)
1470
+ 0.036 0.710 v r2/D (DFF_X1)
1471
+ 0.710 data arrival time
1472
+
1473
+ 0.900 0.900 clock clk (rise edge)
1474
+ 0.000 0.900 clock network delay (ideal)
1475
+ 0.000 0.900 clock reconvergence pessimism
1476
+ 0.900 ^ r2/CK (DFF_X1)
1477
+ -0.172 0.728 library setup time
1478
+ 0.728 data required time
1479
+ -----------------------------------------------------------
1480
+ 0.728 data required time
1481
+ -0.710 data arrival time
1482
+ -----------------------------------------------------------
1483
+ 0.019 slack (MET)
1484
+ ```
1485
+
1486
+ #### Fixing Hold Violations
1487
+
1488
+ To fix hold violation for the design, command to use `repair_timing
1489
+ -hold`
1490
+
1491
+ Refer to the example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/rsz/test/repair_hold10.tcl)
1492
+ to learn more about fixing hold violations.
1493
+
1494
+ Check hold violation post-global routing using the following Tcl
1495
+ commands. Run below steps in terminal in OpenROAD tool root directory:
1496
+
1497
+ ```shell
1498
+ cd ../tools/OpenROAD/src/rsz/test/
1499
+ openroad -gui
1500
+ ```
1501
+
1502
+ Copy and paste the below commands in the `Tcl Commands` section of GUI.
1503
+
1504
+ ```tcl
1505
+ source helpers.tcl
1506
+ read_liberty sky130hd/sky130hd_tt.lib
1507
+ read_lef sky130hd/sky130hd.tlef
1508
+ read_lef sky130hd/sky130hd_std_cell.lef
1509
+ read_def repair_hold10.def
1510
+ create_clock -period 2 clk
1511
+ set_propagated_clock clk
1512
+ set_wire_rc -resistance 0.0001 -capacitance 0.00001
1513
+ set_routing_layers -signal met1-met5
1514
+ global_route
1515
+ estimate_parasitics -global_routing
1516
+ report_worst_slack -min
1517
+ ```
1518
+
1519
+ Read the resulting worst slack as:
1520
+
1521
+ ```
1522
+ worst slack -1.95
1523
+ ```
1524
+
1525
+ The above worst slack was fixed with:
1526
+
1527
+ ```tcl
1528
+ repair_timing -hold
1529
+ ```
1530
+
1531
+ The log is as follows:
1532
+
1533
+ ```
1534
+ [INFO RSZ-0046] Found 2 endpoints with hold violations.
1535
+ [INFO RSZ-0032] Inserted 5 hold buffers.
1536
+ ```
1537
+
1538
+ Re-check the slack value after repair_timing. Type:
1539
+
1540
+ ```tcl
1541
+ report_worst_slack -min
1542
+ ```
1543
+
1544
+ The result worst slack value is as follows:
1545
+
1546
+ ```
1547
+ worst slack 0.16
1548
+ ```
1549
+
1550
+ Note that the worst slack is now met and the hold violation was fixed by
1551
+ the resizer.
1552
+
1553
+ ### Clock Tree Synthesis
1554
+
1555
+ To perform clock tree synthesis `clock_tree_synthesis` flow command used.
1556
+ The OpenROAD-flow-scripts automatically generates a well-balanced clock tree post-placement.
1557
+ In this section, you will learn details about the building and visualize the
1558
+ clock tree.
1559
+
1560
+ Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/cts/test/simple_test.tcl).
1561
+
1562
+ Launch OpenROAD GUI by running the following command(s) in the terminal in OpenROAD tool root directory:
1563
+
1564
+ ```shell
1565
+ cd ../tools/OpenROAD/src/cts/test/
1566
+ openroad -gui
1567
+ ```
1568
+
1569
+ To build the clock tree, run the following commands in `Tcl Commands` of
1570
+ GUI:
1571
+
1572
+ ```tcl
1573
+ read_lef Nangate45/Nangate45.lef
1574
+ read_liberty Nangate45/Nangate45_typ.lib
1575
+ read_def "16sinks.def"
1576
+ create_clock -period 5 clk
1577
+ set_wire_rc -clock -layer metal3
1578
+ clock_tree_synthesis -root_buf CLKBUF_X3 \
1579
+ -buf_list CLKBUF_X3 \
1580
+ -wire_unit 20
1581
+ ```
1582
+
1583
+ Layout view before CTS as follows:
1584
+
1585
+ ![Layout before CTS](./images/Layout_before_CTS.webp)
1586
+
1587
+ Layout view after CTS can be viewed with `Update` option.
1588
+
1589
+ ![Layout after CTS](./images/Layout_after_CTS.webp)
1590
+
1591
+ Here we explore how clock tree buffers are inserted to balance the clock
1592
+ tree structure.
1593
+
1594
+ Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/cts/test/balance_levels.tcl).
1595
+
1596
+ Generate a clock- tree that is unbalanced first, then explore the
1597
+ creation of a well-balanced clock tree.
1598
+
1599
+ Launch OpenROAD GUI by running the following command(s) in the terminal in OpenROAD tool root directory:
1600
+
1601
+ ```shell
1602
+ cd ../tools/OpenROAD/src/cts/test/
1603
+ openroad -gui
1604
+ ```
1605
+
1606
+ Use the following commands in the `TCL commands` section of GUI:
1607
+
1608
+ ```tcl
1609
+ source "helpers.tcl"
1610
+ source "cts-helpers.tcl"
1611
+ read_liberty Nangate45/Nangate45_typ.lib
1612
+ read_lef Nangate45/Nangate45.lef
1613
+ set block [make_array 300 200000 200000 150]
1614
+ sta::db_network_defined
1615
+ create_clock -period 5 clk
1616
+ set_wire_rc -clock -layer metal5
1617
+ ```
1618
+
1619
+ The clock tree structure is as follows with unbalanced mode.
1620
+
1621
+ ![Unbalanced Clock tree](./images/unbalanced_clock_tree.webp)
1622
+
1623
+ Use the `clock_tree_synthesis` command to balance this clock tree structure
1624
+ with buffers. See the format as follows.
1625
+
1626
+ ```tcl
1627
+ clock_tree_synthesis -root_buf CLKBUF_X3 \
1628
+ -buf_list CLKBUF_X3 \
1629
+ -wire_unit 20 \
1630
+ -post_cts_disable \
1631
+ -sink_clustering_enable \
1632
+ -distance_between_buffers 100 \
1633
+ -sink_clustering_size 10 \
1634
+ -sink_clustering_max_diameter 60 \
1635
+ -balance_levels \
1636
+ -num_static_layers 1
1637
+ ```
1638
+
1639
+ To view the balanced clock tree after CTS, in GUI Toolbar, select
1640
+
1641
+ `Clock Tree Viewer` and click `Update` to view the resulting clock
1642
+ tree in GUI as follows:
1643
+
1644
+ ![Balanced Clock Tree](./images/balanced_clock_tree.webp)
1645
+
1646
+ #### Reporting Clock Skews
1647
+
1648
+ The OpenROAD-flow-scripts flow automatically fixes any skew issues that could potentially
1649
+ cause hold violations downstream in the timing path.
1650
+
1651
+ ```tcl
1652
+ report_clock_skew
1653
+ ```
1654
+
1655
+ For the `ibex` design, refer to the following logs to view clock skew reports.
1656
+
1657
+ ```shell
1658
+ less logs/sky130hd/ibex/base/4_1_cts.log
1659
+ ```
1660
+
1661
+ ```
1662
+ cts pre-repair report_clock_skew
1663
+ --------------------------------------------------------------------------
1664
+ Clock core_clock
1665
+ Latency CRPR Skew
1666
+ _28453_/CLK ^
1667
+ 5.92
1668
+ _29312_/CLK ^
1669
+ 1.41 0.00 4.51
1670
+ ```
1671
+
1672
+ ```
1673
+ cts post-repair report_clock_skew
1674
+ --------------------------------------------------------------------------
1675
+ Clock core_clock
1676
+ Latency CRPR Skew
1677
+ _28453_/CLK ^
1678
+ 5.92
1679
+ _29312_/CLK ^
1680
+ 1.41 0.00 4.51
1681
+ ```
1682
+
1683
+ ```
1684
+ cts final report_clock_skew
1685
+ --------------------------------------------------------------------------
1686
+ Clock core_clock
1687
+ Latency CRPR Skew
1688
+ _27810_/CLK ^
1689
+ 5.97
1690
+ _29266_/CLK ^
1691
+ 1.41 0.00 4.56
1692
+ ```
1693
+
1694
+ #### Reporting CTS Metrics
1695
+
1696
+ Run `report_cts` command to view useful metrics such as number of clock
1697
+ roots, number of buffers inserted, number of clock subnets and number of
1698
+ sinks.
1699
+
1700
+ Refer to the built-in examples [here](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/cts/test).
1701
+
1702
+ Run these Tcl commands in the terminal in OpenROAD tool root directory:
1703
+
1704
+ ```
1705
+ cd ../tools/OpenROAD/src/cts/test/
1706
+ openroad
1707
+ source post_cts_opt.tcl
1708
+ report_cts
1709
+ ```
1710
+
1711
+ CTS metrics are as follows for the current design.
1712
+
1713
+ ```
1714
+ [INFO CTS-0003] Total number of Clock Roots: 1.
1715
+ [INFO CTS-0004] Total number of Buffers Inserted: 35.
1716
+ [INFO CTS-0005] Total number of Clock Subnets: 35.
1717
+ [INFO CTS-0006] Total number of Sinks: 301.
1718
+ ```
1719
+
1720
+ ### Adding Filler Cells
1721
+
1722
+ Filler cells fills gaps between detail-placed instances to connect the
1723
+ power and ground rails in the rows. Filler cells have no logical
1724
+ connectivity. These cells are provided continuity in the rows for VDD
1725
+ and VSS nets and it also contains substrate nwell connection to improve
1726
+ substrate biasing.
1727
+
1728
+ `filler_masters` is a list of master/macro names to use for
1729
+ filling the gaps.
1730
+
1731
+ Refer to the following built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/dpl/test/fillers1.tcl)
1732
+ to learn about filler cell insertion.
1733
+
1734
+ To view this in OpenROAD GUI run the following command(s) in the terminal in OpenROAD tool root directory:
1735
+
1736
+ ```shell
1737
+ cd ../tools/OpenROAD/src/grt/test/
1738
+ openroad -gui
1739
+ ```
1740
+
1741
+ In the `Tcl Commands` section of GUI,run following commands:
1742
+
1743
+ ```tcl
1744
+ source "helpers.tcl"
1745
+ read_lef "Nangate45/Nangate45.lef"
1746
+ read_def "gcd.def"
1747
+ ```
1748
+
1749
+ Loaded DEF view without filler insertion:
1750
+
1751
+ ![Without_Fill_Cell_Insertion](./images/wo_fillcell_insertion.webp)
1752
+
1753
+ Run following commands for filler cell insertion:
1754
+ ```
1755
+ set filler_master [list FILLCELL_X1 FILLCELL_X2 FILLCELL_X4 FILLCELL_X8 FILLCELL_X16]
1756
+ filler_placement $filler_master
1757
+ ```
1758
+
1759
+ View the resulting fill cell insertion as follows:
1760
+
1761
+ ![Fill_Cell_Insertion](./images/fillcell_insertion.webp)
1762
+
1763
+ Filler cells removed with `remove_fillers` command.
1764
+
1765
+ ### Global Routing
1766
+
1767
+ The global router analyzes available routing resources and automatically
1768
+ allocates them to avoid any  H/V  overflow violations for optimal routing. 
1769
+ It generates a congestion report for GCells showing total resources, demand,
1770
+ utilization, location and the H/V violation status. If there are no violations
1771
+ reported then the design can proceed to detail routing.
1772
+
1773
+ Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/grt/test/gcd.tcl).
1774
+
1775
+ Launch OpenROAD GUI by running the following command(s) in the terminal in OpenROAD tool root directory:
1776
+
1777
+ ```shell
1778
+ cd ../tools/OpenROAD/src/grt/test/
1779
+ openroad -gui
1780
+ ```
1781
+
1782
+ To run the global routing, run the following commands in `Tcl Commands` of
1783
+ GUI:
1784
+
1785
+ ```tcl
1786
+ source gcd.tcl
1787
+ ```
1788
+
1789
+ Routing resource and congestion analysis done with below log:
1790
+ ```
1791
+ [INFO GRT-0096] Final congestion report:
1792
+ Layer Resource Demand Usage (%) Max H / Max V / Total Overflow
1793
+ ---------------------------------------------------------------------------------------
1794
+ metal1 31235 1651 5.29% 0 / 0 / 0
1795
+ metal2 24628 1652 6.71% 0 / 0 / 0
1796
+ metal3 33120 40 0.12% 0 / 0 / 0
1797
+ metal4 15698 0 0.00% 0 / 0 / 0
1798
+ metal5 15404 0 0.00% 0 / 0 / 0
1799
+ metal6 15642 0 0.00% 0 / 0 / 0
1800
+ metal7 4416 0 0.00% 0 / 0 / 0
1801
+ metal8 4512 0 0.00% 0 / 0 / 0
1802
+ metal9 2208 0 0.00% 0 / 0 / 0
1803
+ metal10 2256 0 0.00% 0 / 0 / 0
1804
+ ---------------------------------------------------------------------------------------
1805
+ Total 149119 3343 2.24% 0 / 0 / 0
1806
+
1807
+ [INFO GRT-0018] Total wirelength: 10598 um
1808
+ [INFO GRT-0014] Routed nets: 563
1809
+ ```
1810
+
1811
+ View the resulting global routing in GUI as follows:
1812
+
1813
+ ![Global Route](./images/global_route_gcd.webp)
1814
+
1815
+ ### Detail Routing
1816
+
1817
+ TritonRoute is an open-source detailed router for modern industrial designs.
1818
+ The router consists of several main building blocks, including pin access
1819
+ analysis, track assignment, initial detailed routing, search and repair, and a DRC engine.
1820
+
1821
+ Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/drt/test/gcd_nangate45.tcl).
1822
+
1823
+ Launch OpenROAD GUI by running the following command(s) in the terminal in OpenROAD tool root directory:
1824
+
1825
+ ```shell
1826
+ cd ../tools/OpenROAD/src/drt/test/
1827
+ openroad -gui
1828
+ ```
1829
+
1830
+ To run the detail routing, run the following commands in `Tcl Commands` of
1831
+ GUI:
1832
+
1833
+ ```tcl
1834
+ read_lef Nangate45/Nangate45_tech.lef
1835
+ read_lef Nangate45/Nangate45_stdcell.lef
1836
+ read_def gcd_nangate45_preroute.def
1837
+ read_guides gcd_nangate45.route_guide
1838
+ set_thread_count [expr [exec getconf _NPROCESSORS_ONLN] / 4]
1839
+ detailed_route -output_drc results/gcd_nangate45.output.drc.rpt \
1840
+ -output_maze results/gcd_nangate45.output.maze.log \
1841
+ -verbose 1
1842
+ write_db gcd_nangate45.odb
1843
+ ```
1844
+
1845
+ For successful routing, DRT will end with 0 violations.
1846
+
1847
+ Log as follows:
1848
+
1849
+ ```
1850
+ [INFO DRT-0199] Number of violations = 0.
1851
+ [INFO DRT-0267] cpu time = 00:00:00, elapsed time = 00:00:00, memory = 674.22 (MB), peak = 686.08 (MB)
1852
+ Total wire length = 5680 um.
1853
+ Total wire length on LAYER metal1 = 19 um.
1854
+ Total wire length on LAYER metal2 = 2798 um.
1855
+ Total wire length on LAYER metal3 = 2614 um.
1856
+ Total wire length on LAYER metal4 = 116 um.
1857
+ Total wire length on LAYER metal5 = 63 um.
1858
+ Total wire length on LAYER metal6 = 36 um.
1859
+ Total wire length on LAYER metal7 = 32 um.
1860
+ Total wire length on LAYER metal8 = 0 um.
1861
+ Total wire length on LAYER metal9 = 0 um.
1862
+ Total wire length on LAYER metal10 = 0 um.
1863
+ Total number of vias = 2223.
1864
+ Up-via summary (total 2223):.
1865
+
1866
+ ---------------
1867
+ active 0
1868
+ metal1 1151
1869
+ metal2 1037
1870
+ metal3 22
1871
+ metal4 7
1872
+ metal5 4
1873
+ metal6 2
1874
+ metal7 0
1875
+ metal8 0
1876
+ metal9 0
1877
+ ---------------
1878
+ 2223
1879
+
1880
+
1881
+ [INFO DRT-0198] Complete detail routing.
1882
+ ```
1883
+
1884
+ View the resulting detail routing in GUI as follows:
1885
+
1886
+ ![Detail Routing](./images/sky130_gcd_route.webp)
1887
+
1888
+ ### Antenna Checker
1889
+
1890
+ Antenna Violation occurs when the antenna ratio exceeds a value specified
1891
+ in a Process Design Kit (PDK). The antenna ratio is the ratio of the gate
1892
+ area to the gate oxide area. The amount of charge collection is determined
1893
+ by the area/size of the conductor (gate area).
1894
+
1895
+ This tool checks antenna violations and generates a report to indicate violated nets.
1896
+
1897
+ Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ant/test/ant_check.tcl).
1898
+
1899
+ Launch OpenROAD by running the following command(s) in the terminal in OpenROAD tool root directory:
1900
+
1901
+ ```shell
1902
+ cd ../tools/OpenROAD/src/ant/test/
1903
+ openroad
1904
+ ```
1905
+
1906
+ To extract antenna violations, run the following commands:
1907
+
1908
+ ```tcl
1909
+ read_lef ant_check.lef
1910
+ read_def ant_check.def
1911
+
1912
+ check_antennas -verbose
1913
+ puts "violation count = [ant::antenna_violation_count]"
1914
+
1915
+ # check if net50 has a violation
1916
+ set net "net50"
1917
+ puts "Net $net violations: [ant::check_net_violation $net]"
1918
+ ```
1919
+
1920
+ The log as follows:
1921
+
1922
+ ```
1923
+ [INFO ANT-0002] Found 1 net violations.
1924
+ [INFO ANT-0001] Found 2 pin violations.
1925
+ violation count = 1
1926
+ Net net50 violations: 1
1927
+ ```
1928
+
1929
+ ### Metal Fill
1930
+
1931
+ Metal fill is a mandatory step at advanced nodes to ensure manufacturability
1932
+ and high yield. It involves filling the empty or white spaces near the
1933
+ design with metal polygons to ensure regular planarization of the wafer.
1934
+
1935
+ This module inserts floating metal fill shapes to meet metal density
1936
+ design rules while obeying DRC constraints. It is driven by a json
1937
+ configuration file.
1938
+
1939
+ Command used as follows:
1940
+ ```tcl
1941
+ density_fill -rules <json_file> [-area <list of lx ly ux uy>]
1942
+ ```
1943
+ If -area is not specified, the core area will be used.
1944
+
1945
+ To run metal fill post route, run the following:
1946
+ ```shell
1947
+ cd flow/tutorials/scripts/metal_fill
1948
+ openroad -gui
1949
+ source "helpers.tcl"
1950
+ read_db ./5_route.odb
1951
+ ```
1952
+ Layout before adding metal fill is as follows:
1953
+ ![Detail Routing](./images/sky130_gcd_route.webp)
1954
+
1955
+ To add metal fill, run the command:
1956
+ ```tcl
1957
+ density_fill -rules ../../../platforms/sky130hd/fill.json
1958
+ ```
1959
+
1960
+ Layout after adding metal fill insertion is as follows:
1961
+ ![Metal Fill](./images/metal_fill_view.webp)
1962
+
1963
+ Metal fill view can enabled with `Misc` and enable `Fills` check box.
1964
+
1965
+ ### Parasitics Extraction
1966
+
1967
+ OpenRCX is a Parasitic Extraction (PEX, or RCX) tool that works on OpenDB design APIs.
1968
+ It extracts routed designs based on the LEF/DEF layout model.
1969
+
1970
+ OpenRCX stores resistance, coupling capacitance and ground (i.e., grounded) capacitance
1971
+ on OpenDB objects with direct pointers to the associated wire and via db
1972
+ objects. Optionally, OpenRCX can generate a `.spef` file.
1973
+
1974
+ Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/rcx/test/45_gcd.tcl).
1975
+
1976
+ Launch OpenROAD tool by running the following command(s) in the terminal in OpenROAD tool root directory:
1977
+
1978
+ ```shell
1979
+ cd ../tools/OpenROAD/src/rcx/test/
1980
+ openroad
1981
+ ```
1982
+
1983
+ To run parasitics for gcd design:
1984
+ ```tcl
1985
+ source 45_gcd.tcl
1986
+ ```
1987
+
1988
+ The log as follows:
1989
+ ```
1990
+ [INFO ODB-0222] Reading LEF file: Nangate45/Nangate45.lef
1991
+ [INFO ODB-0223] Created 22 technology layers
1992
+ [INFO ODB-0224] Created 27 technology vias
1993
+ [INFO ODB-0225] Created 135 library cells
1994
+ [INFO ODB-0226] Finished LEF file: Nangate45/Nangate45.lef
1995
+ [INFO ODB-0127] Reading DEF file: 45_gcd.def
1996
+ [INFO ODB-0128] Design: gcd
1997
+ [INFO ODB-0130] Created 54 pins.
1998
+ [INFO ODB-0131] Created 1820 components and 4618 component-terminals.
1999
+ [INFO ODB-0132] Created 2 special nets and 3640 connections.
2000
+ [INFO ODB-0133] Created 350 nets and 978 connections.
2001
+ [INFO ODB-0134] Finished DEF file: 45_gcd.def
2002
+ [INFO RCX-0431] Defined process_corner X with ext_model_index 0
2003
+ [INFO RCX-0029] Defined extraction corner X
2004
+ [INFO RCX-0008] extracting parasitics of gcd ...
2005
+ [INFO RCX-0435] Reading extraction model file 45_patterns.rules ...
2006
+ [INFO RCX-0436] RC segment generation gcd (max_merge_res 0.0) ...
2007
+ [INFO RCX-0040] Final 2656 rc segments
2008
+ [INFO RCX-0439] Coupling Cap extraction gcd ...
2009
+ [INFO RCX-0440] Coupling threshhold is 0.1000 fF, coupling capacitance less than 0.1000 fF will be grounded.
2010
+ [INFO RCX-0043] 1954 wires to be extracted
2011
+ [INFO RCX-0442] 48% completion -- 954 wires have been extracted
2012
+ [INFO RCX-0442] 100% completion -- 1954 wires have been extracted
2013
+ [INFO RCX-0045] Extract 350 nets, 2972 rsegs, 2972 caps, 2876 ccs
2014
+ [INFO RCX-0015] Finished extracting gcd.
2015
+ [INFO RCX-0016] Writing SPEF ...
2016
+ [INFO RCX-0443] 350 nets finished
2017
+ [INFO RCX-0017] Finished writing SPEF ...
2018
+ ```
2019
+
2020
+ `45_gcd.spef` viewed in `results` directory.
2021
+
2022
+ ## Troubleshooting Problems
2023
+
2024
+ This section shows you how to troubleshoot commonly occurring problems
2025
+ with the flow or any of the underlying application tools.
2026
+
2027
+ ### Debugging Problems in Global Routing
2028
+
2029
+ The global router has a few useful functionalities to understand
2030
+ high congestion issues in the designs.
2031
+
2032
+ Congestion heatmap can be used on any design, whether it has
2033
+ congestion or not. Viewing congestion explained [here](content:heat:maps).
2034
+ If the design has congestion issue, it ends with the error;
2035
+ ```
2036
+ [ERROR GRT-0118] Routing congestion too high.
2037
+ ```
2038
+
2039
+ Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/grt/test/congestion5.tcl).
2040
+
2041
+ Launch OpenROAD GUI by running the following command(s) in the terminal in OpenROAD tool root directory:
2042
+
2043
+ ```shell
2044
+ cd ../tools/OpenROAD/src/grt/test/
2045
+ openroad -gui
2046
+ ```
2047
+
2048
+ To run the global routing, run the following commands in `Tcl Commands` of
2049
+ GUI:
2050
+
2051
+ ```tcl
2052
+ source congestion5.tcl
2053
+ ```
2054
+
2055
+ The design fail with routing congestion error as follows:
2056
+ ![Routing_Congestion](./images/grt_congestion_error.webp)
2057
+
2058
+ In the GUI, you can go under `Heat Maps` and mark the
2059
+ `Routing Congestion` checkbox to visualize the congestion map.
2060
+ ![congestion_heatmap](./images/congestion_heatmap_enable.webp)
2061
+
2062
+ #### Dump congestion information to a text file
2063
+
2064
+ You can create a text file with the congestion information of the
2065
+ GCells for further investigation on the GUI. To do that, add the
2066
+ `-congestion_report_file file_name` to the `global_route` command, as shown below:
2067
+ ```tcl
2068
+ global_route -guide_file out.guide -congestion_report_file congest.rpt
2069
+ ```
2070
+
2071
+ #### Visualization of overflowing GCells as markers
2072
+
2073
+ With the file created with the command described above, you can see more
2074
+ details about the congested GCell, like the total resources, utilization,
2075
+ location, etc. You can load the file following these steps:
2076
+
2077
+ - step 1: In the `DRC Viewer` window, click on `Load` and select the
2078
+ file with the congestion report.
2079
+ - step 2: A summary of the GCells with congestion is shown in the
2080
+ `DRC Viewer` window. Also, the markers are added to the GUI.
2081
+ ![GCell_marker](./images/gcell_marker.webp)
2082
+ - step 3: For details on the routing resources information, use the `Inspector` window.
2083
+ ![zoom_options](./images/zoom_options.webp)
2084
+
2085
+ By Clicking `zoom_to` options, you can enlarge the view as follows:
2086
+ ![zoomto_gcell](./images/zoomto_gcell.webp)
data/markdown/ORFS_docs/ORFS-getting_involved.md ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OpenROAD Getting Involved
2
+
3
+ Thank you for taking the time to read this document and to contribute.
4
+ The OpenROAD project will not reach all of its objectives without help!
5
+
6
+ Possible ways to contribute in the scope of OpenROAD Flow:
7
+
8
+ - Open-source PDK information
9
+ - Open-source Designs
10
+ - Useful scripts
11
+ - Star our project and repos so we can see the number of people
12
+ who are interested
13
+
14
+ ## Licensing Contributions
15
+
16
+ As much as possible, all contributions should be licensed using the BSD3
17
+ license. You can propose another license if you must, but contributions
18
+ made with BSD3 fit best with the spirit of OpenROAD's permissive open-source
19
+ philosophy. We do have exceptions in the project, but over time we hope
20
+ that all contributions will be BSD3, or some other permissive license such as MIT
21
+ or Apache2.0.
22
+
23
+ ## Contributing Open Source PDK information and Designs
24
+
25
+ If you have new design or PDK information to contribute, please add this
26
+ to the repo
27
+ [OpenROAD-flow-scripts](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/).
28
+ In the
29
+ [flow directory](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/tree/master/flow)
30
+ you will see a directory for
31
+ [designs](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/tree/master/flow/designs)
32
+ with Makefiles to run them, and one for PDK
33
+ [platforms](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/tree/master/flow/platforms)
34
+ used by the designs. If you add a new PDK platform, be sure to add at
35
+ least one design that uses it.
36
+
37
+ ## Contributing Scripts and Code
38
+
39
+ We follow the [Google C++ style guide](https://google.github.io/styleguide/cppguide.html).
40
+ If you find code in our project that does *not* follow this guide, then within each file that
41
+ you edit, follow the style in that file.
42
+
43
+ Please pay careful attention to the
44
+ [tool checklist](https://openroad.readthedocs.io/en/latest/contrib/DeveloperGuide.html#tool-checklist) for all code. If you want
45
+ to add or improve functionality in OpenROAD, please start with the
46
+ top-level [app](https://github.com/The-OpenROAD-Project/OpenROAD/) repo. You
47
+ can see in the `src` directory that submodules exist pointing to tested
48
+ versions of the other relevant repos in the project. Please look at the
49
+ tool workflow in the developer guide [document](DeveloperGuide.md)
50
+ to work with the app and its submodule repos in an efficient way.
51
+
52
+ Please run clang-format on all the C++ source files that you change, before
53
+ committing. In the root directory of the OpenROAD repository there is the
54
+ file `.clang-format` that defines all coding formatting rules.
55
+
56
+ Please pay attention to the
57
+ [test directory](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/test)
58
+ and be sure to add tests for any code changes that you make, using open-source
59
+ PDK and design information. We provide the `nangate45` PDK in
60
+ the OpenROAD-flow-scripts repo to help with this. Pull requests with
61
+ code changes are unlikely to be accepted without accompanying test
62
+ cases. There are many
63
+ [examples](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/test/gcd_nangate45.tcl)
64
+ tests. Each repo has a test directory as well with tests you should run
65
+ and add to if you modify something in one of the submodules.
66
+
67
+ For changes that claim to improve QoR or PPA, please run many tests and
68
+ ensure that the improvement is not design-specific. There are designs in
69
+ the
70
+ [OpenROAD-flow-scripts](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/)
71
+ repo which can be used unless the improvement is technology-specific.
72
+
73
+ Do not add runtime or build dependencies without serious thought. For a
74
+ project like OpenROAD with many application subcomponents, the software
75
+ architecture can quickly get out of control. Changes with lots of new
76
+ dependencies which are not necessary are less likely to be integrated.
77
+
78
+ If you want to add Tcl code to define a new tool command, look at [pdngen](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/pdn)
79
+ as an example of how to do so. Take a look at the
80
+ [CMakeLists file](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/CMakeLists.txt)
81
+ which automatically sources the Tcl code and the
82
+ [Tcl file](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pdn/src/pdn.tcl)
83
+ itself.
84
+
85
+ To accept contributions, we require each commit to be made with a DCO (Developer
86
+ Certificate of Origin) attached.
87
+ When you commit you add the `-s` flag to your commit. For example:
88
+
89
+ ``` shell
90
+ git commit -s -m "test dco with -s"
91
+ ```
92
+
93
+ This will append a statement to your commit comment that attests to the DCO. GitHub
94
+ has built in the `-s` option to its command line since use of this is so
95
+ pervasive. The promise is very basic, certifying that you know that you
96
+ have the right to commit the code. Please read the [full statement
97
+ here](https://developercertificate.org/).
98
+
99
+ ## Questions
100
+
101
+ Please refer to our [FAQs](../user/FAQS.md).
data/markdown/ORFS_docs/ORFS-git_guide.md ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Git Quickstart
2
+
3
+ This tutorial serves as a quickstart to Git and contributing to our repository. If you have not already set up OpenROAD-flow-scripts, please follow the instructions [here](../../index.md#build-or-installing-orfs-dependencies).
4
+
5
+ ```{tip} This basic tutorial gives instruction for basic password Git authentication.
6
+ If you would like to setup SSH authentication, please follow this [guide](https://help.github.com/set-up-git-redirect).
7
+ ```
8
+
9
+ ## Forking
10
+
11
+ You will need your own fork to work on the code. Go to the `OpenROAD-flow-scripts` project
12
+ [page](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts) and hit the `Fork` button. You will
13
+ want to clone your fork to your machine:
14
+
15
+ ```shell
16
+ git clone https://github.com/your-user-name/OpenROAD-flow-scripts.git
17
+ cd OpenROAD-flow-scripts
18
+ git remote add upstream https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git
19
+ git fetch upstream
20
+ ```
21
+
22
+ This creates the directory `OpenROAD-flow-scripts` and connects your repository to
23
+ the upstream (master project) *OpenROAD-flow-scripts* repository.
24
+
25
+ ## Creating a branch
26
+
27
+ You want your master branch to reflect only production-ready code, so create a
28
+ feature branch for making your changes. For example:
29
+
30
+ ```shell
31
+ git checkout master && git branch shiny-new-feature
32
+ git checkout shiny-new-feature
33
+ # Or equivalently,
34
+ git checkout master && checkout -b shiny-new-feature
35
+ ```
36
+
37
+ This changes your working directory to the shiny-new-feature branch. Keep any
38
+ changes in this branch specific to one bug or feature so it is clear
39
+ what the branch brings to OpenROAD-flow-scripts. You can have many shiny-new-features
40
+ and switch in between them using the git checkout command.
41
+
42
+ When creating this branch, make sure your master branch is up to date with
43
+ the latest upstream master version. To update your local master branch, you
44
+ can do:
45
+
46
+ ```shell
47
+ git checkout master
48
+ git pull upstream master
49
+ ```
50
+
51
+ When you want to update the feature branch with changes in master after
52
+ you created the branch, check the section on
53
+ [updating a PR](#updating-your-pull-request).
54
+
55
+ ## Committing your code
56
+ Keep style fixes to a separate commit to make your pull request more readable. Once you've made changes, you can see them by typing:
57
+
58
+ ```shell
59
+ git status
60
+ ```
61
+
62
+ If you have created a new file, it is not being tracked by git. Add it by typing:
63
+ ```shell
64
+ git add path/to/file-to-be-added.py
65
+ ```
66
+
67
+ Doing `git status` again should give something like:
68
+ ```shell
69
+ # On branch shiny-new-feature
70
+ #
71
+ # modified: /relative/path/to/file-you-added.py
72
+ #
73
+ ```
74
+
75
+ Finally, commit your changes to your local repository with an explanatory commit
76
+ message. Do note the `-s` option is needed for developer signoff.
77
+ ```shell
78
+ git commit -s -m "your commit message goes here"
79
+ ```
80
+
81
+ ## Pushing your changes
82
+
83
+ When you want your changes to appear publicly on your GitHub page, push your
84
+ forked feature branch's commits:
85
+
86
+ ```shell
87
+ git push origin shiny-new-feature
88
+ ```
89
+
90
+ Here `origin` is the default name given to your remote repository on GitHub.
91
+ You can see the remote repositories:
92
+
93
+ ```shell
94
+ git remote -v
95
+ ```
96
+
97
+ If you added the upstream repository as described above you will see something
98
+ like:
99
+
100
+ ```shell
101
+ origin https://github.com/your-user-name/OpenROAD-flow-scripts.git (fetch)
102
+ origin https://github.com/your-user-name/OpenROAD-flow-scripts.git (push)
103
+ upstream https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git (fetch)
104
+ upstream https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git (push)
105
+ ```
106
+
107
+ Now your code is on GitHub, but it is not yet a part of the OpenROAD-flow-scripts project. For that to
108
+ happen, a pull request needs to be submitted on GitHub.
109
+
110
+ ## Review your code
111
+
112
+ When you're ready to ask for a code review, file a pull request. Before you do, once
113
+ again make sure that you have followed all the guidelines outlined in the [Developer's Guide](./DeveloperGuide.md)
114
+ regarding code style, tests, performance tests, and documentation. You should also
115
+ double check your branch changes against the branch it was based on:
116
+
117
+ 1. Navigate to your repository on GitHub -- https://github.com/your-user-name/OpenROAD-flow-scripts
118
+ 1. Click on `Branches`
119
+ 1. Click on the `Compare` button for your feature branch
120
+ 1. Select the `base` and `compare` branches, if necessary. This will be `master` and
121
+ `shiny-new-feature`, respectively.
122
+
123
+ ## Submitting the pull request
124
+
125
+ If everything looks good, you are ready to make a pull request. A pull request is how
126
+ code from a local repository becomes available to the GitHub community and can be looked
127
+ at and eventually merged into the master version. This pull request and its associated
128
+ changes will eventually be committed to the master branch and available in the next
129
+ release. To submit a pull request:
130
+
131
+ 1. Navigate to your repository on GitHub
132
+ 1. Click on the ``Compare & pull request`` button
133
+ 1. You can then click on ``Commits`` and ``Files Changed`` to make sure everything looks
134
+ okay one last time
135
+ 1. Write a description of your changes in the ``Preview Discussion`` tab
136
+ 1. Click ``Send Pull Request``.
137
+
138
+ This request then goes to the repository maintainers, and they will review
139
+ the code.
140
+
141
+ ## Updating your pull request
142
+
143
+ Based on the review you get on your pull request, you will probably need to make
144
+ some changes to the code. In that case, you can make them in your branch,
145
+ add a new commit to that branch, push it to GitHub, and the pull request will be
146
+ automatically updated. Pushing them to GitHub again is done by:
147
+
148
+ ```shell
149
+ git push origin shiny-new-feature
150
+ ```
151
+
152
+ This will automatically update your pull request with the latest code and restart the
153
+ [Continuous Integration](./CI.md) tests.
154
+
155
+ Another reason you might need to update your pull request is to solve conflicts
156
+ with changes that have been merged into the master branch since you opened your
157
+ pull request.
158
+
159
+ To do this, you need to `merge upstream master` in your branch:
160
+
161
+ ```shell
162
+ git checkout shiny-new-feature
163
+ git fetch upstream
164
+ git merge upstream/master
165
+ ```
166
+
167
+ If there are no conflicts (or they could be fixed automatically), a file with a
168
+ default commit message will open, and you can simply save and quit this file.
169
+
170
+ If there are merge conflicts, you need to solve those conflicts. See
171
+ this [article](https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/)
172
+ for an explanation on how to do this.
173
+ Once the conflicts are merged and the files where the conflicts were solved are
174
+ added, you can run ``git commit`` to save those fixes.
175
+
176
+ If you have uncommitted changes at the moment you want to update the branch with
177
+ master, you will need to ``stash`` them prior to updating.
178
+
179
+ ```{seealso}
180
+ See the stash [docs](https://git-scm.com/book/en/v2/Git-Tools-Stashing-and-Cleaning).
181
+ ```
182
+ This will effectively store your changes and they can be reapplied after updating.
183
+
184
+ After the feature branch has been updated locally, you can now update your pull
185
+ request by pushing to the branch on GitHub:
186
+
187
+ ```shell
188
+ git push origin shiny-new-feature
189
+ ```
190
+
191
+ ## Tips for a successful pull request
192
+
193
+ If you have made it to the `Review your code` phase, one of the core contributors may
194
+ take a look. Please note however that a handful of people are responsible for reviewing
195
+ all of the contributions, which can often lead to bottlenecks.
196
+
197
+ To improve the chances of your pull request being reviewed, you should:
198
+
199
+ - **Reference an open issue** for non-trivial changes to clarify the PR's purpose
200
+ - **Ensure you have appropriate tests**. These should be the first part of any PR
201
+ - **Keep your pull requests as simple as possible**. Larger PRs take longer to review
202
+ - **Ensure that CI is in a green state**. Reviewers may not even look otherwise
203
+ - **Keep updating your pull request**, either by request or every few days
204
+
205
+ ## Acknowledgements
206
+
207
+ This page has been adapted from [pandas Developer Guide](https://pandas.pydata.org/docs/development/contributing.html).
data/markdown/ORFS_docs/ORFS-notebooks.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Colab Quickstart
2
+
3
+ Notebook-based packaging offers three main benefits:
4
+ 1. Colab is completely free to use and can be accessed from any web browser.
5
+ 1. Colab notebooks can be easily shared with others, making it a great
6
+ tool for teams to collaborate and manage OpenROAD design runs.
7
+ 1. The notebook can easily be modified to be used for on-premise servers or
8
+ notebook-based cloud providers such as LambdaLabs/Paperspace.
9
+
10
+ We provide two notebooks for a quickstart to OpenROAD-flow-scripts functionality
11
+ as follows:
12
+
13
+ ## OpenROAD-flow-scripts Automated RTL-GDSII Flow
14
+
15
+ The notebook for the automated flow for `gcd` design in `nangate45` technology node can be found [here](https://colab.research.google.com/drive/1bfcvqOnbw8q7FmSONLw8q7-yBVvKsQot).
16
+
17
+ ## AutoTuner Flow
18
+
19
+ The notebook for the OpenROAD-flow-scripts AutoTuner flow for `gcd` design in `sky130hd` technology node can be found [here](https://colab.research.google.com/drive/1wye0osn34YVWPvTrfBTftjOfGOtF3ABe).
data/markdown/ORFS_docs/ORFS-userguide.md ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OpenRoad Flow Scripts User Guide
2
+
3
+ The OpenROAD Project uses three tools to perform automated RTL-to-GDS layout generation:
4
+
5
+ 1. [yosys](https://github.com/The-OpenROAD-Project/yosys): Logic
6
+ Synthesis
7
+ 2. [OpenROAD](https://github.com/The-OpenROAD-Project/OpenROAD):
8
+ Floorplanning through Detailed Routing
9
+ 3. [KLayout](https://www.klayout.de/): GDS merge, DRC and LVS (public
10
+ PDKs)
11
+
12
+ To automate RTL-to-GDS we provide
13
+ [OpenROAD Flow](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts),
14
+ which contains scripts that integrate the three tools.
15
+
16
+ ## Code Organization
17
+
18
+ The [OpenROAD Flow](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts)
19
+ repository serves as an example RTL-to-GDS flow using the OpenROAD
20
+ tools. The script `build_openroad.sh` in the repository will
21
+ automatically build the OpenROAD toolchain.
22
+
23
+ The two main directories are:
24
+
25
+ 1. `tools/`: contains the source code for the entire yosys and
26
+ [OpenROAD App](https://github.com/The-OpenROAD-Project/OpenROAD)
27
+ (both via submodules) as well as other tools required for the flow.
28
+ 3. `flow/`: contains reference recipes and scripts to run designs
29
+ through the flow. It also contains public platforms and test
30
+ designs.
31
+
32
+ ## Setup
33
+
34
+ See [Getting Started](../index.md#getting-started-with-openroad-flow-scripts) guide.
35
+
36
+ ## Using the OpenROAD Flow
37
+
38
+ See the documentation [here](../tutorials/FlowTutorial.md) for details about the
39
+ flow and how to run designs through the flow.
40
+
41
+ ## Using the OpenROAD App
42
+
43
+ See the documentation [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/README.md) for details about the app and
44
+ the available features and commands.
data/markdown/OR_docs/OR_getting_involved.md ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Getting Involved
2
+
3
+ Thank you for taking the time to read this document and to contribute.
4
+ The OpenROAD project will not reach all of its objectives without help!
5
+
6
+ Possible ways to contribute to the OpenROAD application:
7
+
8
+ - Tool improvements
9
+ - New tools
10
+ - Improvements to documentation, including this document
11
+ - Star our project and repos so we can see the number of people
12
+ who are interested
13
+
14
+ ## Licensing Contributions
15
+
16
+ As much as possible, all contributions should be licensed using the BSD3
17
+ license. You can propose another license if you must, but contributions
18
+ made with BSD3 fit best with the spirit of OpenROAD's permissive open-source
19
+ philosophy. We do have exceptions in the project, but over time we hope
20
+ that all contributions will be BSD3, or some other permissive license such as MIT
21
+ or Apache2.0.
22
+
23
+ ## Contributing Scripts and Code
24
+
25
+ We follow the [Google C++ style guide](https://google.github.io/styleguide/cppguide.html).
26
+ If you find code in our project that does *not* follow this guide, then within each file that
27
+ you edit, follow the style in that file.
28
+
29
+ Please pay careful attention to the
30
+ [tool checklist](DeveloperGuide.md#tool-checklist) for all code. If you want
31
+ to add or improve functionality in OpenROAD, please start with the
32
+ top-level [app](https://github.com/The-OpenROAD-Project/OpenROAD/) repo. You
33
+ can see in the `src` directory that submodules exist pointing to tested
34
+ versions of the other relevant repos in the project. Please look at the
35
+ tool workflow in the developer guide [document](DeveloperGuide.md)
36
+ to work with the app and its submodule repos in an efficient way.
37
+
38
+ Please run clang-format on all the C++ source files that you change, before
39
+ committing. In the root directory of the OpenROAD repository there is the
40
+ file `.clang-format` that defines all coding formatting rules.
41
+
42
+ Please pay attention to the
43
+ [test directory](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/test)
44
+ and be sure to add tests for any code changes that you make, using open-source
45
+ PDK and design information. We provide the `nangate45` PDK in
46
+ the OpenROAD-flow-scripts repo to help with this. Pull requests with
47
+ code changes are unlikely to be accepted without accompanying test
48
+ cases. There are many
49
+ [examples](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/test/gcd_nangate45.tcl)
50
+ tests. Each repo has a test directory as well with tests you should run
51
+ and add to if you modify something in one of the submodules.
52
+
53
+ For changes that claim to improve QoR or PPA, please run many tests and
54
+ ensure that the improvement is not design-specific. There are designs in
55
+ the
56
+ [OpenROAD-flow-scripts](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/)
57
+ repo which can be used unless the improvement is technology-specific.
58
+
59
+ Do not add runtime or build dependencies without serious thought. For a
60
+ project like OpenROAD with many application subcomponents, the software
61
+ architecture can quickly get out of control. Changes with lots of new
62
+ dependencies which are not necessary are less likely to be integrated.
63
+
64
+ If you want to add Tcl code to define a new tool command, look at [pdngen](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/pdn)
65
+ as an example of how to do so. Take a look at the
66
+ [CMake file](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/CMakeLists.txt)
67
+ which automatically sources the Tcl code and the
68
+ [Tcl file](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pdn/src/pdn.tcl)
69
+ itself.
70
+
71
+ To accept contributions, we require each commit to be made with a DCO (Developer
72
+ Certificate of Origin) attached.
73
+ When you commit you add the `-s` flag to your commit. For example:
74
+
75
+ ``` shell
76
+ git commit -s -m "test dco with -s"
77
+ ```
78
+
79
+ This will append a statement to your commit comment that attests to the DCO. GitHub
80
+ has built in the `-s` option to its command line since use of this is so
81
+ pervasive. The promise is very basic, certifying that you know that you
82
+ have the right to commit the code. Please read the [full statement
83
+ here](https://developercertificate.org/).
84
+
85
+ ## Questions
86
+
87
+ Please refer to our [FAQs](../user/FAQS.md).
data/markdown/OR_docs/OR_install_instructions.md ADDED
@@ -0,0 +1,385 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # This script builds the OpenROAD Flow tools locally from source or in a Docker image.
3
+
4
+ # Exit on first error, do not allow unbound variables
5
+ set -eu
6
+
7
+ # Make sure we are on the correct folder before beginning
8
+ cd "$(dirname $(readlink -f $0))"
9
+
10
+ # Set up paths to dependencies, such as cmake and boost. Safe no-op
11
+ # if tools were set up elsewhere in the path.
12
+ . dev_env.sh
13
+
14
+ # Defaults variable values
15
+ NICE=""
16
+
17
+ OPENROAD_APP_REMOTE="origin"
18
+ OPENROAD_APP_BRANCH="master"
19
+
20
+ INSTALL_PATH="$(pwd)/tools/install"
21
+
22
+ YOSYS_USER_ARGS=""
23
+ YOSYS_ARGS="CONFIG=gcc"
24
+
25
+ OPENROAD_APP_USER_ARGS=""
26
+ OPENROAD_APP_ARGS=""
27
+
28
+ LSORACLE_USER_ARGS=""
29
+ LSORACLE_ARGS="\
30
+ -D CMAKE_BUILD_TYPE=RELEASE \
31
+ -D YOSYS_INCLUDE_DIR=$(pwd)/tools/yosys \
32
+ -D YOSYS_PLUGIN=ON \
33
+ "
34
+
35
+ DOCKER_OS_NAME="ubuntu22.04"
36
+ PROC=-1
37
+
38
+ function usage() {
39
+ cat << EOF
40
+
41
+ Usage: $0 [-h|--help] [-o|--local] [-l|--latest]
42
+ [--or_branch BRANCH_NAME] [--or_repo REPO_URL] [--no_init]
43
+ [-n|--nice] [-t|--threads N]
44
+ [--yosys-args-overwrite] [--yosys-args STRING]
45
+ [--openroad-args-overwrite] [--openroad-args STRING]
46
+ [--lsoracle-args-overwrite] [--lsoracle-args STRING]
47
+ [--install-path PATH] [--clean] [--clean-force]
48
+
49
+ [-c|--copy-platforms]
50
+
51
+ Options:
52
+ -h, --help Print this help message.
53
+
54
+ -o, --local Build locally instead of building a Docker image.
55
+
56
+ -l, --latest Use the head of branch --or_branch or 'master'
57
+ by default for tools/OpenROAD.
58
+
59
+ --or_branch BRANCH_NAME Use the head of branch BRANCH for tools/OpenROAD.
60
+
61
+ --or_repo REPO_URL Use a fork at REPO-URL (https/ssh) for tools/OpenROAD.
62
+
63
+ --no_init Skip initializing submodules.
64
+
65
+ -t, --threads N Use N cpus when compiling software.
66
+
67
+ -n, --nice Nice all jobs. Use all cpus unless --threads is
68
+ also given, then use N threads.
69
+
70
+ --yosys-args-overwrite Do not use default flags set by this scrip during
71
+ Yosys compilation.
72
+
73
+ --yosys-args STRING Aditional compilation flags for Yosys compilation.
74
+
75
+ --openroad-args-overwrite
76
+ Do not use default flags set by this scrip during
77
+ OpenROAD app compilation.
78
+
79
+ --openroad-args STRING Aditional compilation flags for OpenROAD app
80
+ compilation.
81
+
82
+ --lsoracle-enable Compile LSOracle. Disable by default as it is not
83
+ currently used on the flow.
84
+
85
+ --lsoracle-args-overwrite
86
+ Do not use default flags set by this script during
87
+ LSOracle compilation.
88
+
89
+ --lsoracle-args STRING Aditional compilation flags for LSOracle
90
+ compilation.
91
+
92
+ --install-path PATH Path to install tools. Default is ${INSTALL_PATH}.
93
+
94
+ --clean Call git clean interactively before compile.
95
+ Useful to remove old build files.
96
+
97
+ --clean-force Call git clean before compile. WARNING: this option
98
+ will not ask for confirmation. Useful to remove
99
+ old build files.
100
+
101
+
102
+ Options valid only for Docker builds:
103
+ -c, --copy-platforms Copy platforms to inside docker image.
104
+
105
+ --os=DOCKER_OS_NAME Choose beween ubuntu22.04 (default), ubuntu20.04.
106
+
107
+ This script builds the OpenROAD tools: openroad, yosys and yosys plugins.
108
+ By default, the tools will be built from the linked submodule hashes.
109
+
110
+ EOF
111
+ }
112
+
113
+ # Parse arguments
114
+ __CMD="$0 $@"
115
+ while (( "$#" )); do
116
+ case "$1" in
117
+ -h|--help)
118
+ usage 2> /dev/null
119
+ exit
120
+ ;;
121
+ -o|--local)
122
+ LOCAL_BUILD=1
123
+ ;;
124
+ -l|--latest)
125
+ USE_OPENROAD_APP_LATEST=1
126
+ ;;
127
+ --or_branch)
128
+ OPENROAD_APP_BRANCH="$2"
129
+ shift
130
+ ;;
131
+ --or_repo)
132
+ OPENROAD_APP_GIT_URL="$2"
133
+ shift
134
+ ;;
135
+ --no_init)
136
+ OPENROAD_FLOW_NO_GIT_INIT=1
137
+ ;;
138
+ -t|--threads)
139
+ PROC="$2"
140
+ shift
141
+ ;;
142
+ -n|--nice)
143
+ NICE="nice"
144
+ ;;
145
+ -c|--copy-platforms)
146
+ DOCKER_COPY_PLATFORMS=1
147
+ ;;
148
+ --yosys-args-overwrite)
149
+ YOSYS_OVERWIRTE_ARGS=1
150
+ ;;
151
+ --yosys-args)
152
+ YOSYS_USER_ARGS="$2"
153
+ shift
154
+ ;;
155
+ --openroad-args-overwrite)
156
+ OPENROAD_APP_OVERWIRTE_ARGS=1
157
+ ;;
158
+ --openroad-args)
159
+ OPENROAD_APP_USER_ARGS="$2"
160
+ shift
161
+ ;;
162
+ --lsoracle-enable)
163
+ LSORACLE_ENABLE=1
164
+ ;;
165
+ --lsoracle-args-overwrite)
166
+ LSORACLE_OVERWIRTE_ARGS=1
167
+ ;;
168
+ --lsoracle-args)
169
+ LSORACLE_USER_ARGS="$2"
170
+ shift
171
+ ;;
172
+ --install-path)
173
+ INSTALL_PATH="$2"
174
+ shift
175
+ ;;
176
+ --clean)
177
+ CLEAN_BEFORE=1
178
+ ;;
179
+ --clean-force)
180
+ CLEAN_BEFORE=1
181
+ CLEAN_FORCE=1
182
+ ;;
183
+ --os=* )
184
+ DOCKER_OS_NAME="${1#*=}"
185
+ ;;
186
+ -*|--*) # unsupported flags
187
+ echo "[ERROR FLW-0005] Unsupported flag $1." >&2
188
+ usage 2> /dev/null
189
+ exit 1
190
+ ;;
191
+ esac
192
+ shift
193
+ done
194
+
195
+ if [[ "$PROC" == "-1" ]]; then
196
+ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
197
+ PROC=$(nproc --all)
198
+ elif [[ "$OSTYPE" == "darwin"* ]]; then
199
+ PROC=$(sysctl -n hw.ncpu)
200
+ else
201
+ cat << EOF
202
+ [WARNING FLW-0025] Unsupported OSTYPE: cannot determine number of host CPUs"
203
+ Defaulting to 2 threads. Use --threads N to use N threads"
204
+ EOF
205
+ PROC=2
206
+ fi
207
+ fi
208
+
209
+ # Only add install prefix variables after parsing arguments.
210
+ YOSYS_ARGS+=" PREFIX=${INSTALL_PATH}/yosys"
211
+ OPENROAD_APP_ARGS+=" -D CMAKE_INSTALL_PREFIX=${INSTALL_PATH}/OpenROAD"
212
+ if [ -n "$CMAKE_INSTALL_RPATH" ]; then
213
+ OPENROAD_APP_ARGS+=" -D CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}"
214
+ OPENROAD_APP_ARGS+=" -D CMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
215
+ fi
216
+ LSORACLE_ARGS+=" \
217
+ -D YOSYS_SHARE_DIR=${INSTALL_PATH}/yosys/share/yosys \
218
+ -D CMAKE_INSTALL_PREFIX=${INSTALL_PATH}/LSOracle \
219
+ "
220
+
221
+ __args_setup() {
222
+ if [ ! -z "${YOSYS_OVERWIRTE_ARGS+x}" ]; then
223
+ echo "[INFO FLW-0014] Overwriting Yosys compilation flags."
224
+ YOSYS_ARGS="${YOSYS_USER_ARGS}"
225
+ else
226
+ YOSYS_ARGS+=" ${YOSYS_USER_ARGS}"
227
+ fi
228
+
229
+ if [ ! -z "${OPENROAD_APP_OVERWIRTE_ARGS+x}" ]; then
230
+ echo "[INFO FLW-0015] Overwriting OpenROAD app compilation flags."
231
+ OPENROAD_APP_ARGS="${OPENROAD_APP_USER_ARGS}"
232
+ else
233
+ OPENROAD_APP_ARGS+=" ${OPENROAD_APP_USER_ARGS}"
234
+ fi
235
+
236
+ if [ ! -z "${LSORACLE_OVERWIRTE_ARGS+x}" ]; then
237
+ echo "[INFO FLW-0016] Overwriting LSOracle compilation flags."
238
+ LSORACLE_ARGS="${LSORACLE_USER_ARGS}"
239
+ else
240
+ LSORACLE_ARGS+=" ${LSORACLE_USER_ARGS}"
241
+ fi
242
+ }
243
+
244
+ __docker_build()
245
+ {
246
+ echo "[INFO FLW-0020] Building docker image for OpenROAD Flow."
247
+ if [ ! -z "${DOCKER_COPY_PLATFORMS+x}" ]; then
248
+ cp .dockerignore{,.bak}
249
+ sed -i '/flow\/platforms/d' .dockerignore
250
+ fi
251
+ ./etc/DockerHelper.sh create -target=dev -os="${DOCKER_OS_NAME}" -threads="${PROC}"
252
+ ./etc/DockerHelper.sh create -target=builder -os="${DOCKER_OS_NAME}" -threads="${PROC}"
253
+ if [ ! -z "${DOCKER_COPY_PLATFORMS+x}" ]; then
254
+ mv .dockerignore{.bak,}
255
+ fi
256
+ }
257
+
258
+ __local_build()
259
+ {
260
+ if [[ "$OSTYPE" == "darwin"* ]]; then
261
+ export PATH="$(brew --prefix bison)/bin:$(brew --prefix flex)/bin:$(brew --prefix tcl-tk)/bin:$PATH"
262
+ export CMAKE_PREFIX_PATH=$(brew --prefix or-tools)
263
+ fi
264
+ if [[ -f "/opt/rh/rh-python38/enable" ]]; then
265
+ set +u
266
+ source /opt/rh/rh-python38/enable
267
+ set -u
268
+ fi
269
+ if [[ -f "/opt/rh/devtoolset-8/enable" ]]; then
270
+ # the scl script has unbound variables
271
+ set +u
272
+ source /opt/rh/devtoolset-8/enable
273
+ set -u
274
+ fi
275
+
276
+ echo "[INFO FLW-0017] Compiling Yosys."
277
+ ${NICE} make install -C tools/yosys -j "${PROC}" ${YOSYS_ARGS}
278
+
279
+ echo "[INFO FLW-0018] Compiling OpenROAD."
280
+ eval ${NICE} cmake tools/OpenROAD -B tools/OpenROAD/build ${OPENROAD_APP_ARGS}
281
+ ${NICE} cmake --build tools/OpenROAD/build --target install -j "${PROC}"
282
+
283
+ if [ ! -z "${LSORACLE_ENABLE+x}" ]; then
284
+ echo "[INFO FLW-0019] Compiling LSOracle."
285
+ ${NICE} cmake tools/LSOracle -B tools/LSOracle/build ${LSORACLE_ARGS}
286
+ ${NICE} cmake --build tools/LSOracle/build --target install -j "${PROC}"
287
+ fi
288
+ }
289
+
290
+ __update_openroad_app_remote()
291
+ (
292
+ cd tools/OpenROAD
293
+ remotes=$(git remote)
294
+ SAVEIFS=$IFS
295
+ IFS=$'\n'
296
+ remotes=($remotes)
297
+ IFS=$SAVEIFS
298
+ if [[ ! " ${remotes[@]} " =~ " ${OPENROAD_APP_REMOTE} " ]]; then
299
+ git remote add "${OPENROAD_APP_REMOTE}" "${OPENROAD_APP_GIT_URL}"
300
+ fi
301
+ )
302
+
303
+ __change_openroad_app_remote()
304
+ {
305
+ base_url=$(dirname "${OPENROAD_APP_GIT_URL}")
306
+ if [[ ${base_url##*/} = $base_url ]]; then
307
+ OPENROAD_APP_REMOTE=${base_url##*:}
308
+ else
309
+ OPENROAD_APP_REMOTE=${base_url##*/}
310
+ fi
311
+ __update_openroad_app_remote
312
+ }
313
+
314
+ __update_openroad_app_latest()
315
+ (
316
+ cd tools/OpenROAD
317
+ git fetch "${OPENROAD_APP_REMOTE}"
318
+ git checkout "${OPENROAD_APP_REMOTE}/${OPENROAD_APP_BRANCH}"
319
+ git pull "${OPENROAD_APP_REMOTE}" "${OPENROAD_APP_BRANCH}"
320
+ git submodule update --init --recursive
321
+ )
322
+
323
+ __common_setup()
324
+ {
325
+ # Clone repositories
326
+ if [ -z "${OPENROAD_FLOW_NO_GIT_INIT+x}" ]; then
327
+ echo "[INFO FLW-0002] Updating git submodules."
328
+ git submodule update --init --recursive
329
+ fi
330
+
331
+ if [ ! -z "${OPENROAD_APP_GIT_URL+x}" ]; then
332
+ echo -n "[INFO FLW-0003] Changing OpenROAD app remote to"
333
+ echo " ${OPENROAD_APP_GIT_URL}."
334
+ __change_openroad_app_remote
335
+ fi
336
+
337
+ if [ ! -z "${USE_OPENROAD_APP_LATEST+x}" ] || [ "${OPENROAD_APP_BRANCH}" != "master" ]; then
338
+ echo -n "[INFO FLW-0004] Updating OpenROAD app to the HEAD"
339
+ echo " of ${OPENROAD_APP_REMOTE}/${OPENROAD_APP_BRANCH}."
340
+ __update_openroad_app_latest
341
+ fi
342
+ }
343
+
344
+ __logging()
345
+ {
346
+ local log_file="build_openroad.log"
347
+ echo "[INFO FLW-0027] Saving logs to ${log_file}"
348
+ echo "[INFO FLW-0028] $__CMD"
349
+ exec > >(tee -i "${log_file}")
350
+ exec 2>&1
351
+ }
352
+
353
+ __cleanup()
354
+ {
355
+ if [ ! -z "${CLEAN_FORCE+x}" ]; then
356
+ CLEAN_CMD="-x -d --force"
357
+ else
358
+ CLEAN_CMD="-x -d --interactive"
359
+ fi
360
+ echo "[INFO FLW-0026] Cleaning up previous binaries and build files."
361
+ git clean ${CLEAN_CMD} tools
362
+ YOSYS_ABC_PATH="tools/yosys/abc"
363
+ if [[ -d "${YOSYS_ABC_PATH}" ]]; then
364
+ echo "Entering '${YOSYS_ABC_PATH}'"
365
+ git --work-tree=${YOSYS_ABC_PATH} --git-dir=${YOSYS_ABC_PATH}/.git clean ${CLEAN_CMD}
366
+ fi
367
+ git submodule foreach --recursive git clean ${CLEAN_CMD}
368
+ }
369
+
370
+ __logging
371
+ if [ ! -z "${CLEAN_BEFORE+x}" ]; then
372
+ __cleanup
373
+ fi
374
+ __args_setup
375
+ __common_setup
376
+
377
+ # Choose install method
378
+ if [ -z "${LOCAL_BUILD+x}" ] && command -v docker &> /dev/null; then
379
+ echo -n "[INFO FLW-0000] Using docker build method."
380
+ __docker_build
381
+ else
382
+ echo -n "[INFO FLW-0001] Using local build method."
383
+ echo " This will create binaries at 'tools/install' unless overwritten."
384
+ __local_build
385
+ fi
data/markdown/OR_docs/OR_readme.md ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Welcome to OpenROAD's documentation!
2
+
3
+ The OpenROAD ("Foundations and Realization of Open, Accessible Design")
4
+ project was launched in June 2018 within the DARPA IDEA program. OpenROAD
5
+ aims to bring down the barriers of cost, expertise and unpredictability that
6
+ currently block designers' access to hardware implementation in advanced
7
+ technologies. The project team (Qualcomm, Arm and multiple universities and
8
+ partners, led by UC San Diego) is developing a fully autonomous, open-source
9
+ tool chain for digital SoC layout generation, focusing on
10
+ the RTL-to-GDSII phase of system-on-chip design. Thus,
11
+ OpenROAD holistically attacks the multiple facets of today's design cost
12
+ crisis: engineering resources, design tool licenses, project schedule,
13
+ and risk.
14
+
15
+ The IDEA program targets no-human-in-loop (NHIL) design, with 24-hour
16
+ turnaround time and zero loss of power-performance-area (PPA) design quality.
17
+
18
+ The NHIL target requires tools to adapt and auto-tune successfully to flow
19
+ completion, without (or, with minimal) human intervention. Machine
20
+ intelligence augments human expertise through efficient modeling and
21
+ prediction of flow and optimization outcomes throughout the synthesis, placement
22
+ and routing process. This is complemented by development of metrics
23
+ and machine learning infrastructure.
24
+
25
+ The 24-hour runtime target implies that problems must be strategically
26
+ decomposed throughout the design process, with clustered and partitioned
27
+ subproblems being solved and recomposed through intelligent distribution
28
+ and management of computational resources. This ensures that the NHIL design
29
+ optimization is performed within its available `[threads * hours]` "box" of
30
+ resources. Decomposition that enables parallel and distributed search over
31
+ cloud resources incurs a quality-of-results loss, but this is subsequently
32
+ recovered through improved flow predictability and enhanced optimization.
33
+
34
+ For a technical description of the OpenROAD flow, please refer to our DAC-2019 paper:
35
+ [Toward an Open-Source Digital Flow: First Learnings from the OpenROAD Project](https://vlsicad.ucsd.edu/Publications/Conferences/371/c371.pdf).
36
+ The paper is also available from [ACM Digital Library](https://dl.acm.org/doi/10.1145/3316781.3326334).
37
+ Other publications and presentations are
38
+ linked [here](https://theopenroadproject.org/publications/).
39
+
40
+ ## Documentation
41
+
42
+ The OpenROAD Project has two releases:
43
+
44
+ - Application ([github](https://github.com/The-OpenROAD-Project/OpenROAD)) ([docs](main/README.md)): The application is a standalone binary for digital place and route that can be used by any other RTL-GDSII flow controller.
45
+ - Flow ([github](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts)) ([docs](https://openroad-flow-scripts.readthedocs.io/en/latest/)): This is the native OpenROAD flow that consists of a set of integrated scripts for an autonomous RTL-GDSII flow using OpenROAD and other open-source tools.
46
+
47
+ ## Code of conduct
48
+
49
+ Please read our code of conduct [here](main/CODE_OF_CONDUCT.md).
50
+
51
+ ## How to contribute
52
+
53
+ If you are willing to **contribute**, see the
54
+ [Getting Involved](contrib/GettingInvolved.md) section.
55
+
56
+ If you are a **developer** with EDA background, learn more about how you
57
+ can use OpenROAD as the infrastructure for your tools in the
58
+ [Developer Guide](contrib/DeveloperGuide.md) section.
59
+
60
+ OpenROAD uses Git for version control and contributions.
61
+ Get familiarised with a quickstart tutorial to contribution [here](contrib/GitGuide.md).
62
+
63
+ ## How to get in touch
64
+
65
+ We maintain the following channels for communication:
66
+
67
+ - Project homepage and news: <https://theopenroadproject.org>
68
+ - Twitter: <https://twitter.com/OpenROAD_EDA>
69
+ - Issues and bugs:
70
+ - OpenROAD: <https://github.com/The-OpenROAD-Project/OpenROAD/issues>
71
+ - Discussions:
72
+ - OpenROAD: <https://github.com/The-OpenROAD-Project/OpenROAD/discussions>
73
+ - Inquiries: openroad@ucsd.edu
74
+
75
+ See also our [FAQs](user/FAQS.md).
76
+
77
+ ## Site Map
78
+
79
+ ```{tableofcontents}
80
+ ```
data/markdown/OR_docs/OR_userguide.md ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OpenROAD User Guide
2
+
3
+ OpenROAD is run using Tcl scripts. The following commands are used to read
4
+ and write design data.
5
+
6
+ ``` shell
7
+ read_lef [-tech] [-library] filename
8
+ read_def filename
9
+ write_def [-version 5.8|5.7|5.6|5.5|5.4|5.3] filename
10
+ read_verilog filename
11
+ write_verilog filename
12
+ read_db filename
13
+ write_db filename
14
+ write_abstract_lef filename
15
+ ```
16
+
17
+ Use the Tcl `source` command to read commands from a file.
18
+
19
+ ``` shell
20
+ source [-echo] file
21
+ ```
22
+
23
+ If an error is encountered in a command while reading the command file,
24
+ then the error is printed and no more commands are read from the file. If
25
+ `file_continue_on_error` is `1` then OpenROAD will continue reading commands
26
+ after the error.
27
+
28
+ If `exit_on_error` is `1` then OpenROAD will exit when it encounters an error.
29
+
30
+ OpenROAD can be used to make a OpenDB database from LEF/DEF, or Verilog
31
+ (flat or hierarchical). Once the database is made it can be saved as a file
32
+ with the `write_db` command. OpenROAD can then read the database with the
33
+ `read_db` command without reading LEF/DEF or Verilog.
34
+
35
+ The `read_lef` and `read_def` commands can be used to build an OpenDB database
36
+ as shown below. The `read_lef -tech` flag reads the technology portion of a
37
+ LEF file. The `read_lef -library` flag reads the MACROs in the LEF file.
38
+ If neither of the `-tech` and `-library` flags are specified they default
39
+ to `-tech -library` if no technology has been read and `-library` if a
40
+ technology exists in the database.
41
+
42
+ ``` shell
43
+ read_lef liberty1.lef
44
+ read_def reg1.def
45
+ # Write the db for future runs.
46
+ write_db reg1.db
47
+ ```
48
+
49
+ The `read_verilog` command is used to build an OpenDB database as shown
50
+ below. Multiple Verilog files for a hierarchical design can be read.
51
+ The `link_design` command is used to flatten the design and make a database.
52
+
53
+ ``` shell
54
+ read_lef liberty1.lef
55
+ read_verilog reg1.v
56
+ link_design top
57
+ # Write the db for future runs.
58
+ write_db reg1.db
59
+ ```
60
+
61
+ ## Example scripts
62
+
63
+ Example scripts demonstrating how to run OpenROAD on sample designs can
64
+ be found in /test. Flow tests taking sample designs from synthesizable RTL Verilog
65
+ to detail-routed final layout in the open-source technologies Nangate45 and Sky130HD are
66
+ shown below.
67
+
68
+ ``` shell
69
+ gcd_nangate45.tcl
70
+ aes_nangate45.tcl
71
+ tinyRocket_nangate45.tcl
72
+ gcd_sky130hd.tcl
73
+ aes_sky130hd.tcl
74
+ ibex_sky130hd.tcl
75
+ ```
76
+
77
+ Each of these designs use the common script `flow.tcl`.
78
+
79
+ ## Abstract LEF Support
80
+
81
+ OpenROAD contains an abstract LEF writer that can take your current design
82
+ and emit an abstract LEF representing the external pins of your design and
83
+ metal obstructions.
84
+
85
+
86
+ ``` tcl
87
+ write_abstract_lef (-bloat_factor bloat_factor|-bloat_occupied_layers) \
88
+ filename
89
+ ```
90
+ ### Options
91
+
92
+ | Switch Name | Description |
93
+ | ----- | ----- |
94
+ | `-bloat_factor` | Specifies the bloat factor used when bloating then merging shapes into LEF obstructions. The factor is measured in # of default metal pitches for the respective layer. A factor of `0` will result in detailed LEF obstructions |
95
+ | `-bloat_occupied_layers` | Generates cover obstructions (obstructions over the entire layer) for each layer where shapes are present |
96
+
97
+ ### Examples
98
+ ```
99
+ read reg1.db
100
+
101
+ # Bloat metal shapes by 3 pitches (respectively for every layer) and then merge
102
+ write_abstract_lef -bloat_factor 3 reg1_abstract.lef
103
+
104
+ # Produce cover obstructions for each layer with shapes present
105
+ write_abstract_lef -bloat_occupied_layers reg1_abstract.lef
106
+ ```
107
+
108
+ ### Global Connections
109
+
110
+ #### Add global connections
111
+
112
+ The `add_global_connection` command is used to specify how to connect power and ground pins on design instances to the appropriate supplies.
113
+
114
+ ```
115
+ add_global_connection -net net_name \
116
+ [-inst_pattern inst_regular_expression] \
117
+ -pin_pattern pin_regular_expression \
118
+ (-power|-ground) \
119
+ [-region region_name]
120
+ ```
121
+
122
+ ##### Options
123
+
124
+ | Switch Name | Description |
125
+ | ----- | ----- |
126
+ | `-net` | Specifies the name of the net in the design to which connections are to be added |
127
+ | `-inst_pattern` | Optional specifies a regular expression to select a set of instances from the design. (Default: .\*) |
128
+ | `-pin_pattern` | Species a regular expression to select pins on the selected instances to connect to the specified net |
129
+ | `-power` | Specifies that the net it a power net |
130
+ | `-ground` | Specifies that the net is a ground net |
131
+ | `-region` | Specifies the name of the region for this rule |
132
+
133
+ ##### Examples
134
+ ```
135
+ # Stdcell power/ground pins
136
+ add_global_connection -net VDD -pin_pattern {^VDD$} -power
137
+ add_global_connection -net VSS -pin_pattern {^VSS$} -ground
138
+
139
+ # SRAM power ground pins
140
+ add_global_connection -net VDD -pin_pattern {^VDDPE$}
141
+ add_global_connection -net VDD -pin_pattern {^VDDCE$}
142
+ add_global_connection -net VSS -pin_pattern {^VSSE$}
143
+ ```
144
+
145
+ #### Perform global connections
146
+
147
+ The `global_connect` command is used to connect power and ground pins on design instances to the appropriate supplies.
148
+
149
+ ```
150
+ global_connect
151
+ ```
152
+
153
+ #### Clear global connection rules
154
+
155
+ The `clear_global_connect` command is used remove all defined global connection rules.
156
+
157
+ ```
158
+ clear_global_connect
159
+ ```
160
+
161
+ #### Report global connection rules
162
+
163
+ The `report_global_connect` command is used print out the currently defined global connection rules.
164
+
165
+ ```
166
+ report_global_connect
167
+ ```
168
+
169
+ #### Report cell type usage
170
+
171
+ The `report_cell_usage` command is used to print out the usage of cells for each type of cell.
172
+
173
+ ```
174
+ report_cell_usage
175
+ ```
176
+
177
+ ## TCL functions
178
+
179
+ Get the die and core areas as a list in microns: `llx lly urx ury`
180
+
181
+ ```
182
+ ord::get_die_area
183
+ ord::get_core_area
184
+ ```
185
+
186
+ ## FAQs
187
+
188
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+openroad+in%3Atitle)
189
+ about this tool.
190
+
191
+ ## License
192
+
193
+ BSD 3-Clause License.
data/markdown/OR_userguide/OR_README.md ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OpenROAD
2
+
3
+ OpenROAD is run using Tcl scripts. The following commands are used to read
4
+ and write design data.
5
+
6
+ ``` shell
7
+ read_lef [-tech] [-library] filename
8
+ read_def filename
9
+ write_def [-version 5.8|5.7|5.6|5.5|5.4|5.3] filename
10
+ read_verilog filename
11
+ write_verilog filename
12
+ read_db filename
13
+ write_db filename
14
+ write_abstract_lef filename
15
+ ```
16
+
17
+ Use the Tcl `source` command to read commands from a file.
18
+
19
+ ``` shell
20
+ source [-echo] file
21
+ ```
22
+
23
+ If an error is encountered in a command while reading the command file,
24
+ then the error is printed and no more commands are read from the file. If
25
+ `file_continue_on_error` is `1` then OpenROAD will continue reading commands
26
+ after the error.
27
+
28
+ If `exit_on_error` is `1` then OpenROAD will exit when it encounters an error.
29
+
30
+ OpenROAD can be used to make a OpenDB database from LEF/DEF, or Verilog
31
+ (flat or hierarchical). Once the database is made it can be saved as a file
32
+ with the `write_db` command. OpenROAD can then read the database with the
33
+ `read_db` command without reading LEF/DEF or Verilog.
34
+
35
+ The `read_lef` and `read_def` commands can be used to build an OpenDB database
36
+ as shown below. The `read_lef -tech` flag reads the technology portion of a
37
+ LEF file. The `read_lef -library` flag reads the MACROs in the LEF file.
38
+ If neither of the `-tech` and `-library` flags are specified they default
39
+ to `-tech -library` if no technology has been read and `-library` if a
40
+ technology exists in the database.
41
+
42
+ ``` shell
43
+ read_lef liberty1.lef
44
+ read_def reg1.def
45
+ # Write the db for future runs.
46
+ write_db reg1.db
47
+ ```
48
+
49
+ The `read_verilog` command is used to build an OpenDB database as shown
50
+ below. Multiple Verilog files for a hierarchical design can be read.
51
+ The `link_design` command is used to flatten the design and make a database.
52
+
53
+ ``` shell
54
+ read_lef liberty1.lef
55
+ read_verilog reg1.v
56
+ link_design top
57
+ # Write the db for future runs.
58
+ write_db reg1.db
59
+ ```
60
+
61
+ ## Example scripts
62
+
63
+ Example scripts demonstrating how to run OpenROAD on sample designs can
64
+ be found in /test. Flow tests taking sample designs from synthesizable RTL Verilog
65
+ to detail-routed final layout in the open-source technologies Nangate45 and Sky130HD are
66
+ shown below.
67
+
68
+ ``` shell
69
+ gcd_nangate45.tcl
70
+ aes_nangate45.tcl
71
+ tinyRocket_nangate45.tcl
72
+ gcd_sky130hd.tcl
73
+ aes_sky130hd.tcl
74
+ ibex_sky130hd.tcl
75
+ ```
76
+
77
+ Each of these designs use the common script `flow.tcl`.
78
+
79
+ ## Abstract LEF Support
80
+
81
+ OpenROAD contains an abstract LEF writer that can take your current design
82
+ and emit an abstract LEF representing the external pins of your design and
83
+ metal obstructions.
84
+
85
+
86
+ ``` tcl
87
+ write_abstract_lef (-bloat_factor bloat_factor|-bloat_occupied_layers) \
88
+ filename
89
+ ```
90
+ ### Options
91
+
92
+ | Switch Name | Description |
93
+ | ----- | ----- |
94
+ | `-bloat_factor` | Specifies the bloat factor used when bloating then merging shapes into LEF obstructions. The factor is measured in # of default metal pitches for the respective layer. A factor of `0` will result in detailed LEF obstructions |
95
+ | `-bloat_occupied_layers` | Generates cover obstructions (obstructions over the entire layer) for each layer where shapes are present |
96
+
97
+ ### Examples
98
+ ```
99
+ read reg1.db
100
+
101
+ # Bloat metal shapes by 3 pitches (respectively for every layer) and then merge
102
+ write_abstract_lef -bloat_factor 3 reg1_abstract.lef
103
+
104
+ # Produce cover obstructions for each layer with shapes present
105
+ write_abstract_lef -bloat_occupied_layers reg1_abstract.lef
106
+ ```
107
+
108
+ ### Global Connections
109
+
110
+ #### Add global connections
111
+
112
+ The `add_global_connection` command is used to specify how to connect power and ground pins on design instances to the appropriate supplies.
113
+
114
+ ```
115
+ add_global_connection -net net_name \
116
+ [-inst_pattern inst_regular_expression] \
117
+ -pin_pattern pin_regular_expression \
118
+ (-power|-ground) \
119
+ [-region region_name]
120
+ ```
121
+
122
+ ##### Options
123
+
124
+ | Switch Name | Description |
125
+ | ----- | ----- |
126
+ | `-net` | Specifies the name of the net in the design to which connections are to be added |
127
+ | `-inst_pattern` | Optional specifies a regular expression to select a set of instances from the design. (Default: .\*) |
128
+ | `-pin_pattern` | Species a regular expression to select pins on the selected instances to connect to the specified net |
129
+ | `-power` | Specifies that the net it a power net |
130
+ | `-ground` | Specifies that the net is a ground net |
131
+ | `-region` | Specifies the name of the region for this rule |
132
+
133
+ ##### Examples
134
+ ```
135
+ # Stdcell power/ground pins
136
+ add_global_connection -net VDD -pin_pattern {^VDD$} -power
137
+ add_global_connection -net VSS -pin_pattern {^VSS$} -ground
138
+
139
+ # SRAM power ground pins
140
+ add_global_connection -net VDD -pin_pattern {^VDDPE$}
141
+ add_global_connection -net VDD -pin_pattern {^VDDCE$}
142
+ add_global_connection -net VSS -pin_pattern {^VSSE$}
143
+ ```
144
+
145
+ #### Perform global connections
146
+
147
+ The `global_connect` command is used to connect power and ground pins on design instances to the appropriate supplies.
148
+
149
+ ```
150
+ global_connect
151
+ ```
152
+
153
+ #### Clear global connection rules
154
+
155
+ The `clear_global_connect` command is used remove all defined global connection rules.
156
+
157
+ ```
158
+ clear_global_connect
159
+ ```
160
+
161
+ #### Report global connection rules
162
+
163
+ The `report_global_connect` command is used print out the currently defined global connection rules.
164
+
165
+ ```
166
+ report_global_connect
167
+ ```
168
+
169
+ #### Report cell type usage
170
+
171
+ The `report_cell_usage` command is used to print out the usage of cells for each type of cell.
172
+
173
+ ```
174
+ report_cell_usage
175
+ ```
176
+
177
+ ## TCL functions
178
+
179
+ Get the die and core areas as a list in microns: `llx lly urx ury`
180
+
181
+ ```
182
+ ord::get_die_area
183
+ ord::get_core_area
184
+ ```
185
+
186
+ ## FAQs
187
+
188
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+openroad+in%3Atitle)
189
+ about this tool.
190
+
191
+ ## License
192
+
193
+ BSD 3-Clause License.
data/markdown/OR_userguide/OR_ant_README.md ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Antenna Rule Checker
2
+
3
+ This tool checks antenna violations and generates a report to indicate
4
+ violated nets. See LEF/DEF 5.8 Language Reference, Appendix C,
5
+ "Calculating and Fixing Process Antenna Violations" (p.389)
6
+ for a [description](https://coriolis.lip6.fr/doc/lefdef/lefdefref/lefdefref.pdf) of antenna violations.
7
+
8
+ This is an example of the detailed and simple reports of the antenna checker:
9
+
10
+ | <img src="./doc/images/ant_report_print.png" width=500px> |
11
+
12
+ Abbreviations Index:
13
+
14
+ - `PAR`: Partial Area Ratio
15
+ - `CAR`: Cumulative Area Ratio
16
+ - `Area`: Gate Area
17
+ - `S. Area`: Side Diffusion Area
18
+ - `C. Area`: Cumulative Gate Area
19
+ - `C. S. Area`: Cumulative Side (Diffusion) Area
20
+
21
+ Antenna violations can be repaired after global routing with the `repair_design` command.
22
+
23
+ ## Commands
24
+
25
+ ```{note}
26
+ - Parameters in square brackets `[-param param]` are optional.
27
+ - Parameters without square brackets `-param2 param2` are required.
28
+ ```
29
+
30
+ ### Check Antennas
31
+
32
+ ```tcl
33
+ check_antennas
34
+ [-net net]
35
+ [-verbose]
36
+ ```
37
+
38
+ #### Options
39
+
40
+ | Switch Name | Description |
41
+ | ----- | ----- |
42
+ | `-verbose` | Report all antenna calculations for violating nets. |
43
+ | `-net` | Check antennas on the specified net. |
44
+
45
+ ## Regression tests
46
+
47
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
48
+
49
+ Simply run the following script:
50
+
51
+ ```shell
52
+ ./test/regression
53
+ ```
54
+
55
+ ## Limitations
56
+
57
+ ## FAQs
58
+
59
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+antenna+in%3Atitle)
60
+ about this tool.
61
+
62
+ ## Algorithm
63
+
64
+ | <img src="./doc/images/example_ant.png" width=400px> | <img src="./doc/images/step1.png" width=400px> |
65
+ |:--:|:--:|
66
+ | Antenna Checker Algorithm: WireGraph Example | Step 1: (a) Start from the root node (ITerm) using upper Via to find a node for a new wire. (b) Save the ITerm area for cumulative gate/diffusion area. |
67
+ | <img src="./doc/images/step2.png" width=400px> | <img src="./doc/images/step3.png" width=400px> |
68
+ | Step 2: From the node of the wire, find all the nodes in the wire through segment wires and find the "root" node of this wire. | Step 3: (a) From the "root" node of the wire, along the outgoing segment edge that goes to other nodes belonging to this wire, calculate the area of this wire. (b) Then, find all the ITerms below these nodes, except for the root node (directly use an ITerm or lower Vias to find ITerms for lower metals). (c) Sum up the areas of all the ITerms found with the cumulative areas and calculate the PAR of this wire. (d) Add the PAR value and the wire info (layer, Index) into the PAR table. Add the new area to the cumulative areas. |
69
+ | <img src="./doc/images/step4.png" width=400px> | <img src="./doc/images/step5.png" width=400px> |
70
+ | Step 4: Find all the upper Vias on this wire (for all the nodes on this wire), and go to the higher-level metal. | Step 5: Repeat Steps 2 and 3 for new-found upper-level wires. |
71
+ | <img src="./doc/images/step6.png" width=400px> | <img src="./doc/images/step7.png" width=400px> |
72
+ | Step 6: Repeat Steps 4 and 5 until we reach a wire that cannot have upper Vias for its nodes (highest-level metal). | Step 7: Pick up another ITerm as a root node and repeat Steps 1 to 6, skipping the wires already in the PAR table. Repeat this for all the ITerms to get a whole PAR table. |
73
+ | <img src="./doc/images/step8.png" width=400px> |
74
+ | Step 8: (a) Pick up a gate ITerm and a node of a wire (e.g., M4,1). Find possible paths that connect them, look up the PAR value of the wires along these paths, and add them up to get the CAR of the (gate, wire) pair. (b) Compare to the AntennaRule to see if the CAR violates the rules. (c) Check this for all (gate, wire) pairs. |
75
+
76
+ ## License
77
+
78
+ BSD 3-Clause License. See [LICENSE](../../LICENSE) file.
data/markdown/OR_userguide/OR_cts_README.md ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Clock Tree Synthesis
2
+
3
+ The clock tree synthesis module in OpenROAD (`cts`) is based on TritonCTS
4
+ 2.0. It is available from the `clock_tree_synthesis` command. TritonCTS 2.0
5
+ performs on-the-fly characterization. Thus, there is no need to generate
6
+ characterization data. The on-the-fly characterization feature can be optionally
7
+ controlled by parameters specified by the `configure_cts_characterization`
8
+ command. Use `set_wire_rc` command to set the clock routing layer.
9
+
10
+ ## Commands
11
+
12
+ ```{note}
13
+ - Parameters in square brackets `[-param param]` are optional.
14
+ - Parameters without square brackets `-param2 param2` are required.
15
+ ```
16
+
17
+ ### Configure CTS Characterization
18
+
19
+ ```tcl
20
+ configure_cts_characterization
21
+ [-max_slew max_slew]
22
+ [-max_cap max_cap]
23
+ [-slew_steps slew_steps]
24
+ [-cap_steps cap_steps]
25
+ ```
26
+
27
+ #### Options
28
+
29
+ | Switch Name | Description |
30
+ | ----- | ----- |
31
+ | `-max_slew` | Max slew value (in the current time unit) that the characterization will test. If this parameter is omitted, the code would use max slew value for specified buffer in `buf_list` from liberty file. |
32
+ | `-max_cap` | Max capacitance value (in the current capacitance unit) that the characterization will test. If this parameter is omitted, the code would use max cap value for specified buffer in `buf_list` from liberty file. |
33
+ | `-slew_steps` | Number of steps that `max_slew` will be divided into for characterization. The default value is `12`, and the allowed values are integers `[0, MAX_INT]`. |
34
+ | `-cap_steps` | Number of steps that `max_cap` will be divided into for characterization. The default value is `34`, and the allowed values are integers `[0, MAX_INT]`. |
35
+
36
+ ### Clock Tree Synthesis
37
+
38
+ ```tcl
39
+ clock_tree_synthesis
40
+ -buf_list <list_of_buffers>
41
+ [-root_buf root_buf]
42
+ [-wire_unit wire_unit]
43
+ [-clk_nets <list_of_clk_nets>]
44
+ [-distance_between_buffers]
45
+ [-branching_point_buffers_distance]
46
+ [-clustering_exponent]
47
+ [-clustering_unbalance_ratio]
48
+ [-sink_clustering_enable]
49
+ [-sink_clustering_size cluster_size]
50
+ [-sink_clustering_max_diameter max_diameter]
51
+ [-balance_levels]
52
+ [-num_static_layers]
53
+ [-sink_clustering_buffer]
54
+ [-use_dummy_load]
55
+ [-insertion_delay]
56
+ [-sink_buffer_max_cap_derate derate_value]
57
+ [-delay_buffer_derate derate_value]
58
+ ```
59
+
60
+ #### Options
61
+
62
+ | Switch Name | Description |
63
+ | ----- | ----- |
64
+ | `-buf_list` | Tcl list of master cells (buffers) that will be considered when making the wire segments (e.g. `{BUFXX, BUFYY}`). |
65
+ | `-root_buffer` | The master cell of the buffer that serves as root for the clock tree. If this parameter is omitted, the first master cell from `-buf_list` is taken. |
66
+ | `-wire_unit` | Minimum unit distance between buffers for a specific wire. If this parameter is omitted, the code gets the value from ten times the height of `-root_buffer`. |
67
+ | `-clk_nets` | String containing the names of the clock roots. If this parameter is omitted, `cts` automatically looks for the clock roots automatically. |
68
+ | `-distance_between_buffers` | Distance (in microns) between buffers that `cts` should use when creating the tree. When using this parameter, the clock tree algorithm is simplified and only uses a fraction of the segments from the LUT. |
69
+ | `-branching_point_buffers_distance` | Distance (in microns) that a branch has to have in order for a buffer to be inserted on a branch end-point. This requires the `-distance_between_buffers` value to be set. |
70
+ | `-clustering_exponent` | Value that determines the power used on the difference between sink and means on the CKMeans clustering algorithm. The default value is `4`, and the allowed values are integers `[0, MAX_INT]`. |
71
+ | `-clustering_unbalance_ratio` | Value determines each cluster's maximum capacity during CKMeans. A value of `0.5` (i.e., 50%) means that each cluster will have exactly half of all sinks for a specific region (half for each branch). The default value is `0.6`, and the allowed values are floats `[0, 1.0]`. |
72
+ | `-sink_clustering_enable` | Enables pre-clustering of sinks to create one level of sub-tree before building H-tree. Each cluster is driven by buffer which becomes end point of H-tree structure. |
73
+ | `-sink_clustering_size` | Specifies the maximum number of sinks per cluster. The default value is `20`, and the allowed values are integers `[0, MAX_INT]`. |
74
+ | `-sink_clustering_max_diameter` | Specifies maximum diameter (in microns) of sink cluster. The default value is `50`, and the allowed values are integers `[0, MAX_INT]`. |
75
+ | `-balance_levels` | Attempt to keep a similar number of levels in the clock tree across non-register cells (e.g., clock-gate or inverter). The default value is `False`, and the allowed values are bool. |
76
+ | `-clk_nets` | String containing the names of the clock roots. If this parameter is omitted, `cts` looks for the clock roots automatically. |
77
+ | `-num_static_layers` | Set the number of static layers. The default value is `0`, and the allowed values are integers `[0, MAX_INT]`. |
78
+ | `-sink_clustering_buffer` | Set the sink clustering buffer(s) to be used. |
79
+ | `-obstruction_aware` | Enables obstruction-aware buffering such that clock buffers are not placed on top of blockages or hard macros. This option may reduce legalizer displacement, leading to better latency, skew or timing QoR. The default value is `False`, and the allowed values are bool. |
80
+ | `-apply_ndr` | Applies 2X spacing non-default rule to all clock nets except leaf-level nets. The default value is `False`. |
81
+ | `-no_insertion_delay` | Don't consider insertion delays in macro timing models in balancing latencies between macro cells and registers. This option prevents construction of separate clock trees for macro cells and registers. The default value is `False`. |
82
+ | `-use_dummy_load` | Applies dummy buffer or inverter cells at clock tree leaves to balance loads. The default values is `False`. |
83
+ | `-sink_buffer_max_cap_derate` | Use this option to control automatic buffer selection. To favor strong(weak) drive strength buffers use a small(large) value. The default value is `0.01`, meaning that buffers are selected by derating max cap limit by 0.01. The value of 1.0 means no derating of max cap limit. |
84
+ | `-delay_buffer_derate` | This option is used with -insertion_delay option that balances latencies between macro cells and registers by inserting delay buffers. The default values is `1.0`, meaning all needed delay buffers are inserted. Value of 0.5 means only half of necessary delay buffers are inserted. Value of 0.0 means no insertion of delay buffers. |
85
+
86
+ ### Report CTS
87
+
88
+ Another command available from `cts` is `report_cts`. It is used to
89
+ extract metrics after a successful `clock_tree_synthesis` run. These are:
90
+
91
+ - Number of Clock Roots
92
+ - Number of Buffers Inserted
93
+ - Number of Clock Subnets
94
+ - Number of Sinks.
95
+
96
+ ```tcl
97
+ report_cts
98
+ [-out_file file]
99
+ ```
100
+
101
+ #### Options
102
+
103
+ | Switch Name | Description |
104
+ | ----- | ----- |
105
+ | `-out_file` | The file to save `cts` reports. If this parameter is omitted, the report is streamed to `stdout` and not saved. |
106
+
107
+ ### Useful Developer Commands
108
+
109
+ If you are a developer, you might find these useful. More details can be found in the [source file](./src/TritonCTS.cpp) or the [swig file](./src/TritonCTS.i).
110
+
111
+ | Command Name | Description |
112
+ | ----- | ----- |
113
+ | `clock_tree_synthesis_debug` | Option to plot the CTS to GUI. |
114
+
115
+ ## Example scripts
116
+
117
+ ```tcl
118
+ clock_tree_synthesis -root_buf "BUF_X4" \
119
+ -buf_list "BUF_X4" \
120
+ -wire_unit 20
121
+ report_cts "file.txt"
122
+ ```
123
+
124
+ ## Regression tests
125
+
126
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
127
+
128
+ Simply run the following script:
129
+
130
+ ```shell
131
+ ./test/regression
132
+ ```
133
+
134
+ ## Limitations
135
+
136
+ ## FAQs
137
+
138
+ Check out
139
+ [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+cts) about this tool.
140
+
141
+ ## References
142
+
143
+ 1. [LEMON](https://lemon.cs.elte.hu/trac/lemon) - **L**ibrary for
144
+ **E**fficient **M**odeling and **O**ptimization in **N**etworks
145
+ 1. Kahng, A. B., Li, J., & Wang, L. (2016, November). Improved flop tray-based design implementation for power reduction. In 2016 IEEE/ACM International Conference on Computer-Aided Design (ICCAD) (pp. 1-8). IEEE. [(.pdf)](https://vlsicad.ucsd.edu/Publications/Conferences/344/c344.pdf)
146
+
147
+ ## Authors
148
+
149
+ TritonCTS 2.0 is written by Mateus Fogaça, PhD student in the Graduate
150
+ Program on Microelectronics from the Federal University of Rio Grande do Sul
151
+ (UFRGS), Brazil. Mr. Fogaça's advisor is Prof. Ricardo Reis.
152
+
153
+ Many guidance provided by (alphabetic order):
154
+ - Andrew B. Kahng
155
+ - Jiajia Li
156
+ - Kwangsoo Han
157
+ - Tom Spyrou
158
+
159
+ ## License
160
+
161
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.
162
+
data/markdown/OR_userguide/OR_dpl_README.md ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Detailed Placement
2
+
3
+ The detailed placement module in OpenROAD (`dpl`) is based on OpenDP, or
4
+ Open-Source Detailed Placement Engine. Its key features are:
5
+
6
+ - Fence region.
7
+ - Fragmented ROWs.
8
+
9
+ ## Commands
10
+
11
+ ### Detailed Placement
12
+
13
+ The `detailed_placement` command performs detailed placement of instances
14
+ to legal locations after global placement.
15
+
16
+ ```tcl
17
+ detailed_placement
18
+ [-max_displacement disp|{disp_x disp_y}]
19
+ [-disallow_one_site_gaps]
20
+ [-report_file_name filename]
21
+ ```
22
+
23
+ #### Options
24
+
25
+ | Switch Name | Description |
26
+ | ----- | ----- |
27
+ | `-max_displacement` | Max distance that an instance can be moved (in microns) when finding a site where it can be placed. Either set one value for both directions or set `{disp_x disp_y}` for individual directions. The default values are `{0, 0}`, and the allowed values within are integers `[0, MAX_INT]`. |
28
+ | `-disallow_one_site_gaps` | Disable one site gap during placement check. |
29
+ | `-report_file_name` | File name for saving the report to (e.g. `report.json`. |
30
+
31
+ ### Set Placement Padding
32
+
33
+ The `set_placement_padding` command sets left and right padding in multiples
34
+ of the row site width. Use the `set_placement_padding` command before
35
+ legalizing placement to leave room for routing. Use the `-global` flag
36
+ for padding that applies to all instances. Use `-instances`
37
+ for instance-specific padding. The instances `insts` can be a list of instance
38
+ names, or an instance object returned by the SDC `get_cells` command. To
39
+ specify padding for all instances of a common master, use the `-filter`
40
+ "ref_name == <name>" option to `get_cells`.
41
+
42
+ ```tcl
43
+ set_placement_padding
44
+ -global|-masters masters|-instances insts
45
+ [-right site_count]
46
+ [-left site_count]
47
+ ```
48
+
49
+ #### Options
50
+
51
+ ```{warning}
52
+ Either one of these flags must be set: `-global | -masters | -instances`.
53
+ The order of preference is `global > masters > instances`
54
+ ```
55
+
56
+ | Switch Name | Description |
57
+ | ----- | ----- |
58
+ | `-global` | Set padding globally using `left` and `right` values. |
59
+ | `-masters` | Set padding only for these masters using `left` and `right` values. |
60
+ | `-instances` | For `-instances`, you will set padding only for these insts using `left` and `right` values. |
61
+ | `-left` | Left padding (in site count). |
62
+ | `-right` | Right padding (in site count). |
63
+ | `instances` | Set padding for these list of instances. Not to be confused with the `-instances` switch above. |
64
+
65
+ ### Filler Placement
66
+
67
+ The `filler_placement` command fills gaps between detail-placed instances
68
+ to connect the power and ground rails in the rows. `filler_masters` is a
69
+ list of master/macro names to use for filling the gaps. Wildcard matching
70
+ is supported, so `FILL*` will match, e.g., `FILLCELL_X1 FILLCELL_X16 FILLCELL_X2
71
+ FILLCELL_X32 FILLCELL_X4 FILLCELL_X8`. To specify a different naming prefix
72
+ from `FILLER_` use `-prefix <new prefix>`.
73
+
74
+ ```tcl
75
+ filler_placement
76
+ [-prefix prefix]
77
+ filler_masters
78
+ ```
79
+
80
+ #### Options
81
+
82
+ | Switch Name | Description |
83
+ | ----- | ----- |
84
+ | `-prefix` | Prefix to name the filler cells. The default value is `FILLER_`. |
85
+ | `filler_masters` | Filler master cells. |
86
+
87
+ ### Remove Fillers
88
+
89
+ This command removes all filler cells.
90
+
91
+ ```tcl
92
+ remove_fillers
93
+ ```
94
+
95
+ No arguments are needed for this function.
96
+
97
+ ### Check Placement
98
+
99
+ The `check_placement` command checks the placement legality. It returns
100
+ `0` if the placement is legal.
101
+
102
+ ```tcl
103
+ check_placement
104
+ [-verbose]
105
+ [-disallow_one_site_gaps]
106
+ [-report_filename filename]
107
+ ```
108
+
109
+ #### Options
110
+
111
+ | Switch Name | Description |
112
+ | ----- | ----- |
113
+ | `-verbose` | Enable verbose logging. |
114
+ | `-disallow_one_site_gaps` | Disable one site gap during placement check. |
115
+ | `-report_file_name` | File name for saving the report to (e.g. `report.json`. |
116
+
117
+ ### Optimize Mirroring
118
+
119
+ The `optimize_mirroring` command mirrors instances about the Y axis in
120
+ a weak attempt to reduce the total half-perimeter wirelength (HPWL).
121
+
122
+ ```tcl
123
+ optimize_mirroring
124
+ ```
125
+
126
+ No arguments are needed for this function.
127
+
128
+ ### Useful Developer Commands
129
+
130
+ If you are a developer, you might find these useful. More details can be found in the [source file](./src/Opendp.cpp) or the [swig file](./src/Opendp.i).
131
+
132
+ | Command Name | Description |
133
+ | ----- | ----- |
134
+ | `detailed_placement_debug` | Debug detailed placement. |
135
+ | `get_masters_arg` | Get masters from a design. |
136
+ | `get_inst_bbox` | Get bounding box of an instance. |
137
+ | `get_inst_grid_bbox` | Get grid bounding box of an instance. |
138
+ | `format_grid` | Format grid (takes in length `x` and site width `w` as inputs). |
139
+ | `get_row_site` | Get row site name.
140
+
141
+ ## Example scripts
142
+
143
+ Examples scripts demonstrating how to run `dpl` on a sample design of `aes` as follows:
144
+
145
+ ```shell
146
+ ./test/aes.tcl
147
+ ```
148
+
149
+ ## Regression tests
150
+
151
+ There are a set of regression tests in `./test`. Refer to this [section](../../README.md#regression-tests) for more information.
152
+
153
+ Simply run the following script:
154
+
155
+ ```shell
156
+ ./test/regression
157
+ ```
158
+
159
+ ## Limitations
160
+
161
+ ## FAQs
162
+
163
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+opendp+in%3Atitle)
164
+ about this tool.
165
+
166
+ ## Authors
167
+
168
+ - SangGi Do and Mingyu Woo (respective Ph. D. advisors: Seokhyeong Kang,
169
+ Andrew B. Kahng).
170
+ - Rewrite and port to OpenDB/OpenROAD by James Cherry, Parallax Software
171
+
172
+ ## References
173
+ 1. Do, S., Woo, M., & Kang, S. (2019, May). Fence-region-aware mixed-height standard cell legalization. In Proceedings of the 2019 on Great Lakes Symposium on VLSI (pp. 259-262). [(.pdf)](https://dl.acm.org/doi/10.1145/3299874.3318012)
174
+
175
+ ## License
176
+
177
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.
data/markdown/OR_userguide/OR_drt_README.md ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Detailed Routing
2
+
3
+ The Detailed Routing (`drt`) module in OpenROAD is based on the open-source
4
+ detailed router, TritonRoute. TritonRoute consists of several main
5
+ building blocks, including pin access analysis, track assignment,
6
+ initial detailed routing, search and repair, and a DRC engine.
7
+ The initial development of the
8
+ [router](https://vlsicad.ucsd.edu/Publications/Conferences/363/c363.pdf)
9
+ is inspired by the [ISPD-2018 initial detailed routing
10
+ contest](http://www.ispd.cc/contests/18/). However, the current framework
11
+ differs and is built from scratch, aiming for an industrial-oriented scalable
12
+ and flexible flow.
13
+
14
+ TritonRoute provides industry-standard LEF/DEF interface with
15
+ support of [ISPD-2018](http://www.ispd.cc/contests/18/) and
16
+ [ISPD-2019](http://www.ispd.cc/contests/19/) contest-compatible route
17
+ guide format.
18
+
19
+ ## Commands
20
+
21
+ ```{note}
22
+ - Parameters in square brackets `[-param param]` are optional.
23
+ - Parameters without square brackets `-param2 param2` are required.
24
+ ```
25
+
26
+ ### Detailed Route
27
+
28
+ ```tcl
29
+ detailed_route
30
+ [-output_maze filename]
31
+ [-output_drc filename]
32
+ [-output_cmap filename]
33
+ [-output_guide_coverage filename]
34
+ [-drc_report_iter_step step]
35
+ [-db_process_node name]
36
+ [-disable_via_gen]
37
+ [-droute_end_iter iter]
38
+ [-via_in_pin_bottom_layer layer]
39
+ [-via_in_pin_top_layer layer]
40
+ [-or_seed seed]
41
+ [-or_k_ k]
42
+ [-bottom_routing_layer layer]
43
+ [-top_routing_layer layer]
44
+ [-verbose level]
45
+ [-distributed]
46
+ [-remote_host rhost]
47
+ [-remote_port rport]
48
+ [-shared_volume vol]
49
+ [-cloud_size sz]
50
+ [-clean_patches]
51
+ [-no_pin_access]
52
+ [-min_access_points count]
53
+ [-save_guide_updates]
54
+ [-repair_pdn_vias layer]
55
+ ```
56
+
57
+ #### Options
58
+
59
+ | Switch Name | Description |
60
+ | ----- | ----- |
61
+ | `-output_maze` | Path to output maze log file (e.g. `output_maze.log`). |
62
+ | `-output_drc` | Path to output DRC report file (e.g. `output_drc.rpt`). |
63
+ | `-output_cmap` | Path to output congestion map file (e.g. `output.cmap`). |
64
+ | `-output_guide_coverage` | Path to output guide coverage file (e.g. `sample_coverage.csv`). |
65
+ | `-drc_report_iter_step` | Report DRC on each iteration which is a multiple of this step. The default value is `0`, and the allowed values are integers `[0, MAX_INT]`. |
66
+ | `-db_process_node` | Specify the process node. |
67
+ | `-disable_via_gen` | Option to diable via generation with bottom and top routing layer. The default value is disabled. |
68
+ | `-droute_end_iter` | Number of detailed routing iterations. The default value is `-1`, and the allowed values are integers `[1, 64]`. |
69
+ | `-via_in_pin_bottom_layer` | Via-in pin bottom layer name. |
70
+ | `-via_in_pin_top_layer` | Via-in pin top layer name. |
71
+ | `-or_seed` | Refer to developer arguments [here](#developer-arguments). |
72
+ | `-or_k` | Refer to developer arguments [here](#developer-arguments). |
73
+ | `-bottom_routing_layer` | Bottommost routing layer name. |
74
+ | `-top_routing_layer` | Topmost routing layer name. |
75
+ | `-verbose` | Sets verbose mode if the value is greater than 1, else non-verbose mode (must be integer, or error will be triggered.) |
76
+ | `-distributed` | Refer to distributed arguments [here](#distributed-arguments). |
77
+ | `-clean_patches` | Clean unneeded patches during detailed routing. |
78
+ | `-no_pin_access` | Disables pin access for routing. |
79
+ | `-min_access_points` | Minimum access points for standard cell and macro cell pins. |
80
+ | `-save_guide_updates` | Flag to save guides updates. |
81
+ | `-repair_pdn_vias` | This option is used for PDKs where M1 and M2 power rails run in parallel. |
82
+
83
+ #### Developer arguments
84
+
85
+ Some arguments that are helpful for developers are listed here.
86
+
87
+ | Switch Name | Description |
88
+ | ----- | ----- |
89
+ | `-or_seed` | Random seed for the order of nets to reroute. The default value is `-1`, and the allowed values are integers `[0, MAX_INT]`. |
90
+ | `-or_k` | Number of swaps is given by $k * sizeof(rerouteNets)$. The default value is `0`, and the allowed values are integers `[0, MAX_INT]`. |
91
+
92
+ ### Detailed Route Debugging
93
+
94
+ The following command and arguments are useful when debugging error
95
+ messages from `drt` and to understand its behavior.
96
+
97
+ ```tcl
98
+ detailed_route_debug
99
+ [-pa]
100
+ [-ta]
101
+ [-dr]
102
+ [-maze]
103
+ [-net name]
104
+ [-pin name]
105
+ [-worker x y]
106
+ [-iter iter]
107
+ [-pa_markers]
108
+ [-dump_dr]
109
+ [-dump_dir dir]
110
+ [-pa_edge]
111
+ [-pa_commit]
112
+ [-write_net_tracks]
113
+ ```
114
+
115
+ #### Options
116
+
117
+ | Switch Name | Description |
118
+ | ----- | ----- |
119
+ | `-pa` | Enable debug for pin access. |
120
+ | `-ta` | Enable debug for track assignment. |
121
+ | `-dr` | Enable debug for detailed routing. |
122
+ | `-maze` | Enable debug for maze routing. |
123
+ | `-net` | Enable debug for net name. |
124
+ | `-pin` | Enable debug for pin name. |
125
+ | `-worker` | Debugs routes that pass through the point `{x, y}`. |
126
+ | `-iter` | Specifies the number of debug iterations. The default value is `0`, and the accepted values are integers `[0, MAX_INT`. |
127
+ | `-pa_markers` | Enable pin access markers. |
128
+ | `-dump_dr` | Filename for detailed routing dump. |
129
+ | `-dump_dir` | Directory for detailed routing dump. |
130
+ | `-pa_edge` | Enable visibility of pin access edges. |
131
+ | `-pa_commit` | Enable visibility of pin access commits. |
132
+ | `-write_net_tracks` | Enable writing of net track assigments. |
133
+
134
+ ### Check Pin Access
135
+
136
+ ```tcl
137
+ pin_access
138
+ [-db_process_node name]
139
+ [-bottom_routing_layer layer]
140
+ [-top_routing_layer layer]
141
+ [-min_access_points count]
142
+ [-verbose level]
143
+ [-distributed]
144
+ [-remote_host rhost]
145
+ [-remote_port rport]
146
+ [-shared_volume vol]
147
+ [-cloud_size sz]
148
+ ```
149
+
150
+ #### Options
151
+
152
+ | Switch Name | Description |
153
+ | ----- | ----- |
154
+ | `-db_process_node` | Specify process node. |
155
+ | `-bottom_routing_layer` | Bottommost routing layer. |
156
+ | `-top_routing_layer` | Topmost routing layer. |
157
+ | `-min_access_points` | Minimum number of access points per pin. |
158
+ | `-verbose` | Sets verbose mode if the value is greater than 1, else non-verbose mode (must be integer, or error will be triggered.) |
159
+ | `-distributed` | Refer to distributed arguments [here](#distributed-arguments). |
160
+
161
+ ### Distributed arguments
162
+
163
+ We have compiled all distributed arguments in this section.
164
+
165
+ ```{note}
166
+ Additional setup is required. Please refer to this [guide](./doc/Distributed.md).
167
+ ```
168
+
169
+ | Switch Name | Description |
170
+ | ----- | ----- |
171
+ | `-distributed` | Enable distributed mode with Kubernetes and Google Cloud. |
172
+ | `-remote_host` | The host IP. |
173
+ | `-remote_port` | The value of the port to access from. |
174
+ | `-shared_volume` | The mount path of the nfs shared folder. |
175
+ | `-cloud_size` | The number of workers. |
176
+
177
+ ### Useful developer functions
178
+
179
+ If you are a developer, you might find these useful. More details can be found in the [source file](./src/TritonRoute.cpp) or the [swig file](./src/TritonRoute.i).
180
+
181
+ | Function Name | Description |
182
+ | ----- | ----- |
183
+ | `detailed_route_set_default_via` | Set default via. |
184
+ | `detailed_route_set_unidirectional_layer` | Set unidirectional layer. |
185
+ | `step_dr` | Refer to function `detailed_route_step_drt`. |
186
+ | `check_drc` | Refer to function `check_drc_cmd`. |
187
+
188
+
189
+
190
+ ## Example scripts
191
+
192
+ Example script demonstrating how to run TritonRoute on a sample design of `gcd`
193
+ in the Nangate45 technology node.
194
+
195
+ ```shell
196
+ # single machine example
197
+ ./test/gcd_nangate45.tcl
198
+
199
+ # distributed example
200
+ ./test/gcd_nangate45_distributed.tcl
201
+ ```
202
+
203
+ ## Regression tests
204
+
205
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
206
+
207
+ Simply run the following script:
208
+
209
+ ```shell
210
+ ./test/regression
211
+ ```
212
+
213
+ ## Limitations
214
+
215
+ ## FAQs
216
+
217
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+tritonroute+in%3Atitle)
218
+ about this tool.
219
+
220
+ ## References
221
+
222
+ Please cite the following paper(s) for publication:
223
+
224
+ 1. A. B. Kahng, L. Wang and B. Xu, "TritonRoute: The Open Source Detailed
225
+ Router", IEEE Transactions on Computer-Aided Design of Integrated Circuits
226
+ and Systems (2020), doi:10.1109/TCAD.2020.3003234. [(.pdf)](https://ieeexplore.ieee.org/ielaam/43/9358030/9120211-aam.pdf)
227
+ 1. A. B. Kahng, L. Wang and B. Xu, "The Tao of PAO: Anatomy of a Pin Access
228
+ Oracle for Detailed Routing", Proc. ACM/IEEE Design Automation Conf., 2020,
229
+ pp. 1-6. [(.pdf)](https://vlsicad.ucsd.edu/Publications/Conferences/377/c377.pdf)
230
+
231
+ ## Authors
232
+
233
+ TritonRoute was developed by graduate students Lutong Wang and
234
+ Bangqi Xu from UC San Diego, and serves as the detailed router in the
235
+ [OpenROAD](https://theopenroadproject.org/) project.
236
+
237
+ ## License
238
+
239
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.
data/markdown/OR_userguide/OR_fin_README.md ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Metal fill
2
+
3
+ This module inserts floating metal fill shapes to meet metal density
4
+ design rules while obeying DRC constraints. It is driven by a `json`
5
+ configuration file.
6
+
7
+ ## Commands
8
+
9
+ ```{note}
10
+ - Parameters in square brackets `[-param param]` are optional.
11
+ - Parameters without square brackets `-param2 param2` are required.
12
+ ```
13
+
14
+ ### Density Fill
15
+
16
+ ```tcl
17
+ density_fill
18
+ [-rules rules_file]
19
+ [-area {lx ly ux uy}]
20
+ ```
21
+
22
+ #### Options
23
+
24
+ | Switch Name | Description |
25
+ | ----- | ----- |
26
+ | `-rules` | Specify `json` rule file. |
27
+ | `-area` | Optional. If not specified, the core area will be used. |
28
+
29
+ ## Example scripts
30
+
31
+ The rules `json` file controls fill and you can see an example
32
+ [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/platforms/sky130hd/fill.json).
33
+
34
+ The schema for the `json` is:
35
+
36
+ ```json
37
+ {
38
+ "layers": {
39
+ "<group_name>": {
40
+ "layers": "<list of integer gds layers>",
41
+ "names": "<list of name strings>",
42
+ "opc": {
43
+ "datatype": "<list of integer gds datatypes>",
44
+ "width": "<list of widths in microns>",
45
+ "height": "<list of heightsin microns>",
46
+ "space_to_fill": "<real: spacing between fills in microns>",
47
+ "space_to_non_fill": "<real: spacing to non-fill shapes in microns>",
48
+ "space_line_end": "<real: spacing to end of line in microns>"
49
+ },
50
+ "non-opc": {
51
+ "datatype": "<list of integer gds datatypes>",
52
+ "width": "<list of widths in microns>",
53
+ "height": "<list of heightsin microns>",
54
+ "space_to_fill": "<real: spacing between fills in microns>",
55
+ "space_to_non_fill": "<real: spacing to non-fill shapes in microns>"
56
+ }
57
+ }, ...
58
+ }
59
+ }
60
+ ```
61
+
62
+ The `opc` section is optional depending on your process.
63
+
64
+ The width/height lists are effectively parallel arrays of shapes to try
65
+ in left to right order (generally larger to smaller).
66
+
67
+ The layer grouping is for convenience. For example in some technologies many
68
+ layers have similar rules so it is convenient to have a `Mx`, `Cx` group.
69
+
70
+ This all started out in `klayout` so there are some obsolete fields that the
71
+ parser accepts but ignores (e.g., `space_to_outline`).
72
+
73
+ ## Regression tests
74
+
75
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
76
+
77
+ Simply run the following script:
78
+
79
+ ```shell
80
+ ./test/regression
81
+ ```
82
+
83
+ ## Limitations
84
+
85
+ ## FAQs
86
+
87
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+metal%20fill+in%3Atitle)
88
+ about this tool.
89
+
90
+ ## License
91
+
92
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.
data/markdown/OR_userguide/OR_gpl_README.md ADDED
@@ -0,0 +1,243 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Global Placement
2
+
3
+ The global placement module in OpenROAD (`gpl`) is based on the open-source
4
+ RePlAce tool, from the paper "Advancing Solution Quality and Routability Validation
5
+ in Global Placement".
6
+
7
+ Features:
8
+
9
+ - Analytic and nonlinear placement algorithm. Solves
10
+ electrostatic force equations using Nesterov's method.
11
+ ([link](https://cseweb.ucsd.edu/~jlu/papers/eplace-todaes14/paper.pdf))
12
+ - Verified with various commercial technologies and research enablements using OpenDB
13
+ (7/14/16/28/45/55/65nm).
14
+ - Verified deterministic solution generation with various compilers and OS.
15
+ - Supports Mixed-size placement mode.
16
+
17
+ | <img src="./doc/image/adaptec2.inf.gif" width=350px> | <img src="./doc/image/coyote_movie.gif" width=400px> |
18
+ |:--:|:--:|
19
+ | Visualized examples from ISPD 2006 contest; adaptec2.inf |Real-world Design: Coyote (TSMC16 7.5T) |
20
+
21
+ ## Commands
22
+
23
+ ```{note}
24
+ - Parameters in square brackets `[-param param]` are optional.
25
+ - Parameters without square brackets `-param2 param2` are required.
26
+ ```
27
+
28
+ ### Global Placement
29
+
30
+ When using the `-timing_driven` flag, `gpl` does a virtual `repair_design`
31
+ to find slacks and
32
+ weight nets with low slack. It adjusts the worst slacks (modified with
33
+ `-timing_driven_nets_percentage`) using a multiplier (modified with
34
+ `-timing_driven_net_weight_max`). The multiplier
35
+ is scaled from the full value for the worst slack, to 1.0 at the
36
+ `timing_driven_nets_percentage` point. Use the `set_wire_rc` command to set
37
+ resistance and capacitance of estimated wires used for timing.
38
+
39
+ ```
40
+ global_placement
41
+ [-timing_driven]
42
+ [-routability_driven]
43
+ [-skip_initial_place]
44
+ [-incremental]
45
+ [-bin_grid_count grid_count]
46
+ [-density target_density]
47
+ [-init_density_penalty init_density_penalty]
48
+ [-init_wirelength_coef init_wirelength_coef]
49
+ [-min_phi_coef min_phi_conef]
50
+ [-max_phi_coef max_phi_coef]
51
+ [-overflow overflow]
52
+ [-initial_place_max_iter initial_place_max_iter]
53
+ [-initial_place_max_fanout initial_place_max_fanout]
54
+ [-pad_left pad_left]
55
+ [-pad_right pad_right]
56
+ [-verbose_level level]
57
+ [-force_cpu]
58
+ [-skip_io]
59
+ [-routability_check_overflow routability_check_overflow]
60
+ [-routability_max_density routability_max_density]
61
+ [-routability_max_bloat_iter routability_max_bloat_iter]
62
+ [-routability_max_inflation_iter routability_max_inflation_iter]
63
+ [-routability_target_rc_metric routability_target_rc_metric]
64
+ [-routability_inflation_ratio_coef routability_inflation_ratio_coef]
65
+ [-routability_pitch_scale routability_pitch_scale]
66
+ [-routability_max_inflation_ratio routability_max_inflation_ratio]
67
+ [-routability_rc_coefficients routability_rc_coefficients]
68
+ [-timing_driven_net_reweight_overflow]
69
+ [-timing_driven_net_weight_max]
70
+ [-timing_driven_nets_percentage]
71
+ ```
72
+
73
+ #### General Arguments
74
+
75
+ | Switch Name | Description |
76
+ | ----- | ----- |
77
+ | `-timing_driven` | Enable timing-driven mode. See [link](#timing-driven-arguments) for timing-specific arguments. |
78
+ | `-routability_driven` | Enable routability-driven mode. See [link](#routability-driven-arguments) for routability-specific arguments. |
79
+ | `-skip_initial_place` | Skip the initial placement (Biconjugate gradient stabilized, or BiCGSTAB solving) before Nesterov placement. Initial placement improves HPWL by ~5% on large designs. Equivalent to `-initial_place_max_iter 0`. |
80
+ | `-incremental` | Enable the incremental global placement. Users would need to tune other parameters (e.g., `init_density_penalty`) with pre-placed solutions. |
81
+ | `-bin_grid_count` | Set bin grid's counts. The internal heuristic defines the default value. Allowed values are integers `[64,128,256,512,...]`. |
82
+ | `-density` | Set target density. The default value is `0.7` (i.e., 70%). Allowed values are floats `[0, 1]`. |
83
+ | `-init_density_penalty` | Set initial density penalty. The default value is `8e-5`. Allowed values are floats `[1e-6, 1e6]`. |
84
+ | `-init_wirelength_coef` | Set initial wirelength coefficient. The default value is `0.25`. Allowed values are floats. |
85
+ | `-min_phi_coef` | Set `pcof_min` ($\mu_k$ Lower Bound). The default value is `0.95`. Allowed values are floats `[0.95, 1.05]`. |
86
+ | `-max_phi_coef` | Set `pcof_max` ($\mu_k$ Upper Bound). Default value is 1.05. Allowed values are `[1.00-1.20, float]`. |
87
+ | `-overflow` | Set target overflow for termination condition. The default value is `0.1`. Allowed values are floats `[0, 1]`. |
88
+ | `-initial_place_max_iter` | Set maximum iterations in the initial place. The default value is 20. Allowed values are integers `[0, MAX_INT]`. |
89
+ | `-initial_place_max_fanout` | Set net escape condition in initial place when $fanout \geq initial\_place\_max\_fanout$. The default value is 200. Allowed values are integers `[1, MAX_INT]`. |
90
+ | `-pad_left` | Set left padding in terms of number of sites. The default value is 0, and the allowed values are integers `[1, MAX_INT]` |
91
+ | `-pad_right` | Set right padding in terms of number of sites. The default value is 0, and the allowed values are integers `[1, MAX_INT]` |
92
+ | `-verbose_level` | Set verbose level for `gpl`. The default value is 1. Allowed values are integers `[0, 5]`. |
93
+ | `-force_cpu` | Force to use the CPU solver even if the GPU is available. |
94
+ | `-skip_io` | Flag to ignore the IO ports when computing wirelength during placement. The default value is False, allowed values are boolean. |
95
+
96
+ #### Routability-Driven Arguments
97
+
98
+ | Switch Name | Description |
99
+ | ----- | ----- |
100
+ | `-routability_check_overflow` | Set overflow threshold for routability mode. The default value is `0.2`, and the allowed values are floats `[0, 1]`. |
101
+ | `-routability_max_density` | Set density threshold for routability mode. The default value is `0.99`, and the allowed values are floats `[0, 1]`. |
102
+ | `-routability_max_bloat_iter` | Set bloat iteration threshold for routability mode. The default value is `1`, and the allowed values are integers `[1, MAX_INT]`.|
103
+ | `-routability_max_inflation_iter` | Set inflation iteration threshold for routability mode. The default value is `4`, and the allowed values are integers `[1, MAX_INT]`. |
104
+ | `-routability_target_rc_metric` | Set target RC metric for routability mode. The default value is `1.25`, and the allowed values are floats. |
105
+ | `-routability_inflation_ratio_coef` | Set inflation ratio coefficient for routability mode. The default value is `2.5`, and the allowed values are floats. |
106
+ | `-routability_max_inflation_ratio` | Set inflation ratio threshold for routability mode. The default value is `2.5`, and the allowed values are floats. |
107
+ | `-routability_rc_coefficients` | Set routability RC coefficients. It comes in the form of a Tcl List `{k1, k2, k3, k4}`. The default value for each coefficient is `{1.0, 1.0, 0.0, 0.0}` respectively, and the allowed values are floats. |
108
+
109
+ #### Timing-Driven Arguments
110
+
111
+ | Switch Name | Description |
112
+ | ----- | ----- |
113
+ | `-timing_driven_net_reweight_overflow` | Set overflow threshold for timing-driven net reweighting. Allowed value is a Tcl list of integers where each number is `[0, 100]`. |
114
+ | `-timing_driven_net_weight_max` | Set the multiplier for the most timing-critical nets. The default value is `1.9`, and the allowed values are floats. |
115
+ | `-timing_driven_nets_percentage` | Set the reweighted percentage of nets in timing-driven mode. The default value is 10. Allowed values are floats `[0, 100]`. |
116
+
117
+
118
+ ### Useful developer functions
119
+
120
+ If you are a developer, you might find these useful. More details can be found in the [source file](./src/replace.cpp) or the [swig file](./src/replace.i).
121
+
122
+ ```tcl
123
+ # debugging global placement
124
+ global_placement_debug -pause -update -inst -draw_bins -initial
125
+
126
+ # adds padding and gets global placement uniform target density
127
+ get_global_placement_uniform_density -pad_left -pad_right
128
+ ```
129
+
130
+ ### Cluster Flops
131
+
132
+ Cluster single bit flops into multi-bit flops.
133
+
134
+ ```
135
+ cluster_flops
136
+ [-tray_weight tray_weight]
137
+ [-timing_weight timing_weight]
138
+ [-max_split_size max_split_size]
139
+ [-num_paths num_paths]
140
+ ```
141
+
142
+ #### General Arguments
143
+
144
+ | Switch Name | Description |
145
+ | ----- | ----- |
146
+ | `-tray_weight` | Set the weighting factor for tray cost (recommended to be `[20.0, float]`). |
147
+ | `-timing_weight` | Set the weighting factor for timing-critical paths in (recommended to be `[1.0. float]`). |
148
+ | `-max_split_size` | The maximum size of a single pointset after running the pointset decomposition algorithm for runtime improvement (default = 250). |
149
+ | `num_paths` | Number of timing-critical paths to consider (default = 0). |
150
+
151
+
152
+ ## Example Scripts
153
+
154
+ Example scripts demonstrating how to run `gpl` on a sample design on `core01` as follows:
155
+
156
+ ```shell
157
+ ./test/core01.tcl
158
+ ```
159
+
160
+ ## Regression tests
161
+
162
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
163
+
164
+ Simply run the following script:
165
+
166
+ ```shell
167
+ ./test/regression
168
+ ```
169
+
170
+ ## Limitations
171
+
172
+ ## Using the Python interface to gpl
173
+
174
+ This API tries to stay close to the API defined in `C++` class `Replace`
175
+ that is located [here](include/gpl/Replace.h).
176
+
177
+ When initializing a design, a sequence of Python commands might look like
178
+ the following:
179
+
180
+ ```python
181
+ from openroad import Design, Tech
182
+ tech = Tech()
183
+ tech.readLef(...)
184
+ design = Design(tech)
185
+ design.readDef(...)
186
+ gpl = design.getReplace()
187
+ ```
188
+
189
+ Here is an example of some options / configurations to the global placer.
190
+ (See [Replace.h](include/gpl/Replace.h) for a complete list)
191
+
192
+ ```python
193
+ gpl.setInitialPlaceMaxIter(iter)
194
+ gpl.setSkipIoMode(skip_io)
195
+ gpl.setTimingDrivenMode(timing_driven)
196
+ gpl.setTimingNetWeightMax(weight)
197
+ ```
198
+
199
+ There are some useful Python functions located in the file
200
+ [grt_aux.py](test/grt_aux.py) but these are not considered a part of the *final*
201
+ API and they may change.
202
+
203
+ ## FAQs
204
+
205
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+replace+in%3Atitle)
206
+ about this tool.
207
+
208
+ ## References
209
+
210
+ - C.-K. Cheng, A. B. Kahng, I. Kang and L. Wang, "RePlAce: Advancing
211
+ Solution Quality and Routability Validation in Global Placement", IEEE
212
+ Transactions on Computer-Aided Design of Integrated Circuits and Systems,
213
+ 38(9) (2019), pp. 1717-1730. [(.pdf)](https://vlsicad.ucsd.edu/Publications/Journals/j126.pdf)
214
+ - J. Lu, P. Chen, C.-C. Chang, L. Sha, D. J.-H. Huang, C.-C. Teng and
215
+ C.-K. Cheng, "ePlace: Electrostatics based Placement using Fast Fourier
216
+ Transform and Nesterov's Method", ACM TODAES 20(2) (2015), article 17. [(.pdf)](https://cseweb.ucsd.edu/~jlu/papers/eplace-todaes14/paper.pdf)
217
+ - J. Lu, H. Zhuang, P. Chen, H. Chang, C.-C. Chang, Y.-C. Wong, L. Sha,
218
+ D. J.-H. Huang, Y. Luo, C.-C. Teng and C.-K. Cheng, "ePlace-MS:
219
+ Electrostatics based Placement for Mixed-Size Circuits", IEEE TCAD 34(5)
220
+ (2015), pp. 685-698. [(.pdf)](https://cseweb.ucsd.edu/~jlu/papers/eplace-ms-tcad14/paper.pdf)
221
+ - A. B. Kahng, J. Li and L. Wang,
222
+ "Improved Flop Tray-Based Design Implementation for Power Reduction",
223
+ IEEE/ACM ICCAD, 2016, pp. 20:1-20:8.
224
+ - The timing-driven mode has been implemented by
225
+ Mingyu Woo (only available in [legacy repo in standalone
226
+ branch](https://github.com/The-OpenROAD-Project/RePlAce/tree/standalone).)
227
+ - The routability-driven mode has been implemented by Mingyu Woo.
228
+ - Timing-driven mode re-implementation is ongoing with the current
229
+ clean-code structure.
230
+
231
+ ## Authors
232
+
233
+ - Authors/maintainer since Jan 2020: Mingyu Woo (Ph.D. Advisor:
234
+ Andrew. B. Kahng)
235
+ - Original open-sourcing of RePlAce: August 2018, by Ilgweon Kang
236
+ (Ph.D. Advisor: Chung-Kuan Cheng), Lutong Wang (Ph.D. Advisor: Andrew
237
+ B. Kahng), and Mingyu Woo (Ph.D. Advisor: Andrew B. Kahng).
238
+ - Also thanks to Dr. Jingwei Lu for open-sourcing the previous
239
+ ePlace-MS/ePlace project code.
240
+
241
+ ## License
242
+
243
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.
data/markdown/OR_userguide/OR_grt_README.md ADDED
@@ -0,0 +1,489 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Global Routing
2
+
3
+ The global routing module in OpenROAD (`grt`) is based on FastRoute, an
4
+ open-source global router originally derived from Iowa State University's
5
+ FastRoute4.1 algorithm.
6
+
7
+ ## Commands
8
+
9
+ ```{note}
10
+ - Parameters in square brackets `[-param param]` are optional.
11
+ - Parameters without square brackets `-param2 param2` are required.
12
+ ```
13
+
14
+ ### Global Route
15
+
16
+ ```tcl
17
+ global_route
18
+ [-guide_file out_file]
19
+ [-congestion_iterations iterations]
20
+ [-congestion_report_file file_name]
21
+ [-congestion_report_iter_step steps]
22
+ [-grid_origin {x y}]
23
+ [-critical_nets_percentage percent]
24
+ [-allow_congestion]
25
+ [-verbose]
26
+ [-start_incremental]
27
+ [-end_incremental]
28
+ ```
29
+
30
+ #### Options
31
+
32
+ | Switch Name | Description |
33
+ | ----- | ----- |
34
+ | `-guide_file` | Set the output guides file name (e.g., `route.guide`). |
35
+ | `-congestion_iterations` | Set the number of iterations made to remove the overflow of the routing. The default value is `50`, and the allowed values are integers `[0, MAX_INT]`. |
36
+ | `-congestion_report_file` | Set the file name to save the congestion report. The file generated can be read by the DRC viewer in the GUI (e.g., `report_file.rpt`). |
37
+ | `-congestion_report_iter_step` | Set the number of iterations to report. The default value is `0`, and the allowed values are integers `[0, MAX_INT]`. |
38
+ | `-grid_origin` | Set the (x, y) origin of the routing grid in DBU. For example, `-grid_origin {1 1}` corresponds to the die (0, 0) + 1 DBU in each x--, y- direction. |
39
+ | `-critical_nets_percentage` | Set the percentage of nets with the worst slack value that are considered timing critical, having preference over other nets during congestion iterations (e.g. `-critical_nets_percentage 30`). The default value is `0`, and the allowed values are integers `[0, MAX_INT]`. |
40
+ | `-allow_congestion` | Allow global routing results to be generated with remaining congestion. The default is false. |
41
+ | `-verbose` | This flag enables the full reporting of the global routing. |
42
+ | `-start_incremental` | This flag initializes the GRT listener to get the net modified. The default is false. |
43
+ | `-end_incremental` | This flag run incremental GRT with the nets modified. The default is false. |
44
+
45
+ ### Set Routing Layers
46
+
47
+ ```tcl
48
+ set_routing_layers
49
+ [-signal min-max]
50
+ [-clock min-max]
51
+ ```
52
+
53
+ #### Options
54
+
55
+ | Switch Name | Description |
56
+ | ----- | ----- |
57
+ | `-signal` | Set the min and max routing signal layer (names) in this format "%s-%s". |
58
+ | `-clock` | Set the min and max routing clock layer (names) in this format "%s-%s". |
59
+
60
+ Example: `set_routing_layers -signal Metal2-Metal10 -clock Metal6-Metal9`
61
+
62
+ ### Set Macro Extension
63
+
64
+ ```tcl
65
+ set_macro_extension extension
66
+ ```
67
+
68
+ #### Options
69
+
70
+ | Argument Name | Description |
71
+ | ----- | ----- |
72
+ | `extension` | Number of `GCells` added to the blockage boundaries from macros. A `GCell` is typically defined in terms of `Mx` routing tracks. The default `GCell` size is 15 `M3` pitches. |
73
+
74
+ Example: `set_macro_extension 2`
75
+
76
+ ### Set Pin Offset
77
+
78
+ ```tcl
79
+ set_pin_offset offset
80
+ ```
81
+
82
+ #### Options
83
+
84
+ | Argument Name | Description |
85
+ | ----- | ----- |
86
+ | `offset` | Pin offset in microns (must be a positive integer). |
87
+
88
+ ### Set Global Routing Layer Adjustment
89
+
90
+ The `set_global_routing_layer_adjustment` command sets routing resource
91
+ adjustments in the routing layers of the design. Such adjustments reduce the number of
92
+ routing tracks that the global router assumes to exist. This promotes the spreading of routing
93
+ and reduces peak congestion, to reduce challenges for detailed routing.
94
+
95
+ ```tcl
96
+ set_global_routing_layer_adjustment layer adjustment
97
+ ```
98
+
99
+ #### Options
100
+
101
+ | Argument Name | Description |
102
+ | ----- | ----- |
103
+ | `layer` | Integer for the layer number (e.g. for M1 you would use 1). |
104
+ | `adjustment` | Float indicating the percentage reduction of each edge in the specified layer. |
105
+
106
+ You can set adjustment for a
107
+ specific layer, e.g., `set_global_routing_layer_adjustment Metal4 0.5` reduces
108
+ the routing resources of routing layer `Metal4` by 50%. You can also set adjustment
109
+ for all layers at once using `*`, e.g., `set_global_routing_layer_adjustment * 0.3` reduces the routing resources of all routing layers by 30%. And, you can
110
+ also set resource adjustment for a layer range, e.g.: `set_global_routing_layer_adjustment
111
+ Metal4-Metal8 0.3` reduces the routing resources of routing layers `Metal4`,
112
+ `Metal5`, `Metal6`, `Metal7` and `Metal8` by 30%.
113
+
114
+ ### Set Routing Alpha
115
+
116
+ By default the global router uses heuristic rectilinear Steiner minimum
117
+ trees (RSMTs) as an initial basis to construct route guides. An RSMT
118
+ tries to minimize the total wirelength needed to connect a given set
119
+ of pins. The Prim-Dijkstra heuristic is an alternative net topology
120
+ algorithm that supports a trade-off between total wirelength and maximum
121
+ path depth from the net driver to its loads. The `set_routing_alpha`
122
+ command enables the Prim/Dijkstra algorithm and sets the alpha parameter
123
+ used to trade-off wirelength and path depth. Alpha is between 0.0
124
+ and 1.0. When alpha is 0.0 the net topology minimizes total wirelength
125
+ (i.e. capacitance). When alpha is 1.0 it minimizes longest path between
126
+ the driver and loads (i.e., maximum resistance). Typical values are
127
+ 0.4-0.8. You can call it multiple times for different nets.
128
+
129
+ ```tcl
130
+ set_routing_alpha
131
+ [-net net_name]
132
+ [-min_fanout fanout]
133
+ [-min_hpwl hpwl]
134
+ [-clock_nets]
135
+ alpha
136
+ ```
137
+
138
+ #### Options
139
+
140
+ | Switch Name | Description |
141
+ | ----- | ----- |
142
+ | `-net` | Net name. |
143
+ | `-min_fanout` | Set the minimum number for fanout. |
144
+ | `-min_hpwl` | Set the minimum half-perimetere wirelength (microns). |
145
+ | `-clock_nets` | Flag to set routing alpha for clock nets. The default value is `False`, and the allowed values are bools. |
146
+ | `alpha` | Set the trade-off value between wirelength and path depth. The allowed values are floats `[0, 1]`. |
147
+
148
+ Example: `set_routing_alpha -net clk 0.3` sets the alpha value of 0.3 for net *clk*.
149
+
150
+ ### Set Global Routing Region Adjustment
151
+
152
+ ```tcl
153
+ set_global_routing_region_adjustment
154
+ {lower_left_x lower_left_y upper_right_x upper_right_y}
155
+ -layer layer
156
+ -adjustment adjustment
157
+ ```
158
+
159
+ #### Options
160
+
161
+ | Switch Name | Description |
162
+ | ----- | ----- |
163
+ | `lower_left_x`, `lower_left_y`, `upper_right_x` , `upper_right_y` | Bounding box to consider. |
164
+ | `-layer` | Integer for the layer number (e.g. for M1 you would use 1). |
165
+ | `-adjustment` | Float indicating the percentage reduction of each edge in the specified layer. |
166
+
167
+ Example: `set_global_routing_region_adjustment {1.5 2 20 30.5} -layer Metal4 -adjustment 0.7`
168
+
169
+ ### Set Global Routing Randomness
170
+
171
+ The randomized global routing shuffles the
172
+ order of the nets and randomly subtracts or adds to the capacities of
173
+ a random set of edges.
174
+
175
+ ```tcl
176
+ set_global_routing_random
177
+ [-seed seed]
178
+ [-capacities_perturbation_percentage percent]
179
+ [-perturbation_amount value]
180
+ ```
181
+
182
+ #### Options
183
+
184
+ | Switch Name | Description |
185
+ | ----- | ----- |
186
+ | `-seed` | Sets the random seed (must be non-zero for randomization). |
187
+ | `-capacities_perturbation_percentage` | Sets the percentage of edges whose capacities are perturbed. By default, the edge capacities are perturbed by adding or subtracting 1 (track) from the original capacity. |
188
+ | `-perturbation_amount` | Sets the perturbation value of the edge capacities. This option is only meaningful when `-capacities_perturbation_percentage` is used. |
189
+
190
+ Example:
191
+ `set_global_routing_random -seed 42 \
192
+ -capacities_perturbation_percentage 50 \
193
+ -perturbation_amount 2`
194
+
195
+ ### Set Specific Nets to Route
196
+
197
+ The `set_nets_to_route` command defines a list of nets to route. Only the nets
198
+ defined in this command are routed, leaving the remaining nets without any
199
+ global route guides.
200
+
201
+ ```tcl
202
+ set_nets_to_route
203
+ net_names
204
+ ```
205
+
206
+ #### Options
207
+
208
+ | Switch Name | Description |
209
+ | ----- | ----- |
210
+ | `net_names` | Tcl list of set of nets (e.g. `{net1, net2}`). |
211
+
212
+ ### Repair Antennas
213
+
214
+ The `repair_antennas` command checks the global routing for antenna
215
+ violations and repairs the violations by inserting diodes near the
216
+ gates of the violating nets. By default the command runs only one
217
+ iteration to repair antennas. Filler instances added by the
218
+ `filler_placement` command should NOT be in the database when
219
+ `repair_antennas` is called.
220
+
221
+ ```tcl
222
+ repair_antennas
223
+ [diode_cell]
224
+ [-iterations iterations]
225
+ [-ratio_margin margin]
226
+ ```
227
+
228
+ #### Options
229
+
230
+ | Switch Name | Description |
231
+ | ----- | ----- |
232
+ | `diode_cell` | Diode cell to fix antenna violations. |
233
+ | `-iterations` | Number of iterations. The default value is `1`, and the allowed values are integers `[0, MAX_INT]`. |
234
+ | `-ratio_margin` | Add a margin to the antenna ratios. The default value is `0`, and the allowed values are integers `[0, 100]`. |
235
+
236
+ See LEF/DEF 5.8 Language Reference, Appendix C, "Calculating and
237
+ Fixing Process Antenna Violations" for a [description](coriolis.lip6.fr/doc/lefdef/lefdefref/lefdefref.pdf)
238
+ of antenna violations.
239
+
240
+ If no `diode_cell` argument is specified the LEF cell with class CORE, ANTENNACELL will be used.
241
+ If any repairs are made the filler instances are remove and must be
242
+ placed with the `filler_placement` command.
243
+
244
+ If the LEF technology layer `ANTENNADIFFSIDEAREARATIO` properties are constant
245
+ instead of PWL, inserting diodes will not improve the antenna ratios,
246
+ and thus, no
247
+ diodes are inserted. The following warning message will be reported:
248
+
249
+ ```
250
+ [WARNING GRT-0243] Unable to repair antennas on net with diodes.
251
+ ```
252
+
253
+ ### Write Global Routing Guides
254
+
255
+ ```tcl
256
+ write_guides file_name
257
+ ```
258
+
259
+ | Switch Name | Description |
260
+ | ----- | ----- |
261
+ | `file_name` | Guide file name. |
262
+
263
+ Example: `write_guides route.guide`.
264
+
265
+ ### Estimate Global Routing Parasitics
266
+
267
+ To estimate RC parasitics based on global route results, use the `-global_routing`
268
+ option of the `estimate_parasitics` command.
269
+
270
+ ```{note}
271
+ To see the function definition for `estimate_parasitics`, refer to
272
+ [Resizer docs](../rsz/README.md#estimate-parasitics).
273
+ ```
274
+
275
+ ```tcl
276
+ estimate_parasitics -global_routing
277
+ ```
278
+
279
+ ### Plot Global Routing Guides
280
+
281
+ The `draw_route_guides` command plots the route guides for a set of nets.
282
+ To erase the route guides from the GUI, pass an empty list to this command:
283
+ `draw_route_guides {}`.
284
+
285
+ ```tcl
286
+ draw_route_guides
287
+ net_names
288
+ [-show_pin_locations]
289
+ ```
290
+
291
+ #### Options
292
+
293
+ | Switch Name | Description |
294
+ | ----- | ----- |
295
+ | `net_names` | Tcl list of set of nets (e.g. `{net1, net2}`). |
296
+ | `-show_pin_locations` | Draw circles for the pin positions on the routing grid. |
297
+
298
+ ### Report Wirelength
299
+
300
+ The `report_wire_length` command reports the wire length of the nets. Use the `-global_route`
301
+ and the `-detailed_route` flags to report the wire length from global and detailed routing,
302
+ respectively. If none of these flags are used, the tool will identify the state of the design
303
+ and report the wire length accordingly.
304
+
305
+ ```tcl
306
+ report_wire_length
307
+ [-net net_list]
308
+ [-file file]
309
+ [-global_route]
310
+ [-detailed_route]
311
+ [-verbose]
312
+ ```
313
+
314
+ #### Options
315
+
316
+ | Switch Name | Description |
317
+ | ----- | ----- |
318
+ | `-net` | List of nets to report the wirelength. Use `*` to report the wire length for all nets of the design. |
319
+ | `-file` | The name of the file for the wirelength report. |
320
+ | `-global_route` | Report the wire length of the global routing. |
321
+ | `-detailed_route` | Report the wire length of the detailed routing. |
322
+ | `-verbose` | This flag enables the full reporting of the layer-wise wirelength information. |
323
+
324
+ Example: `report_wire_length -net {clk net60} -global_route -detailed_route -verbose -file out.csv`
325
+
326
+ ### Debug Mode
327
+
328
+ The `global_route_debug` command allows you to start a debug mode to view the status of the Steiner Trees.
329
+ It also allows you to dump the input positions for the Steiner tree creation of a net.
330
+ This must be used before calling the `global_route` command.
331
+ Set the name of the net and the trees that you want to visualize.
332
+
333
+ ```tcl
334
+ global_route_debug
335
+ [-st]
336
+ [-rst]
337
+ [-tree2D]
338
+ [-tree3D]
339
+ [-saveSttInput file_name]
340
+ [-net net_name]
341
+ ```
342
+
343
+ #### Options
344
+
345
+ | Switch Name | Description |
346
+ | ----- | ----- |
347
+ | `-st` | Show the Steiner Tree generated by `stt`. |
348
+ | `-rst` | Show the Rectilinear Steiner Tree generated by `grt`. |
349
+ | `-tree2D` | Show the Rectilinear Steiner Tree generated by `grt` after the overflow iterations. |
350
+ | `-tree3D` | Show the 3D Rectilinear Steiner Tree post-layer assignment. |
351
+ | `-saveSttInput` | File name to save `stt` input of a net. |
352
+ | `-net` | The name of the net name to be displayed. |
353
+
354
+ ## Example scripts
355
+
356
+ Examples scripts demonstrating how to run FastRoute on a sample design of `gcd` as follows:
357
+
358
+ ```shell
359
+ ./test/gcd.tcl
360
+ ```
361
+
362
+ ### Read Global Routing Guides
363
+
364
+ ```tcl
365
+ read_guides file_name
366
+ ```
367
+
368
+ #### Options
369
+
370
+ | Switch Name | Description |
371
+ | ----- | ----- |
372
+ | `file_name` | Path to global routing guide. |
373
+
374
+ ### Useful developer functions
375
+
376
+ If you are a developer, you might find these useful. More details can be found in the [source file](./src/GlobalRouter.cpp) or the [swig file](./src/GlobalRouter.i).
377
+
378
+ | Function Name | Description |
379
+ | ----- | ----- |
380
+ | `check_routing_layer` | Check if the layer is within the min/max routing layer specified. |
381
+ | `parse_layer_name` | Get routing layer number from layer name |
382
+ | `parse_layer_range` | Parses a range from `layer_range` argument of format (%s-%s). `cmd` argument is not used. |
383
+ | `check_region` | Checks the defined region if its within the die area. |
384
+ | `define_layer_range` | Provide a Tcl list of layers and automatically generate the min and max layers for signal routing. |
385
+ | `define_clock_layer_range` | Provide a Tcl list of layers and automatically generate the min and max layers for clock routing. |
386
+ | `have_detailed_route` | Checks if block has detailed route already. |
387
+
388
+ ## Regression tests
389
+
390
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
391
+
392
+ Simply run the following script:
393
+
394
+ ```shell
395
+ ./test/regression
396
+ ```
397
+
398
+ ## Limitations
399
+
400
+ ## Using the Python interface to grt
401
+
402
+ ```{warning}
403
+ The `Python` interface is currently in development and is subject to change.
404
+ ```
405
+
406
+ The `Python` API tries to stay close to the API defined in the `C++` class
407
+ `GlobalRouter` that is located [here](./include/grt/GlobalRouter.h)
408
+
409
+ When initializing a design, a sequence of `Python` commands might look like
410
+ the following:
411
+
412
+ ```python
413
+ from openroad import Design, Tech
414
+ tech = Tech()
415
+ tech.readLef(...)
416
+ design = Design(tech)
417
+ design.readDef(...)
418
+ gr = design.getGlobalRouter()
419
+ ```
420
+
421
+ Here are some options to the `global_route`
422
+ command. (See `GlobalRouter.h` for a complete list)
423
+
424
+ ```python
425
+ gr.setGridOrigin(x, y) # int, default 0,0
426
+ gr.setCongestionReportFile(file_name) # string
427
+ gr.setOverflowIterations(n) # int, default 50
428
+ gr.setAllowCongestion(allowCongestion) # boolean, default False
429
+ gr.setCriticalNetsPercentage(percentage) # float
430
+ gr.setMinRoutingLayer(minLayer) # int
431
+ gr.setMaxRoutingLayer(maxLayer) # int
432
+ gr.setMinLayerForClock(minLayer) # int
433
+ gr.setMaxLayerForClock(maxLayer) # int
434
+ gr.setVerbose(v) # boolean, default False
435
+ ```
436
+
437
+ and when ready to actually do the global route:
438
+
439
+ ```python
440
+ gr.globalRoute(save_guides) # boolean, default False
441
+ ```
442
+
443
+ If you have set `save_guides` to True, you can then save the guides in `file_name` with:
444
+
445
+ ```python
446
+ design.getBlock().writeGuides(file_name)
447
+ ```
448
+
449
+ You can find the index of a named layer with
450
+
451
+ ```python
452
+ lindex = tech.getDB().getTech().findLayer(layer_name)
453
+ ```
454
+
455
+ or, if you only have the `Python` design object
456
+
457
+ ```python
458
+ lindex = design.getTech().getDB().getTech().findLayer(layer_name)
459
+ ```
460
+
461
+ Be aware that much of the error checking is done in `Tcl`, so that with
462
+ the current `C++` / `Python` API, that might be an issue to deal
463
+ with. There are also some useful `Python` functions located in the `grt_aux.py` [file](./test/grt_aux.py)
464
+ but these are not considered a part of the *final* API and may be subject to change.
465
+
466
+ ## FAQs
467
+
468
+ Check out
469
+ [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+fastroute+in%3Atitle)
470
+ about this tool.
471
+
472
+ ## References
473
+
474
+ - Database comes from [OpenDB](https://github.com/The-OpenROAD-Project/OpenDB)
475
+ - [FastRoute 4.1 documentation](src/fastroute/README). The FastRoute4.1
476
+ version was received from [Yue Xu](mailto:yuexu@iastate.edu) on June 15, 2019.
477
+ - Min Pan, Yue Xu, Yanheng Zhang and Chris Chu. "FastRoute: An Efficient and
478
+ High-Quality Global Router. VLSI Design, Article ID 608362, 2012."
479
+ Available [here](https://home.engineering.iastate.edu/~cnchu/pubs/j52.pdf).
480
+ - C. J. Alpert, T. C. Hu, J. H. Huang, A. B. Kahng and
481
+ D. Karger, "Prim-Dijkstra Tradeoffs for Improved Performance-Driven
482
+ Global Routing", IEEE Transactions on Computer-Aided Design of
483
+ Integrated Circuits and Systems 14(7) (1995), pp. 890-896. Available
484
+ [here](https://vlsicad.ucsd.edu/Publications/Journals/j18.pdf).
485
+
486
+
487
+ ## License
488
+
489
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.
data/markdown/OR_userguide/OR_gui_README.md ADDED
@@ -0,0 +1,507 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Graphical User Interface
2
+
3
+ The graphical user interface can be access by launching OpenROAD with ``-gui`` or by opening it from the command-line with ``gui::show``.
4
+
5
+ ## Commands
6
+
7
+ ### Add buttons to the toolbar
8
+
9
+ ```
10
+ create_toolbar_button [-name name]
11
+ -text button_text
12
+ -script tcl_script
13
+ [-echo]
14
+ ```
15
+
16
+ Returns: name of the new button, either ``name`` or ``buttonX``.
17
+
18
+ Options description:
19
+ - ``button_text``: The text to put on the button.
20
+ - ``tcl_script``: The tcl script to evaluate when the button is pressed.
21
+ - ``name``: (optional) name of the button, used when deleting the button.
22
+ - ``echo``: (optional) indicate that the commands in the ``tcl_script`` should be echoed in the log.
23
+
24
+ To remove the button:
25
+
26
+ ```
27
+ gui::remove_toolbar_button name
28
+ ```
29
+
30
+ ### Add items to the menubar
31
+
32
+ ```
33
+ create_menu_item [-name name]
34
+ [-path menu_path]
35
+ -text item_text
36
+ -script tcl_script
37
+ [-shortcut key_shortcut]
38
+ [-echo]
39
+ ```
40
+
41
+ Returns: name of the new item, either ``name`` or ``actionX``.
42
+
43
+ Options description:
44
+ - ``item_text``: The text to put on the item.
45
+ - ``tcl_script``: The tcl script to evaluate when the button is pressed.
46
+ - ``name``: (optional) name of the item, used when deleting the item.
47
+ - ``menu_path``: (optional) Menu path to place the new item in (hierarchy is separated by /), defaults to "Custom Scripts", but this can also be "Tools" or "New menu/New submenu".
48
+ - ``key_shortcut``: (optional) key shortcut to trigger this item.
49
+ - ``echo``: (optional) indicate that the commands in the ``tcl_script`` should be echoed in the log.
50
+
51
+ To remove the item:
52
+
53
+ ```
54
+ gui::remove_menu_item name
55
+ ```
56
+
57
+
58
+ ### Save screenshot of layout
59
+
60
+ This command can be both be used when the GUI is active and not active.
61
+
62
+ ```
63
+ save_image [-resolution microns_per_pixel]
64
+ [-area {x0 y0 x1 y1}]
65
+ [-width width]
66
+ [-display_option {option value}]
67
+ filename
68
+ ```
69
+
70
+ Options description:
71
+ - ``filename`` path to save the image to.
72
+ - ``x0, y0`` first corner of the layout area (in microns) to be saved, default is to save what is visible on the screen unless called when gui is not active and then it selected the whole block.
73
+ - ``x1, y1`` second corner of the layout area (in microns) to be saved, default is to save what is visible on the screen unless called when gui is not active and then it selected the whole block.
74
+ - ``microns_per_pixel`` resolution in microns per pixel to use when saving the image, default will match what the GUI has selected.
75
+ - ``width`` width of the output image in pixels, default will be computed from the resolution. Cannot be used with ``-resolution``.
76
+ - ``option`` specific setting for a display option to show or hide specific elements. For example, to hide metal1 ``-display_option {Layers/metal1 false}``, to show routing tracks ``-display_option {Tracks/Pref true}``, or to show everthing ``-display_option {* true}``.
77
+
78
+ ### Save screenshot of clock trees
79
+
80
+ ```
81
+ save_clocktree_image filename
82
+ -clock clock_name
83
+ [-width width]
84
+ [-height height]
85
+ [-corner corner]
86
+ ```
87
+
88
+ Options description:
89
+ - ``filename`` path to save the image to.
90
+ - ``-clock`` name of the clock to save the clocktree for.
91
+ - ``-corner`` name of the timing corner to save the clocktree for, default to the first corner defined.
92
+ - ``-height`` height of the image in pixels, defaults to the height of the GUI widget.
93
+ - ``-width`` width of the image in pixels, defaults to the width of the GUI widget.
94
+
95
+ ### Selecting objects
96
+
97
+ ```
98
+ select -type object_type
99
+ [-name glob_pattern]
100
+ [-filter attribute=value]
101
+ [-case_insensitive]
102
+ [-highlight group]
103
+ ```
104
+
105
+ Returns: number of objects selected.
106
+
107
+ Options description:
108
+ - ``object_type``: name of the object type. For example, ``Inst`` for instances, ``Net`` for nets, and ``DRC`` for DRC violations.
109
+ - ``glob_pattern``: (optional) filter selection by the specified name. For example, to only select clk nets ``*clk*``. Use ``-case_insensitive`` to filter based on case insensitive instead of case sensitive.
110
+ - ``attribute=value``: (optional) filter selection based on the objects' properties. ``attribute`` represents the property's name and ``value`` the property's value. In case the property holds a collection (e. g. BTerms in a Net) or a table (e. g. Layers in a Generate Via Rule) ``value`` can be any element within those. A special case exists for checking whether a collection is empty or not by using the value ``CONNECTED``. This can be useful to select a specific group of elements (e. g. BTerms=CONNECTED will select only Nets connected to Input/Output Pins).
111
+ - ``group``: (optional) add the selection to the specific highlighting group. Values can be 0 to 7.
112
+
113
+ ### Displaying timing cones
114
+
115
+ ```
116
+ display_timing_cone pin
117
+ [-fanin]
118
+ [-fanout]
119
+ [-off]
120
+ ```
121
+
122
+ Options description:
123
+ - ``pin``: name of the instance or block pin.
124
+ - ``fanin``: (optional) display the fanin timing cone.
125
+ - ``fanout``: (optional) display the fanout timing cone.
126
+ - ``off``: (optional) remove the timing cone.
127
+
128
+ ### Limit drawing to specific nets
129
+
130
+ ```
131
+ focus_net net
132
+ [-remove]
133
+ [-clear]
134
+ ```
135
+
136
+ Options description:
137
+ - ``pin``: name of the net.
138
+ - ``remove``: (optional) removes the net from from the focus.
139
+ - ``clear``: (optional) clears all nets from focus.
140
+
141
+ ## TCL functions
142
+
143
+ ### Support
144
+
145
+ Determine is the GUI is active:
146
+
147
+ ```
148
+ gui::enabled
149
+ ```
150
+
151
+ Announce to the GUI that a design was loaded
152
+ (note: this is only needed when the design was loaded through the odb API and not via ``read_def`` or ``read_db``):
153
+
154
+ ```
155
+ gui::design_created
156
+ ```
157
+
158
+ To load the results of a DRC report:
159
+
160
+ ```
161
+ gui::load_drc filename
162
+ ```
163
+
164
+ ### Opening and closing
165
+
166
+ To open the GUI from the command-line (this command does not return until the GUI is closed):
167
+
168
+ ```
169
+ gui::show
170
+ gui::show script
171
+ gui::show script interactive
172
+ ```
173
+
174
+ Options description:
175
+ - ``script`` TCL script to evaluate in the GUI.
176
+ - ``interactive`` indicates if true the GUI should open in an interactive session (default), or if false that the GUI would execute the script and return to the terminal.
177
+
178
+ To close the GUI and return to the command-line:
179
+
180
+ ```
181
+ gui::hide
182
+ ```
183
+
184
+ ### Layout navigation
185
+
186
+ To fit the whole layout in the window:
187
+
188
+ ```
189
+ gui::fit
190
+ ```
191
+
192
+ To zoom in our out to a specific region:
193
+
194
+ ```
195
+ gui::zoom_to x0 y0 x1 y1
196
+ ```
197
+
198
+ Options description:
199
+ - ``x0, y0`` first corner of the layout area in microns.
200
+ - ``x1, y1`` second corner of the layout area in microns.
201
+
202
+ To zoom in the layout:
203
+
204
+ ```
205
+ gui::zoom_in
206
+ gui::zoom_in x y
207
+ ```
208
+
209
+ Options description:
210
+ - ``x, y`` new center of layout.
211
+
212
+ To zoom out the layout:
213
+
214
+ ```
215
+ gui::zoom_out
216
+ gui::zoom_out x y
217
+ ```
218
+
219
+ Options description:
220
+ - ``x, y`` new center of layout.
221
+
222
+ To move the layout to new area:
223
+
224
+ ```
225
+ gui::center_at x y
226
+ ```
227
+
228
+ Options description:
229
+ - ``x, y`` new center of layout.
230
+
231
+ To change the resolution to a specific value:
232
+
233
+ ```
234
+ gui::set_resolution resolution
235
+ ```
236
+
237
+ Options description:
238
+ - ``resolution`` database units per pixel.
239
+
240
+ ### Selections
241
+
242
+ To add a single net to the selected items:
243
+
244
+ ```
245
+ gui::selection_add_net name
246
+ ```
247
+
248
+ Options description:
249
+ - ``name`` name of the net to add.
250
+
251
+ To add several nets to the selected items:
252
+
253
+ ```
254
+ gui::selection_add_nets name_regex
255
+ ```
256
+
257
+ Options description:
258
+ - ``name_regex`` regular expression of the net names to add.
259
+
260
+ To add a single instance to the selected items:
261
+
262
+ ```
263
+ gui::selection_add_inst name
264
+ ```
265
+
266
+ Options description:
267
+ - ``name`` name of the instance to add.
268
+
269
+ To add several instances to the selected items:
270
+
271
+ ```
272
+ gui::selection_add_insts name_regex
273
+ ```
274
+
275
+ Options description:
276
+ - ``name_regex`` regular expression of the instance names to add.
277
+
278
+ To add items at a specific point or in an area:
279
+
280
+ ```
281
+ gui::select_at x y
282
+ gui::select_at x y append
283
+ gui::select_at x0 y0 x1 y1
284
+ gui::select_at x0 y0 x1 y1 append
285
+ ```
286
+
287
+ Options description:
288
+ - ``x, y`` point in the layout area in microns.
289
+ - ``x0, y0`` first corner of the layout area in microns.
290
+ - ``x1, y1`` second corner of the layout area in microns.
291
+ - ``append`` if ``true`` (the default value) append the new selections to the current selection list, else replace the selection list with the new selections.
292
+
293
+ To navigate through multiple selected items:
294
+
295
+ ```
296
+ gui::select_next
297
+ gui::select_previous
298
+ ```
299
+
300
+ Returns: current index of the selected item.
301
+
302
+ To clear the current set of selected items:
303
+
304
+ ```
305
+ gui::clear_selections
306
+ ```
307
+
308
+ To get the properties for the current selection in the Inspector:
309
+
310
+ ```
311
+ gui::get_selection_property name
312
+ ```
313
+
314
+ Options description:
315
+ - ``name`` name of the property. For example, ``Type`` for object type or ``bbox`` for the bounding box of the object.
316
+
317
+ To animate the current selection in the Inspector:
318
+
319
+ ```
320
+ gui::selection_animate
321
+ gui::selection_animate repeat
322
+ ```
323
+
324
+ Options description:
325
+ - ``repeat``: indicate how many times the animation should repeat, default value is 0 repeats. If the value is 0, the animation will repeat indefinitely.
326
+
327
+ ### Highlighting
328
+
329
+ To highlight a net:
330
+
331
+ ```
332
+ gui::highlight_net name
333
+ gui::highlight_net name highlight_group
334
+ ```
335
+
336
+ Options description:
337
+ - ``name`` name of the net to highlight.
338
+ - ``highlight_group`` group to add the highlighted net to, defaults to ``0``, valid groups are ``0 - 7``.
339
+
340
+ To highlight an instance:
341
+
342
+ ```
343
+ gui::highlight_inst name
344
+ gui::highlight_inst name highlight_group
345
+ ```
346
+
347
+ Options description:
348
+ - ``name`` name of the instance to highlight.
349
+ - ``highlight_group`` group to add the highlighted instance to, defaults to ``0``, valid groups are ``0 - 7``.
350
+
351
+ To clear the highlight groups:
352
+
353
+ ```
354
+ gui::clear_highlights
355
+ gui::clear_highlights highlight_group
356
+ ```
357
+
358
+ Options description:
359
+ - ``highlight_group`` group to clear, defaults to ``0``, valid groups are ``-1 - 7``. Use ``-1`` to clear all groups.
360
+
361
+ ### Rulers
362
+
363
+ To add a ruler to the layout:
364
+
365
+ 1. either press ``k`` and use the mouse to place it visually.
366
+ To disable snapping for the ruler when adding, hold the ``Ctrl`` key, and to allow non-horizontal or vertical snapping when completing the ruler hold the ``Shift`` key.
367
+
368
+ 2. or use the command:
369
+
370
+ ```
371
+ gui::add_ruler x0 y0 x1 y1
372
+ gui::add_ruler x0 y0 x1 y1 label
373
+ gui::add_ruler x0 y0 x1 y1 label name
374
+ gui::add_ruler x0 y0 x1 y1 label name euclidian
375
+ ```
376
+
377
+ Returns: name of the newly created ruler.
378
+
379
+ Options description:
380
+ - ``x0, y0`` first end point of the ruler in microns.
381
+ - ``x1, y1`` second end point of the ruler in microns.
382
+ - ``label`` text label for the ruler.
383
+ - ``name`` name of the ruler.
384
+ - ``euclidian`` ``1`` for euclidian ruler, and ``0`` for regular ruler.
385
+
386
+ To remove a single ruler:
387
+
388
+ ```
389
+ gui::delete_ruler name
390
+ ```
391
+
392
+ Options description:
393
+ - ``name`` name of the ruler.
394
+
395
+ To remove all the rulers:
396
+
397
+ ```
398
+ gui::clear_rulers
399
+ ```
400
+
401
+ ### Heat Maps
402
+
403
+ The currently availble heat maps are:
404
+
405
+ - ``Power``
406
+ - ``Routing``
407
+ - ``Placement``
408
+ - ``IRDrop``
409
+ - ``RUDY`` [^RUDY]
410
+
411
+ To control the settings in the heat maps:
412
+
413
+ ```
414
+ gui::set_heatmap name option
415
+ gui::set_heatmap name option value
416
+ ```
417
+
418
+ Options description:
419
+ - ``name`` is the name of the heatmap.
420
+ - ``option`` is the name of the option to modify. If option is ``rebuild`` the map will be destroyed and rebuilt.
421
+ - ``value`` is the new value for the specified option. This is not used when rebuilding map.
422
+
423
+ These options can also be modified in the GUI by double-clicking the underlined display control for the heat map.
424
+
425
+
426
+ To save the raw data from the heat maps ins a comma separated value (CSV) format:
427
+
428
+ ```
429
+ gui::dump_heatmap name filename
430
+ ```
431
+
432
+ Options description:
433
+ - ``name`` is the name of the heatmap.
434
+ - ``filename`` path to the file to write the data to.
435
+
436
+ [^RUDY]: RUDY means Rectangular Uniform wire DensitY, which can predict the routing density very rough and quickly. You can see this notion in [this paper](https://past.date-conference.com/proceedings-archive/2007/DATE07/PDFFILES/08.7_1.PDF)
437
+
438
+
439
+
440
+ ### GUI Display Controls
441
+
442
+ Control the visible and selected elements in the layout:
443
+
444
+ ```
445
+ gui::set_display_controls name display_type value
446
+ ```
447
+
448
+ Options description:
449
+ - ``name`` is the name of the control. For example, for the power nets option this would be ``Signals/Power`` or could be ``Layers/*`` to set the option for all the layers.
450
+ - ``display_type`` is either ``visible`` or ``selectable``
451
+ - ``value`` is either ``true`` or ``false``
452
+
453
+ To check the visibility or selectability of elements in the layout:
454
+
455
+ ```
456
+ gui::check_display_controls name display_type
457
+ ```
458
+
459
+ Options description:
460
+ - ``name`` is the name of the control. For example, for the power nets option this would be ``Signals/Power`` or could be ``Layers/*`` to set the option for all the layers.
461
+ - ``display_type`` is either ``visible`` or ``selectable``
462
+
463
+
464
+ When performing a batch operation changing the display controls settings, the following commands can be used to save the current state of the display controls and restore them at the end.
465
+
466
+ ```
467
+ gui::save_display_controls
468
+ gui::restore_display_controls
469
+ ```
470
+
471
+ ### GUI Controls
472
+
473
+ To request user input via the GUI:
474
+
475
+ ```
476
+ gui::input_dialog title question
477
+ ```
478
+
479
+ Returns: a string with the input, or empty string if canceled.
480
+
481
+ Options description:
482
+ - ``title`` is the title of the input message box.
483
+ - ``question`` is the text for the message box.
484
+
485
+ Pause the execution of the script:
486
+
487
+ ```
488
+ gui::pause
489
+ gui::pause timeout
490
+ ```
491
+
492
+ Options description:
493
+ - ``timeout`` is specified in milliseconds, if it is not provided the pause will last until the user presses the Continue button.
494
+
495
+ To open or close a specific layout widget:
496
+
497
+ ```
498
+ gui::show_widget name
499
+ gui::hide_widget name
500
+ ```
501
+
502
+ Options description:
503
+ - ``name`` of the widget. For example, the display controls would be "Display Control".
504
+
505
+ ## License
506
+
507
+ BSD 3-Clause License. See [LICENSE](../../LICENSE) file.
data/markdown/OR_userguide/OR_ifp_README.md ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Initialize Floorplan
2
+
3
+ This tool initializes floorplan constraints, die/core area, and makes tracks.
4
+
5
+ ## Commands
6
+
7
+ ```{note}
8
+ - Parameters in square brackets `[-param param]` are optional.
9
+ - Parameters without square brackets `-param2 param2` are required.
10
+ ```
11
+
12
+ ### Initialize Floorplan
13
+
14
+ Do note that there are two ways of setting the floorplan dimensions.
15
+ The user can either specify manually die/core area, or
16
+ specify the utilization/aspect ratio.
17
+
18
+ #### Method 1: Automatic die size calculation
19
+
20
+ ```
21
+ initialize_floorplan
22
+ [-utilization util]
23
+ [-aspect_ratio ratio]
24
+ [-core_space space | {bottom top left right}]
25
+ [-sites site_name]
26
+ ```
27
+ ##### Options
28
+
29
+ | Switch Name | Description |
30
+ | ----- | ----- |
31
+ | `-utilization` | Percentage utilization. Allowed values are `double` `>0`, more than 100% utilization can be useful with mock abstracts. |
32
+ | `-aspect_ratio` | Ratio $\frac{height}{width}$. The default value is `1.0` and the allowed values are floats `[0, 1.0]`. |
33
+ | `-core_space` | Space around the core, default `0.0` microns. Allowed values are either one value for all margins or a set of four values, one for each margin. The order of the four values are: `{bottom top left right}`. |
34
+ | `-sites` | Tcl list of sites to make rows for (e.g. `{SITEXX, SITEYY}`) |
35
+
36
+
37
+ #### Method 2: Set die/core area
38
+
39
+ ```tcl
40
+ initialize_floorplan
41
+ [-die_area {llx lly urx ury}]
42
+ [-core_area {llx lly urx ury}]
43
+ [-additional_sites site_names]
44
+ -site site_name
45
+ ```
46
+
47
+ ##### Options
48
+
49
+ | Switch Name | Description |
50
+ | ----- | ----- |
51
+ | `-die_area` | Die area coordinates in microns (lower left x/y and upper right x/y coordinates). |
52
+ | `-core_area` | Core area coordinates in microns (lower left x/y and upper right x/y coordinates). |
53
+ | `-site` | The LEF site to make rows for. |
54
+ | `-additional_sites` | Any additional LEF site to make rows. |
55
+
56
+ The die area and core area used to write ROWs can be specified explicitly
57
+ with the `-die_area` and `-core_area` arguments. Alternatively, the die and
58
+ core areas can be computed from the design size and utilization as shown below:
59
+
60
+ The -site argument determines the basic single-height rows to make.
61
+ For a hybrid row design the site should have a row pattern. Any sites
62
+ referenced by an instance in the netlist will also have rows
63
+ constructed for them.
64
+
65
+ Additional sites are specified if you wish to have rows for a site
66
+ that is not used in the nelist but may be needed later. For example,
67
+ you might not have any double height cells in the incoming netlist but
68
+ you expect some to be generated by flop clustering later in the flow.
69
+
70
+ Example computation:
71
+
72
+ ```
73
+ core_area = design_area / (utilization / 100)
74
+ core_width = sqrt(core_area / aspect_ratio)
75
+ core_height = core_width * aspect_ratio
76
+ core = ( core_space_left, core_space_bottom )
77
+ ( core_space_left + core_width, core_space_bottom + core_height )
78
+ die = ( 0, 0 )
79
+ ( core_width + core_space_left + core_space_right,
80
+ core_height + core_space_bottom + core_space_top )
81
+ ```
82
+
83
+ ### Make Tracks
84
+
85
+ The `initialize_floorplan` command removes existing tracks.
86
+
87
+ Use the `make_tracks` command to add routing tracks to a floorplan.
88
+
89
+ ```tcl
90
+ make_tracks
91
+ [layer]
92
+ [-x_pitch x_pitch]
93
+ [-y_pitch y_pitch]
94
+ [-x_offset x_offset]
95
+ [-y_offset y_offset]
96
+ ```
97
+
98
+ #### Options
99
+
100
+ | Switch Name | Description |
101
+ | ----- | ----- |
102
+ | `layer` | Select layer name to make tracks for. Defaults to all layers. |
103
+ | `-x_pitch`, `-y_pitch` | If set, overrides the LEF technology x-/y- pitch. Use the same unit as in the LEF file. |
104
+ | `-x_offset`, `-y_offset` | If set, overrides the LEF technology x-/y- offset. Use the same unit as in the LEFT file. |
105
+
106
+ ### Inserting tieoff cells
107
+
108
+ To insert tiecells:
109
+
110
+ ```tcl
111
+ insert_tiecells
112
+ tie_pin
113
+ [-prefix inst_prefix]
114
+ ```
115
+
116
+ #### Options
117
+
118
+ | Switch Name | Description |
119
+ | ----- | ----- |
120
+ | `tie_pin` | Indicates the master and port to use to tie off nets. For example, `LOGIC0_X1/Z` for the Nangate45 library, where `LOGIC0_X1` is the master and `Z` is the output port on the master. |
121
+ | `-prefix` | Used to control the prefix of the new tiecell names. This will default to `TIEOFF_`. |
122
+
123
+ ### Useful developer functions
124
+
125
+ If you are a developer, you might find these useful. More details can be found in the [source file](./src/InitFloorplan.cc) or the [swig file](./src/InitFloorPlan.i).
126
+
127
+ | Command Name | Description |
128
+ | ----- | ----- |
129
+ | `microns_to_mfg_grid` | Convert microns to manufacturing grid DBU. |
130
+
131
+ ## Example scripts
132
+
133
+ Example scripts on running `ifp` for a sample design of `mpd_top` are as follows:
134
+
135
+ ```tcl
136
+ ./test/upf_test.tcl
137
+ ```
138
+
139
+ ## Regression tests
140
+
141
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
142
+
143
+ Simply run the following script:
144
+
145
+ ```shell
146
+ ./test/regression
147
+ ```
148
+
149
+ ## Limitations
150
+
151
+ ## FAQs
152
+
153
+ Check out
154
+ [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+ifp+in%3Atitle)
155
+ about this tool.
156
+
157
+ ## License
158
+
159
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.
data/markdown/OR_userguide/OR_mpl2_README.md ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hierarchical Macro Placement
2
+
3
+ A hierarchical automatic macro placer for large-scale complex IP blocks, "Hier-RTLMP".
4
+ This tool builds on the existing RTLMP (`mpl`) framework, adopting a multilevel physical
5
+ planning approach that exploits the hierarchy and data flow inherent in the design RTL.
6
+
7
+ ## Commands
8
+
9
+ ```{note}
10
+ - Parameters in square brackets `[-param param]` are optional.
11
+ - Parameters without square brackets `-param2 param2` are required.
12
+ ```
13
+
14
+ ### Hier-RTLMP algorithm
15
+
16
+ ```tcl
17
+ rtl_macro_placer
18
+ [-max_num_macro max_num_macro]
19
+ [-min_num_macro min_num_macro]
20
+ [-max_num_inst max_num_inst]
21
+ [-min_num_inst min_num_inst]
22
+ [-tolerance tolerance]
23
+ [-max_num_level max_num_level]
24
+ [-coarsening_ratio coarsening_ratio]
25
+ [-num_bundled_ios num_bundled_ios]
26
+ [-large_net_threshold large_net_threshold]
27
+ [-signature_net_threshold signature_net_threshold]
28
+ [-halo_width halo_width]
29
+ [-fence_lx fence_lx]
30
+ [-fence_ly fence_ly]
31
+ [-fence_ux fence_ux]
32
+ [-fence_uy fence_uy]
33
+ [-area_weight area_weight]
34
+ [-outline_weight outline_weight]
35
+ [-wirelength_weight wirelength_weight]
36
+ [-guidance_weight guidance_weight]
37
+ [-fence_weight fence_weight]
38
+ [-boundary_weight boundary_weight]
39
+ [-notch_weight notch_weight]
40
+ [-macro_blockage_weight macro_blockage_weight]
41
+ [-pin_access_th pin_access_th]
42
+ [-target_util target_util]
43
+ [-target_dead_space target_dead_space]
44
+ [-min_ar min_ar]
45
+ [-snap_layer snap_layer]
46
+ [-bus_planning]
47
+ [-report_directory report_directory]
48
+ [-write_macro_placement file_name]
49
+ ```
50
+
51
+ #### Generic Parameters
52
+
53
+ | Switch Name | Description |
54
+ | ----- | ----- |
55
+ | `-max_num_macro`, `-min_num_macro` | Maximum/minimum number of macros in a cluster. The default value is `0` for both, and the allowed values are integers `[0, MAX_INT]`. |
56
+ | `-max_num_inst`, `-min_num_inst` | Maximum/minimum number of standard cells in a cluster. The default value is `0` for both, and the allowed values are integers `[0, MAX_INT]`. |
57
+ | `-tolerance` | Add a margin to the minimum and maximum number of macros/std cells in a cluster. For min, we multiply by (1 - `tol`), and for the max (1 + `tol`). This is to improve the robustness of hierarchical clustering. The allowed values are floats `[0, 1)`, and the default value is `0.1`. |
58
+ | `-max_num_level` | Maximum depth of physical hierarchical tree. The default value is `2`, and the allowed values are integers `[0, MAX_INT]`. |
59
+ | `-coarsening_ratio` | The larger the coarsening_ratio, the faster the convergence process. The allowed values are floats, and the default value is `10.0`. |
60
+ | `-num_bundled_ios` | Specifies the number of bundled pins for the left, right, top, and bottom boundaries. The default value is `3`, and the allowed values are integers `[0, MAX_INT]`. |
61
+ | `-large_net_threshold` | Ignore nets with many connections during clustering, such as global nets. The default value is `50`, and the allowed values are integers `[0, MAX_INT]`. |
62
+ | `-signature_net_threshold` | Minimum number of connections between two clusters to be identified as connected. The default value is `50`, and the allowed values are integers `[0, MAX_INT]`. |
63
+ | `-halo_width` | Horizontal/vertical halo around macros (microns). The allowed values are floats, and the default value is `0.0`. |
64
+ | `-fence_lx`, `-fence_ly`, `-fence_ux`, `-fence_uy` | Defines the global fence bounding box coordinates. The default values are the core area coordinates). |
65
+ | `-pin_access_th` | Specifies the pin access threshold value of macros. The default value is `0.0`, and the allowed values are floats [0,1]. |
66
+ | `-target_util` | Specifies the target utilization of `MixedCluster` and has higher priority than target_dead_space. The allowed values are floats, and the default value is `0.25`. |
67
+ | `-target_dead_space` | Specifies the target dead space percentage, which influences the utilization of `StandardCellCluster`. The allowed values are floats, and the default value is `0.05`. |
68
+ | `-min_ar` | Specifies the minimum aspect ratio $a$, or the ratio of its width to height of a `StandardCellCluster` from $[a, \frac{1}{a}]$. The allowed values are floats, and the default value is `0.33`. |
69
+ | `-snap_layer` | Snap macro origins to this routing layer track. The default value is 4, and the allowed values are integers `[1, MAX_LAYER]`). |
70
+ | `-bus_planning` | Flag to enable bus planning. We recommend to enable bus planning for technologies with very limited routing layers such as SKY130 and GF180. As for technologies such as NanGate45 and ASAP7, we recommend to keep it disabled. |
71
+ | `-report_directory` | Save reports to this directory. |
72
+ | `-write_macro_placement` | Generates a file with the placement of the macros placed by HierRTLMP flow in the format of multiple calls for the `place_macro` command. |
73
+
74
+
75
+ #### Simulated Annealing Weight parameters
76
+
77
+ Do note that while action probabilities are normalized to 1.0, the weights are not necessarily normalized.
78
+
79
+ | Switch Name | Description |
80
+ | ----- | ----- |
81
+ | `-area_weight` | Weight for the area of current floorplan. The allowed values are floats, and the default value is `0.1`. |
82
+ | `-outline_weight` | Weight for violating the fixed outline constraint, meaning that all clusters should be placed within the shape of their parent cluster. The allowed values are floats, and the default value is `100.0`. |
83
+ | `-wirelength_weight` | Weight for half-perimeter wirelength. The allowed values are floats, and the default value is `100.0`. |
84
+ | `-guidance_weight` | Weight for guidance cost or clusters being placed near specified regions if users provide such constraints. The allowed values are floats, and the default value is `10.0`. |
85
+ | `-fence_weight` | Weight for fence cost, or how far the macro is from zero fence violation. The allowed values are floats, and the default value is `10.0`. |
86
+ | `-boundary_weight` | Weight for the boundary, or how far the hard macro clusters are from boundaries. Note that mixed macro clusters are not pushed, thus not considered in this cost. The allowed values are floats, and the default value is `50.0`. |
87
+ | `-notch_weight` | Weight for the notch, or the existence of dead space that cannot be used for placement & routing. Note that this cost applies only to hard macro clusters. The allowed values are floats, and the default value is `10.0`. |
88
+ | `-macro_blockage_weight` | Weight for macro blockage, or the overlapping instances of the macro. The allowed values are floats, and the default value is `10.0`. |
89
+
90
+ ### Write Macro Placement
91
+
92
+ Command to generate a file with the placement of the macros in the design using multiple calls for the `place_macro` command:
93
+
94
+ ```tcl
95
+ write_macro_placement file_name
96
+ ```
97
+
98
+ ### Place Macro
99
+
100
+ Command for placement of one specific macro.
101
+
102
+ ```tcl
103
+ place_macro
104
+ -macro_name macro_name
105
+ -location {x y}
106
+ [-orientation orientation]
107
+ ```
108
+
109
+ #### Options
110
+
111
+ | Switch Name | Description |
112
+ | ----- | ----- |
113
+ | `-macro_name` | The name of a macro of the design. |
114
+ | `-location` | The lower left corner of the macro in microns. |
115
+ | `-orientation` | The orientation according to odb. If nothing is specified, defaults to `R0`. We only allow `R0`, `MY`, `MX` and `R180`. |
116
+
117
+ ## Example scripts
118
+
119
+ Example of a script demonstrating how to run `mpl2` on a sample design of `bp_fe_top` as follows:
120
+
121
+ ```shell
122
+ ./test/bp_fe_top.tcl
123
+ ```
124
+
125
+ ## Regression tests
126
+
127
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
128
+
129
+ Simply run the following script:
130
+
131
+ ```shell
132
+ ./test/regression
133
+ ```
134
+
135
+ ## Limitations
136
+
137
+ ## References
138
+ 1. A. B. Kahng, R. Varadarajan and Z. Wang,
139
+ "RTL-MP: Toward Practical, Human-Quality Chip Planning and Macro Placement",
140
+ [(.pdf)](https://vlsicad.ucsd.edu/Publications/Conferences/389/c389.pdf), Proc. ACM/IEEE Intl. Symp. on Physical Design, 2022, pp. 3-11.
141
+ 1. A. B. Kahng, R. Varadarajan and Z. Wang,
142
+ "Hier-RTLMP: A hierarchical automatic macro placer for large-scale complex IP blocks.",
143
+ [(.pdf)](https://arxiv.org/pdf/2304.11761.pdf), arXiv preprint arXiv:2304.11761, 2023.
144
+
145
+ ## FAQs
146
+
147
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+hier-rtlmp+OR+hier+OR+mpl2) about this tool.
148
+
149
+ ## License
150
+
151
+ BSD 3-Clause License. See [LICENSE](../../LICENSE) file.
data/markdown/OR_userguide/OR_mpl_README.md ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Macro Placement
2
+
3
+ The macro placement module in OpenROAD (`mpl`) is based on
4
+ TritonMacroPlacer, an open-source ParquetFP-based macro cell placer.
5
+ The macro placer places macros/blocks honoring halos, channels
6
+ and cell row "snapping".
7
+ Run `global_placement` before macro placement.
8
+
9
+ Approximately $\Bigl\lceil [{\frac{numMacros}{3}}]^{1.5} \Bigr\rceil$ quadrisections
10
+ of the initial placed mixed-size layout are explored and packed using
11
+ ParquetFP-based annealing. The best resulting floorplan according to a
12
+ heuristic evaluation function is kept.
13
+
14
+ ## Commands
15
+
16
+ ```{note}
17
+ - Parameters in square brackets `[-param param]` are optional.
18
+ - Parameters without square brackets `-param2 param2` are required.
19
+ ```
20
+
21
+ ### Macro Placement
22
+
23
+ ```tcl
24
+ macro_placement
25
+ [-halo {halo_x halo_y}]
26
+ [-channel {channel_x channel_y}]
27
+ [-fence_region {lx ly ux uy}]
28
+ [-snap_layer snap_layer_number]
29
+ [-style corner_wax_wl|corner_min_wl]
30
+ ```
31
+
32
+ #### Options
33
+
34
+ | Switch Name | Description |
35
+ | ----- | ----- |
36
+ | `-halo` | Horizontal and vertical halo around macros (microns). |
37
+ | `-channel` | Horizontal and vertical channel width between macros (microns). |
38
+ | `-fence_region` | Restrict macro placements to a region (microns). Defaults to the core area. |
39
+ | `-snap_layer` | Snap macro origins to this routing layer track. |
40
+ | `-style` | Placement style, to choose either `corner_max_wl` or `corner_min_wl`. The default value is `corner_max_wl`. |
41
+
42
+ For placement style, `corner_max_wl` means that choosing the partitions that maximise the wirelength
43
+ of connections between the macros to force them to the corners. Vice versa for `corner_min_wl`.
44
+
45
+ Macros will be placed with $max(halo * 2, channel)$ spacing between macros, and between
46
+ macros and the fence/die boundary. If no solutions are found, try reducing the
47
+ channel/halo.
48
+
49
+
50
+ ### Useful developer functions
51
+
52
+ If you are a developer, you might find these useful. More details can be found in the [source file](./src/MacroPlacer.cpp) or the [swig file](./src/MacroPlacer.i).
53
+
54
+ | Command Name | Description |
55
+ | ----- | ----- |
56
+ | `macro_placement_debug` | Macro placement debugging. Note that GUI must be present for this command, otherwise a segfault will occur. |
57
+
58
+ ## Example scripts
59
+
60
+ Example scripts demonstrating how to run TritonMacroPlace on a sample design of `east_west` as follows:
61
+
62
+ ```tcl
63
+ ./test/east_west.tcl
64
+ ./test/east_west1.tcl
65
+ ./test/east_west2.tcl
66
+ ```
67
+
68
+ ## Regression tests
69
+
70
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
71
+
72
+ Simply run the following script:
73
+
74
+ ```shell
75
+ ./test/regression
76
+ ```
77
+
78
+ ## Limitations
79
+
80
+ ## FAQs
81
+
82
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+mpl) about this tool.
83
+
84
+ ## License
85
+
86
+ BSD 3-Clause License. See [LICENSE](../../LICENSE) file.
data/markdown/OR_userguide/OR_odb_OR_codeGenerator_README.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Automatic Code Generator
2
+
3
+ This is an automatic code generation tool for OpenDB objects and Iterators. To test the tool you can use the following command
4
+
5
+ ``` shell
6
+ python3 gen.py --json schema.json --src_dir ../db --include_dir ../../include/odb --templates templates
7
+ ```
8
+
9
+ Where schema.json is the json file that includes the requirements, src is the source files directory, include is the include directory, and templates is the directory including the jinja templates for the classes.
10
+
11
+ Empty sections are removed by default from the output. If you need to add someting to a section that is currently empty, you can run the generator with --keep_empty to preserve them. Once the section is filled in, the flag can be dropped and the code regnerated to remove the remaining empty sections.
data/markdown/OR_userguide/OR_odb_README.md ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OpenDB
2
+
3
+ OpenDB is a design database to support tools for physical chip design. It
4
+ was originally developed by Athena Design Systems. Nefelus, Inc. acquired
5
+ the rights to the code and open-sourced it with BSD-3 license in 2019 to support the DARPA
6
+ OpenROAD project.
7
+
8
+ The structure of OpenDB is based on the text file formats LEF
9
+ (library) and DEF (design) formats version 5.6. OpenDB supports a
10
+ binary file format to save and load the design much faster than using
11
+ LEF and DEF.
12
+
13
+ OpenDB is written in C++ 98 with standard library style iterators.
14
+ The classes are designed to be fast enough to base an application on without
15
+ having to copy them into application-specific structures.
16
+
17
+
18
+ ## Directory structure
19
+
20
+ ```
21
+ include/odb/db.h - public header for all database classes
22
+ src/db - private/internal database representations
23
+ src/lefin - LEF reader
24
+ src/lefout - LEF writer
25
+ src/defin - DEF reader
26
+ src/defout - DEF writer
27
+ ```
28
+
29
+ ## Database API
30
+
31
+ We are still working on documenting the APIs. We have over 1,800 objects
32
+ and functions that we are still documenting (for both TCL and Python).
33
+ **Contributions are very welcome in this effort**. Find starting points below.
34
+
35
+ ### TCL
36
+
37
+ After building successfully, run OpenDB Tcl shell using
38
+ `../../build/src/odb/src/swig/tcl/odbtcl`. An example usage:
39
+
40
+ ```
41
+ set db [dbDatabase_create]
42
+ set lef_parser [new_lefin $db true]
43
+ set tech [lefin_createTech $lef_parser ./src/odb/test/data/gscl45nm.lef]
44
+ ```
45
+
46
+ You can find examples on using the API from Tcl under `test/tcl/` directory.
47
+
48
+ The full set of the Tcl commands exposed can be found under
49
+ `./build/src/swig/tcl/opendb_wrapper.cpp`. Search for `SWIG_prefix`.
50
+
51
+
52
+ ### Python
53
+
54
+ After building successfully, run `openroad -python` to enable the Python
55
+ interpreter. You can find examples on using the API from Python under
56
+ `test/python/` directory.
57
+
58
+ To list the full set of the Python classes exposed run `openroad -python`
59
+ then:
60
+ ```
61
+ import openroad
62
+ import odb
63
+ print(', '.join(dir(openroad)))
64
+ print(', '.join(dir(odb)))
65
+ ```
66
+
67
+ ### C++
68
+
69
+ All public database classes are defined in `db.h`. These class definitions
70
+ provide all functions for examining and modifying the database objects. The
71
+ database is an object itself, so multiple database objects can exist
72
+ simultaneously (no global state).
73
+
74
+ `dbTypes.h` defines types returned by database class member functions.
75
+
76
+ All database objects are in the `odb` namespace.
77
+
78
+ - `dbChip`
79
+ - `dbBlock`
80
+ - `dbTech`
81
+ - `dbLib`
82
+
83
+ All database objects have a 32bit object identifier accessed with the
84
+ `dbObject::getOID` base class member function that returns a `uint`. This
85
+ identifier is preserved across save/restores of the database so it should
86
+ be used to reference database object by data structures instead of pointers
87
+ if the reference lifetime is across database save/restores. OIDs allow the
88
+ database to have exactly the same layout across save/restores.
89
+
90
+ The database distance units are **nanometers** and use the type `uint`.
91
+
92
+ ## Example scripts
93
+
94
+ ## Regression tests
95
+
96
+ There are a set of regression tests in /test.
97
+
98
+ ```
99
+ ./test/regression-tcl.sh
100
+ ./test/regression-py.sh
101
+ ```
102
+
103
+ ## Database Internals
104
+
105
+ The internal description included here is paraphrased from Lukas van Ginneken
106
+ by James Cherry.
107
+
108
+ The database separates the implementation from the interface, and as a result,
109
+ each class becomes two classes, a public one and a private one. For instance,
110
+ `dbInst` has the public API functions, while class `_dbInst` has the private
111
+ data fields.
112
+
113
+ The objects are allocated in dynamically resizable tables, the implementation
114
+ of which is in `dbTable.hpp`. Each table consists of a number of pages,
115
+ each containing 128 objects. The table contains the body of the `struct`,
116
+ not a set of pointers. This eliminates most of the pointer overhead while
117
+ iteration is accomplished by stepping through the table. Thus, grouping these
118
+ objects does not require a doubly-linked list and saves 16 bytes per object
119
+ (at the cost of some table overhead). Each object has an id, which is the
120
+ index into the table. The lowest 7 bits are the index in the page, while
121
+ the higher bits are the page number. Object id's are persistent when saving
122
+ and reading the data model to disk, even as pointer addresses may change.
123
+
124
+ Everything in the data model can be stored on disk and restored from disk
125
+ exactly the way it was. An extensive set of equality tests and diff functions
126
+ make it possible to check for even the smallest deviation. The capability
127
+ to save an exact copy of the state of the system makes it possible to create
128
+ a checkpoint. This is a necessary capability for debugging complex systems.
129
+
130
+ The code follows the definition of LEF and DEF closely and reflects many of
131
+ the idiosyncrasies of LEF and DEF. The code defines many types of objects
132
+ to reflect LEF and DEF constructs although it sometimes uses different
133
+ terminology, for instance, the object to represent a library cell is called
134
+ `dbMaster` while the LEF keyword is MACRO.
135
+
136
+ The data model supports the EEQ and LEQ keywords (i.e., electrically equivalent
137
+ and logically equivalent Masters), which could be useful for sizing. However,
138
+ it does not support any logic function representation. In general, there is
139
+ very limited support for synthesis-specific information: no way to represent
140
+ busses, no way to represent logic function, very limited understanding of
141
+ signal flow, limited support of timing information, and no support for high
142
+ level synthesis or test insertion.
143
+
144
+ The db represents routing as in DEF, representing a trace from point to point
145
+ with a given width. The layout for a net is stored in a class named `dbWire`
146
+ and it requires a special `dbWireDecoder` (which works like an iterator)
147
+ to unpack the data and another `dbWireEncoder` to pack it. The data model
148
+ does not support a region query and objects that are in the same layer are
149
+ scattered about the data model and are of different classes.
150
+
151
+ This means that whatever tool is using the layout information will have to
152
+ build its own data structures that are suitable to the layout operations
153
+ of that tool. For instance, the router, the extractor, and the DRC engine
154
+ would each have to build their unique data structures. This encourages
155
+ batch mode operation (route the whole chip, extract the whole chip, run
156
+ DRC on the whole chip).
157
+
158
+ ## Limitations
159
+
160
+ ## FAQs
161
+
162
+ Check out
163
+ [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+fastroute+in%3Atitle)
164
+ about this tool.
165
+
166
+
167
+ ## LICENSE
168
+
169
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.
data/markdown/OR_userguide/OR_odb_doc_OpenDB-AddFieldsInDbObjects.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Adding new fields in DB Object
2
+
3
+ For example `add_pitchDiag` in object `DbTechLayer`.
4
+
5
+ | | Action | File | Source Code |
6
+ |---|--------------------------------------------------------|-------------------|------------------------------------------------------------------------------------|
7
+ | 1 | Add Fields at the .h file | `dbTechLayer.h` | |
8
+ | 2 | Define a keyword for db rev number | `dbDatabase.h` | `#define ADS_DB_DF58 52` |
9
+ | 3 | Set the current rev number same as | `dbDatabase.h` | `#define ADS_DB_SCHEMA_MINOR 52` |
10
+ | 4 | Stream in new fields Conditionally upon Schema number | `dbTechLayer.cpp` | `if ( stream.getDatabase()->isSchema(ADS_DB_DF58) ) { stream >> layer._pitchDiag;` |
11
+ | 5 | Stream out new fields Conditionally upon Schema number | `dbTechLayer.cpp` | `if ( stream.getDatabase()->isSchema(ADS_DB_DF58) ) { stream << layer._pitchDiag;` |
12
+ | 6 | Conditionally Diff new fields | `dbTechLayer.cpp` | `if ( stream.getDatabase()->isSchema(ADS_DB_DF58) ) { DIFF_FIELD(_pitchDiag);` |
13
+ | 7 | Conditionally Diff Out new fields | `dbTechLayer.cpp` | `if ( stream.getDatabase()->isSchema(ADS_DB_DF58) ) { DIFF_OUT_FIELD(_pitchDiag);` |
14
+ | 8 | Created access APIs to the fields | `dbTechLayer.cpp` | `"dbTechLayer::getPitchDiag(), dbTechLayer::setPitchDiag( int pitch )"` |
15
+ | 9 | Add new APIs in include/db.h | db.h | `class dbTechLayer` |
data/markdown/OR_userguide/OR_odb_test_unitTestsPython_README.md ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python Unit Tests
2
+
3
+ ## Running tests
4
+
5
+ For running the python unit tests you will need to install first *testtools* and *unittest-parallel* which enables concurrent unit testing
6
+
7
+ ``` shell
8
+ pip3 install testtools
9
+ pip3 install unittest-parallel
10
+ ```
11
+
12
+ Then, you can run the unit tests in sequence by running
13
+
14
+ ``` shell
15
+ ../unitTests.sh
16
+ ```
17
+
18
+ or in parallel by running
19
+
20
+ ``` shell
21
+ ../unitTests.sh parallel
22
+ ```
23
+
24
+ **Note**: The test cases within each Unit Test run in parallel in both situations
25
+
26
+ --------------------------------------------------------------------------
27
+
28
+ ## <u>Tests Structure</u>
29
+
30
+ The directory unitTestsPython includes unit tests for OpenDB Python APIs. Any test file starts with 'Test' followed by the test target.
31
+
32
+ ### odbUnitTest.py:
33
+
34
+ This includes `TestCase` class which inherits from `unittest.TestCase` with additional functionalities:
35
+
36
+ * `changeAndTest(self,obj,SetterName,GetterName,expectedVal,*args)`which is a function for changing a value and testing for the effect of that change where:
37
+
38
+ * `obj` is the object to be tested
39
+ * `SetterName` is the name of the function to be called for changing a value
40
+ * `GetterName` is the name of the function to be called for testing the effect
41
+ * `expectedVal` is the expected value for the testing
42
+ * `*args` are the arguments passed to the `SetterName` function
43
+
44
+ So, in the end, the expected behavior is:
45
+
46
+ ``` python
47
+ obj.SetterName(*args)
48
+
49
+ assert(obj.GetterName()==expectedVal)
50
+ ```
51
+
52
+
53
+ * `check(self,obj,GetterName,expectedVal,*args)` which tests against expected value
54
+
55
+ * `change(self,obj,SetterName,*args)` which changes a value in the object
56
+
57
+ * `main()` runs the `TestCase` in sequential order
58
+
59
+ * `mainParallel(Test)` runs the passed `Test` class in parallel
60
+
61
+ ### helper.py:
62
+
63
+ A set of functions for creating simple db instances to be used for testing. You can find the description of each function in the comments
64
+
65
+ ### TestNet.py:
66
+
67
+ Unit test class for testing dbNet. It inherits from `odbUnitTest.TestCase` . it consists of
68
+
69
+ * `setUp(self)` function to be called before each test case. Here, we create the database with the desired chip, block, masters, instances and nets.
70
+ * `tearDown(self)` function to be called after each test case. Here, we destroy our db.
71
+ * `test_*(self)` the test cases functions. Their names should start with `test` for the unittest suite to recognize.
72
+
73
+ ### TestDestroy.py:
74
+
75
+ Integration test class for testing the `destroy(*args)` function on OpenDB.
76
+
77
+ * `test_destroy_net` destroying net and testing for the effect on the *block,inst, iterms and bterms*
78
+ * `test_destroy_inst` destroying instance and testing for the effect on *block, iterms, net, bterms*
79
+ * `test_destroy_bterm` destroying bterm and testing for the effect on *block and net*
80
+ * `test_destroy_block` destroying block and testing for the effect on *block(parent and child relation), and chip*
81
+ * `test_destroy_bpin` destroying bpin and testing for the effect on *bterm*
82
+ * `test_create_destroy_wire` destroying wire and test for the effect on *net*
83
+ * `test_destroy_capnode` destroying capnode and test for the effect on *net(node and connected ccsegs)*
84
+ * `test_destroy_ccseg` destroying ccseg and test for the effect on *node,block and net*
85
+
86
+ * `test_destroy_lib` destroying lib and test for the effect on *db*
87
+
88
+ * `test_destroy_obstruction` destroying obstruction and test for the effect on *block*
89
+ * `test_create_regions` creating regions and test for the effect on *block and region(parent and child relation)*
90
+ * `test_destroy_region_child` destroying _ and test for the effect on *block and region(parent)*
91
+
92
+ * `test_destroy_region_parent` destroying _ and test for the effect on *block*
93
+
94
+ ### TestBlock.py:
95
+
96
+ Unit Test for dbBlock
97
+
98
+ * `test_find` testing the find function with *BTerm, Child, Inst, Net, ITerm, ExtCornerBlock, nonDefaultRule, Region*
99
+
100
+ * Testing the ComputeBBox() function through the first call of getBBox:
101
+ * `test_bbox0` testing empty block box
102
+ * `test_bbox1` testing block box with Inst placed
103
+ * `test_bbox2` testing block box with Inst and BPin placed
104
+ * `test_bbox3` testing block box with Inst, BPin and Obstruction placed
105
+ * `test_bbox3` testing block box with Inst, BPin, Obstruction and SWire placed
106
+
107
+ ### TestBTerm.py:
108
+
109
+ Unit Test for dbBTerm
110
+
111
+ * `test_idle` testing for idle disconnected `BTerm` behavior
112
+ * `test_connect` testing connect function of `BTerm` on `BTerm` and `Net`
113
+ * `test_disconnect` testing disconnect function of `BTerm` on `BTerm` and `Net`
114
+
115
+ ### TestInst.py:
116
+
117
+ Unit Test for dbInst
118
+
119
+ * `test_swap_master` testing swap master function
120
+
121
+ ### TestITerm.py:
122
+
123
+ Unit Test for dbITerm
124
+
125
+ * `test_idle` testing for disconnected ITerm without a net
126
+ * `test_connection_from_iterm` testing the connect(ITerm,...) and disconnect functions of ITerm and their effect on ITerm and Net
127
+ * `test_connection_from_inst` testing the connect(Inst,...) and disconnect functions of ITerm and their effect on ITerm and Net
128
+ * Testing for getAvgXY() function
129
+ * `test_avgxy_R0` testing with default orientation R0
130
+ * `test_avgxy_R90` testing with different orientation R90 for transformation
131
+
132
+ --------------------------
133
+
134
+ #### Problems Found In Testing
135
+
136
+ * multiple core dumps that leads to aborting the process:
137
+ * dbNet.get1st*() (when nothing on top of the list)
138
+ * childRegion.getParent() (after destroying the parent region)
139
+ * Implementation of ComputeBBox() is flawed and needs to be reconsidered
data/markdown/OR_userguide/OR_pad_README.md ADDED
@@ -0,0 +1,406 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Chip-level Connections
2
+
3
+ The chip-level connections module in OpenROAD (`pad`) is based on the
4
+ open-source tool ICeWall. In this utility, either place an IO ring around the
5
+ boundary of the chip and connect with either wirebond pads or a bump array.
6
+
7
+ ## Commands
8
+
9
+ ```{note}
10
+ - Parameters in square brackets `[-param param]` are optional.
11
+ - Parameters without square brackets `-param2 param2` are required.
12
+ ```
13
+
14
+ ### Placing Terminals
15
+
16
+ In the case where the bond pads are integrated into the padcell, the IO terminals need to be placed.
17
+ To place a terminals on the padring
18
+
19
+ ```tcl
20
+ place_io_terminals
21
+ -allow_non_top_layer
22
+ inst_pins
23
+ ```
24
+
25
+ #### Options
26
+
27
+ | Switch Name | Description |
28
+ | ----- | ----- |
29
+ | `-allow_non_top_layer` | Allow the terminal to be placed below the top layer. |
30
+ | `inst_pins` | Instance pins to place the terminals on. |
31
+
32
+ #### Examples
33
+ ```
34
+ place_io_terminals u_*/PAD
35
+ place_io_terminals u_*/VDD
36
+ ```
37
+
38
+ ### Defining a Bump Array
39
+
40
+ To define a bump array.
41
+
42
+ ```tcl
43
+ make_io_bump_array
44
+ -bump master
45
+ -origin {x y}
46
+ -rows rows
47
+ -columns columns
48
+ -pitch {x y}
49
+ [-prefix prefix]
50
+ ```
51
+
52
+ #### Options
53
+
54
+ | Switch Name | Description |
55
+ | ----- | ----- |
56
+ | `-bump` | Name of the bump master. |
57
+ | `-origin` | Origin of the array. |
58
+ | `-rows` | Number of rows to create. |
59
+ | `-columns` | Number of columns to create. |
60
+ | `-pitch` | Pitch of the array. |
61
+ | `-prefix` | Name prefix for the bump array. The default value is `BUMP_`. |
62
+ Example usage:
63
+
64
+ ```tcl
65
+ make_io_bump_array -bump BUMP -origin "200 200" -rows 14 -columns 14 -pitch "200 200"
66
+ ```
67
+
68
+ ### Removing Entire Bump Array
69
+
70
+ To remove a bump array.
71
+
72
+ ```tcl
73
+ remove_io_bump_array -bump master
74
+ ```
75
+
76
+ #### Options
77
+
78
+ | Switch Name | Description |
79
+ | ----- | ----- |
80
+ | `-bump` | Name of the bump master. |
81
+
82
+ Example usage:
83
+
84
+ ```tcl
85
+ remove_io_bump_array -bump BUMP
86
+ ```
87
+
88
+ ### Removing a Single Bump Instance
89
+
90
+ To remove a single bump instance.
91
+
92
+ ```tcl
93
+ remove_io_bump instance_name
94
+ ```
95
+
96
+ #### Options
97
+
98
+ | Switch Name | Description |
99
+ | ----- | ----- |
100
+ | `instance_name` | Name of the bump. |
101
+
102
+ ### Assigning a Net to a Bump
103
+
104
+ To assign a net to a bump.
105
+
106
+ ```tcl
107
+ assign_io_bump
108
+ -net net
109
+ [-terminal iterm]
110
+ [-dont_route]
111
+ instance
112
+ ```
113
+
114
+ #### Options
115
+
116
+ | Switch Name | Description |
117
+ | ----- | ----- |
118
+ | `-net` | Net to connect to. |
119
+ | `-terminal` | Instance terminal to route to. |
120
+ | `-dont_route` | Flag to indicate that this bump should not be routed, only perform assignment. |
121
+ | `instance` | Name of the bump. |
122
+
123
+ Example usage:
124
+
125
+ ```tcl
126
+ assign_io_bump -net p_ddr_addr_9_o BUMP_6_0
127
+ assign_io_bump -net p_ddr_addr_8_o BUMP_6_2
128
+ assign_io_bump -net DVSS BUMP_6_4
129
+ assign_io_bump -net DVDD BUMP_7_3
130
+ assign_io_bump -net DVDD -terminal u_dvdd/DVDD BUMP_8_3
131
+ assign_io_bump -net p_ddr_addr_7_o BUMP_7_1
132
+ assign_io_bump -net p_ddr_addr_6_o BUMP_7_0
133
+ ```
134
+
135
+ ### Define IO Rows
136
+
137
+ Define an IO site for the pads to be placed into.
138
+
139
+ ```tcl
140
+ make_io_sites
141
+ -horizontal_site site
142
+ -vertical_site site
143
+ -corner_site site
144
+ -offset offset
145
+ [-rotation_horizontal rotation]
146
+ [-rotation_vertical rotation]
147
+ [-rotation_corner rotation]
148
+ [-ring_index index]
149
+ ```
150
+
151
+ #### Options
152
+
153
+ | Switch Name | Description |
154
+ | ----- | ----- |
155
+ | `-horizontal_site` | Name of the site for the horizontal pads (east and west). |
156
+ | `-vertical_site` | Name of the site for the vertical pads (north and south). |
157
+ | `-corner_site` | Name of the site for the corner cells. |
158
+ | `-offset` | Offset from the die edge to place the rows. |
159
+ | `-rotation_horizontal` | Rotation to apply to the horizontal sites to ensure pads are placed correctly. The default value is `R0`. |
160
+ | `-rotation_vertical` | Rotation to apply to the vertical sites to ensure pads are placed correctly. The default value is `R0`. |
161
+ | `-rotation_corner` | Rotation to apply to the corner sites to ensure pads are placed correctly. The default value is `R0`. |
162
+ | `-ring_index` | Used to specify the index of the ring in case of multiple rings. |
163
+
164
+ Example usage:
165
+
166
+ ```tcl
167
+ make_io_sites -horizontal_site IOSITE_H -vertical_site IOSITE_V -corner_site IOSITE_C -offset 35
168
+ make_io_sites -horizontal_site IOSITE_H -vertical_site IOSITE_V -corner_site IOSITE_C -offset 35 -rotation_horizontal R180
169
+ ```
170
+
171
+ ### Remove IO Rows
172
+
173
+ When the padring is complete, the following command can remove the IO rows to avoid causing confusion with the other tools.
174
+
175
+ ```tcl
176
+ remove_io_rows
177
+ ```
178
+
179
+ ### Placing Corners
180
+
181
+ To place the corner cells
182
+
183
+ ```tcl
184
+ place_corners
185
+ master
186
+ [-ring_index index]
187
+ ```
188
+
189
+ #### Options
190
+
191
+ | Switch Name | Description |
192
+ | ----- | ----- |
193
+ | `master` | Name of the master for the corners. |
194
+ | `-ring_index` | Used to specify the index of the ring in case of multiple rings. |
195
+
196
+ Example usage:
197
+
198
+ ```tcl
199
+ place_corners sky130_fd_io__corner_bus_overlay
200
+ ```
201
+
202
+ ### Placing Pads
203
+
204
+ To place a pad into the pad ring.
205
+
206
+ ```tcl
207
+ place_pad
208
+ -row row_name
209
+ -location offset
210
+ -mirror
211
+ [-master master]
212
+ name
213
+ ```
214
+
215
+ #### Options
216
+
217
+ | Switch Name | Description |
218
+ | ----- | ----- |
219
+ | `-row` | Name of the row to place the pad into, examples include: `IO_NORTH`, `IO_SOUTH`, `IO_WEST`, `IO_EAST`, `IO_NORTH_0`, `IO_NORTH_1`. |
220
+ | `-location` | Offset from the bottom left chip edge to place the pad at. |
221
+ | `-mirror` | Specifies if the pad should be mirrored. |
222
+ | `-master` | Name of the instance master if the instance needs to be created. |
223
+ | `name` | Name of the instance. |
224
+
225
+ Example usage:
226
+
227
+ ```tcl
228
+ place_pad -row IO_SOUTH -location 280.0 {u_clk.u_in}
229
+ place_pad -row IO_SOUTH -location 360.0 -mirror {u_reset.u_in}
230
+ place_pad -master sky130_fd_io__top_ground_hvc_wpad -row IO_SOUTH -location 439.5 {u_vzz_0}
231
+ place_pad -master sky130_fd_io__top_power_hvc_wpad -row IO_SOUTH -location 517.5 {u_v18_0}
232
+ ```
233
+
234
+ ### Placing IO Filler Cells
235
+
236
+ To place the IO filler cells.
237
+
238
+ ```tcl
239
+ place_io_fill
240
+ -row row_name
241
+ [-permit_overlaps masters]
242
+ masters
243
+ ```
244
+
245
+ #### Options
246
+
247
+ | Switch Name | Description |
248
+ | ----- | ----- |
249
+ | `-row` | Name of the row to place the pad into, examples include: `IO_NORTH`, `IO_SOUTH`, `IO_WEST`, `IO_EAST`, `IO_NORTH_0`, `IO_NORTH_1`. |
250
+ | `-permit_overlaps` | Names of the masters for the IO filler cells that allow for overlapping. |
251
+ | `masters` | Names of the masters for the IO filler cells. |
252
+
253
+ Example usage:
254
+
255
+ ```tcl
256
+ place_io_fill -row IO_NORTH s8iom0s8_com_bus_slice_10um s8iom0s8_com_bus_slice_5um s8iom0s8_com_bus_slice_1um
257
+ place_io_fill -row IO_SOUTH s8iom0s8_com_bus_slice_10um s8iom0s8_com_bus_slice_5um s8iom0s8_com_bus_slice_1um
258
+ place_io_fill -row IO_WEST s8iom0s8_com_bus_slice_10um s8iom0s8_com_bus_slice_5um s8iom0s8_com_bus_slice_1um
259
+ place_io_fill -row IO_EAST s8iom0s8_com_bus_slice_10um s8iom0s8_com_bus_slice_5um s8iom0s8_com_bus_slice_1um
260
+ ```
261
+
262
+ ### Connecting Ring Signals
263
+
264
+ Once the ring is complete, use the following command to connect the ring signals.
265
+
266
+ ```tcl
267
+ connect_by_abutment
268
+ ```
269
+
270
+ ### Placing Wirebond Pads
271
+
272
+ To place the wirebond pads over the IO cells.
273
+
274
+ ```tcl
275
+ place_bondpad
276
+ -bond master
277
+ [-offset {x y}]
278
+ [-rotation rotation]
279
+ io_instances
280
+ ```
281
+
282
+ #### Options
283
+
284
+ | Switch Name | Description |
285
+ | ----- | ----- |
286
+ | `-bond` | Name of the bondpad master. |
287
+ | `-offset` | Offset to place the bondpad at with respect to the io instance. |
288
+ | `-rotation` | Rotation of the bondpad. |
289
+ | `io_instances` | Names of the instances to add bond pads to. |
290
+
291
+ Example usage:
292
+
293
+ ```tcl
294
+ place_bondpad -bond PAD IO_*
295
+ ```
296
+
297
+ ### Creating False IO Sites
298
+
299
+ If the library does not contain sites for the IO cells, the following command can be used to add them.
300
+ This should not be used unless the sites are not in the library.
301
+
302
+ ```tcl
303
+ make_fake_io_site
304
+ -name name
305
+ -width width
306
+ -height height
307
+ ```
308
+
309
+ #### Options
310
+
311
+ | Switch Name | Description |
312
+ | ----- | ----- |
313
+ | `-name` | Name of the site. |
314
+ | `-width` | Width of the site (in microns). |
315
+ | `-height` | Height of the site (in microns). |
316
+
317
+ Example usage:
318
+
319
+ ```tcl
320
+ make_fake_io_site -name IO_HSITE -width 1 -height 204
321
+ make_fake_io_site -name IO_VSITE -width 1 -height 200
322
+ make_fake_io_site -name IO_CSITE -width 200 -height 204
323
+ ```
324
+
325
+ ### Redistribution Layer Routing
326
+
327
+ To route the RDL for the bump arrays.
328
+
329
+ ```tcl
330
+ rdl_route
331
+ -layer layer
332
+ [-bump_via access_via]
333
+ [-pad_via access_via]
334
+ [-width width]
335
+ [-spacing spacing]
336
+ [-turn_penalty penalty]
337
+ [-allow45]
338
+ nets
339
+ ```
340
+
341
+ #### Options
342
+
343
+ | Switch Name | Description |
344
+ | ----- | ----- |
345
+ | `-layer` | Layer to route on. |
346
+ | `-bump_via` | Via to use to to connect the bump to the routing layer. |
347
+ | `-pad_via` | Via to use to to connect the pad cell to the routing layer. |
348
+ | `-width` | Width of the routing. Defaults to minimum width for each respective layer. |
349
+ | `-spacing` | Spacing of the routing. Defaults to minimum spacing for each respective layer. |
350
+ | `-turn_penalty` | Scaling factor to apply to discurage turning to allow for straighter routes. The default value is `2.0`, and the allowed values are floats. |
351
+ | `-allow45` | Specifies that 45 degree routing is permitted. |
352
+ | `nets` | Nets to route. |
353
+
354
+ ### Useful Developer Commands
355
+
356
+ If you are a developer, you might find these useful. More details can be found in the [source file](./src/ICeWall.cpp) or the [swig file](./src/pad.i).
357
+
358
+ | Command Name | Description |
359
+ | ----- | ----- |
360
+ | `find_site` | Find site given site name. |
361
+ | `find_master` | Find master given master name. |
362
+ | `find_instance` | Find instance given instance name. |
363
+ | `find_net` | Find net given net name. |
364
+ | `assert_required` | Assert argument that is required for `cmd` |
365
+ | `connect_iterm` | Connect instance terminals. Required inputs are: `inst_name`, `iterm_name`, `net_name`. |
366
+ | `convert_tcl` | These functions read from $ICeWall::library parameters to generate a standalone Tcl script. |
367
+
368
+ ## Example Scripts
369
+
370
+ Example scripts for running ICeWall functions can be found in `./test`.
371
+
372
+ ```tcl
373
+ ./test/assign_bumps.tcl
374
+ ./test/bump_array_make.tcl
375
+ ./test/bump_array_remove.tcl
376
+ ./test/bump_array_remove_single.tcl
377
+ ./test/connect_by_abutment.tcl
378
+ ./test/make_io_sites.tcl
379
+ ./test/place_bondpad.tcl
380
+ ./test/place_bondpad_stagger.tcl
381
+ ./test/place_pad.tcl
382
+ ./test/rdl_route.tcl
383
+ ./test/rdl_route_45.tcl
384
+ ./test/rdl_route_assignments.tcl
385
+ ```
386
+
387
+ ## Regression Tests
388
+
389
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
390
+
391
+ Simply run the following script:
392
+
393
+ ```shell
394
+ ./test/regression
395
+ ```
396
+
397
+ ## Limitations
398
+
399
+ ## FAQs
400
+
401
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+pad)
402
+ about this tool.
403
+
404
+ ## License
405
+
406
+ BSD 3-Clause License. See [LICENSE](../../LICENSE) file.
data/markdown/OR_userguide/OR_par_README.md ADDED
@@ -0,0 +1,582 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Partition Manager
2
+
3
+ The partitioning module (`par`) is based on TritonPart, an open-source
4
+ constraints-driven partitioner. `par` can be used
5
+ to partition a hypergraph or a gate-level netlist.
6
+
7
+ ## Highlights
8
+ - Start of the art multiple-constraints driven partitioning “multi-tool”
9
+ - Optimizes cost function based on user requirement
10
+ - Permissive open-source license
11
+ - Solves multi-way partitioning with following features:
12
+ - Multidimensional real-value weights on vertices and hyperedges
13
+ - Multilevel coarsening and refinement framework
14
+ - Fixed vertices constraint
15
+ - Timing-driven partitioning framework
16
+ - Group constraint: Groups of vertices need to be in same block
17
+ - Embedding-aware partitioning
18
+
19
+ ## Dependency
20
+
21
+ We use Google OR-Tools as our ILP solver.
22
+
23
+ Our recommendation is to follow the OpenROAD [DependencyInstaller](../etc/DependencyInstaller.sh) for installation of this requirement.
24
+
25
+ Alternatively, you may also install Google OR-Tools
26
+ following these [instructions](https://developers.google.com/optimization/install).
27
+
28
+ ```{warning}
29
+ Due to a build issue, TritonPart is not supported for macOS. Stay tuned to this page for updates!
30
+ ```
31
+
32
+ ## Main Algorithm
33
+
34
+ An overview of the TritonPart algorithm is shown below. It takes as inputs
35
+ - Hypergraph $H(V,E)$ in `.hgr` format.
36
+ - Vertex weight $w_v \in \mathcal{R}_+^m$
37
+ - Hyperedge weight $w_e \in \mathcal{R}_+^n$
38
+ - Number of blocks $K$.
39
+ - Imbalance factor $\epsilon$.
40
+ - User-specified cost function $\phi$.
41
+
42
+ There are five main steps in the main algorithm,
43
+ mainly 1) constraints-driven coarsening,
44
+ 2) initial partitioning, 3) refinement, 4) cut-overlay clustering and
45
+ partitioning (COCP), and 5) V-cycle refinement. The steps for the
46
+ timing-aware algorithm may be found in the next [section](#timing-aware-algorithm).
47
+
48
+ 1. Constraints-Driven Coarsening
49
+
50
+ The first step involves multilevel coarsening. Specifically, at each level,
51
+ clusters of vertices are identified, and the merged and represented
52
+ as a single vertex in the resulting coarser hypergraph. In this algorithm,
53
+ the First-Choice scheme is used, which traverses the vertices in the
54
+ hypergraph according to a given ordering and merges pairs of vertices with
55
+ high connectivity. The connectivity between a pair of vertices $(u,v)$
56
+ is measured as follows:
57
+
58
+ $$r(u, v) = \sum_{e\in \{I(v)\cap I(u)\}} \frac{\langle \alpha, w_e\rangle}{|e|-1}$$
59
+
60
+ To efficiently manage multiple constraints, the following enhancements are
61
+ made to the coarsening scheme above:
62
+
63
+ - **Fixed Vertex Constraint**: Fixed vertices that belong to the same partitioning block are merged into a single vertex.
64
+ - **Grouping Constraint**: Vertices that belong to the same group are merged into a single vertex.
65
+ - **Embedding Constraint**: The embedding information is incorporated into the heavy-edge rating function. The new connectivity is updated as follows:
66
+
67
+ $$\hat{r}(u, v) = r(u, v) + \rho\frac{1}{||X_u - X_v||_2}$$
68
+
69
+ where $\rho$ is a normalization factor set to the average distance between two
70
+ vertex embeddings. When vertices $v_1, ... , v_t$ are merged into a single
71
+ vertex $v_{coarse}$, the corresponding vertex embedding $X_{v_{coarse}}$
72
+ is defined as the *center of gravity* of $t$ vertices:
73
+
74
+ $$X_{v_{coarse}} = \sum_{j=1}^{t} \frac{||w_{v_j}||}{M} X_{v_j},\ where\ M= \sum_{j=1}^t ||w_{v_j}|| $$
75
+
76
+ - **Community Guidance**: Only vertices within the same community are
77
+ considered for merging.
78
+ - **Tie-breaking mechanism**: If multiple neighbor pairs have the same rating
79
+ score, combine the lexicographically first unmatched vertex to break ties.
80
+
81
+ 2. Initial Partitioning
82
+
83
+ After completing the coarsening process, an initial partitioning solution for
84
+ the coarsest hypergraph $H_c$ is derived. Two sub-steps are involved in this:
85
+ the best partitioning solution from random and VILE partitioning is chosen
86
+ from $\eta = 50$ runs as a warm-start to the ILP-based partitioner. The
87
+ optimization is based on only the cut size rather than the cost function
88
+ $\phi$ to keep the runtime reasonable.
89
+
90
+ 3. Refinement
91
+
92
+ After a feasible solution $H_{c_\xi}$ is obtained by initial partitioning,
93
+ uncoarsening and move-based refinement is performed to improve the
94
+ partitioning solution. Three refinement heuristics are applied in sequence:
95
+ - **$K$-way pairwise FM (PM)**: This addresses multi-way partitioning
96
+ as concurrent bi-partitioning problems in a restricted version of K-way
97
+ Fiduccia–Mattheyses (FM) algorithm. First, $\lfloor K/2\rfloor $ pairs of
98
+ blocks are obtained, with refinement-specific vertex movements restricted
99
+ to associated paired blocks. Next, two-way FM is concurrently performed on
100
+ all the block pairs. finally, a new configuration of block pairs is computed
101
+ at the end of the PM.
102
+ - **Direct $K$-way FM**: Using $K$ priority queues, for each block $V_i$,
103
+ establish a priority queue that stores the vertices that can be potentially
104
+ moved from the current block to block $V_i$. This queue is ordered according
105
+ to the gain of the vertices. Gain is defined as the reduction in cost
106
+ function from the movement of the vertex from the current block to $V_i$.
107
+ Next, after a vertex move, each priority queue is updated independently, thus
108
+ enabling parallel updates via multi-threading. Next, early-stop is implemented
109
+ by limiting the maximum number of vertices moved to 100 per pass. Finally,
110
+ the *corking effect* is mitigated by traversing the priority queue belonging
111
+ to the vertex with the highest gain and identifying a feasible vertex move.
112
+ - **Greedy Hyperedge Refinement (HER)**: First, randomly visit all
113
+ hyperedges. For each hyperedge $e$ that crosses the partition boundary,
114
+ determine whether a subset of vertices in $e$ can be moved without violating
115
+ the multi-dimensional balance constraints. The objective is to make $e$
116
+ entirely constrained in a block.
117
+
118
+ 4. Cut-Overlay Clustering and Partitioning (COCP)
119
+
120
+ Cut-overlay Clustering and Partitioning (COCP) is a mechanism to
121
+ combine multiple good-quality partitioning solutions to generate an
122
+ improved solution. To begin, the sets of hyperedges cut in the $\theta$
123
+ candidate solutions are denoted as $E_1,..., E_\theta \subset E$. First,
124
+ $\cup_{i=1}^\theta E_i$ is removed from the hypergraph $H(V, E)$, resulting in
125
+ a number of connected components. Next, all vertices within each connected
126
+ component are merged to form a coarser hypergraph $H_{overlay}$. If the
127
+ number of vertices in $H_{overlay}$ is less than $thr_{ilp}$, ILP-based
128
+ partitioning is performed. If not, a single round of constraints-driven
129
+ coarsening is conducted to further reduce the size of $H_{overlay}$
130
+ and generate a coarser hypergraph $H_{overlay}^{'}$. Finally, multilevel
131
+ refinement is performed to further improve the partitioning solution at
132
+ each level of the hierarchy and return the improved solution $S^{'}$.
133
+
134
+ 5. V-Cycle Refinement
135
+
136
+ Cut-overlay clustering and partitioning produces a high-quality partitioning
137
+ solution $S^{'}$. To improve it, there are three phases similar to *hMETIS*,
138
+ namely multilevel coarsening, ILP-based partitioning, and refinement.
139
+ Firstly, in multilevel partitioning, $S^{'}$ is used as a community guidance
140
+ for the constraints-driven coarsening. Only vertices within the same block
141
+ are permitted to be merged to ensure that the current solution $S^{'}$
142
+ is preserved in the coarsest hypergraph $H_{c_\xi}$. In the ILP-based
143
+ partitioning phase, if the number of vertices in $H_{c_\xi}$ does not exceed
144
+ $thr_{ilp}$, run ILP-based partitioning to improve $S^{'}$. Otherwise,
145
+ continue with $S^{'}$ in successive iterations of these two steps (default
146
+ set to 2). The refinement phase is conducted as per step 3.
147
+
148
+ ![](./doc/algo.webp)<center>TritonPart algorithm at a glance</center>
149
+
150
+ ## Timing Aware Algorithm
151
+
152
+ `par` can also be used as a timing-aware partitioning framework. A slack
153
+ propagation methodology is used that optimizes cuts for both timing-critical
154
+ and timing-noncritical paths.
155
+
156
+ 1. Extraction of Timing Paths and Slack Information
157
+
158
+ First, the top $P$ timing-critical paths and the slack information of each
159
+ hyperedge using the wireload model (WLM) is obtained from *OpenSTA*. The
160
+ timing cost of each path is then calculated:
161
+
162
+ $$t_p = (1- \frac{slack_p - \Delta}{clock\_period})^\mu$$
163
+
164
+ where a fixed extra delay $\Delta$ is introduced for timing guardband,
165
+ and $\mu$ (default 2) is the exponent.
166
+
167
+ The snaking factor of a path $SF(p)$ is defined as the maximum number
168
+ of block reentries along the path $p$. The timing cost of a hyperedge is
169
+ computed using the timing weight corresponding to hyperedge slack $slack_e$
170
+ and the accumulated timing cost of all paths traversing the hyperedge.
171
+
172
+ $$t_e = (1- \frac{slack_e -\Delta}{clock\_period})^\mu + \sum_{\{p|e\in p\}}t_p$$
173
+
174
+ 2. Timing-aware Coarsening
175
+
176
+ The timing-aware feature is achieved by adding a timing cost of hyperedge
177
+ $t_e$ to the connectivity score earlier mentioned. If vertices $(u,v)$
178
+ are associated with multiple critical paths, then they are more likely to
179
+ be merged. This is reflected in the update score function:
180
+
181
+ $$r_t(u,v) = \hat{r}(u,v) + \sum_{e\in\{I(v) \cap I(u)\}} \frac{\beta t_e}{|e| - 1}$$
182
+
183
+ 3. Timing-aware Refinement
184
+
185
+ Timing-aware refinement is based on a similar cost function as the main
186
+ algorithm. Instead, an additional slack propagation step is performed at
187
+ the end of each PM/FM/HER pass.
188
+
189
+ ## Commands
190
+
191
+ ```{note}
192
+ - Parameters in square brackets `[-param param]` are optional.
193
+ - Parameters without square brackets `-param2 param2` are required.
194
+ ```
195
+
196
+ ### Partition Netlist
197
+
198
+ ```tcl
199
+ triton_part_hypergraph
200
+ -hypergraph_file hypergraph_file
201
+ -num_parts num_parts
202
+ -balance_constraint balance_constraint
203
+ [-base_balance base_balance]
204
+ [-seed seed]
205
+ [-vertex_dimension vertex_dimension]
206
+ [-hyperedge_dimension hyperedge_dimension]
207
+ [-placement_dimension placement_dimension]
208
+ [-fixed_file fixed_file]
209
+ [-community_file community_file]
210
+ [-group_file group_file]
211
+ [-placement_file placement_file]
212
+ [-e_wt_factors e_wt_factors]
213
+ [-v_wt_factors <v_wt_factors>]
214
+ [-placement_wt_factors <placement_wt_factors>]
215
+ [-thr_coarsen_hyperedge_size_skip thr_coarsen_hyperedge_size_skip]
216
+ [-thr_coarsen_vertices thr_coarsen_vertices]
217
+ [-thr_coarsen_hyperedges thr_coarsen_hyperedges]
218
+ [-coarsening_ratio coarsening_ratio]
219
+ [-max_coarsen_iters max_coarsen_iters]
220
+ [-adj_diff_ratio adj_diff_ratio]
221
+ [-min_num_vertices_each_part min_num_vertices_each_part]
222
+ [-num_initial_solutions num_initial_solutions]
223
+ [-num_best_initial_solutions num_best_initial_solutions]
224
+ [-refiner_iters refiner_iters]
225
+ [-max_moves max_moves]
226
+ [-early_stop_ratio early_stop_ratio]
227
+ [-total_corking_passes total_corking_passes]
228
+ [-v_cycle_flag v_cycle_flag ]
229
+ [-max_num_vcycle max_num_vcycle]
230
+ [-num_coarsen_solutions num_coarsen_solutions]
231
+ [-num_vertices_threshold_ilp num_vertices_threshold_ilp]
232
+ [-global_net_threshold global_net_threshold]
233
+ ```
234
+
235
+ #### Options
236
+
237
+ | Switch Name | Description |
238
+ | ----- | ----- |
239
+ | `-num_parts` | Number of partitions. The default value is `2`, and the allowed values are integers `[0, MAX_INT]`. |
240
+ | `-balance_constraint` | Allowed imbalance between blocks. The default value is `1.0`, and the allowed values are floats. |
241
+ | `-base_balance` | Tcl list of baseline imbalance between partitions. The default value is `{1.0}`, and the allowed values are floats that sum up to `1.0`. |
242
+ | `-seed` | Random seed. The default value is `0`, and the allowed values are integers `[-MAX_INT, MAX_INT]`. |
243
+ | `-vertex_dimension` | Number of vertices in the hypergraph. The default value is `1`, and the allowed values are integers `[0, MAX_INT]`. |
244
+ | `-hyperedge_dimension` | Number of hyperedges in hypergraph. The default value is `1`, and the allowed values are integers `[0, MAX_INT]`. |
245
+ | `-placement_dimension` | Number of dimensions for canvas if placement information is provided. The default value is `0`, and the allowed values are integers `[0, MAX_INT]`. |
246
+ | `-hypergraph_file` | Path to hypergraph file. |
247
+ | `-fixed_file` | Path to fixed vertices constraint file. |
248
+ | `-community_file` | Path to `community` attributes file to guide the partitioning process. |
249
+ | `-group_file` | Path to `stay together` attributes file. |
250
+ | `-placement_file` | Placement information file, each line corresponds to a group fixed vertices, community, and placement attributes following the [hMETIS](https://course.ece.cmu.edu/~ee760/760docs/hMetisManual.pdf) format. |
251
+ | `-e_wt_factors` | Hyperedge weight factor. |
252
+ | `-v_wt_factors` | Vertex weight factors. |
253
+ | `-placement_wt_factors` | Placement weight factors. |
254
+ | `-thr_coarsen_hyperedge_size_skip` | Threshold for ignoring large hyperedge (default 200, integer). |
255
+ | `-thr_coarsen_vertices` | Number of vertices of coarsest hypergraph (default 10, integer). |
256
+ | `-thr_coarsen_hyperedges` | Number of vertices of coarsest hypergraph (default 50, integer). |
257
+ | `-coarsening_ratio` | Coarsening ratio of two adjacent hypergraphs (default 1.6, float). |
258
+ | `-max_coarsen_iters` | Number of iterations (default 30, integer). |
259
+ | `-adj_diff_ratio` | Minimum difference of two adjacent hypergraphs (default 0.0001, float). |
260
+ | `-min_num_vertices_each_part` | Minimum number of vertices in each partition (default 4, integer). |
261
+ | `-num_initial_solutions` | Number of initial solutions (default 50, integer). |
262
+ | `-num_best_initial_solutions` | Number of top initial solutions to filter out (default 10, integer). |
263
+ | `-refiner_iters` | Refinement iterations (default 10, integer). |
264
+ | `-max_moves` | The allowed moves for each Fiduccia-Mattheyes (FM) algorithm pass or greedy refinement (default 60, integer). |
265
+ | `-early_stop_ratio` | Describes the ratio $e$ where if the $n_{moved vertices} > n_{vertices} * e$, the tool exits the current FM pass. The intention behind this is that most of the gains are achieved by the first few FM moves. (default 0.5, float). |
266
+ | `-total_corking_passes` | Maximum level of traversing the buckets to solve the "corking effect" (default 25, integer). |
267
+ | `-v_cycle_flag` | Disables v-cycle is used to refine partitions (default true, bool). |
268
+ | `-max_num_vcycle` | Maximum number of `vcycles` (default 1, integer). |
269
+ | `-num_coarsen_solutions` | Number of coarsening solutions with different randoms seed (default 3, integer). |
270
+ | `-num_vertices_threshold_ilp` | Describes threshold $t$, the number of vertices used for integer linear programming (ILP) partitioning. if $n_{vertices} > t$, do not use ILP-based partitioning.(default 50, integer). |
271
+ | `-global_net_threshold` | If the net is larger than this, it will be ignored by TritonPart (default 1000, integer). |
272
+
273
+ ### Evaluate Hypergraph Partition
274
+
275
+ ```tcl
276
+ evaluate_hypergraph_solution
277
+ -num_parts num_parts
278
+ -balance_constraint balance_constraint
279
+ -hypergraph_file hypergraph_file
280
+ -solution_file solution_file
281
+ [-base_balance base_balance]
282
+ [-vertex_dimension vertex_dimension]
283
+ [-hyperedge_dimension hyperedge_dimension]
284
+ [-fixed_file fixed_file]
285
+ [-group_file group_file]
286
+ [-e_wt_factors e_wt_factors]
287
+ [-v_wt_factors v_wt_factors]
288
+ ```
289
+
290
+ #### Options
291
+
292
+ | Switch Name | Description |
293
+ | ----- | ----- |
294
+ | `-num_parts` | Number of partitions. The default value is `2`, and the allowed values are integers `[0, MAX_INT]`. |
295
+ | `-balance_constraint` | Allowed imbalance between blocks. The default value is `1.0`, and the allowed values are floats. |
296
+ | `-vertex_dimension` | Number of vertices in the hypergraph. The default value is `1`, and the allowed values are integers `[0, MAX_INT]`. |
297
+ | `-hyperedge_dimension` | Number of hyperedges in hypergraph. The default value is `1`, and the allowed values are integers `[0, MAX_INT]`. |
298
+ | `-hypergraph_file` | Path to hypergraph file. |
299
+ | `-solution_file` | Path to solution file. |
300
+ | `-base_balance` | Tcl list of baseline imbalance between partitions. The default value is `{1.0}`, and the allowed values are floats that sum up to `1.0`. |
301
+ | `-fixed_file` | Path to fixed vertices constraint file. |
302
+ | `-group_file` | Path to `stay together` attributes file. |
303
+ | `-e_wt_factors` | Hyperedge weight factor. |
304
+ | `-v_wt_factors` | Vertex weight factor. |
305
+
306
+
307
+ ### Partition Netlist
308
+
309
+ ```tcl
310
+ triton_part_design
311
+ [-num_parts num_parts]
312
+ [-balance_constraint balance_constraint]
313
+ [-base_balance base_balance]
314
+ [-seed seed]
315
+ [-timing_aware_flag timing_aware_flag]
316
+ [-top_n top_n]
317
+ [-placement_flag placement_flag]
318
+ [-fence_flag fence_flag]
319
+ [-fence_lx fence_lx]
320
+ [-fence_ly fence_ly]
321
+ [-fence_ux fence_ux]
322
+ [-fence_uy fence_uy]
323
+ [-fixed_file fixed_file]
324
+ [-community_file community_file]
325
+ [-group_file group_file]
326
+ [-solution_file solution_file]
327
+ [-net_timing_factor net_timing_factor]
328
+ [-path_timing_factor path_timing_factor]
329
+ [-path_snaking_factor path_snaking_factor]
330
+ [-timing_exp_factor timing_exp_factor]
331
+ [-extra_delay extra_delay]
332
+ [-guardband_flag guardband_flag]
333
+ [-e_wt_factors e_wt_factors]
334
+ [-v_wt_factors v_wt_factors]
335
+ [-placement_wt_factors placement_wt_factors]
336
+ [-thr_coarsen_hyperedge_size_skip thr_coarsen_hyperedge_size_skip]
337
+ [-thr_coarsen_vertices thr_coarsen_vertices]
338
+ [-thr_coarsen_hyperedges thr_coarsen_hyperedges]
339
+ [-coarsening_ratio coarsening_ratio]
340
+ [-max_coarsen_iters max_coarsen_iters]
341
+ [-adj_diff_ratio adj_diff_ratio]
342
+ [-min_num_vertices_each_part min_num_vertices_each_part]
343
+ [-num_initial_solutions num_initial_solutions]
344
+ [-num_best_initial_solutions num_best_initial_solutions]
345
+ [-refiner_iters refiner_iters]
346
+ [-max_moves max_moves]
347
+ [-early_stop_ratio early_stop_ratio]
348
+ [-total_corking_passes total_corking_passes]
349
+ [-v_cycle_flag v_cycle_flag ]
350
+ [-max_num_vcycle max_num_vcycle]
351
+ [-num_coarsen_solutions num_coarsen_solutions]
352
+ [-num_vertices_threshold_ilp num_vertices_threshold_ilp]
353
+ [-global_net_threshold global_net_threshold]
354
+ ```
355
+
356
+ #### Options
357
+
358
+ | Switch Name | Description |
359
+ | ----- | ----- |
360
+ | `-num_parts` | Number of partitions. The default value is `2`, and the allowed values are integers `[0, MAX_INT]`. |
361
+ | `-balance_constraint` | Allowed imbalance between blocks. The default value is `1.0`, and the allowed values are floats. |
362
+ | `-base_balance` | Tcl list of baseline imbalance between partitions. The default value is `{1.0}`, and the allowed values are floats that sum up to `1.0`. |
363
+ | `-seed` | Random seed. The default value is `1`, and the allowed values are integers `[-MAX_INT, MAX_INT]`. |
364
+ | `-timing_aware_flag` | Enable timing-driven mode. The default value is `true`, and the allowed values are booleans. |
365
+ | `-top_n` | Extract the top n critical timing paths. The default value is `1000`, and the allowed values are integers `[0, MAX_INT`. |
366
+ | `-placement_flag` | Enable placement driven partitioning. The default value is `false`, and the allowed values are booleans. |
367
+ | `-fence_flag ` | Consider fences in the partitioning. The default value is `false`, and the allowed values are booleans. |
368
+ | `-fence_lx ` | Fence lower left x in microns. The default value is `0.0`, and the allowed values are floats. |
369
+ | `-fence_ly ` | Fence lower left y in microns. The default value is `0.0`, and the allowed values are floats. |
370
+ | `-fence_ux ` | Fence upper right x in microns. The default value is `0.0`, and the allowed values are floats. |
371
+ | `-fence_uy ` | Fence upper right y in microns. The default value is `0.0`, and the allowed values are floats. |
372
+ | `-fixed_file` | Path to fixed vertices constraint file |
373
+ | `-community_file` | Path to `community` attributes file to guide the partitioning process. |
374
+ | `-group_file` | Path to `stay together` attributes file. |
375
+ | `-solution_file` | Path to solution file. |
376
+ | `-net_timing_factor` | Hyperedge timing weight factor (default 1.0, float). |
377
+ | `-path_timing_factor` | Cutting critical timing path weight factor (default 1.0, float). |
378
+ | `-path_snaking_factor` | Snaking a critical path weight factor (default 1.0, float). |
379
+ | `-timing_exp_factor` | Timing exponential factor for normalized slack (default 1.0, float). |
380
+ | `-extra_delay` | Extra delay introduced by a cut (default 1e-9, float). |
381
+ | `-guardband_flag` | Enable timing guardband option (default false, bool). |
382
+ | `-e_wt_factors` | Hyperedge weight factor. |
383
+ | `-v_wt_factors` | Vertex weight factor. |
384
+ | `-placement_wt_factors` | Placement weight factor. |
385
+ | `-thr_coarsen_hyperedge_size_skip` | Threshold for ignoring large hyperedge. The default value is `1000`, and the allowed values are integers `[0, MAX_INT]`. |
386
+ | `-thr_coarsen_vertices` | Number of vertices of coarsest hypergraph. The default value is `10`, and the allowed values are integers `[0, MAX_INT]`. |
387
+ | `-thr_coarsen_hyperedges` | Number of vertices of the coarsest hypergraph. The default value is `50`, and the allowed values are integers `[0, MAX_INT]`. |
388
+ | `-coarsening_ratio` | Coarsening ratio of two adjacent hypergraphs. The default value is `1.5`, and the allowed values are floats. |
389
+ | `-max_coarsen_iters` | Number of iterations. The default value is `30`, and the allowed values are integers `[0, MAX_INT]`. |
390
+ | `-adj_diff_ratio` | Minimum ratio difference of two adjacent hypergraphs. The default value is `0.0001`, and the allowed values are floats. |
391
+ | `-min_num_vertices_each_part` | Minimum number of vertices in each partition. The default value is `4`, and the allowed values are integers `[0, MAX_INT]`. |
392
+ | `-num_initial_solutions` | Number of initial solutions. The default value is `100`, and the allowed values are integers `[0, MAX_INT]`. |
393
+ | `-num_best_initial_solutions` | Number of top initial solutions to filter out. The default value is `10`, and the allowed values are integers `[0, MAX_INT]`. |
394
+ | `-refiner_iters` | Refinement iterations. The default value is `10`, and the allowed values are integers `[0, MAX_INT]`. |
395
+ | `-max_moves` | The allowed moves for each Fiduccia-Mattheyes (FM) algorithm pass or greedy refinement. The default value is `100`, and the allowed values are integers `[0, MAX_INT]`. |
396
+ | `-early_stop_ratio` | Describes the ratio $e$ where if the $n_{moved vertices} > n_{vertices} * e$, the tool exists the current FM pass. The intention behind this is that most of the gains are achieved by the first few FM moves. The default value is `0.5`, and the allowed values are floats. |
397
+ | `-total_corking_passes` | Maximum level of traversing the buckets to solve the "corking effect". The default value is `25`, and the allowed values are integers `[0, MAX_INT]`. |
398
+ | `-v_cycle_flag` | Disables v-cycle is used to refine partitions. The default value is `true`, and the allowed values are booleans. |
399
+ | `-max_num_vcycle` | Maximum number of vcycles. The default value is `1`, and the allowed values are integers `[0, MAX_INT]`. |
400
+ | `-num_coarsen_solutions` | Number of coarsening solutions with different randoms seed. The default value is `4`, and the allowed values are integers `[0, MAX_INT]`. |
401
+ | `-num_vertices_threshold_ilp` | Describes threshold $t$, the number of vertices used for integer linear programming (ILP) partitioning. if $n_{vertices} > t$, do not use ILP-based partitioning. The default value is `50`, and the allowed values are integers `[0, MAX_INT]`. |
402
+ | `-global_net_threshold` | If the net is larger than this, it will be ignored by TritonPart. The default value is `1000`, and the allowed values are integers `[0, MAX_INT]`. |
403
+
404
+ ### Evaluation Netlist Partition
405
+
406
+ ```tcl
407
+ evaluate_part_design_solution
408
+ [-num_parts num_parts]
409
+ [-balance_constraint balance_constraint]
410
+ [-base_balance base_balance]
411
+ [-timing_aware_flag timing_aware_flag]
412
+ [-top_n top_n]
413
+ [-fence_flag fence_flag]
414
+ [-fence_lx fence_lx]
415
+ [-fence_ly fence_ly]
416
+ [-fence_ux fence_ux]
417
+ [-fence_uy fence_uy]
418
+ [-fixed_file fixed_file]
419
+ [-community_file community_file]
420
+ [-group_file group_file]
421
+ [-hypergraph_file hypergraph_file]
422
+ [-hypergraph_int_weight_file hypergraph_int_weight_file]
423
+ [-solution_file solution_file]
424
+ [-net_timing_factor net_timing_factor]
425
+ [-path_timing_factor path_timing_factor]
426
+ [-path_snaking_factor path_snaking_factor]
427
+ [-timing_exp_factor timing_exp_factor]
428
+ [-extra_delay extra_delay]
429
+ [-guardband_flag guardband_flag]
430
+ [-e_wt_factors e_wt_factors]
431
+ [-v_wt_factors v_wt_factors]
432
+ ```
433
+
434
+ #### Options
435
+
436
+ | Switch Name | Description |
437
+ | ----- | ----- |
438
+ | `-num_parts` | Number of partitions. The default value is `2`, and the allowed values are integers `[0, MAX_INT]`. |
439
+ | `-balance_constraint` | Allowed imbalance between blocks. The default value is `1.0`, and the allowed values are floats. |
440
+ | `-base_balance` | Tcl list of baseline imbalance between partitions. The default value is `{1.0}`, and the allowed values are floats that sum up to `1.0`. |
441
+ | `-timing_aware_flag` | Enable timing-driven mode. The default value is `true`, and the allowed values are booleans. |
442
+ | `-top_n` | Extract the top n critical timing paths. The default value is `1000`, and the allowed values are integers `[0, MAX_INT]`. |
443
+ | `-fence_flag ` | Consider fences in the partitioning. The default value is `false`, and the allowed values are booleans. |
444
+ | `-fence_lx ` | Fence lower left x in microns. The default value is `0.0`, and the allowed values are floats. |
445
+ | `-fence_ly ` | Fence lower left y in microns. The default value is `0.0`, and the allowed values are floats. |
446
+ | `-fence_ux ` | Fence upper right x in microns. The default value is `0.0`, and the allowed values are floats. |
447
+ | `-fence_uy ` | Fence upper right y in microns. The default value is `0.0`, and the allowed values are floats. |
448
+ | `-fixed_file` | Path to fixed vertices constraint file. |
449
+ | `-community_file` | Path to `community` attributes file to guide the partitioning process. |
450
+ | `-group_file` | Path to `stay together` attributes file. |
451
+ | `-hypergraph_file` | Path to hypergraph file. |
452
+ | `-hypergraph_int_weight_file` | Path to `hMETIS` format integer weight file. |
453
+ | `-solution_file` | Path to solution file. |
454
+ | `-net_timing_factor` | Hyperedge timing weight factor. The default value is `1.0`, and the allowed values are floats. |
455
+ | `-path_timing_factor` | Cutting critical timing path weight factor. The default value is `1.0`, and the allowed values are floats. |
456
+ | `-path_snaking_factor` | Snaking a critical path weight factor. The default value is `1.0`, and the allowed values are floats. |
457
+ | `-timing_exp_factor` | Timing exponential factor for normalized slack. The default value is `1.0`, and the allowed values are floats. |
458
+ | `-extra_delay` | Extra delay introduced by a cut. The default value is `1e-9`, and the allowed values are floats. |
459
+ | `-guardband_flag` | Enable timing guardband option. The default value is 1`false`, and the allowed values are booleans. |
460
+ | `-e_wt_factors` | Hyperedge weight factors. |
461
+ | `-v_wt_factors` | Vertex weight factors. |
462
+
463
+ ### Write Partition to Verilog
464
+
465
+ ```tcl
466
+ write_partition_verilog
467
+ [-port_prefix prefix]
468
+ [-module_suffix suffix]
469
+ [file]
470
+ ```
471
+
472
+ #### Options
473
+
474
+ | Switch Name | Description |
475
+ | ----- | ----- |
476
+ | `-port_prefix` | Port name prefix. |
477
+ | `-module_suffix` | Module name suffix. |
478
+ | `file` | Filename to write partition verilog to. |
479
+
480
+ ### Read the Partition file
481
+
482
+ ```tcl
483
+ read_partitioning
484
+ -read_file name
485
+ [-instance_map_file file_path]
486
+
487
+
488
+ ## Example Scripts
489
+
490
+ ### How to partition a hypergraph in the way you would using hMETIS (min-cut partitioning)
491
+
492
+ ```tcl
493
+ triton_part_hypergraph -hypergraph_file des90.hgr -num_parts 5 -balance_constraint 2 -seed 2
494
+ ```
495
+ You can also check the provided example [here](./examples/min-cut-partitioning/run_openroad.tcl).
496
+
497
+ ### How to perform the embedding-aware partitioning
498
+
499
+ ```tcl
500
+ set num_parts 2
501
+ set balance_constraint 2
502
+ set seed 0
503
+ set design sparcT1_chip2
504
+ set hypergraph_file "${design}.hgr"
505
+ set placement_file "${design}.hgr.ubfactor.2.numparts.2.embedding.dat"
506
+ set solution_file "${design}.hgr.part.${num_parts}"
507
+
508
+ triton_part_hypergraph -hypergraph_file $hypergraph_file -num_parts $num_parts \
509
+ -balance_constraint $balance_constraint \
510
+ -seed $seed \
511
+ -placement_file ${placement_file} -placement_wt_factors { 0.00005 0.00005 } \
512
+ -placement_dimension 2
513
+
514
+ ```
515
+
516
+ You can find the provided example [here](./examples/embedding-aware-partitioning/run_placement_aware_flow.tcl).
517
+
518
+
519
+ ### How to partition a netlist
520
+
521
+ ```tcl
522
+ # set technology information
523
+ set ALL_LEFS “list_of_lefs”
524
+ set ALL_LIBS “list_of_libs”
525
+ # set design information
526
+ set design “design_name”
527
+ set top_design “top_design”
528
+ set netlist “netlist.v”
529
+ set sdc “timing.sdc”
530
+ foreach lef_file ${ALL_LEFS} {
531
+ read_lef $lef_file
532
+ }
533
+ foreach lib_file ${ALL_LIBS} {
534
+ read_lib $lib_file
535
+ }
536
+ read_verilog $netlist
537
+ link_design $top_design
538
+ read_sdc $sdc
539
+
540
+ set num_parts 5
541
+ set balance_constraint 2
542
+ set seed 0
543
+ set top_n 100000
544
+ # set the extra_delay_cut to 20% of the clock period
545
+ # the extra_delay_cut is introduced for each cut hyperedge
546
+ set extra_delay_cut 9.2e-10
547
+ set timing_aware_flag true
548
+ set timing_guardband true
549
+ set part_design_solution_file "${design}_part_design.hgr.part.${num_parts}"
550
+
551
+ ##############################################################################################
552
+ ### TritonPart with slack progagation
553
+ ##############################################################################################
554
+ puts "Start TritonPart with slack propagation"
555
+ # call triton_part to partition the netlist
556
+ triton_part_design -num_parts $num_parts -balance_constraint $balance_constraint \
557
+ -seed $seed -top_n $top_n \
558
+ -timing_aware_flag $timing_aware_flag -extra_delay $extra_delay_cut \
559
+ -guardband_flag $timing_guardband \
560
+ -solution_file $part_design_solution_file
561
+ ```
562
+
563
+ You can find the provided example [here](./examples/timing-aware-partitioning/run_timing_aware_flow.tcl).
564
+
565
+ ## Regression tests
566
+
567
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
568
+
569
+ Simply run the following script:
570
+
571
+ ```shell
572
+ ./test/regression
573
+ ```
574
+
575
+ ## References
576
+ 1. Bustany, I., Kahng, A. B., Koutis, I., Pramanik, B., & Wang, Z. (2023). K-SpecPart: A Supervised Spectral Framework for Multi-Way Hypergraph Partitioning Solution Improvement. arXiv preprint arXiv:2305.06167. [(.pdf)](https://arxiv.org/pdf/2305.06167)
577
+ 1. Bustany, I., Gasparyan, G., Kahng, A. B., Koutis, I., Pramanik, B., & Wang, Z. (2023). "An Open-Source Constraints-Driven General Partitioning Multi-Tool for VLSI Physical Design", Proc. ACM/IEEE International Conference of Computer-Aided Design 2023,[(.pdf)](https://vlsicad.ucsd.edu/Publications/Conferences/401/c401.pdf).
578
+
579
+
580
+ ## License
581
+
582
+ BSD 3-Clause License. See [LICENSE](../../LICENSE) file.
data/markdown/OR_userguide/OR_pdn_README.md ADDED
@@ -0,0 +1,493 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Power Distribution Network Generator
2
+
3
+ The power distribution network (PDN) generator module in OpenROAD (`pdn`)
4
+ is based on the PDNGEN tool.
5
+ This utility aims to simplify the process of adding a power grid into a
6
+ floorplan. The aim is to specify a small set of power grid policies to be
7
+ applied to the design, such as layers to use, stripe width and spacing,
8
+ then have the utility generate the actual metal straps. Grid policies can
9
+ be defined over the stdcell area, and over areas occupied by macros.
10
+
11
+ ```{seealso}
12
+ To work with UPF files, refer to [Read UPF Utility](../upf/README.md).
13
+ ```
14
+
15
+ ## Commands
16
+
17
+ ```{note}
18
+ - Parameters in square brackets `[-param param]` are optional.
19
+ - Parameters without square brackets `-param2 param2` are required.
20
+ ```
21
+
22
+ ### Build Power Grid
23
+
24
+ Build a power grid in accordance with the information specified.
25
+
26
+ ```tcl
27
+ pdngen
28
+ [-skip_trim]
29
+ [-dont_add_pins]
30
+ [-reset]
31
+ [-ripup]
32
+ [-report_only]
33
+ [-failed_via_report file]
34
+ ```
35
+
36
+ #### Options
37
+
38
+ | Switch Name | Description |
39
+ | ----- | ----- |
40
+ | `-skip_trim` | Skip the metal trim step, which attempts to remove metal stubs. |
41
+ | `-dont_add_pins` | Prevent the creation of block pins. |
42
+ | `-reset` | Reset the grid and domain specifications. |
43
+ | `-ripup` | Ripup the existing power grid, as specified by the voltage domains. |
44
+ | `-report_only` | Print the current specifications. |
45
+ | `-failed_via_report` | Generate a report file that can be viewed in the DRC viewer for all the failed vias (i.e., those that did not get built or were removed). |
46
+
47
+ ### Define Voltage Domains
48
+
49
+ Defines a named voltage domain with the names of the power and ground nets for a region.
50
+
51
+ This region must already exist in the floorplan before referencing it with the `set_voltage_domain` command. If the `-region` argument is not supplied, then the region is the entire core area of the design.
52
+
53
+ ```tcl
54
+ set_voltage_domain
55
+ -name domain_name
56
+ -power power_net_name
57
+ -ground ground_net_name
58
+ [-region region_name]
59
+ [-secondary_power secondary_power_net]
60
+ [-switched_power switched_power_net]
61
+ ```
62
+
63
+ #### Options
64
+
65
+ | Switch Name | Description |
66
+ | ----- | ----- |
67
+ | `-name` | Defines the name of the voltage domain. The default is "Core" or region name if provided. |
68
+ | `-power` | Specifies the name of the power net for this voltage domain. |
69
+ | `-ground` | Specifies the name of the ground net for this voltage domain. |
70
+ | `-region` | Specifies a region of the design occupied by this voltage domain. |
71
+ | `-secondary_power` | Specifies the name of the secondary power net for this voltage domain. |
72
+ | `-switched_power` | Specifies the name of the switched power net for switched power domains. |
73
+
74
+ Example usage:
75
+
76
+ ```tcl
77
+ set_voltage_domain -power VDD -ground VSS
78
+ set_voltage_domain -name TEMP_ANALOG -region TEMP_ANALOG -power VIN -ground VSS
79
+ set_voltage_domain -region test_domain -power VDD -ground VSS -secondary_power VREG
80
+ ```
81
+
82
+ ### Define Power Grid (General)
83
+
84
+ Define the rules to describe a power grid pattern to be placed in the design.
85
+
86
+ ```{warning}
87
+ `define_pdn_grid` is overloaded with two different signatures. Take note of the arguments when using this function!
88
+ ```
89
+
90
+ ```tcl
91
+ define_pdn_grid
92
+ [-name name]
93
+ [-voltage_domain list_of_domain_names]
94
+ [-pins list_of_pin_layers]
95
+ [-starts_with POWER|GROUND]
96
+ [-starts_with POWER|GROUND]
97
+ [-obstructions list_of_layers]
98
+ ```
99
+
100
+ #### Options
101
+
102
+ | Switch Name | Description |
103
+ | ----- | ----- |
104
+ | `-name` | The name to use when referring to this grid definition. |
105
+ | `-voltage_domain` | This grid's voltage domain name. Defaults to the last domain created. |
106
+ | `-pins` | List of layers where the power straps will be promoted to block pins. |
107
+ | `-starts_with` | Use `POWER` or `GROUND` for the first placed strap. Defaults to `GROUND`. |
108
+ | `-obstructions` | Layers to add routing blockages to avoid DRC violations. |
109
+
110
+ Example usage:
111
+
112
+ ```tcl
113
+ define_pdn_grid -name main_grid -pins {metal7} -voltage_domain {CORE TEMP_ANALOG}
114
+ ```
115
+
116
+ ### Define Power Grid (Macros)
117
+
118
+ ```tcl
119
+ define_pdn_grid
120
+ -macro
121
+ [-name name]
122
+ [-grid_over_pg_pins|-grid_over_boundary]
123
+ [-voltage_domain list_of_domain_names]
124
+ [-orient list_of_valid_orientations]
125
+ [-instances list_of_instances]
126
+ [-cells list_of_cells]
127
+ [-default]
128
+ [-halo list_of_halo_values]
129
+ [-pins list_of_pin_layers]
130
+ [-starts_with POWER|GROUND]
131
+ [-obstructions list_of_layers]
132
+ [-power_switch_cell name]
133
+ [-power_control signal_name]
134
+ [-power_control_network STAR|DAISY]
135
+ ```
136
+
137
+ #### Options
138
+
139
+ | Switch Name | Description |
140
+ | ----- | ----- |
141
+ | `-macro` | The type of grid added as a macro. |
142
+ | `-name` | The name to use when referring to this grid definition. |
143
+ | `-grid_over_pg_pins`, `-grid_over_boundary` | Place the power grid over the power ground pins of the macro (default) or place the power grid over the entire macro. |
144
+ | `-voltage_domain` | Grid's voltage domain name. Defaults to the last domain created. |
145
+ | `-orient` | For a macro, defines a set of valid orientations. LEF orientations (N, FN, S, FS, E, FE, W and FW) can be used as well as standard geometry orientations (R0, R90, R180, R270, MX, MY, MXR90 and MYR90). Macros with one of the valid orientations will use this grid specification. |
146
+ | `-instances` | For a macro, defines a set of valid instances. Macros with a matching instance name will use this grid specification. |
147
+ | `-cells` | For a macro, defines a set of valid cells. Macros, which are instances of one of these cells, will use this grid specification. |
148
+ | `-default` | For a macro, specifies this is a default grid that can be overwritten. |
149
+ | `-halo` | Specifies the design's default minimum separation of selected macros from other cells. This is only used if the macro does not define halo values in the LEF description. If one value is specified, it will be used on all four sides; if two values are specified, the first will be applied to left/right sides, and the second will be applied to top/bottom sides; if four values are specified, then they are applied to left, bottom, right and top sides respectively (Default: 0). |
150
+ | `-pins` | Defines a list of layers where the power straps will be promoted to block pins. |
151
+ | `-starts_with` | Use `POWER` or `GROUND` for the first placed strap. Defaults to `GROUND`.|
152
+ | `-obstructions` | Specify the layers to add routing blockages in order to avoid DRC violations. |
153
+ | `-power_switch_cell` | Defines the name of the coarse grain power switch cell to be used wherever the stdcell rail connects to the rest of the power grid. The mesh layers are associated with the unswitched power net of the voltage domain, whereas the stdcell rail is associated with the switched power net of the voltage domain. The placement of a power switch cell connects the unswitched power mesh to the switched power rail through a power switch defined by the `define_power_switch_cell` command. |
154
+ | `-power_control` | Defines the name of the power control signal used to control the switching of the inserted power switches. |
155
+ | `-power_control_network` | Defines the structure of the power control signal network. Choose from STAR or DAISY. If STAR is specified, then the network is wired as a high-fanout net with the power control signal driving the power control pin on every power switch. If DAISY is specified, then the power switches are connected in a daisy-chain configuration - note, this requires that the power switch defined by the `define_power_switch_cell` command defines an acknowledge pin for the switch. |
156
+
157
+ Example usage:
158
+
159
+ ```tcl
160
+ define_pdn_grid -macro -name ram -orient {R0 R180 MX MY} -grid_over_pg_pins -starts_with POWER -pin_direction vertical
161
+ define_pdn_grid -macro -name rotated_rams -orient {E FE W FW} -grid_over_boundary -starts_with POWER -pin_direction horizontal
162
+ ```
163
+
164
+ ### Define Power Grid for an Existing Routing Solution
165
+
166
+ ```tcl
167
+ define_pdn_grid
168
+ -existing
169
+ [-name name]
170
+ [-obstructions list_of_layers]
171
+ ```
172
+
173
+ #### Options
174
+
175
+ | Switch Name | Description |
176
+ | ----- | ----- |
177
+ | `-existing` | Enable use of existing routing solution. |
178
+ | `-name` | The name to use when referring to this grid definition. Defaults to `existing_grid`. |
179
+ | `-obstructions` | The layers to add routing blockages in order to avoid DRC violations. |
180
+
181
+ Example usage:
182
+
183
+ ```tcl
184
+ define_pdn_grid -name main_grid -existing
185
+ ```
186
+
187
+ ### Define Power Switch Cell
188
+
189
+ Define a power switch cell that will be inserted into a power grid.
190
+
191
+ ```tcl
192
+ define_power_switch_cell
193
+ -name name
194
+ -control control_pin
195
+ -power_switchable power_switchable_pin
196
+ -power unswitched_power_pin
197
+ -ground ground_pin
198
+ [-acknowledge acknowledge_pin_name]
199
+ ```
200
+
201
+ #### Options
202
+
203
+ | Switch Name | Description |
204
+ | ----- | ----- |
205
+ | `-name` | The name of the power switch cell. |
206
+ | `-control` | The name of the power control port of the power switch cell. |
207
+ | `-switched_power` | The pin's name that outputs the switched power net. |
208
+ | `-power` | The pin's name that connects to the unswitched power net. |
209
+ | `-ground` | The pin's name that connects to the ground net. |
210
+ | `-acknowledge` | The name of the output control signal of the power control switch if it has one. |
211
+
212
+ Example usage:
213
+
214
+ ```tcl
215
+ define_power_switch_cell -name POWER_SWITCH -control SLEEP -switched_power VDD -power VDDG -ground VSS
216
+ ```
217
+
218
+ ### Add Stripes
219
+
220
+ Defines a pattern of power and ground stripes in a single layer to be added to a power grid.
221
+
222
+ ```tcl
223
+ add_pdn_stripe
224
+ -layer layer_name
225
+ [-grid grid_name]
226
+ [-width width_value]
227
+ [-followpins]
228
+ [-extend_to_core_ring]
229
+ [-pitch pitch_value]
230
+ [-spacing spacing_value]
231
+ [-offset offset_value]
232
+ [-starts_with POWER|GROUND]
233
+ [-extend_to_boundary]
234
+ [-snap_to_grid]
235
+ [-number_of_straps count]
236
+ [-nets list_of_nets]
237
+ ```
238
+
239
+ #### Options
240
+
241
+ | Switch Name | Description |
242
+ | ----- | ----- |
243
+ | `-layer` | The layer name for these stripes. |
244
+ | `-grid` | The grid to which this stripe definition will be added. (Default: Last grid defined by `define_pdn_grid`). |
245
+ | `-width` | Value for the width of the stripe. |
246
+ | `-followpins` | Indicates that the stripe forms part of the stdcell rails, pitch and spacing are dictated by the stdcell rows, and the `-width` is not needed if it can be determined from the cells. |
247
+ | `-extend_to_core_ring` | Extend the stripes to the core PG ring. |
248
+ | `-pitch` | Value for the distance between each power/ground pair. |
249
+ | `-spacing` | Optional specification of the spacing between power/ground pairs within a single pitch defaults to `pitch / 2`. |
250
+ | `-offset` | Value for the offset of the stripe from the lower left corner of the design core area. |
251
+ | `-starts_with` | Use `POWER` or `GROUND` for the first placed strap. Defaults to `GROUND`. |
252
+ | `-extend_to_boundary` | Extend the stripes to the boundary of the grid. |
253
+ | `-snap_to_grid` | Snap the stripes to the defined routing grid. |
254
+ | `-number_of_straps` | Number of power/ground pairs to add. |
255
+ | `-nets` | Limit straps to just this list of nets. |
256
+
257
+ Example usage:
258
+
259
+ ```tcl
260
+ add_pdn_stripe -grid main_grid -layer metal1 -followpins
261
+ add_pdn_stripe -grid main_grid -layer metal2 -width 0.17 -followpins
262
+ add_pdn_stripe -grid main_grid -layer metal4 -width 0.48 -pitch 56.0 -offset 2 -starts_with GROUND
263
+ ```
264
+
265
+ ### Add Rings
266
+
267
+ The `add_pdn_ring` command defines power/ground rings around a grid region. The ring structure is built using two layers that are orthogonal to each other. A power/ground pair will be added above and below the grid using the horizontal layer, with another power/ground pair to the left and right using the vertical layer. These four pairs of power/ground stripes form a ring around the specified grid. Power straps on these layers that are inside the enclosed region are extended to connect to the ring.
268
+
269
+ ```tcl
270
+ add_pdn_ring
271
+ -layers layer_name
272
+ -widths width_value|list_of_2_values
273
+ -spacings spacing_value|list_of_2_values
274
+ [-grid grid_name]
275
+ [-core_offsets offset_value]
276
+ [-pad_offsets offset_value]
277
+ [-add_connect]
278
+ [-extend_to_boundary]
279
+ [-connect_to_pads]
280
+ [-connect_to_pad_layers layers]
281
+ [-starts_with POWER|GROUND]
282
+ [-nets list_of_nets]
283
+ ```
284
+
285
+ #### Options
286
+
287
+ | Switch Name | Description |
288
+ | ----- | ----- |
289
+ | `-layers` | Specifies the name of the layer for these stripes. |
290
+ | `-widths` | Value for the width of the stdcell rail. |
291
+ | `-spacings` | Optional specification of the spacing between power/ground pairs within a single pitch. (Default: pitch / 2). |
292
+ | `-grid` | Specifies the name of the grid to which this ring defintion will be added. (Default: Last grid created by `define_pdn_grid`). |
293
+ | `-core_offsets` | Value for the offset of the ring from the grid region. |
294
+ | `-pad_offsets` | When defining a power grid for the top level of an SoC, can be used to define the offset of ring from the pad cells. |
295
+ | `-add_connect` | Automatically add a connection between the two layers. |
296
+ | `-extend_to_boundary` | Extend the rings to the grid boundary. |
297
+ | `-connect_to_pads` | The core side of the pad pins will be connected to the ring. |
298
+ | `-connect_to_pad_layers` | Restrict the pad pins layers to this list. |
299
+ | `-starts_with` | Use `POWER` or `GROUND` for the first placed strap. Defaults to `GROUND`. |
300
+ | `-nets` | Limit straps to just this list of nets. |
301
+
302
+ Example usage:
303
+
304
+ ```tcl
305
+ add_pdn_ring -grid main_grid -layer {metal6 metal7} -widths 5.0 -spacings 3.0 -core_offset 5
306
+ ```
307
+
308
+ ### Add Connections
309
+
310
+ The `add_pdn_connect` command is used to define which layers in the power grid are to be connected together. During power grid generation, vias will be added for overlapping power nets and overlapping ground nets. The use of fixed vias from the technology file can be specified or else via stacks will be constructed using VIARULEs. If VIARULEs are not available in the technology, then fixed vias must be used.
311
+
312
+ ```tcl
313
+ add_pdn_connect
314
+ -layers list_of_two_layers
315
+ [-grid grid_name]
316
+ [-cut_pitch pitch_value]
317
+ [-fixed_vias list_of_fixed_vias]
318
+ [-dont_use_vias list_of_vias]
319
+ [-max_rows rows]
320
+ [-max_columns columns]
321
+ [-ongrid ongrid_layers]
322
+ [-split_cuts split_cuts_mapping]
323
+ ```
324
+
325
+ #### Options
326
+
327
+ | Switch Name | Description |
328
+ | ----- | ----- |
329
+ | `-layers` | Layers to be connected where there are overlapping power or overlapping ground nets. |
330
+ | `-grid` | Specifies the name of the grid definition to which this connection will be added (Default: Last grid created by `define_pdn_grid`). |
331
+ | `-cut_pitch` | When the two layers are parallel, e.g., overlapping stdcell rails, specify the distance between via cuts. |
332
+ | `-fixed_vias` | List of fixed vias to be used to form the via stack. |
333
+ | `-dont_use_vias` | List or pattern of vias to not use to form the via stack. |
334
+ | `-max_rows` | Maximum number of rows when adding arrays of vias. |
335
+ | `-max_columns` | Maximum number of columns when adding arrays of vias. |
336
+ | `-ongrid` | List of intermediate layers in a via stack to snap onto a routing grid. |
337
+ | `-split_cuts` | Specifies layers to use split cuts on with an associated pitch, for example `{metal3 0.380 metal5 0.500}`. |
338
+
339
+ Example usage:
340
+
341
+ ```tcl
342
+ add_pdn_connect -grid main_grid -layers {metal1 metal2} -cut_pitch 0.16
343
+ add_pdn_connect -grid main_grid -layers {metal2 metal4}
344
+ add_pdn_connect -grid main_grid -layers {metal4 metal7}
345
+
346
+ add_pdn_connect -grid ram -layers {metal4 metal5}
347
+ add_pdn_connect -grid ram -layers {metal5 metal6}
348
+ add_pdn_connect -grid ram -layers {metal6 metal7}
349
+
350
+ add_pdn_connect -grid rotated_rams -layers {metal4 metal6}
351
+ add_pdn_connect -grid rotated_rams -layers {metal6 metal7}
352
+ ```
353
+
354
+ ### Repairing Power Grid vias after Detailed Routing
355
+
356
+ To remove vias which generate DRC violations after detailed placement and routing use `repair_pdn_vias`.
357
+
358
+ ```tcl
359
+ repair_pdn_vias
360
+ [-all]
361
+ [-net net_name]
362
+ ```
363
+
364
+ #### Options
365
+
366
+ | Switch Name | Description |
367
+ | ----- | ----- |
368
+ | `-all` | Repair vias on all supply nets. |
369
+ | `-net` | Repair only vias on the specified net. |
370
+
371
+ ### Useful Developer Commands
372
+
373
+ If you are a developer, you might find these useful. More details can be found in the [source file](../src/PdnGen.cc) or the [swig file](PdnGen.i).
374
+
375
+ | Command Name | Description |
376
+ | ----- | ----- |
377
+ | `name_cmp` | Compare 2 input strings `obj1` and `obj2` if they are equal. |
378
+ | `check_design_state` | Check if the design is loaded. |
379
+ | `get_layer` | Get the layer reference of the layer name. |
380
+ | `get_voltage_domains` | Gets a Tcl list of power domains in design. |
381
+ | `match_orientation` | Checks if a given orientation `orient` is within a list of orientations `orients`. |
382
+ | `get_insts` | Get the Tcl list of instances. |
383
+ | `get_masters` | Get the Tcl list of masters. |
384
+ | `get_one_to_two` | If a Tcl list has one element `{x}`, Tcl list `{x x}` is returned. If a Tcl list of two elements `{y y}`, list as is returned. Otherwise, for any other list lengths, an error is triggered. |
385
+ | `get_one_to_four` | Similar logic for the above function, except the logic only works for lists of length one, two, and four, respectively. All other list lengths trigger errors. |
386
+ | `get_obstructions` | Get the Tcl list of layers. |
387
+ | `get_starts_with` | If value starts with `POWER`, return 1; else if value starts with `GROUND` return 0; else return error. |
388
+ | `get_mterm` | Find master terminal. |
389
+ | `get_orientations` | Get the list of valid orientations. |
390
+
391
+ ## Example scripts
392
+
393
+ ### Defining a SoC power grid with pads
394
+
395
+ ```
396
+ add_global_connection -net VDD -pin_pattern {^VDD$} -power
397
+ add_global_connection -net VDD -pin_pattern {^VDDPE$}
398
+ add_global_connection -net VDD -pin_pattern {^VDDCE$}
399
+ add_global_connection -net VSS -pin_pattern {^VSS$} -ground
400
+ add_global_connection -net VSS -pin_pattern {^VSSE$}
401
+
402
+ set_voltage_domain -power VDD -ground VSS
403
+
404
+ define_pdn_grid -name "Core"
405
+ add_pdn_ring -grid "Core" -layers {metal8 metal9} -widths 5.0 -spacings 2.0 -core_offsets 4.5 -connect_to_pads
406
+
407
+ add_pdn_stripe -followpins -layer metal1 -extend_to_core_ring
408
+
409
+ add_pdn_stripe -layer metal4 -width 0.48 -pitch 56.0 -offset 2.0 -extend_to_core_ring
410
+ add_pdn_stripe -layer metal7 -width 1.40 -pitch 40.0 -offset 2.0 -extend_to_core_ring
411
+ add_pdn_stripe -layer metal8 -width 1.40 -pitch 40.0 -offset 2.0 -extend_to_core_ring
412
+ add_pdn_stripe -layer metal9 -width 1.40 -pitch 40.0 -offset 2.0 -extend_to_core_ring
413
+
414
+ add_pdn_connect -layers {metal1 metal4}
415
+ add_pdn_connect -layers {metal4 metal7}
416
+ add_pdn_connect -layers {metal7 metal8}
417
+ add_pdn_connect -layers {metal8 metal9}
418
+ add_pdn_connect -layers {metal9 metal10}
419
+
420
+ pdngen
421
+ ```
422
+
423
+ ### Sroute
424
+
425
+ The `add_sroute_connect` command is employed for connecting pins located
426
+ outside of a specific power domain to the power ring, especially in cases where
427
+ multiple power domains are present. During `sroute`, multi-cut vias will be added
428
+ for new connections. The use of fixed vias from the technology file should be
429
+ specified for the connection using the `add_sroute_connect` command. The use
430
+ of max_rows and max_columns defines the row and column limit for the via stack.
431
+
432
+ ```
433
+ add_sroute_connect
434
+ -layers list_of_2_layers
435
+ -cut_pitch pitch_value
436
+ [-net net]
437
+ [-outerNet outerNet]
438
+ [-fixed_vias list_of_vias]
439
+ [-max_rows rows]
440
+ [-max_columns columns]
441
+ [-metalwidths metalwidths]
442
+ [-metalspaces metalspaces]
443
+ [-ongrid ongrid_layers]
444
+ [-insts inst]
445
+ ```
446
+
447
+ #### Options
448
+
449
+ | Switch Name | Description |
450
+ | ----- | ----- |
451
+ | `-net` | The inner net where the power ring exists. |
452
+ | `-outerNet` | The outer net where instances/pins that need to get connected exist. |
453
+ | `-layers` | The metal layers for vertical stripes within inner power ring. |
454
+ | `-cut_pitch` | Distance between via cuts when the two layers are parallel, e.g., overlapping stdcell rails. (Default:200 200) |
455
+ | `-fixed_vias` | List of fixed vias to be used to form the via stack. |
456
+ | `-max_rows` | Maximum number of rows when adding arrays of vias. (Default:10) |
457
+ | `-max_columns` | Maximum number of columns when adding arrays of vias. (Default:10) |
458
+ | `-metalwidths` | Width for each metal layer. |
459
+ | `-metalspaces` | Spacing of each metal layer. |
460
+ | `-ongrid` | List of intermediate layers in a via stack to snap onto a routing grid. |
461
+ | `-insts` | List of all the instances that contain the pin that needs to get connected with power ring. (Default:nothing) |
462
+
463
+ #### Examples
464
+
465
+ ```
466
+ add_sroute_connect -net "VIN" -outerNet "VDD" -layers {met1 met4} -cut_pitch {200 200} -fixed_vias {M3M4_PR_M} -metalwidths {1000 1000} -metalspaces {800} -ongrid {met3 met4} -insts "temp_analog_1.a_header_0"
467
+
468
+ ```
469
+ ## Regression tests
470
+
471
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
472
+
473
+ Simply run the following script:
474
+
475
+ ```shell
476
+ ./test/regression
477
+ ```
478
+
479
+ ## Limitations
480
+
481
+ Currently the following assumptions are made:
482
+
483
+ 1. The design is rectangular
484
+ 1. The input floorplan includes the stdcell rows, placement of all macro blocks and IO pins.
485
+ 1. The stdcells rows will be cut around macro placements
486
+
487
+ ## FAQs
488
+
489
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+pdn) about this tool.
490
+
491
+ ## License
492
+
493
+ BSD 3-Clause License. See [LICENSE](../../LICENSE) file.
data/markdown/OR_userguide/OR_ppl_README.md ADDED
@@ -0,0 +1,321 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Pin Placer
2
+
3
+ Place pins on the boundary of the die on the track grid to minimize net
4
+ wirelengths. Pin placement also creates a metal shape for each pin using
5
+ min-area rules.
6
+
7
+ For designs with unplaced cells, the net wirelength is computed considering
8
+ the center of the die area as the unplaced cells position.
9
+
10
+ ## Commands
11
+
12
+ ```{note}
13
+ - Parameters in square brackets `[-param param]` are optional.
14
+ - Parameters without square brackets `-param2 param2` are required.
15
+ ```
16
+
17
+ ### Define Pin Shape Pattern
18
+
19
+ The `define_pin_shape_pattern` command defines a pin placement grid on the
20
+ specified layer. This grid has positions inside the die area, not only at
21
+ the edges of the die boundary.
22
+
23
+ ```tcl
24
+ define_pin_shape_pattern
25
+ [-layer layer]
26
+ [-x_step x_step]
27
+ [-y_step y_step]
28
+ [-region {llx lly urx ury} | *]
29
+ [-size {width height}]
30
+ [-pin_keepout dist]
31
+ ```
32
+
33
+ #### Options
34
+
35
+ | Switch Name | Description |
36
+ | ----- | ----- |
37
+ | `-layer` | The single top-most routing layer of the placement grid. |
38
+ | `-x_step`, `-y_step` | The distance (in microns) between each valid position on the grid in the x- and y-directions, respectively. |
39
+ | `-region` | The `{llx, lly, urx, ury}` region of the placement grid (in microns). If the `*` is specified, the region will be the entire die area. |
40
+ | `-size` | The width and height (in microns) of the pins assigned to this grid. The centers of the pins are placed on the grid positions. Pins may have half of their shapes outside the defined region. |
41
+ | `-pin_keepout` | The boundary (in microns) around existing routing obstructions that the pins should avoid; this defaults to the `layer` minimum spacing. |
42
+
43
+ #### Face-to-Face direct-bonding IOs
44
+
45
+ The `define_pin_shape_pattern` command can be used to place pins in any metal
46
+ layer with the minimum allowed spacing to facilitate 3DIC integration of
47
+ chips using face-to-face packaging technologies. These technologies include
48
+ [micro bumps](https://semiengineering.com/bumps-vs-hybrid-bonding-for-advanced-packaging/)
49
+ and
50
+ [hybrid bonding](https://www.3dincites.com/2018/04/hybrid-bonding-from-concept-to-commercialization/)
51
+ for high density face-to-face interconnect.
52
+
53
+ ### Set IO Pin Constraint
54
+
55
+ The `set_io_pin_constraint` command sets region constraints for pins according
56
+ to the pin direction or the pin name. This command can be called multiple
57
+ times with different constraints.
58
+
59
+ You can use the `set_io_pin_constraint` command to restrict pins to the
60
+ pin placement grid created with the `define_pin_shape_pattern` command.
61
+
62
+ It is possible to use the `-region`, `-group` and `-order` arguments together
63
+ per `set_io_pin_constraint` call, but the `-mirrored_pins` argument should be
64
+ called alone.
65
+
66
+ ```tcl
67
+ set_io_pin_constraint
68
+ [-direction direction]
69
+ [-pin_names names]
70
+ [-region edge:interval]
71
+ [-mirrored_pins names]
72
+ [-group]
73
+ [-order]
74
+ ```
75
+
76
+ #### Options
77
+
78
+ | Switch Name | Description |
79
+ | ----- | ----- |
80
+ | `-direction` | Pin direction (`input`, `output`, `inout`, or `feedthrough`). |
81
+ | `-pin_names` | List of names. Only one of (`-direction`, `-pin_names`) should be used in a single call for the `set_io_pin_constraint` command. |
82
+ | `-region` | Syntax is `-region edge:interval`. The `edge` values are (`top\|bottom\|left\|right`). The `interval` can be the whole edge with the wildcard `*` value or a range of values. |
83
+ | `-mirrored_pins` | List of pins that sets pairs of pins that will be symmetrically placed in the vertical or the horizontal edges. The number of pins in this list **must be even**. For example, in `set_io_pin_constraint -mirrored_pins {pin1 pin2 pin3 pin4 pin5 pin6}`, the pins `pin1` and `pin2` will be placed symmetrically to each other. Same for `pin3` and `pin4`, and for `pin5` and `pin6`. |
84
+ | `-group` | Flag places together on the die boundary the pin list defined in `-pin_names,` similar to the `-group_pins` option on the `place_pins` command. |
85
+ | `-order` | Flag places the pins ordered in ascending x/y position and must be used only when `-group` is also used. |
86
+
87
+ The `edge` values are (up, top, bottom, left, right), where `up` is
88
+ the grid created by `define_pin_shape_pattern`. To restrict pins to the
89
+ pin placement grid defined with `define_pin_shape_pattern` use:
90
+
91
+ - `-region up:{llx lly urx ury}` to restrict the pins into a specific
92
+ region in the grid. The region is defined in microns.
93
+ - `-region up:*` to restrict the pins into the entire region of the grid.
94
+
95
+ The `up` option is only available when the pin placement grid is created with
96
+ the `define_pin_shape_pattern` command.
97
+
98
+ ### Clear IO Pin Constraints
99
+
100
+ The `clear_io_pin_constraints` command clears all the previously-defined
101
+ constraints and pin shape patterns created with `set_io_pin_constraint` or
102
+ `define_pin_shape_pattern`.
103
+
104
+ ```tcl
105
+ clear_io_pin_constraints
106
+ ```
107
+
108
+ ### Set Pin Length
109
+
110
+ The `set_pin_length` command defines the length of all vertical and horizontal
111
+ pins.
112
+
113
+ ```tcl
114
+ set_pin_length
115
+ [-hor_length h_length]
116
+ [-ver_length v_length]
117
+ ```
118
+
119
+ #### Options
120
+
121
+ | Switch Name | Description |
122
+ | ----- | ----- |
123
+ | `-hor_length` | The length (in microns) of the horizontal pins. |
124
+ | `-ver_length` | The length (in microns) of the vertical pins. |
125
+
126
+ ### Set Pin Extension
127
+
128
+ The `set_pin_length_extension` command defines the an extension of the length
129
+ of all vertical and horizontal pins. Note that this command may generate pins
130
+ partially outside the die area.
131
+
132
+ ```tcl
133
+ set_pin_length_extension
134
+ [-hor_extension h_extension]
135
+ [-ver_extension v_extension]
136
+ ```
137
+
138
+ #### Options
139
+
140
+ | Switch Name | Description |
141
+ | ----- | ----- |
142
+ | `-hor_extension` | The length (in microns) for the horizontal pins. |
143
+ | `-ver_extension` | The length (in microns) for the vertical pins. |
144
+
145
+ ### Set Pin Thick Multiplier
146
+
147
+ The `set_pin_thick_multiplier` command defines a multiplier for the thickness of all
148
+ vertical and horizontal pins.
149
+
150
+ ```tcl
151
+ set_pin_thick_multiplier
152
+ [-hor_multiplier h_mult]
153
+ [-ver_multiplier v_mult]
154
+ ```
155
+
156
+ #### Options
157
+
158
+ | Switch Name | Description |
159
+ | ----- | ----- |
160
+ | `-hor_multiplier` | The thickness multiplier for the horizontal pins. |
161
+ | `-ver_multiplier` | The thickness multiplier for the vertical pins. |
162
+
163
+ ### Set Simulated Annealing Parameters
164
+
165
+ The `set_simulated_annealing` command defines the parameters for simulated annealing pin placement.
166
+
167
+ ```tcl
168
+ set_simulated_annealing
169
+ [-temperature temperature]
170
+ [-max_iterations iter]
171
+ [-perturb_per_iter perturbs]
172
+ [-alpha alpha]
173
+ ```
174
+
175
+ #### Options
176
+
177
+ | Switch Name | Description |
178
+ | ----- | ----- |
179
+ | `-temperature` | Temperature parameter. The default value is `1.0`, and the allowed values are floats `[0, MAX_FLOAT]`. |
180
+ | `-max_iterations` | The maximum number of iterations. The default value is `2000`, and the allowed values are integers `[0, MAX_INT]`. |
181
+ | `-perturb_per_iter` | The number of perturbations per iteration. The default value is `0`, and the allowed values are integers `[0, MAX_INT]`. |
182
+ | `-alpha` | The temperature decay factor. The default value is `0.985`, and the allowed values are floats `(0, 1]`. |
183
+
184
+ ### Place Individual Pin
185
+
186
+ The `place_pin` command places a specific pin in the specified location with the specified size.
187
+ It is recommended that individual pins be placed before the `place_pins` command,
188
+ as the routing tracks occupied by these individual pins will be blocked, preventing overlaps.
189
+
190
+ To place an individual pin:
191
+
192
+ ```tcl
193
+ place_pin
194
+ -pin_name pin_name
195
+ -layer layer
196
+ -location {x y}
197
+ [-pin_size {width height}]
198
+ [-force_to_die_boundary]
199
+ ```
200
+
201
+ #### Options
202
+
203
+ | Switch Name | Description |
204
+ | ----- | ----- |
205
+ | `-pin_name` | The name of a pin of the design. |
206
+ | `-layer` | The routing layer where the pin is placed. |
207
+ | `-location` | The center of the pin (in microns). |
208
+ | `-pin_size` | The width and height of the pin (in microns). |
209
+ | `-force_to_die_boundary` | When this flag is enabled, the pin will be snapped to the nearest routing track, next to the die boundary. |
210
+
211
+ ### Place All Pins
212
+
213
+ Use the following command to perform pin placement:
214
+
215
+ ```tcl
216
+ place_pins
217
+ -hor_layers h_layers
218
+ -ver_layers v_layers
219
+ [-random_seed seed]
220
+ [-random]
221
+ [-corner_avoidance length]
222
+ [-min_distance distance]
223
+ [-min_distance_in_tracks]
224
+ [-exclude region]
225
+ [-group_pins pin_list]
226
+ [-annealing]
227
+ [-write_pin_placement file_name]
228
+ ```
229
+
230
+ #### Options
231
+
232
+ | Switch Name | Description |
233
+ | ----- | ----- |
234
+ | `-hor_layers` | The layers to create the metal shapes of pins placed in horizontal tracks. It can be a single layer or a list of layer names. |
235
+ | `-ver_layers` | The layers to create the metal shapes of pins placed in vertical tracks. It can be a single layer or a list of layer names. |
236
+ | `-corner_avoidance` | The distance (in microns) from each corner within which pin placement should be avoided. |
237
+ | `-min_distance` | The minimum distance between pins on the die boundary. This distance can be in microns (default) or in number of tracks between each pin. |
238
+ | `-min_distance_in_tracks` | Flag that allows setting the min distance in number of tracks instead of microns. |
239
+ | `-exclude` | A region where pins cannot be placed. Either `top|bottom|left|right:edge_interval`, which is the edge interval from the selected edge; `begin:end` for begin-end of all edges. |
240
+ | `-group_pins` | A list of pins to be placed together on the die boundary. |
241
+ | `-annealing` | Flag to enable simulated annealing pin placement. |
242
+ | `-write_pin_placement` | A file with the pin placement generated in the format of multiple calls for the `place_pin` command. |
243
+
244
+ The `exclude` option syntax is `-exclude edge:interval`. The `edge` values are
245
+ (top|bottom|left|right). The `interval` can be the whole edge, with the `*`
246
+ value, or a range of values. For example, in `place_pins -hor_layers metal2
247
+ -ver_layers metal3 -exclude top:* -exclude right:15-60.5 -exclude left:*-50`
248
+ three intervals are excluded: the whole top edge, the right edge from 15
249
+ microns to 60.5 microns, and the left edge from its beginning to 50 microns.
250
+
251
+ #### Developer Arguments
252
+
253
+ | Switch Name | Description |
254
+ | ----- | ----- |
255
+ | `-random_seed` | Specify the seed for random operations. |
256
+ | `-random` | When this flag is enabled, the pin placement is random. |
257
+
258
+ ### Write Pin Placement
259
+
260
+ Use the following command to write a file with the pin placement in the format of multiple calls for the `place_pin` command:
261
+
262
+ ```tcl
263
+ write_pin_placement file_name
264
+ ```
265
+
266
+ #### Options
267
+
268
+ | Switch Name | Description |
269
+ | ----- | ----- |
270
+ | `file_name` | The name of the file with the pin placement. |
271
+
272
+ ### Useful Developer Commands
273
+
274
+ If you are a developer, you might find these useful. More details can be found in the [source file](./src/IOPlacer.cpp) or the [swig file](./src/IOPlacer.i).
275
+
276
+ | Command Name | Description |
277
+ | ----- | ----- |
278
+ | `parse_edge` | Parse edge (top/bottom/left/right). |
279
+ | `parse_direction` | Parse direction. |
280
+ | `parse_excludes_arg` | Parse excluded arguments. |
281
+ | `parse_group_pins_arg` | Parse group pins arguments. |
282
+ | `parse_layer_name` | Parse layer name. |
283
+ | `parse_pin_names` | Parse pin names. |
284
+ | `get_edge_extreme` | Get extremes of edge. |
285
+ | `exclude_intervals` | Set exclude interval. |
286
+ | `add_pins_to_constraint` | Add pins to constrained region. |
287
+ | `add_pins_to_top_layer` | Add pins to top layer. |
288
+
289
+
290
+ ## Example scripts
291
+
292
+ Example scripts of `ppl` running on a sample design of `gcd` as follows:
293
+
294
+ ```tcl
295
+ ./test/gcd.tcl
296
+ ```
297
+
298
+ ## Regression tests
299
+
300
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
301
+
302
+ Simply run the following script:
303
+
304
+ ```shell
305
+ ./test/regression
306
+ ```
307
+
308
+ ## Limitations
309
+
310
+ ## References
311
+
312
+ - This code depends on [Munkres](src/munkres/README.txt).
313
+
314
+ ## FAQs
315
+
316
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+ioplacer+in%3Atitle)
317
+ about this tool.
318
+
319
+ ## License
320
+
321
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.
data/markdown/OR_userguide/OR_psm_README.md ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # IR Drop Analysis
2
+
3
+ The IR Drop Analysis module in OpenROAD (`psm`) is based on PDNSim,
4
+ an open-source static IR analyzer.
5
+
6
+ Features:
7
+
8
+ - Report worst IR drop.
9
+ - Report worst current density over all nodes and wire segments in the
10
+ power distribution network, given a placed and PDN-synthesized design.
11
+ - Check for floating PDN stripes on the power and ground nets.
12
+ - Spice netlist writer for power distribution network wire segments.
13
+
14
+ | | |
15
+ | - | - |
16
+ | ![Image 1](doc/current_map.jpg) | ![Image 2](doc/IR_map.jpg) |
17
+ <p style="text-align: center;">(Left): Current Map, (Right): IR drop map</p>
18
+
19
+ ## Commands
20
+
21
+ ```{note}
22
+ - Parameters in square brackets `[-param param]` are optional.
23
+ - Parameters without square brackets `-param2 param2` are required.
24
+ ```
25
+
26
+ ### Analyze Power Grid
27
+
28
+ ```tcl
29
+ analyze_power_grid
30
+ [-vsrc vsrc_file]
31
+ [-outfile out_file]
32
+ [-error_file err_file]
33
+ [-enable_em]
34
+ [-em_outfile em_out_file]
35
+ [-net net_name]
36
+ [-dx bump_pitch_x]
37
+ [-dy bump_pitch_y]
38
+ [-node_density val_node_density]
39
+ [-node_density_factor val_node_density_factor]
40
+ [-corner corner]
41
+ ```
42
+
43
+ #### Options
44
+
45
+ | Switch Name | Description |
46
+ | ----- | ----- |
47
+ | `-vsrc` | File to set the location of the power C4 bumps/IO pins. [Vsrc_aes.loc file](test/Vsrc_aes_vdd.loc) for an example with a description specified [here](doc/Vsrc_description.md). |
48
+ | `-dx`,`-dy` | These arguments set the bump pitch to decide the voltage source location in the absence of a vsrc file. Default bump pitch of 140um used in absence of these arguments and vsrc. |
49
+ | `-net` | Name of the net to analyze, power or ground net name. |
50
+ | `-enable_em` | Report current per power grid segment. |
51
+ | `-outfile` | Write per-instance voltage into the file. |
52
+ | `-em_outfile` | Write the per-segment current values into a file. This option is only available if used in combination with `-enable_em`. |
53
+ | `-voltage` | Sets the voltage on a specific net. If this option is not set, the Liberty file's voltage value is obtained from operating conditions. |
54
+ | `-node_density` | Node density (in microns) on the standard cell rails. It cannot be used together with `-node_density_factor`. |
55
+ | `-node_density_factor` | Factor which is multiplied by standard cell height to determine the node density on the std cell rails. It cannot be used together with `-node_density`. The default value is `5`, and the allowed values are integers `[0, MAX_INT]`. |
56
+ | `-corner` | Corner to use for analysis. |
57
+
58
+ ### Check Power Grid
59
+
60
+ ```tcl
61
+ check_power_grid -net net_name
62
+ ```
63
+
64
+ #### Options
65
+
66
+ | Switch Name | Description |
67
+ | ----- | ----- |
68
+ | `-net` | Name of the net to analyze. Must be a power or ground net name. |
69
+
70
+ ### Write Spice Power Grid
71
+
72
+ ```tcl
73
+ write_pg_spice
74
+ [-vsrc vsrc_file]
75
+ [-outfile out_file]
76
+ [-net net_name]
77
+ [-dx bump_pitch_x]
78
+ [-dy bump_pitch_y]
79
+ [-corner corner]
80
+ ```
81
+
82
+ #### Options
83
+
84
+ | Switch Name | Description |
85
+ | ----- | ----- |
86
+ | `-vsrc` | File to set the location of the power C4 bumps/IO pins. See [Vsrc_aes.loc file](test/Vsrc_aes_vdd.loc) for an example and its [description](doc/Vsrc_description.md). |
87
+ | `-dx`,`-dy` | Set the bump pitch to decide the voltage source location in the absence of a `vsrc` file. The default bump pitch is 140um if neither these arguments nor a `vsrc` file are given. |
88
+ | `-net` | Name of the net to analyze. Must be a power or ground net name. |
89
+ | `-outfile` | Write per-instance voltage written into the file. |
90
+ | `-corner` | Corner to use for analysis. |
91
+
92
+ ### Set PDNSim Net voltage
93
+
94
+ ```tcl
95
+ set_pdnsim_net_voltage
96
+ [-net net_name]
97
+ [-voltage volt]
98
+ ```
99
+
100
+ #### Options
101
+
102
+ | Switch Name | Description |
103
+ | ----- | ----- |
104
+ | `-net` | Name of the net to analyze. It must be a power or ground net name. |
105
+ | `-voltage` | Sets the voltage on a specific net. If this option is not given, the Liberty file's voltage value is obtained from operating conditions. |
106
+
107
+ ### Useful Developer Commands
108
+
109
+ If you are a developer, you might find these useful. More details can be found in the [source file](./src/pdnsim.cpp) or the [swig file](./src/pdnsim.i).
110
+
111
+ | Command Name | Description |
112
+ | ----- | ----- |
113
+ | `find_net` | Get a reference to net name. |
114
+
115
+ ## Example scripts
116
+
117
+ Example scripts demonstrating how to run PDNSim on a sample design on `aes` as follows:
118
+
119
+ ```tcl
120
+ ./test/aes_test_vdd.tcl
121
+ ./test/aes_test_vss.tcl
122
+ ```
123
+
124
+ ## Regression tests
125
+
126
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
127
+
128
+ Simply run the following script:
129
+
130
+ ```shell
131
+ ./test/regression
132
+ ```
133
+
134
+ ## Limitations
135
+
136
+ ## FAQs
137
+
138
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+psm+in%3Atitle)
139
+ about this tool.
140
+
141
+ ## References
142
+
143
+ 1. PDNSIM [documentation](doc/PDNSim-documentation.pdf)
144
+ 1. Chhabria, V.A. and Sapatnekar, S.S. (no date) The-openroad-project/pdnsim: Power Grid Analysis, GitHub. Available at: https://github.com/The-OpenROAD-Project/PDNSim (Accessed: 24 July 2023). [(link)](https://github.com/The-OpenROAD-Project/PDNSim)
145
+
146
+ ## License
147
+
148
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.
data/markdown/OR_userguide/OR_psm_doc_VOR_description.md ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Voltage source location file description
2
+
3
+ This file specifies the description of the C4 bump configurations file.
4
+ The file is a csv as described below:
5
+
6
+ ```
7
+ <x_coordinate>, <y_coordinate>, <octagonal_c4_bump_edge_length>, <voltage_value>
8
+ ```
9
+
10
+ The x and y coordinate specify the center location of the voltage C4 bumps in
11
+ micro meter.
12
+
13
+ The octagonal c4_edge_length specifies the edge length of the C4 to determine
14
+ the pitch of the RDL layer in micron
15
+
16
+ Voltage_value specifies the value of voltage source at the C4 bump. In case
17
+ there is a need to specify voltage drop in micron
18
+
19
+ ## Example file
20
+
21
+ ```
22
+ 250,250,20,1.1
23
+ 130,170,20,1.1
24
+ 370,410,10,1.1
25
+ 410,450,10,1.1
26
+ ```
data/markdown/OR_userguide/OR_rcx_README.md ADDED
@@ -0,0 +1,297 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Parasitics Extraction
2
+
3
+ The parasitics extraction module in OpenROAD (`rcx`) is based on the
4
+ open-source OpenRCX, a Parasitic Extraction (PEX, or RCX) tool that
5
+ works on OpenDB design APIs.
6
+ It extracts routed designs based on the LEF/DEF layout model.
7
+
8
+ OpenRCX extracts both Resistance and Capacitance for wires, based on coupling
9
+ distance to the nearest wire and the track density context over and/or under the
10
+ wire of interest, as well as cell
11
+ abstracts. The capacitance and resistance measurements are based on equations
12
+ of coupling distance interpolated on exact measurements from a calibration
13
+ file, called the Extraction Rules file. The Extraction Rules file (RC technology
14
+ file) is generated once for every process node and corner, using
15
+ a provided utility for DEF wire pattern generation and regression modeling.
16
+
17
+ OpenRCX stores resistance, coupling capacitance and ground (i.e., grounded) capacitance
18
+ on OpenDB objects with direct pointers to the associated wire and via db
19
+ objects. Optionally, OpenRCX can generate a `.spef` file.
20
+
21
+ ## Commands
22
+
23
+ ```{note}
24
+ - Parameters in square brackets `[-param param]` are optional.
25
+ - Parameters without square brackets `-param2 param2` are required.
26
+ ```
27
+
28
+ ### Define Process Corner
29
+
30
+ ```tcl
31
+ define_process_corner
32
+ [-ext_model_index index]
33
+ filename
34
+ ```
35
+
36
+ #### Options
37
+
38
+ | Switch Name | Description |
39
+ | ----- | ----- |
40
+ | `-ext_model_index` | Extraction model index. Expects 2 inputs (an index, and corner name). |
41
+ | `filename` | Path to process corner file `rcx_patterns.rules`. |
42
+
43
+ ### Extract Parasitics
44
+
45
+ The `extract_parasitics` command performs parasitic extraction based on the
46
+ routed design. If there are no information on routed design, no parasitics are
47
+ returned.
48
+
49
+ ```tcl
50
+ extract_parasitics
51
+ [-ext_model_file filename]
52
+ [-corner_cnt count]
53
+ [-max_res ohms]
54
+ [-coupling_threshold fF]
55
+ [-debug_net_id id]
56
+ [-lef_res]
57
+ [-cc_model track]
58
+ [-context_depth depth]
59
+ [-no_merge_via_res]
60
+ ```
61
+
62
+ #### Options
63
+
64
+ | Switch Name | Description |
65
+ | ----- | ----- |
66
+ | `-ext_model_file` | Specify the Extraction Rules file used for the extraction. |
67
+ | `-corner_cnt` | Defines the number of corners used during the parasitic extraction. |
68
+ | `-max_res` | Combines resistors in series up to the threshold value. |
69
+ | `-coupling_threshold` | Coupling below this threshold is grounded. The default value is `0.1`, units are in `fF`, accepted values are floats. |
70
+ | `-debug_net_id` | *Developer Option*: Net ID to evaluate. |
71
+ | `-lef_res` | Override LEF resistance per unit. |
72
+ | `-cc_model` | Specify the maximum number of tracks of lateral context that the tool considers on the same routing level. The default value is `10`, and the allowed values are integers `[0, MAX_INT]`. |
73
+ | `-context_depth` | Specify the number of levels of vertical context that OpenRCX needs to consider for the over/under context overlap for capacitance calculation. The default value is `5`, and the allowed values are integers `[0, MAX_INT]`. |
74
+ | `-no_merge_via_res` | Separates the via resistance from the wire resistance. |
75
+
76
+ ### Write SPEF
77
+
78
+ The `write_spef` command writes the `.spef` output of the parasitics stored
79
+ in the database.
80
+
81
+ ```tcl
82
+ write_spef
83
+ [-net_id net_id]
84
+ [-nets nets]
85
+ filename
86
+ ```
87
+
88
+ #### Options
89
+
90
+ | Switch Name | Description |
91
+ | ----- | ----- |
92
+ | `-net_id` | Output the parasitics info for specific net IDs. |
93
+ | `-nets` | Net name. |
94
+ | `filename` | Output filename. |
95
+
96
+ ### Scale RC
97
+
98
+ Use the `adjust_rc` command to scale the resistance, ground, and coupling
99
+ capacitance.
100
+
101
+ ```tcl
102
+ adjust_rc
103
+ [-res_factor res]
104
+ [-cc_factor cc]
105
+ [-gndc_factor gndc]
106
+ ```
107
+
108
+ #### Options
109
+
110
+ | Switch Name | Description |
111
+ | ----- | ----- |
112
+ | `-res_factor` | Scale factor for resistance. |
113
+ | `-cc_factor` | Scale factor for coupling capacitance. |
114
+ | `-gndc_factor` | Scale factor for ground capacitance. |
115
+
116
+ ### Comparing SPEF files
117
+
118
+ The `diff_spef` command compares the parasitics in the reference database `<filename>.spef`.
119
+ The output of this command is `diff_spef.out`
120
+ and contains the RC numbers from the parasitics in the database and the
121
+ `<filename>.spef`, and the percentage RC difference of the two data.
122
+
123
+ ```tcl
124
+ diff_spef
125
+ [-file filename]
126
+ [-r_res]
127
+ [-r_cap]
128
+ [-r_cc_cap]
129
+ [-r_conn]
130
+ ```
131
+
132
+ #### Options
133
+
134
+ | Switch Name | Description |
135
+ | ----- | ----- |
136
+ | `-file` | Path to the input `.spef` filename. |
137
+ | `-r_res` | Read resistance. |
138
+ | `-r_cap` | Read capacitance. |
139
+ | `-r_cc_cap` | Read coupled capacitance. |
140
+ | `r_conn` | Read connections. |
141
+
142
+ ### Extraction Rules File Generation
143
+
144
+ The `bench_wires` command produces a layout which contains various patterns
145
+ that are used to characterize per-unit length R and C values. The generated patterns model
146
+ the lateral, vertical, and diagonal coupling capacitances, as well as ground
147
+ capacitance effects. This command generates a .def file that contains a number of wire patterns.
148
+
149
+ This command is specifically intended for the Extraction Rules file generation only.
150
+
151
+ ```tcl
152
+ bench_wires
153
+ [-met_cnt mcnt]
154
+ [-cnt count]
155
+ [-len wire_len]
156
+ [-over]
157
+ [-diag]
158
+ [-all]
159
+ [-db_only]
160
+ [-under_met layer]
161
+ [-w_list width]
162
+ [-s_list space]
163
+ [-over_dist dist]
164
+ [-under_dist dist]
165
+ ```
166
+
167
+ #### Options
168
+
169
+ | Switch Name | Description |
170
+ | ----- | ----- |
171
+ | `-met_cnt` | Number of layers used in each pattern. The default value is `-1`, meaning it is not set, and the allowed values are integers `[0, MAX_INT]`. |
172
+ | `-cnt` | Number of wires in each pattern. The default value is `5`, and the default values are integers `[0, MAX_INT]`. |
173
+ | `-len` | Wirelength in microns in the pattern. The default value is `100`, and the allowed values are integers `[0, MAX_INT]`. |
174
+ | `-all` | Consider all different pattern geometries (`over`, `under`, `over_under`, and `diagonal`). |
175
+ | `-db_only` | Run with db values only. All parameters in `bench_wires` are ignored. |
176
+ | `-under_met` | Consider under metal layer. |
177
+ | `-w_list` | Lists of wire width multipliers from the minimum spacing defined in the LEF. |
178
+ | `-s_list` | Lists of wire spacing multipliers from the minimum spacing defined in the LEF. The list will be the input index on the OpenRCX RC table (Extraction Rules file). |
179
+ | `-over_dist`, `-under_dist` | Consider over and under metal distance respectively. |
180
+
181
+ ### Generate verilog netlist
182
+
183
+ `bench_verilog` is used after the `bench_wires` command. This command
184
+ generates a Verilog netlist of the generated pattern layout by the `bench_wires`
185
+ command.
186
+
187
+ This command is optional when running the Extraction Rules generation
188
+ flow. This step is required if the favorite extraction tool (i.e., reference
189
+ extractor) requires a Verilog netlist to extract parasitics of the pattern layout.
190
+
191
+
192
+ ```tcl
193
+ bench_verilog
194
+ [filename]
195
+ ```
196
+
197
+ #### Options
198
+
199
+ | Switch Name | Description |
200
+ | ----- | ----- |
201
+ | `filename` | Name for the Verilog output file (e.g., `output.v`). |
202
+
203
+ ### Read SPEF
204
+
205
+ The `bench_read_spef` command reads a `<filename>.spef` file and stores the
206
+ parasitics into the database.
207
+
208
+ ```tcl
209
+ bench_read_spef
210
+ [filename]
211
+ ```
212
+
213
+ #### Options
214
+
215
+ | Switch Name | Description |
216
+ | ----- | ----- |
217
+ | `filename` | Path to the input `.spef` file. |
218
+
219
+ ### Write Rule File
220
+
221
+ The `write_rules` command writes the Extraction Rules file (RC technology file)
222
+ for OpenRCX. It processes the parasitics data from the layout patterns that are
223
+ generated using the `bench_wires` command, and writes the Extraction Rules file
224
+ with `<filename>` as the output file.
225
+
226
+ This command is specifically intended for the purpose of Extraction Rules file
227
+ generation.
228
+
229
+ ```tcl
230
+ write_rules
231
+ [-file filename]
232
+ [-dir dir]
233
+ [-name name]
234
+ [-pattern pattern]
235
+ ```
236
+
237
+ #### Options
238
+
239
+ | Switch Name | Description |
240
+ | ----- | ----- |
241
+ | `-file` | Output file name. |
242
+ | `-dir` | Output file directory. |
243
+ | `-name` | Name of rule. |
244
+ | `-pattern` | Flag to write the pattern to rulefile (0/1). |
245
+
246
+ ## Example scripts
247
+
248
+ Example scripts demonstrating how to run OpenRCX in the OpenROAD environment
249
+ on sample designs can be found in /test. An example flow test taking a sample design
250
+ from synthesizable RTL Verilog to final-routed layout in an open-source SKY130 technology
251
+ is shown below.
252
+
253
+ ```
254
+ ./test/gcd.tcl
255
+ ```
256
+
257
+ Example scripts demonstrating how to run the
258
+ Extraction Rules file generation can be found in this
259
+ [directory](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/rcx/calibration/script).
260
+
261
+ ```
262
+ ./calibration/script/generate_patterns.tcl # generate patterns
263
+ ./calibration/script/generate_rules.tcl # generate the Extraction Rules file
264
+ ./calibration/script/ext_patterns.tcl # check the accuracy of OpenRCX
265
+ ```
266
+
267
+ ## Regression tests
268
+
269
+ There are a set of regression tests in `/test`. For more information, refer to this [section](../../README.md#regression-tests).
270
+
271
+ Simply run the following script:
272
+
273
+ ```shell
274
+ ./test/regression
275
+ ```
276
+
277
+ ## Extraction Rules File Generation
278
+
279
+ This flow generates an Extraction Rules file (RC tech file, or RC table) for
280
+ OpenRCX. This file provides resistance and capacitance tables used for RC
281
+ extraction for a specific process corner.
282
+
283
+ The Extraction Rules file (RC technology file) is generated once for every
284
+ process node and corner automatically.
285
+
286
+ The detailed documentation can be found [here](doc/calibration.md).
287
+
288
+ ## Limitations
289
+
290
+ ## FAQs
291
+
292
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+rcx)
293
+ about this tool.
294
+
295
+ ## License
296
+
297
+ BSD 3-Clause License. See [LICENSE](../../LICENSE) file.
data/markdown/OR_userguide/OR_rcx_doc_calibration.md ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Extraction Rules Generation Flow for OpenRCX
2
+
3
+ This flow generates the RC tech file for OpenRCX. The RC tech file provides
4
+ resistance and capacitance tables used for RC extraction for a specific process
5
+ corner.
6
+
7
+ # The flow involves:
8
+
9
+ A. Running OpenRCX `generate_patterns.tcl` to generate layout patterns.
10
+
11
+ - Input: tech LEF
12
+ - Output: `patterns.def`, `patterns.v`
13
+ - Script: `generate_patterns.tcl`
14
+ - Desc: OpenRCX generates many pattern geometries to model various types
15
+ of capacitance and resistance (i.e., multi-conductor) geometric configurations.
16
+
17
+ B. Running your favorite extraction tool (i.e., reference extractor) to extract
18
+ parasitics of the layout patterns.
19
+
20
+ - Input: `patterns.def`, `patterns.v` (if required), and additional files
21
+ required by the reference extractor.
22
+ - Output: `patterns.spef`
23
+ - Script: Not provided
24
+ - Desc: Extract parasitics of the patterns generated by OpenRCX using a reference
25
+ extractor. This one-time step provides the parasitics of various types of pattern
26
+ geometries as reference for fitted per-unit length R, C calculation.
27
+
28
+ C. Running OpenRCX to convert `patterns.spef` to RC tech file.
29
+
30
+ - Input: `patterns.spef`
31
+ - Output: RC tech file
32
+ - Script: `generate_rules.tcl`
33
+ - Desc: OpenRCX takes the `.spef` from the reference extractor and performs
34
+ calculations to produce capacitance and resistance tables for a wide range of
35
+ wire geometries. The output of this flow is a custom RC tech file for
36
+ OpenRCX.
37
+
38
+ D. Benchmarking - test the accuracy of OpenRCX on the patterns layout.
39
+ - Input: `patterns.def` and RC tech file
40
+ - Output: `rcx.spef`, `diff_spef.out`
41
+ - Script: `ext_patterns.tcl`
42
+ - Desc: Perform parasitic extraction on pattern layout for the calibration
43
+ using the generated RC tech file. OpenRCX then compares the extracted
44
+ parasitics with the golden parasitics that had been extracted by the reference extractor
45
+ in Step (B) above.
46
+
47
+ ## How to run:
48
+
49
+ 1. Go to OpenRCX home directory (`./OpenROAD/src/rcx`).
50
+
51
+ 2. Navigate to calibration folder `cd calibration`
52
+
53
+ 3. Modify the `user_env.tcl` script in the script directory.
54
+
55
+ - TECH_LEF: points to the directory of the tech LEF
56
+ - PROCESS_NODE: the technology node
57
+ - extRules: the name and the location of the OpenRCX tech file
58
+
59
+ 4. Run the executable script `run.sh` --> run Steps (A) through (D) of the flow above.
60
+
61
+ - `source run.sh` or `./run.sh`
62
+
63
+ 5. The OpenRCX RC tech file can be found in the directory that is specified in the extRules variable.
data/markdown/OR_userguide/OR_rmp_README.md ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Restructure
2
+
3
+ The restructure module in OpenROAD (`rmp`) is based on
4
+ an interface to ABC for local resynthesis. The package allows
5
+ logic restructuring that targets area or timing. It extracts a cloud of logic
6
+ using the OpenSTA timing engine, and passes it to ABC through `blif` interface.
7
+ Multiple recipes for area or timing are run to obtain multiple structures from ABC;
8
+ the most desirable among these is used to improve the netlist.
9
+ The ABC output is read back by a `blif` reader which is integrated to OpenDB.
10
+ `blif` writer and reader also support constants from and to OpenDB. Reading
11
+ back of constants requires insertion of tie cells which should be provided
12
+ by the user as per the interface described below.
13
+
14
+ ## Commands
15
+
16
+ ```{note}
17
+ - Parameters in square brackets `[-param param]` are optional.
18
+ - Parameters without square brackets `-param2 param2` are required.
19
+ ```
20
+
21
+ Restructuring can be done in two modes: area or delay.
22
+
23
+ ### Area Mode
24
+
25
+ ```tcl
26
+ restructure
27
+ -liberty_file liberty_file
28
+ -target area
29
+ -tielo_pin tielo_pin_name
30
+ -tiehi_pin tiehi_pin_name
31
+ -work_dir workdir_name
32
+ ```
33
+
34
+ ### Timing Mode
35
+
36
+ ```tcl
37
+ restructure
38
+ -liberty_file liberty_file
39
+ -target timing
40
+ -slack_threshold slack_val
41
+ -depth_threshold depth_threshold
42
+ -tielo_pin tielo_pin_name
43
+ -tiehi_pin tiehi_pin_name
44
+ -work_dir workdir_name
45
+ ```
46
+
47
+ #### Options
48
+
49
+ | Switch Name | Description |
50
+ | ----- | ----- |
51
+ | `-liberty_file` | Liberty file with description of cells used in design. This is passed to ABC. |
52
+ | `-target` | Either `area` or `delay`. In area mode, the focus is area reduction, and timing may degrade. In delay mode, delay is likely reduced, but the area may increase. The default value is `area`. |
53
+ | `-slack_threshold` | Specifies a (setup) timing slack value below which timing paths need to be analyzed for restructuring. The default value is `0`, and the allowed values are floats `[0, MAX_FLOAT]`. |
54
+ | `-depth_threshold` | Specifies the path depth above which a timing path would be considered for restructuring. The default value is `16`, and the allowed values are `[0, MAX_INT]`. |
55
+ | `-tielo_pin` | Tie cell pin that can drive constant zero. The format is `<cell>/<port>`. |
56
+ | `-tiehi_pin` | Tie cell pin that can drive constant one. The format is `<cell>/<port>`. |
57
+ | `-work_dir` | Name of the working directory for temporary files. If not provided, `run` directory would be used. |
58
+
59
+ ## Example scripts
60
+
61
+ Example scripts on running `rmp` for a sample design of `gcd` as follows:
62
+
63
+ ```tcl
64
+ ./test/gcd_restructure.tcl
65
+ ```
66
+
67
+ ## Regression tests
68
+
69
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
70
+
71
+ Simply run the following script:
72
+
73
+ ```shell
74
+ ./test/regression
75
+ ```
76
+
77
+ ## Limitations
78
+
79
+ ## FAQs
80
+
81
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+restructure)
82
+ about this tool.
83
+
84
+ ## Authors
85
+
86
+ - Sanjiv Mathur
87
+ - Ahmad El Rouby
88
+
89
+ ## License
90
+
91
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.
data/markdown/OR_userguide/OR_rsz_README.md ADDED
@@ -0,0 +1,372 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Gate Resizer
2
+
3
+ Gate Resizer commands are described below. The `resizer` commands stop when
4
+ the design area is `-max_utilization util` percent of the core area. `util`
5
+ is between 0 and 100. The `resizer` stops and reports an error if the max
6
+ utilization is exceeded.
7
+
8
+ ## Commands
9
+
10
+ ```{note}
11
+ - Parameters in square brackets `[-param param]` are optional.
12
+ - Parameters without square brackets `-param2 param2` are required.
13
+ ```
14
+
15
+ ### Set Wire RC
16
+
17
+ The `set_wire_rc` command sets the resistance and capacitance used to estimate
18
+ delay of routing wires. Separate values can be specified for clock and data
19
+ nets with the `-signal` and `-clock` flags. Without either `-signal` or
20
+ `-clock` the resistance and capacitance for clocks and data nets are set.
21
+
22
+ ```tcl
23
+ set_wire_rc
24
+ [-clock]
25
+ [-signal]
26
+ [-layer layer_name]
27
+
28
+ or
29
+ set_wire_rc
30
+ [-resistance res]
31
+ [-capacitance cap]
32
+ ```
33
+
34
+ #### Options
35
+
36
+ | Switch Name | Description |
37
+ | ----- | ----- |
38
+ | `-clock` | Enable setting of RC for clock nets. |
39
+ | `-signal` | Enable setting of RC for signal nets. |
40
+ | `-layer` | Use the LEF technology resistance and area/edge capacitance values for the layer. This is used for a default width wire on the layer. |
41
+ | `-resistance` | Resistance per unit length, units are from the first Liberty file read, usually in the form of $\frac{resistanceUnit}{distanceUnit}$. Usually kΩ/µm. |
42
+ | `-capacitance` | Capacitance per unit length, units are from the first Liberty file read, usually in the form of $\frac{capacitanceUnit}{distanceUnit}$. Usually pF/µm. |
43
+
44
+
45
+ ### Set Layer RC
46
+
47
+ The `set_layer_rc` command can be used to set the resistance and capacitance
48
+ for a layer or via. This is useful if these values are missing from the LEF file,
49
+ or to override the values in the LEF.
50
+
51
+ ```tcl
52
+ set_layer_rc
53
+ [-layer layer]
54
+ [-via via_layer]
55
+ [-resistance res]
56
+ [-capacitance cap]
57
+ [-corner corner]
58
+ ```
59
+
60
+ #### Options
61
+
62
+ | Switch Name | Description |
63
+ | ----- | ----- |
64
+ | `-layer` | Set layer name to modify. Note that the layer must be a routing layer. |
65
+ | `-via` | Select via layer name. Note that via resistance is per cut/via, not area-based. |
66
+ | `-resistance` | Resistance per unit length, same convention as `set_wire_rc`. |
67
+ | `-capacitance` | Capacitance per unit length, same convention as `set_wire_rc`. |
68
+ | `-corner` | Process corner to use. |
69
+
70
+ ### Estimate Parasitics
71
+
72
+ Estimate RC parasitics based on placed component pin locations. If there are
73
+ no component locations, then no parasitics are added. The resistance and capacitance
74
+ values are per distance unit of a routing wire. Use the `set_units` command to check
75
+ units or `set_cmd_units` to change units. The goal is to represent "average"
76
+ routing layer resistance and capacitance. If the set_wire_rc command is not
77
+ called before resizing, then the default_wireload model specified in the first
78
+ Liberty file read or with the SDC set_wire_load command is used to make parasitics.
79
+
80
+ After the `global_route` command has been called, the global routing topology
81
+ and layers can be used to estimate parasitics with the `-global_routing`
82
+ flag.
83
+
84
+ ```tcl
85
+ estimate_parasitics
86
+ -placement|-global_routing
87
+ ```
88
+
89
+ #### Options
90
+
91
+ | Switch Name | Description |
92
+ | ----- | ----- |
93
+ | `-placement` or `-global_routing` | Either of these flags must be set. Parasitics are estimated based after placement stage versus after global routing stage. |
94
+
95
+ ### Set Don't Use
96
+
97
+ The `set_dont_use` command removes library cells from consideration by
98
+ the `resizer` engine and the `CTS` engine. `lib_cells` is a list of cells returned by `get_lib_cells`
99
+ or a list of cell names (`wildcards` allowed). For example, `DLY*` says do
100
+ not use cells with names that begin with `DLY` in all libraries.
101
+
102
+ ```tcl
103
+ set_dont_use lib_cells
104
+ unset_dont_use lib_cells
105
+ ```
106
+
107
+ ### Set Don't Touch
108
+
109
+ The `set_dont_touch` command prevents the resizer commands from
110
+ modifying instances or nets.
111
+
112
+ ```tcl
113
+ set_dont_touch instances_nets
114
+ unset_dont_touch instances_nets
115
+ ```
116
+
117
+ ### Buffer Ports
118
+
119
+ The `buffer_ports -inputs` command adds a buffer between the input and its
120
+ loads. The `buffer_ports -outputs` adds a buffer between the port driver
121
+ and the output port. Inserting buffers on input and output ports makes
122
+ the block input capacitances and output drives independent of the block
123
+ internals.
124
+
125
+ ```tcl
126
+ buffer_ports
127
+ [-inputs]
128
+ [-outputs]
129
+ [-max_utilization util]
130
+ ```
131
+
132
+ #### Options
133
+
134
+ | Switch Name | Description |
135
+ | ----- | ----- |
136
+ | `-inputs`, `-outputs` | Insert a buffer between the input and load, output and load respectively. The default behavior is `-inputs` and `-outputs` set if neither is specified. |
137
+ | `-max_utilization` | Defines the percentage of core area used. |
138
+
139
+ ### Remove Buffers
140
+
141
+ Use the `remove_buffers` command to remove buffers inserted by synthesis. This
142
+ step is recommended before using `repair_design` so that there is more flexibility
143
+ in buffering nets.
144
+
145
+ ```tcl
146
+ remove_buffers
147
+ ```
148
+
149
+ ### Repair Design
150
+
151
+ The `repair_design` command inserts buffers on nets to repair max slew, max
152
+ capacitance and max fanout violations, and on long wires to reduce RC delay in
153
+ the wire. It also resizes gates to normalize slews. Use `estimate_parasitics
154
+ -placement` before `repair_design` to estimate parasitics considered
155
+ during repair. Placement-based parasitics cannot accurately predict
156
+ routed parasitics, so a margin can be used to "over-repair" the design
157
+ to compensate.
158
+
159
+ ```tcl
160
+ repair_design
161
+ [-max_wire_length max_length]
162
+ [-slew_margin slew_margin]
163
+ [-cap_margin cap_margin]
164
+ [-max_utilization util]
165
+ [-verbose]
166
+ ```
167
+
168
+ #### Options
169
+
170
+ | Switch Name | Description |
171
+ | ----- | ----- |
172
+ | `-max_wire_length` | Maximum length of wires (in microns), defaults to a value that minimizes the wire delay for the wire RC values specified by `set_wire_rc`. |
173
+ | `-slew_margin` | Add a slew margin. The default value is `0`, the allowed values are integers `[0, 100]`. |
174
+ | `-cap_margin` | Add a capactitance margin. The default value is `0`, the allowed values are integers `[0, 100]`. |
175
+ | `-max_utilization` | Defines the percentage of core area used. |
176
+ | `-verbose` | Enable verbose logging on progress of the repair. |
177
+
178
+ ### Repair Tie Fanout
179
+
180
+ The `repair_tie_fanout` command connects each tie high/low load to a copy
181
+ of the tie high/low cell.
182
+
183
+ ```tcl
184
+ repair_tie_fanout
185
+ [-separation dist]
186
+ [-verbose]
187
+ lib_port
188
+ ```
189
+
190
+ #### Options
191
+
192
+ | Switch Name | Description |
193
+ | ----- | ----- |
194
+ | `-separation` | Tie high/low insts are separated from the load by this value (Liberty units, usually microns). |
195
+ | `-verbose` | Enable verbose logging of repair progress. |
196
+ | `lib_port` | Tie high/low port, which can be a library/cell/port name or object returned by `get_lib_pins`. |
197
+
198
+ ### Repair Timing
199
+
200
+ The `repair_timing` command repairs setup and hold violations. It
201
+ should be run after clock tree synthesis with propagated clocks.
202
+ Setup repair is done before hold repair so that hold repair does not
203
+ cause setup checks to fail.
204
+
205
+ The worst setup path is always repaired. Next, violating paths to
206
+ endpoints are repaired to reduced the total negative slack.
207
+
208
+ ```tcl
209
+ repair_timing
210
+ [-setup]
211
+ [-hold]
212
+ [-recover_power percent_of_paths_with_slack]
213
+ [-setup_margin setup_margin]
214
+ [-hold_margin hold_margin]
215
+ [-allow_setup_violations]
216
+ [-skip_pin_swap]
217
+ [-skip_gate_cloning]
218
+ [-repair_tns tns_end_percent]
219
+ [-max_utilization util]
220
+ [-max_buffer_percent buffer_percent]
221
+ [-verbose]
222
+ ```
223
+
224
+ #### Options
225
+
226
+ | Switch Name | Description |
227
+ | ----- | ----- |
228
+ | `-setup` | Repair setup timing. |
229
+ | `-hold` | Repair hold timing. |
230
+ | `-recover_power` | Set the percentage of paths to recover power for. The default value is `0`, and the allowed values are floats `(0, 100]`. |
231
+ | `-setup_margin` | Add additional setup slack margin. |
232
+ | `-hold_margin` | Add additional hold slack margin. |
233
+ | `-allow_setup_violations` | While repairing hold violations, buffers are not inserted that will cause setup violations unless `-allow_setup_violations` is specified. |
234
+ | `-skip_pin_swap` | Flag to skip pin swap. The default value is `False`, and the allowed values are bools. |
235
+ | `-skip_gate_cloning` | Flag to skip gate cloning. The default value is `False`, and the allowed values are bools. |
236
+ | `-repair_tns` | Percentage of violating endpoints to repair (0-100). When `tns_end_percent` is zero (the default), only the worst endpoint is repaired. When `tns_end_percent` is 100, all violating endpoints are repaired. |
237
+ | `-max_utilization` | Defines the percentage of core area used. |
238
+ | `-max_buffer_percent` | Specify a maximum number of buffers to insert to repair hold violations as a percentage of the number of instances in the design. The default value is `20`, and the allowed values are integers `[0, 100]`. |
239
+ | `-verbose` | Enable verbose logging of the repair progress. |
240
+
241
+ Use`-recover_power` to specify the percent of paths with positive slack which
242
+ will be considered for gate resizing to save power. It is recommended that
243
+ this option be used with global routing based parasitics.
244
+
245
+ ### Repair Clock Nets
246
+
247
+ The `clock_tree_synthesis` command inserts a clock tree in the design
248
+ but may leave a long wire from the clock input pin to the clock tree
249
+ root buffer. The `repair_clock_nets` command inserts buffers in the
250
+ wire from the clock input pin to the clock root buffer.
251
+
252
+ ```tcl
253
+ repair_clock_nets
254
+ [-max_wire_length max_wire_length]
255
+ ```
256
+
257
+ #### Options
258
+
259
+ | Switch Name | Description |
260
+ | ----- | ----- |
261
+ | `-max_wire_length` | Maximum length of wires (in microns), defaults to a value that minimizes the wire delay for the wire RC values specified by `set_wire_rc`. |
262
+
263
+ ### Repair Clock Inverters
264
+
265
+ The repair_clock_inverters command replaces an inverter in the clock
266
+ tree with multiple fanouts with one inverter per fanout. This
267
+ prevents the inverter from splitting up the clock tree seen by CTS.
268
+ It should be run before clock_tree_synthesis.
269
+
270
+ ```tcl
271
+ repair_clock_inverters
272
+ ```
273
+
274
+ ### Report Design Area
275
+
276
+ The `report_design_area` command reports the area of the design's components
277
+ and the utilization.
278
+
279
+ ```tcl
280
+ report_design_area
281
+ ```
282
+
283
+ ### Report Floating Nets
284
+
285
+ The `report_floating_nets` command reports nets with only one pin connection.
286
+
287
+ ```tcl
288
+ report_floating_nets
289
+ [-verbose]
290
+ ```
291
+
292
+ #### Options
293
+
294
+ | Switch Name | Description |
295
+ | ----- | ----- |
296
+ | `-verbose` | Print the net names. |
297
+
298
+ ### Useful Developer Commands
299
+
300
+ If you are a developer, you might find these useful. More details can be found in the [source file](./src/Resizer.cc) or the [swig file](./src/Resizer.i).
301
+
302
+ | Command Name | Description |
303
+ | ----- | ----- |
304
+ | `repair_setup_pin` | Repair setup pin violation. |
305
+ | `check_parasitics` | Check if the `estimate_parasitics` command has been called. |
306
+ | `parse_time_margin_arg` | Get the raw value for timing margin (e.g. `slack_margin`, `setup_margin`, `hold_margin`) |
307
+ | `parse_percent_margin_arg` | Get the above margin in perentage format. |
308
+ | `parse_margin_arg` | Same as `parse_percent_margin_arg`. |
309
+ | `parse_max_util` | Check maximum utilization. |
310
+ | `parse_max_wire_length` | Get maximum wirelength. |
311
+ | `check_corner_wire_caps` | Check wire capacitance for corner. |
312
+ | `check_max_wire_length` | Check if wirelength is allowed by rsz for minimum delay. |
313
+ | `dblayer_wire_rc` | Get layer RC values. |
314
+ | `set_dblayer_wire_rc` | Set layer RC values. |
315
+
316
+ ## Example scripts
317
+
318
+ A typical `resizer` command file (after a design and Liberty libraries have
319
+ been read) is shown below.
320
+
321
+ ```tcl
322
+ read_sdc gcd.sdc
323
+
324
+ set_wire_rc -layer metal2
325
+
326
+ set_dont_use {CLKBUF_* AOI211_X1 OAI211_X1}
327
+
328
+ buffer_ports
329
+ repair_design -max_wire_length 100
330
+ repair_tie_fanout LOGIC0_X1/Z
331
+ repair_tie_fanout LOGIC1_X1/Z
332
+ # clock tree synthesis...
333
+ repair_timing
334
+ ```
335
+
336
+ Note that OpenSTA commands can be used to report timing metrics before
337
+ or after resizing the design.
338
+
339
+ ```tcl
340
+ set_wire_rc -layer metal2
341
+ report_checks
342
+ report_tns
343
+ report_wns
344
+ report_checks
345
+
346
+ repair_design
347
+
348
+ report_checks
349
+ report_tns
350
+ report_wns
351
+ ```
352
+
353
+ ## Regression tests
354
+
355
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
356
+
357
+ Simply run the following script:
358
+
359
+ ```shell
360
+ ./test/regression
361
+ ```
362
+
363
+ ## Limitations
364
+
365
+ ## FAQs
366
+
367
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+resizer)
368
+ about this tool.
369
+
370
+ ## License
371
+
372
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.
data/markdown/OR_userguide/OR_stt_OR_flt_README.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Flute3
2
+
3
+ Flute3 is an open-source rectilinear Steiner minimum tree heuristic with
4
+ improvements made by UFRGS students and James Cherry. This tool is used
5
+ for the calculation of wirelength in `grt` and `rsz`.
6
+
7
+ The version in this repository uses
8
+ CMake and C++ namespace, and has dynamic memory allocation. Flute3 can handle nets with any degree.
9
+
10
+ ## External references (Optional)
11
+
12
+ The algorithm base is Flute3.1, extracted from the FastRoute4.1 version
13
+ that was received from <yuexu@iastate.edu> on June 15, 2019,
14
+ with the BSD-3 open source license as given in the FastRoute
15
+ [website](https://home.engineering.iastate.edu/~cnchu/FastRoute.html#License).
16
+
17
+ ## License
18
+
19
+ See [LICENSE](LICENSE) file.
data/markdown/OR_userguide/OR_tap_README.md ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Tapcell
2
+
3
+ Tapcell and endcap insertion.
4
+
5
+ ## Commands
6
+
7
+ ```{note}
8
+ - Parameters in square brackets `[-param param]` are optional.
9
+ - Parameters without square brackets `-param2 param2` are required.
10
+ ```
11
+
12
+ ### Add Tapcell/Endcap
13
+
14
+ ```tcl
15
+ tapcell
16
+ [-tapcell_master tapcell_master]
17
+ [-endcap_master endcap_master]
18
+ [-distance dist]
19
+ [-halo_width_x halo_x]
20
+ [-halo_width_y halo_y]
21
+ [-tap_nwin2_master tap_nwin2_master]
22
+ [-tap_nwin3_master tap_nwin3_master]
23
+ [-tap_nwout2_master tap_nwout2_master]
24
+ [-tap_nwout3_master tap_nwout3_master]
25
+ [-tap_nwintie_master tap_nwintie_master]
26
+ [-tap_nwouttie_master tap_nwouttie_master]
27
+ [-cnrcap_nwin_master cnrcap_nwin_master]
28
+ [-cnrcap_nwout_master cnrcap_nwout_master]
29
+ [-incnrcap_nwin_master incnrcap_nwin_master]
30
+ [-incnrcap_nwout_master incnrcap_nwout_master]
31
+ [-tap_prefix tap_prefix]
32
+ [-endcap_prefix endcap_prefix]
33
+ [-tbtie_cpp tbtie_cpp]
34
+ [-no_cell_at_top_bottom]
35
+ ```
36
+
37
+ #### Options
38
+
39
+ | Switch Name | Description |
40
+ | ----- | ----- |
41
+ | `-tapcell_master` | Master used as a tapcell. |
42
+ | `-endcap_master` | Master used as an endcap. |
43
+ | `-distance` | Distance (in microns) between each tapcell in the checkerboard. |
44
+ | `-halo_width_x` | Horizontal halo size (in microns) around macros during cut rows. |
45
+ | `-halo_width_y` | Vertical halo size (in microns) around macros during cut rows. |
46
+ | `-tap_nwintie_master` | Master cell placed at the top and bottom of|macros and the core area according the row orientation. |
47
+ | `-tap_nwin2_master` | Master cell placed at the top and bottom of macros and the core area according the row orientation. This master should be smaller than `tap_nwintie_master` |
48
+ | `-tap_nwin3_master` | Master cell placed at the top and bottom of macros and the core area according the row orientation. This master should be smaller than `tap_nwin2_master`. |
49
+ | `-tap_nwouttie_master` | Master cell placed at the top and bottom of macros and the core area according the row orientation. |
50
+ | `-tap_nwout2_master` | Master cell placed at the top and bottom of macros and the core area according the row orientation. This master should be smaller than `tap_nwouttie_master`. |
51
+ | `-tap_nwout3_master` | Master cell placed at the top and bottom of macros and the core area according the row orientation | This master should be smaller than `tap_nwout2_master`. |
52
+ | `-incnrcap_nwin_master` | Master cell placed at the corners of macros, according the row orientation. |
53
+ | `-incnrcap_nwout_master` | Master cell placed at the corners of macros, according the row orientation. |
54
+ | `-cnrcap_nwin_master` | Macro cell placed at the corners the core area according the row orientation. |
55
+ | `-cnrcap_nwout_master` | Macro cell placed at the corners the core area according the row orientation. |
56
+ | `-tap_prefix` | Prefix for the tapcell instances. The default value is `TAP_`. |
57
+ | `-endcap_prefix` | Prefix for the endcaps instances. The default value is `PHY_`. |
58
+ | `-tbtie_cpp` | Option is deprecated. |
59
+ | `-no_cell_at_top_bottom` | Option is deprecated. |
60
+
61
+ The figures below show two examples of tapcell insertion. When only the
62
+ `-tapcell_master` and `-endcap_master` masters are given, the tapcell placement
63
+ is similar to Figure 1. When the remaining masters are give, the tapcell
64
+ placement is similar to Figure 2.
65
+
66
+ | <img src="./doc/image/tapcell_example1.svg" width=450px> | <img src="./doc/image/tapcell_example2.svg" width=450px> |
67
+ |:--:|:--:|
68
+ | Figure 1: Tapcell insertion representation | Figure 2: Tapcell insertion around macro representation |
69
+
70
+ ### Only cutting rows
71
+
72
+ ```tcl
73
+ cut_rows
74
+ [-endcap_master endcap_master]
75
+ [-halo_width_x halo_x]
76
+ [-halo_width_y halo_y]
77
+ ```
78
+
79
+ #### Options
80
+
81
+ | Switch Name | Description |
82
+ | ----- | ----- |
83
+ | `-endcap_master` | Master used as an endcap. |
84
+ | `-halo_width_x` | Horizontal halo size (in microns) around macros during cut rows. |
85
+ | `-halo_width_y` | Vertical halo size (in microns) around macros during cut rows. |
86
+
87
+ ### Only adding boundary/endcap cells
88
+
89
+ Place endcaps into the design, the naming for the arguments to `place_endcaps` is based on the
90
+ LEF58 `CLASS` specification foe endcaps.
91
+
92
+ ```tcl
93
+ place_endcaps
94
+ [-corner master]
95
+ [-edge_corner master]
96
+ [-endcap masters]
97
+ [-endcap_horizontal masters]
98
+ [-endcap_vertical master]
99
+ [-prefix prefix]
100
+ [-left_top_corner master]
101
+ [-right_top_corner master]
102
+ [-left_bottom_corner master]
103
+ [-right_bottom_corner master]
104
+ [-left_top_edge master]
105
+ [-right_top_edge master]
106
+ [-left_bottom_edge master]
107
+ [-right_bottom_edge master]
108
+ [-left_edge master]
109
+ [-right_edge master]
110
+ [-top_edge masters]
111
+ [-bottom_edge masters]
112
+ ```
113
+
114
+ #### Options
115
+
116
+ | Switch Name | Description |
117
+ | ----- | ----- |
118
+ | `-prefix` | Prefix to use for the boundary cells. Defaults to "PHY_". |
119
+ | `-corner` | Master for the corner cells on the outer corners. |
120
+ | `-edge_corner` | Master for the corner cells on the inner corners. |
121
+ | `-endcap` | Master used as an endcap. |
122
+ | `-endcap_horizontal` | List of masters for the top and bottom row endcaps. (overrides `-endcap`). |
123
+ | `-endcap_vertical` | Master for the left and right row endcaps. (overrides `-endcap`). |
124
+ | `-left_top_corner` | Master for the corner cells on the outer top left corner. (overrides `-corner`). |
125
+ | `-right_top_corner` | Master for the corner cells on the outer top right corner. (overrides `-corner`). |
126
+ | `-left_bottom_corner` | Master for the corner cells on the outer bottom left corner. (overrides `-corner`). |
127
+ | `-right_bottom_corner` | Master for the corner cells on the outer bottom right corner. (overrides `-corner`). |
128
+ | `-left_top_edge` | Master for the corner cells on the inner top left corner. (overrides `-edge_corner`). |
129
+ | `-right_top_edge` | Master for the corner cells on the inner top right corner. (overrides `-edge_corner`). |
130
+ | `-left_bottom_edge` | Master for the corner cells on the inner bottom left corner. (overrides `-edge_corner`). |
131
+ | `-right_bottom_edge` | Master for the corner cells on the inner bottom right corner. (overrides `-edge_corner`). |
132
+ | `-left_edge` | Master for the left row endcaps. (overrides `-endcap_vertical`). |
133
+ | `-right_edge` | Master for the right row endcaps. (overrides `-endcap_vertical`). |
134
+ | `-top_edge` | List of masters for the top row endcaps. (overrides `-endcap_horizontal`). |
135
+ | `-bottom_edge` | List of masters for the bottom row endcaps. (overrides `-endcap_horizontal`). |
136
+
137
+ ### Only adding tapcells cells
138
+
139
+ ```tcl
140
+ place_tapcells
141
+ -master tapcell_master
142
+ -distance dist
143
+ ```
144
+
145
+ #### Options
146
+
147
+ | Switch Name | Description |
148
+ | ----- | ----- |
149
+ | `-master` | Master to use for the tapcells. |
150
+ | `-distance` | Distance between tapcells. |
151
+
152
+
153
+ ### Remove Tapcells/Endcaps
154
+
155
+ ```tcl
156
+ tapcell_ripup
157
+ -tap_prefix tap_prefix
158
+ -endcap_prefix endcap_prefix
159
+ ```
160
+
161
+ #### Options
162
+
163
+ | Switch Name | Description |
164
+ | ----- | ----- |
165
+ | `-tap_prefix` | Remove tapcells with said prefix. |
166
+ | `-endcap_prefix` | Remove endcaps with said prefix. |
167
+
168
+ ## Example scripts
169
+
170
+ You can find script examples for both 45nm and 14nm in `./etc/scripts`
171
+
172
+ ```tcl
173
+ ./etc/scripts/example_14nm.tcl
174
+ ./etc/scripts/example_45nm.tcl
175
+ ```
176
+
177
+ ## Regression tests
178
+
179
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
180
+
181
+ Simply run the following script:
182
+
183
+ ```shell
184
+ ./test/regression
185
+ ```
186
+
187
+ ## Limitations
188
+
189
+ ## FAQs
190
+
191
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+tap+in%3Atitle)
192
+ about this tool.
193
+
194
+ ## License
195
+
196
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.
data/markdown/OR_userguide/OR_upf_README.md ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Read UPF Utility
2
+
3
+ This module contains functionality to read, and modify information
4
+ from Unified Power Format (UPF) files.
5
+
6
+ ## Commands
7
+
8
+ ```{note}
9
+ - Parameters in square brackets `[-param param]` are optional.
10
+ - Parameters without square brackets `-param2 param2` are required.
11
+ ```
12
+
13
+ ### Read UPF
14
+
15
+ Sources the UPF file.
16
+
17
+ ```tcl
18
+ read_upf
19
+ -file file
20
+ ```
21
+
22
+ #### Options
23
+
24
+ | Switch Name | Description |
25
+ | ----- | ----- |
26
+ | `-file` | Path to `.upf` file. |
27
+
28
+ ### Create Power Domain
29
+
30
+ ```tcl
31
+ create_power_domain
32
+ [-elements elements]
33
+ name
34
+ ```
35
+
36
+ #### Options
37
+
38
+ | Switch Name | Description |
39
+ | ----- | ----- |
40
+ | `-elements` | List of module paths that belong this this domain OR `*` for top domain. |
41
+ | `name` | Domain name. |
42
+
43
+ ### Create Logic Port
44
+
45
+ ```tcl
46
+ create_logic_port
47
+ [-direction direction]
48
+ port_name
49
+ ```
50
+
51
+ #### Options
52
+
53
+ | Switch Name | Description |
54
+ | ----- | ----- |
55
+ | `-direction` | Direction of the port (`in`, `out`, `inout`). |
56
+ | `port_name` | Port name. |
57
+
58
+ ### Create Power Switch
59
+
60
+ ```tcl
61
+ create_power_switch
62
+ [-domain domain]
63
+ [-output_supply_port output_supply_port]
64
+ [-input_supply_port input_supply_port]
65
+ [-control_port control_port]
66
+ [-on_state on_state]
67
+ name
68
+ ```
69
+
70
+ #### Options
71
+
72
+ | Switch Name | Description |
73
+ | ----- | ----- |
74
+ | `-domain` | Power domain name. |
75
+ | `-output_supply_port` | Output supply port of the switch. |
76
+ | `-input_supply_port` | Input supply port of the switch. |
77
+ | `-control_port` | Control port on the switch. |
78
+ | `-on_state` | One of {`state_name`, `input_supply_port`, `boolean_expression`}. |
79
+ | `name` | Power switch name. |
80
+
81
+ ### Create or Update Isolation Strategy
82
+
83
+ ```tcl
84
+ set_isolation
85
+ [-domain domain]
86
+ [-applies_to applies_to]
87
+ [-clamp_value clamp_value]
88
+ [-isolation_signal isolation_signal]
89
+ [-isolation_sense isolation_sense]
90
+ [-location location]
91
+ [-update]
92
+ name
93
+ ```
94
+
95
+ #### Options
96
+
97
+ | Switch Name | Description |
98
+ | ----- | ----- |
99
+ | `-domain` | Power domain |
100
+ | `-applies_to` | Restricts the strategy to apply one of these (`inputs`, `outputs`, `both`). |
101
+ | `-clamp_value` | Value the isolation can drive (`0`, `1`). |
102
+ | `-isolation_signal` | The control signal for this strategy. |
103
+ | `-isolation_sense` | The active level of isolation control signal. |
104
+ | `-location` | Domain in which isolation cells are placed (`parent`, `self`, `fanout`). |
105
+ | `-update` | Only available if using existing strategy, will error if the strategy doesn't exist. |
106
+ | `name` | Isolation strategy name. |
107
+
108
+ ### Set Interface cell
109
+
110
+ ```tcl
111
+ use_interface_cell
112
+ [-domain domain]
113
+ [-strategy strategy]
114
+ [-lib_cells lib_cells]
115
+ ```
116
+
117
+ #### Options
118
+
119
+ | Switch Name | Description |
120
+ | ----- | ----- |
121
+ | `-domain` | Power domain name. |
122
+ | `-strategy` | Isolation strategy name. |
123
+ | `-lib_cells` | List of lib cells that could be used. |
124
+
125
+ ### Set Domain Area
126
+
127
+ ```tcl
128
+ set_domain_area
129
+ domain_name
130
+ -area {llx lly urx ury}
131
+ ```
132
+
133
+ #### Options
134
+
135
+ | Switch Name | Description |
136
+ | ----- | ----- |
137
+ | `domain_name` | Power domain name. |
138
+ | `-area` | x-/y- coordinates in microns for the lower left and upper right corners of the power domain area. |
139
+
140
+
141
+ ### Map existing power switch
142
+
143
+ ```tcl
144
+ map_power_switch
145
+ [-switch_name_list switch_name_list]
146
+ [-lib_cells lib_cells]
147
+ [-port_map port_map]
148
+ ```
149
+
150
+ #### Options
151
+
152
+ | Switch Name | Description |
153
+ | ----- | ----- |
154
+ | `-switch_name_list` | A list of switches (as defined by create_power_switch) to map. |
155
+ | `-lib_cells` | A list of library cells that could be mapped to the power switch |
156
+ | `-port_map` | A map that associates model ports defined by create_power_switch to logical ports |
157
+
158
+ ## Example scripts
159
+
160
+ Example script demonstrating how to run `upf` related commands can be found here:
161
+
162
+ ```tcl
163
+ ./test/upf_test.tcl
164
+ ```
165
+
166
+ ## Regression tests
167
+
168
+ There are a set of regression tests in `./test`. For more information, refer to this [section](../../README.md#regression-tests).
169
+
170
+ Simply run the following script:
171
+
172
+ ```shell
173
+ ./test/regression
174
+ ```
175
+
176
+ ## Limitations
177
+
178
+ ## FAQs
179
+
180
+ Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+upf)
181
+ about this tool.
182
+
183
+ ## License
184
+
185
+ BSD 3-Clause License. See [LICENSE](LICENSE) file.