Skip to content

Commit 16438b1

Browse files
authored
Mock array element latency (#1925)
* add target clock latency Signed-off-by: Tom Spyrou <[email protected]> * add source clock latency Signed-off-by: Tom Spyrou <[email protected]> * add element constraint.sdc, update metrics logs with paths used to pull the source latency numbers Signed-off-by: Tom Spyrou <[email protected]> * redirect report Signed-off-by: Tom Spyrou <[email protected]> * remove source latency accidentally added to top sdc Signed-off-by: Tom Spyrou <[email protected]> * set source latency to 0 before write_timing_model Signed-off-by: Tom Spyrou <[email protected]> * comments to show where latency should be added Signed-off-by: Tom Spyrou <[email protected]> * use reg to reg paths to find metrics for latency Signed-off-by: Tom Spyrou <[email protected]> * use reg to reg paths to find metrics for latency Signed-off-by: Tom Spyrou <[email protected]> * guard against no registers Signed-off-by: Tom Spyrou <[email protected]> --------- Signed-off-by: Tom Spyrou <[email protected]> Co-authored-by: Tom Spyrou <[email protected]>
1 parent d7d9288 commit 16438b1

File tree

4 files changed

+53
-2
lines changed

4 files changed

+53
-2
lines changed

flow/designs/asap7/mock-array/Element/constraints.sdc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@ set clk_port [get_ports $clk_port_name]
1414
create_clock -period $clk_period -waveform [list 0 [expr $clk_period / 2]] -name $clk_name $clk_port
1515
set_clock_uncertainty -setup 20.0 [get_clocks $clk_name]
1616
set_clock_uncertainty -hold 20.0 [get_clocks $clk_name]
17+
# From top level run's metrics
18+
#set_clock_latency -source 350 [get_clocks $clk_name]
1719

1820
create_clock -period $clk_period -waveform [list 0 [expr $clk_period / 2]] -name ${clk_name}_vir
1921
set_clock_uncertainty -setup 20.0 [get_clocks ${clk_name}_vir]
2022
set_clock_uncertainty -hold 20.0 [get_clocks ${clk_name}_vir]
2123
set_clock_latency 70 [get_clocks ${clk_name}_vir]
24+
# From top level run's metrics
25+
#set_clock_latency -source 380 [get_clocks ${clk_name}_vir]
2226

2327
set_max_transition 250 [current_design]
2428
set_max_transition 100 -clock_path [all_clocks]

flow/designs/asap7/mock-array/constraints.sdc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ set_clock_uncertainty 10 [get_clocks $clk_name]
1313

1414
create_clock -name ${clk_name}_vir -period $clk_period -waveform [list 0 [expr $clk_period/2]]
1515
set_clock_uncertainty 10 [get_clocks ${clk_name}_vir]
16-
set_clock_latency 380 [get_clocks ${clk_name}_vir] ;# Matching real clock latency
1716

1817
set clk_port [get_ports $clk_port_name]
1918
set non_clock_inputs [lsearch -inline -all -not -exact [all_inputs] $clk_port]

flow/scripts/generate_abstract.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ if {$design_stage >= 6 && [file exists $::env(RESULTS_DIR)/$stem.spef]} {
1616
if {$design_stage >= 4} {
1717
set_propagated_clock [all_clocks]
1818
}
19-
19+
# write_timing_model includes the source latency in the model
20+
set_clock_latency -source 0 [all_clocks]
2021
puts "Generating abstract views"
2122
write_timing_model $::env(RESULTS_DIR)/$::env(DESIGN_NAME).lib
2223
write_abstract_lef -bloat_occupied_layers $::env(RESULTS_DIR)/$::env(DESIGN_NAME).lef

flow/scripts/report_metrics.tcl

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,53 @@ proc report_metrics { stage when {include_erc true} {include_clock_skew true} }
152152
set path_delay -1
153153
set path_slack 0
154154
}
155+
156+
if { [llength [all_registers]] != 0} {
157+
report_puts "\n=========================================================================="
158+
report_puts "$when report_checks -path_delay max reg to reg"
159+
report_puts "--------------------------------------------------------------------------"
160+
report_checks -path_delay max -from [all_registers] -to [all_registers] -format full_clock_expanded >> $filename
161+
report_puts "\n=========================================================================="
162+
report_puts "$when report_checks -path_delay min reg to reg"
163+
report_puts "--------------------------------------------------------------------------"
164+
report_checks -path_delay min -from [all_registers] -to [all_registers] -format full_clock_expanded >> $filename
165+
166+
set inp_to_reg_critical_path [lindex [find_timing_paths -path_delay max -from [all_inputs] -to [all_registers]] 0]
167+
if {$inp_to_reg_critical_path != ""} {
168+
set target_clock_latency_max [sta::format_time [$inp_to_reg_critical_path target_clk_delay] 4]
169+
} else {
170+
set target_clock_latency_max 0
171+
}
172+
173+
174+
set inp_to_reg_critical_path [lindex [find_timing_paths -path_delay min -from [all_inputs] -to [all_registers]] 0]
175+
if {$inp_to_reg_critical_path != ""} {
176+
set target_clock_latency_min [sta::format_time [$inp_to_reg_critical_path target_clk_delay] 4]
177+
set source_clock_latency [sta::format_time [$inp_to_reg_critical_path source_clk_latency] 4]
178+
} else {
179+
set target_clock_latency_min 0
180+
set source_clock_latency 0
181+
}
182+
183+
report_puts "\n=========================================================================="
184+
report_puts "$when critical path target clock latency max path"
185+
report_puts "--------------------------------------------------------------------------"
186+
report_puts "$target_clock_latency_max"
187+
188+
report_puts "\n=========================================================================="
189+
report_puts "$when critical path target clock latency min path"
190+
report_puts "--------------------------------------------------------------------------"
191+
report_puts "$target_clock_latency_min"
192+
193+
report_puts "\n=========================================================================="
194+
report_puts "$when critical path source clock latency min path"
195+
report_puts "--------------------------------------------------------------------------"
196+
report_puts "$source_clock_latency"
197+
} else {
198+
puts "No registers in design"
199+
}
200+
# end if all_registers
201+
155202
report_puts "\n=========================================================================="
156203
report_puts "$when critical path delay"
157204
report_puts "--------------------------------------------------------------------------"

0 commit comments

Comments
 (0)