Skip to content

Commit b81d8e7

Browse files
authored
Merge pull request #763 from The-OpenROAD-Project-staging/skip-unconst-ref-sdc
Skip writing the updated_clk.sdc if there is no constrained path
2 parents 7943c16 + 868baf6 commit b81d8e7

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

flow/scripts/write_ref_sdc.tcl

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,23 @@ if { [llength $clks] == 0 } {
1515

1616
if { [llength $clks] == 1 } {
1717
set slack [sta::time_sta_ui [sta::worst_slack_cmd "max"]]
18-
set ref_period [expr ($period - $slack) * (1.0 - $margin/100.0)]
19-
utl::info "FLW" 8 "Clock $clk_name period [format %.3f $ref_period]"
20-
utl::info "FLW" 9 "Clock $clk_name slack [format %.3f $slack]"
21-
22-
set sources [$clk sources]
23-
# Redefine clock with updated period.
24-
create_clock -name $clk_name -period $ref_period $sources
25-
# Undo the set_propagated_clock so SDC at beginning of flow uses ideal clocks.
26-
unset_propagated_clock [all_clocks]
27-
write_sdc [file join $env(RESULTS_DIR) "updated_clks.sdc"]
28-
# Reset
29-
create_clock -name $clk_name -period $period $sources
30-
set_propagated_clock [all_clocks]
18+
if { $slack < 1e30 } {
19+
set ref_period [expr ($period - $slack) * (1.0 - $margin/100.0)]
20+
utl::info "FLW" 8 "Clock $clk_name period [format %.3f $ref_period]"
21+
utl::info "FLW" 9 "Clock $clk_name slack [format %.3f $slack]"
22+
23+
set sources [$clk sources]
24+
# Redefine clock with updated period.
25+
create_clock -name $clk_name -period $ref_period $sources
26+
# Undo the set_propagated_clock so SDC at beginning of flow uses ideal clocks.
27+
unset_propagated_clock [all_clocks]
28+
write_sdc [file join $env(RESULTS_DIR) "updated_clks.sdc"]
29+
# Reset
30+
create_clock -name $clk_name -period $period $sources
31+
set_propagated_clock [all_clocks]
32+
} else {
33+
utl::warn "FLW" 13 "No constrained path found. Skipping sdc update."
34+
}
3135
} else {
3236
utl::warn "FLW" 10 "more than one clock found. Skipping sdc update."
3337
}

0 commit comments

Comments
 (0)