11# Static Timing Analysis (STA) Tutorial
22
3- OpenSTA is a command line tool called ` sta ` , but it is
4- also integrated into OpenROAD and the OpenLane environment. You can run it there in either the
5- [ Nix or Docker environment ] ( installation.md ) :
3+ OpenSTA is a command line tool called ` sta ` , but it is
4+ also integrated into OpenROAD and the [ ORFS environment] ( orfs-installation.md ) :
5+
66```
77$ openroad
88OpenROAD edf00dff99f6c40d67a30c0e22a8191c5d2ed9d6
@@ -17,82 +17,92 @@ These tutorials all use [TCL (Tool Command
1717Language)] ( https://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html ) scripts to
1818interact with OpenSTA. You don't need to master TCL, but you should be familiar with
1919it. It is based on LISP but with customized commands for EDA tools. While you can also use
20- some of these commands in Python, * the industry standard is currently TCL* .
20+ some of these commands in Python, * the industry standard is currently TCL* .
2121
2222The full documentation of the OpenSTA commands can be found
2323[ here] ( https://github.com/The-OpenROAD-Project/OpenSTA/blob/2c5df8ccbc09a98bd39af206339505754cbee339/doc/OpenSTA.pdf ) .
2424
2525This tutorial will utilize the spm design example final output that was created by OpenLane2.
2626You should untar the file for this tutorial:
27+
2728``` bash
2829git clone https://github.com/VLSIDA/chip-tutorials.git
2930cd chip-tutorials
3031tar -zxvf final.tar.gz
3132```
33+
3234which will create the final subdirectory with subdirectories for the different design files.
3335The ones that we are concerned with are the following: def, odb, nl, sdc, and spef.
3436
3537This assumes that you have an environment variable pointing to your PDK installation directory. In most cases, this will be:
38+
3639``` bash
3740export PDK_ROOT=~ /.volare
3841```
42+
3943Note that PDK_ROOT is an environment variable set in the OpenLane environment that points to the
40- PDK installation directory.
44+ PDK installation directory.
4145
4246## Single corner timing analysis
4347
44- There are four main steps to setting up a timing analysis.
48+ There are four main steps to setting up a timing analysis.
49+
45501 . Read in the library file(s)
46511 . Read in the design file(s)
47521 . Read in the parasitic file(s)
48- 1 . Read in the constraints
53+ 1 . Read in the constraints
4954
5055The following is an example that does each of these steps:
56+
5157``` tcl
5258read_lib $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/lib/sky130_fd_sc_hd__ss_100C_1v60.lib
5359read_db odb/spm.odb
5460read_spef spef/max/spm.max.spef
5561read_sdc sdc/spm.sdc
5662```
5763
58- ### Other ways to read the design file(s)
64+ ### Other ways to read the design file(s)
5965
6066Instead of reading the ODB (OpenROAD database format) file, you can use
6167gate-level verilog file or the DEF (Design Exchange Format) file. You may need to do this
6268depending on what output is available from the steps of the design flow (i.e. they don't all save ODB files). However,
6369these both require that you also read in the LEF technology and cell files. This would replace the
6470reading of the design above with these multiple steps like this for the DEF:
71+
6572``` tcl
6673read_lef $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/techlef/sky130_fd_sc_hd__nom.tlef
6774read_lef $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/lef/sky130_fd_sc_hd.lef
6875read_lef $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/lef/sky130_ef_sc_hd.lef
6976read_def def/spm.def
7077```
78+
7179or like this for the gate-level Verilog:
80+
7281``` tcl
7382read_lef $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/techlef/sky130_fd_sc_hd__nom.tlef
7483read_lef $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/lef/sky130_fd_sc_hd.lef
7584read_lef $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/lef/sky130_ef_sc_hd.lef
7685read_verilog nl/spm.nl.v
7786link_design spm
7887```
88+
7989The other steps (library files, parasitics, and constraints) are the same. Note
8090that with the Verilog method, the ` link_design ` command will report a few
8191missing liberty files:
92+
8293```
8394[WARNING ORD-2011] LEF master sky130_ef_sc_hd__decap_12 has no liberty cell.
8495[WARNING ORD-2011] LEF master sky130_fd_sc_hd__fill_1 has no liberty cell.
8596[WARNING ORD-2011] LEF master sky130_fd_sc_hd__fill_2 has no liberty cell.
8697[WARNING ORD-2011] LEF master sky130_fd_sc_hd__tapvpwrvgnd_1 has no liberty cell.
8798```
88- but that is ok since they are special cells that do not have timing.
8999
100+ but that is ok since they are special cells that do not have timing.
90101
91102## Reports
92103
93104The [ STA Reporting Tutorial] ( sta-reports.md ) goes into more detail on the different reports that can be generated.
94105
95-
96106## Timing Constraints
97107
98108The [ STA Timing Constraints Tutorial] ( sta-constraints.md ) goes into more detail on the different constraints that can be used.
@@ -110,22 +120,20 @@ TBD
110120OpenROAD has a GUI that can be used to view the timing results. You can open it
111121by running ` openroad -gui ` and running the previous commands in the "TCL Commands"
112122portion of OpenROAD. It is recommended
113- to use the ODB or DEF design files as these have the placement information.
123+ to use the ODB or DEF design files as these have the placement information.
114124Once you do this, click on the "Timing Report" tab and then click the "Update" button
115125to run the timing analysis. You should see something like this:
116126
117127![ Timing Analysis in OpenROAD] ( sta/openroad-timing.png )
118128
119- You can select the top ranked path (and expand the window sizes) to see the details
129+ You can select the top ranked path (and expand the window sizes) to see the details
120130of the path like this:
121131
122132![ Timing Path in OpenROAD] ( sta/openroad-timing-report.png )
123133
124- The path should also be highlighted in the layout to see the placement. However, the color
134+ The path should also be highlighted in the layout to see the placement. However, the color
125135defaults to black.
126136
127-
128-
129137# License
130138
131139Copyright 2024 VLSI-DA (see [ LICENSE] ( LICENSE ) for use)
0 commit comments