From aeef4d0572747b4fca9ff3910a3c35869c6384dc Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Thu, 22 Jun 2023 12:53:38 +0300 Subject: [PATCH] Enhance IR Drop Analysis (#1864) + Add `VSRC_LOC_FILES` + Fix IR drop analysis flow + Consistent default NONE in configuration.md --- docs/source/reference/configuration.md | 8 ++++- scripts/openroad/irdrop.tcl | 42 +++++++++++++------------- scripts/tcl_commands/all.tcl | 17 +++++++++-- 3 files changed, 42 insertions(+), 25 deletions(-) diff --git a/docs/source/reference/configuration.md b/docs/source/reference/configuration.md index e9162266..266b18e0 100644 --- a/docs/source/reference/configuration.md +++ b/docs/source/reference/configuration.md @@ -259,6 +259,12 @@ These variables worked initially, but they were too sky130 specific and will be | `SPEF_WIRE_MODEL` | **Removed:** Specifies the wire model used in SPEF extraction. Options are `L` or `Pi`
(Default: `L`) | | `SPEF_EDGE_CAP_FACTOR` | **Removed:** Specifies the edge capacitance factor used in SPEF extraction. Ranges from 0 to 1
(Default: `1`) | +### IR Drop Analysis + +|Variable|Description| +|-|-| +| `VSRC_LOC_FILES` | PSM loc file for power and ground nets. Variable should be provided as a json/tcl list or a space delimited tcl string as follows: `net1 file1 net2 file2`. See [this](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/psm#commands) for more info.
(Default: NONE) | + ### Magic |Variable|Description| |-|-| @@ -323,7 +329,7 @@ These variables worked initially, but they were too sky130 specific and will be | | 4: Use Sylvain Minaut's custom script for diode insertion. | | | 5: **removed** A combination of strategies 2 and 4. | | | 6: A combination of strategies 3 and 4. | -| `DIODE_ON_PORTS` | Insert diodes on ports with the specified polarities. Available options are `none`, `in`, `out` and `both`.
(Default: `none`) | +| `DIODE_ON_PORTS` | Insert diodes on ports with the specified polarities. Available options are `none`, `in`, `out` and `both`.
(Default: NONE) | | `HEURISTIC_ANTENNA_THRESHOLD` | Minimum manhattan distance of a net to insert a diode in microns. Only applicable for `RUN_HEURISTIC_DIODE_INSERTION` is enabled.
(Default: `90`) | `USE_ARC_ANTENNA_CHECK` | Specifies whether to use the openroad ARC antenna checker or magic antenna checker. 0=magic antenna checker, 1=ARC OR antenna checker
(Default: `1`) | `RUN_LINTER` | Enable linter (currently Verilator)
(Default: `1`) diff --git a/scripts/openroad/irdrop.tcl b/scripts/openroad/irdrop.tcl index 8ef239d2..19f6c633 100644 --- a/scripts/openroad/irdrop.tcl +++ b/scripts/openroad/irdrop.tcl @@ -11,27 +11,27 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -if {[catch {read_lef $::env(MERGED_LEF)} errmsg]} { - puts stderr $errmsg - exit 1 -} - -if {[catch {read_def $::env(CURRENT_DEF)} errmsg]} { - puts stderr $errmsg - exit 1 -} - -foreach lib $::env(LIB_SYNTH_COMPLETE) { - read_liberty $lib -} - -if { [info exists ::env(EXTRA_LIBS) ] } { - foreach lib $::env(EXTRA_LIBS) { - read_liberty $lib - } -} +source $::env(SCRIPTS_DIR)/openroad/common/io.tcl +read +read_spef $::env(CURRENT_SPEF) source $::env(SCRIPTS_DIR)/openroad/common/set_rc.tcl -analyze_power_grid -net $::env(VDD_NET) -outfile $::env(_tmp_save_rpt) +if { [info exists ::env(VSRC_LOC_FILES)] } { + foreach {net vsrc_file} "$::env(VSRC_LOC_FILES)" { + set arg_list [list] + lappend -net $net + lappend -outfile $::env(_tmp_save_rpt_prefix)-$net.rpt + lappend -vsrc $vsrc_file + analyze_power_grid {*}$arg_list + } +} else { + foreach net "$::env(VDD_NETS) $::env(GND_NETS)" { + set arg_list [list] + lappend arg_list -net $::env(VDD_NET) + lappend arg_list -outfile $::env(_tmp_save_rpt_prefix)-$net.rpt + analyze_power_grid {*}$arg_list + } +} + + diff --git a/scripts/tcl_commands/all.tcl b/scripts/tcl_commands/all.tcl index affa0062..73e3ccd7 100755 --- a/scripts/tcl_commands/all.tcl +++ b/scripts/tcl_commands/all.tcl @@ -889,6 +889,13 @@ proc prep {args} { } } + if { [info exists ::env(VSRC_LOC_FILES)] } { + if { [expr [llength $::env(VSRC_LOC_FILES)] % 2] != 0 } { + puts_err "Please define VSRC_LOC_FILES correctly. i.e. : net1 file1 net2 file2 ..." + flow_fail + } + } + TIMER::timer_stop exec echo "[TIMER::get_runtime]" | python3 $::env(SCRIPTS_DIR)/write_runtime.py "openlane design prep" return -code ok @@ -1213,11 +1220,15 @@ proc run_irdrop_report {args} { set log [index_file $::env(signoff_logs)/irdrop.log] puts_info "Creating IR Drop Report (log: [relpath . $log])..." - set rpt [index_file $::env(signoff_reports)/irdrop.rpt] + if { ![info exists ::env(VSRC_LOC_FILES)] } { + puts_warn "VSRC_LOC_FILES is not defined. The IR drop analysis will run, but the values may be inaccurate." + } - set ::env(_tmp_save_rpt) $rpt + set rpt [index_file $::env(signoff_reports)/irdrop] + + set ::env(_tmp_save_rpt_prefix) $rpt run_openroad_script $::env(SCRIPTS_DIR)/openroad/irdrop.tcl -indexed_log $log - unset ::env(_tmp_save_rpt) + unset ::env(_tmp_save_rpt_prefix) TIMER::timer_stop exec echo "[TIMER::get_runtime]" | python3 $::env(SCRIPTS_DIR)/write_runtime.py "ir drop report - openroad"