Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions docs/contrib/EndpointSlackTracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,21 @@ cells) re-time the design if it is loaded, or else copy the previous step's
snapshot. Intermediate `.odb` files written through `orfs_write_db` (e.g. CTS
`save_progress`) also get a snapshot; `*-failed` ones don't.

So that all steps are timed the same way, parasitics are estimated before
reporting as in `open.tcl`, based on the step number:
A placed step is timed with the parasitics OpenROAD has for it: a bare
`estimate_parasitics` estimates from the global routes when there are any,
else from placement, and does nothing once `read_spef` has read the
extracted parasitics:

| Steps | Parasitics |
| --- | --- |
| 1, 2 | none (cells are not placed) |
| 3, 4 | `estimate_parasitics -placement` |
| 5, `6_1_fill` | `estimate_parasitics -global_routing` if global routes exist |
| `6_final` | `rcx`: the extracted `6_final.spef`, as in `6_finish.rpt` (`global_routing` on platforms without `RCX_RULES`) |
| before placement, and `3_1_place_gp_skip_io` while the pins are unplaced | `none` |
| placed, before global route | `placement` |
| global route and later | `global_routing` |
| `6_final` | `spef`: the extracted `6_final.spef`, as in `6_finish.rpt` (`global_routing` on platforms without `RCX_RULES`) |

The parasitics model is recorded in each snapshot and shown by
`endpointSlack.py`. Slack changes between steps with different models (e.g.
`2_4_floorplan_pdn` to `3_1_place_gp_skip_io`, `4_1_cts` to `5_1_grt`, or
`2_4_floorplan_pdn` to the first placed step, `4_1_cts` to `5_1_grt`, or
`6_1_fill` to `6_final`) include the change of model. Detailed routing is
only extracted in `6_final`, so `5_2_route` to `6_1_fill` show global routing
estimates.
Expand Down
1 change: 1 addition & 0 deletions docs/user/FlowVariables.md
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ configuration file.
## generate_abstract variables

