Skip to content

Commit ee52d2a

Browse files
committed
Update min_clk_period calculation and unit scaling for ASAP7 (ps)
1 parent d110db4 commit ee52d2a

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

‎flow/scripts/dump_paths_native.tcl‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ foreach path_end $paths {
2828
set startpoint [get_name $start_pin]
2929
set endpoint [get_name $end_pin]
3030

31-
# Calculate min_clk_period = clock_period - slack
32-
# Using clock period from endpoint clock or default to (1.1ns - slack) converted
33-
set clk_period 1.1e-9
34-
set min_clk_period [expr {$clk_period - $slack}]
31+
# Get clock period from active clocks or default to datapath arrival if no clocks
32+
set clocks [all_clocks]
33+
if {[llength $clocks] > 0} {
34+
set clk_period [[lindex $clocks 0] period]
35+
set min_clk_period [expr {$clk_period - $slack}]
36+
} else {
37+
set min_clk_period [$path arrival]
38+
}
3539

3640
# Redirect standard report output to string for precise table parsing
3741
utl::redirectStringBegin
@@ -84,9 +88,15 @@ foreach path_end $paths {
8488
}
8589
}
8690

87-
# Convert seconds to nanoseconds if values are in scientific notation (OpenSTA default unit seconds)
91+
# Convert seconds to delay units (ns for values > 1e-11, ps for values <= 1e-11 / asap7)
8892
if {$min_clk_period < 1e-4} {
89-
set min_clk_period [expr {$min_clk_period * 1e9}]
93+
if {[string match "*asap7*" $stage_prefix] || $datapath_delay > 10.0} {
94+
# asap7 OpenSTA reports in ps directly
95+
set min_clk_period [expr {$min_clk_period * 1e12}]
96+
} else {
97+
# sky130hd OpenSTA reports in ns
98+
set min_clk_period [expr {$min_clk_period * 1e9}]
99+
}
90100
}
91101

92102
puts $fp "$startpoint,$endpoint,$min_clk_period,$net_delay,$logic_delay,$total_cap,$buffers"

0 commit comments

Comments
 (0)