- [ABSTRACT_SOURCE](#ABSTRACT_SOURCE)
- [SKIP_DETAILED_ROUTE](#SKIP_DETAILED_ROUTE)

## Uncategorized variables

Expand Down
6 changes: 3 additions & 3 deletions flow/scripts/cts.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set_dont_use $::env(DONT_USE_CELLS)
log_cmd clock_tree_synthesis {*}$cts_args

utl::push_metrics_stage "cts__{}__pre_repair_timing"
log_cmd estimate_parasitics -placement
log_cmd estimate_parasitics
if { $::env(DETAILED_METRICS) } {
report_metrics 4 "cts pre-repair-timing"
}
Expand All @@ -52,7 +52,7 @@ if { $result != 0 } {
error "Detailed placement failed in CTS: $msg"
}

log_cmd estimate_parasitics -placement
log_cmd estimate_parasitics

if { $::env(CTS_SNAPSHOTS) } {
save_progress 4_1_pre_repair_setup_hold
Expand All @@ -79,7 +79,7 @@ if { !$::env(SKIP_CTS_REPAIR_TIMING) } {

check_placement -verbose

log_cmd estimate_parasitics -placement
log_cmd estimate_parasitics
}

report_metrics 4 "cts final"
Expand Down
2 changes: 1 addition & 1 deletion flow/scripts/detail_place.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ proc do_dpl { } {

utl::info FLW 12 "Placement violations [check_placement -verbose]."

log_cmd estimate_parasitics -placement
log_cmd estimate_parasitics
}

set result [catch { do_dpl } errMsg]
Expand Down
14 changes: 4 additions & 10 deletions flow/scripts/final_outputs.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ if { $::env(SEC_CHECK) } {
}

# Run extraction and STA
if {
[env_var_exists_and_non_empty RCX_RULES]
&& !$::env(SKIP_DETAILED_ROUTE)
} {
if { [final_extracts_parasitics] } {
# RCX section
define_process_corner -ext_model_index 0 X
set_extraction_rules_file $::env(RCX_RULES)
Expand All @@ -35,7 +32,6 @@ if {

# Read Spef for OpenSTA
read_spef $::env(RESULTS_DIR)/6_final.spef
set final_parasitics rcx

# Static IR drop analysis
if { [env_var_exists_and_non_empty PWR_NETS_VOLTAGES] } {
Expand All @@ -57,12 +53,10 @@ if {
puts "IR drop analysis for ground nets is skipped because GND_NETS_VOLTAGES is undefined"
}
} else {
puts "OpenRCX is not enabled for this platform."
puts "Falling back to global route-based estimates."
log_cmd estimate_parasitics -global_routing
set final_parasitics global_routing
puts "OpenRCX is not enabled for this platform or detailed route was skipped."
log_cmd estimate_parasitics
}
write_endpoint_slack 6_final $final_parasitics
write_endpoint_slack 6_final

report_cell_usage

Expand Down
11 changes: 5 additions & 6 deletions flow/scripts/generate_abstract.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ set sdc_file [lindex $result 1]

log_cmd load_design $stem.odb [file tail $sdc_file]

if { $design_stage >= 6 && [file exists $::env(RESULTS_DIR)/$stem.spef] } {
log_cmd read_spef $::env(RESULTS_DIR)/$stem.spef
} elseif { $design_stage >= 5 } {
log_cmd estimate_parasitics -global_routing
} elseif { $design_stage >= 3 } {
log_cmd estimate_parasitics -placement
if { $stem == "6_final" && [final_extracts_parasitics] } {
log_cmd read_spef $::env(RESULTS_DIR)/6_final.spef
}
if { [grt::design_is_placed] } {
log_cmd estimate_parasitics
}

if { $design_stage >= 4 } {
Expand Down
4 changes: 2 additions & 2 deletions flow/scripts/global_place.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ if { $result != 0 } {
error $errMsg
}

log_cmd estimate_parasitics -placement
log_cmd estimate_parasitics

if { $::env(CLUSTER_FLOPS) } {
log_cmd cluster_flops {*}[env_var_or_empty CLUSTER_FLOPS_ARGS]
log_cmd estimate_parasitics -placement
log_cmd estimate_parasitics
}

report_metrics 3 "global place" false false
Expand Down
11 changes: 6 additions & 5 deletions flow/scripts/global_route.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ proc global_route_helper { } {
error $errMsg
}
orfs_write_sdc $::env(RESULTS_DIR)/5_1_grt.sdc
orfs_write_db $::env(RESULTS_DIR)/5_1_grt.odb
# A route that failed has no parasitics to time the endpoints with.
orfs_write_db $::env(RESULTS_DIR)/5_1_grt.odb 0
return 0
}
return 1
Expand Down Expand Up @@ -74,7 +75,7 @@ proc global_route_helper { } {
-right $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT)

set_propagated_clock [all_clocks]
log_cmd estimate_parasitics -global_routing
log_cmd estimate_parasitics

if { [env_var_exists_and_non_empty DONT_USE_CELLS] } {
set_dont_use $::env(DONT_USE_CELLS)
Expand Down Expand Up @@ -106,7 +107,7 @@ proc global_route_helper { } {

# Repair timing using global route parasitics
puts "Repair setup and hold violations..."
log_cmd estimate_parasitics -global_routing
log_cmd estimate_parasitics

repair_timing_helper

Expand All @@ -126,7 +127,7 @@ proc global_route_helper { } {
return
}

log_cmd estimate_parasitics -global_routing
log_cmd estimate_parasitics

if { $::env(OPT_POST_GRT_WNS) } {
set repair_timing_args \
Expand Down Expand Up @@ -171,7 +172,7 @@ proc global_route_helper { } {
}

puts "Estimate parasitics..."
log_cmd estimate_parasitics -global_routing
log_cmd estimate_parasitics

report_metrics 5 "global route"

Expand Down
16 changes: 7 additions & 9 deletions flow/scripts/open.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,14 @@ proc read_timing { input_file } {
set_propagated_clock [all_clocks]
}

if { $design_stage >= 6 && [file exist $::env(RESULTS_DIR)/6_final.spef] } {
if {
[file rootname [file tail $input_file]] == "6_final"
&& [final_extracts_parasitics]
} {
log_cmd read_spef $::env(RESULTS_DIR)/6_final.spef
} elseif { $design_stage >= 5 } {
if { [log_cmd grt::have_routes] } {
log_cmd estimate_parasitics -global_routing
} else {
puts "No global routing results available, skipping estimate_parasitics"
}
} elseif { $design_stage >= 3 } {
log_cmd estimate_parasitics -placement
}
if { [grt::design_is_placed] } {
log_cmd estimate_parasitics
}

# Warm up OpenSTA, so clicking on timing related buttons reacts faster
Expand Down
4 changes: 2 additions & 2 deletions flow/scripts/resize.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ erase_non_stage_variables place
load_design 3_3_place_gp.odb 2_floorplan.sdc
source_step_tcl PRE RESIZE

log_cmd estimate_parasitics -placement
log_cmd estimate_parasitics

set instance_count_before [sta::network_leaf_instance_count]
set pin_count_before [sta::network_leaf_pin_count]
Expand All @@ -28,7 +28,7 @@ repair_design_helper
if { $::env(ENABLE_PLACE_REPAIR_TIMING) } {
# Repair timing using placement parasitics.
puts "Repair setup and hold violations..."
log_cmd estimate_parasitics -placement
log_cmd estimate_parasitics

repair_timing_helper
}
Expand Down
35 changes: 16 additions & 19 deletions flow/scripts/util.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -343,32 +343,29 @@ proc endpoint_slack_file { step } {
return $::env(REPORTS_DIR)/${step}_endpoint_slack.json
}

# The final stage extracts parasitics into 6_final.spef when the platform
# has OpenRCX rules and the design is detail routed. 6_final.odb is timed
# with that SPEF; whether a .spef file exists says nothing.
proc final_extracts_parasitics { } {
return [expr {
[env_var_exists_and_non_empty RCX_RULES]
&& !$::env(SKIP_DETAILED_ROUTE)
}]
}

# Write the setup and hold slack of every endpoint at the end of a flow
# step so they can be compared across steps with
# flow/util/endpointSlack.py. Parasitics are estimated the same way as
# open.tcl so that every step is timed consistently, unless the caller
# has already loaded parasitics (e.g. extracted ones) and passes their
# name as parasitics.
proc write_endpoint_slack { step { parasitics "" } } {
# flow/util/endpointSlack.py. A placed design is timed with the parasitics
# OpenROAD has for it, a design before placement without any.
proc write_endpoint_slack { step } {
if { !$::env(REPORT_ENDPOINT_SLACK) || [string match "*-failed" $step] } {
return
}
set filename [endpoint_slack_file $step]
puts "Writing endpoint slack to $filename"

if { $parasitics == "" } {
set design_stage [lindex [split $step _] 0]
set parasitics none
if { $design_stage >= 5 } {
if { [grt::have_routes] } {
set parasitics global_routing
}
} elseif { $design_stage >= 3 } {
set parasitics placement
}
if { $parasitics != "none" } {
estimate_parasitics -$parasitics
}
if { [grt::design_is_placed] } {
log_cmd estimate_parasitics
}
# Update timing before sta::endpoints: the endpoint set is cached the
# first time it is requested and misses gated clock enable checks if the
Expand All @@ -379,7 +376,7 @@ proc write_endpoint_slack { step { parasitics "" } } {
puts $fileId "{"
puts $fileId "\"design\": \"$::env(DESIGN_NAME)\","
puts $fileId "\"step\": \"$step\","
puts $fileId "\"parasitics\": \"$parasitics\","
puts $fileId "\"parasitics\": \"[est::parasitics_source]\","
# Seconds per reported time unit
puts $fileId "\"time_unit\": [sta::time_ui_sta 1],"
# endpoint: [setup slack, hold slack], null if unconstrained
Expand Down
3 changes: 2 additions & 1 deletion flow/scripts/variables.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions flow/scripts/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,7 @@ SKIP_DETAILED_ROUTE:
stages:
- route
- final
- generate_abstract
MAX_REPAIR_ANTENNAS_ITER_DRT:
default: 5
description: >
Expand Down