Skip to content

Commit bc6e396

Browse files
oharboeclaude
andcommitted
metrics: report what is free unconditionally
With SKIP_REPORT_METRICS=1, report_metrics reported nothing at all, so a flow that skips it for speed also lost design area, instance counts and utilization, though those are a walk over the instances that needs no timer. Report them unconditionally, before the skip. SKIP_REPORT_METRICS now skips only what costs time: the timing update behind setup and hold WS and TNS, fmax, the max slew/cap/fanout checks and clock skew; the power analysis; and the reports/<stage>_*.rpt text reports. The calls that take measurable time even on asap7/gcd, 5 to 200 ms each on a few hundred cells, run under log_cmd, so on a large design the log names any that takes five seconds or more. The four register path searches go through `log_cmd eval { ... }`, so the log prints the command rather than the expanded register list. On asap7/gcd, metrics on (DETAILED_METRICS=1) and off give byte-identical .odb files at every stage; with SKIP_REPORT_METRICS=1 every stage's metrics .json has the design area and no timing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 7bf5a81 commit bc6e396

4 files changed

Lines changed: 26 additions & 17 deletions

File tree

‎docs/user/FlowVariables.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ configuration file.
291291
| <a name="SKIP_LAST_GASP"></a>SKIP_LAST_GASP| Do not use last gasp optimization to fix timing violations (default: use gate last gasp).| |
292292
| <a name="SKIP_PIN_SWAP"></a>SKIP_PIN_SWAP| Do not use pin swapping as a transform to fix timing violations (default: use pin swapping).| |
293293
| <a name="SKIP_REPAIR_TIE_FANOUT"></a>SKIP_REPAIR_TIE_FANOUT| Skip repair_tie_fanout at floorplan step.| 0|
294-
| <a name="SKIP_REPORT_METRICS"></a>SKIP_REPORT_METRICS| If set to 1, then metrics, report_metrics does nothing. Useful to speed up builds.| 0|
294+
| <a name="SKIP_REPORT_METRICS"></a>SKIP_REPORT_METRICS| If set to 1, report_metrics writes only the metrics that cost no analysis: design area, instance counts and utilization. Timing, power, clock skew, the max slew/cap/fanout checks and the reports/<stage>_*.rpt text reports are skipped; they need a timing update and a power analysis at every stage that calls it. The counters the tools record as they run (placement, legalization, routing, repair, warnings) are written either way.| 0|
295295
| <a name="SKIP_VT_SWAP"></a>SKIP_VT_SWAP| Do not perform VT swap to improve QoR (default: do VT swap).| |
296296
| <a name="SLEW_MARGIN"></a>SLEW_MARGIN| Specifies a slew margin when fixing max slew violations. This option allows you to overfix.| |
297297
| <a name="SWAP_ARITH_OPERATORS"></a>SWAP_ARITH_OPERATORS| Improve timing QoR by swapping ALU and MULT arithmetic operators.| 0|

‎flow/scripts/report_metrics.tcl‎

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ proc report_puts { out } {
77
}
88

99
proc report_metrics { stage when { include_erc true } { include_clock_skew true } } {
10+
report_design_area_metrics
1011
if { $::env(SKIP_REPORT_METRICS) } {
1112
return
1213
}
@@ -17,7 +18,7 @@ proc report_metrics { stage when { include_erc true } { include_clock_skew true
1718
report_puts "\n=========================================================================="
1819
report_puts "$when report_tns"
1920
report_puts "--------------------------------------------------------------------------"
20-
report_tns >> $filename
21+
log_cmd report_tns >> $filename
2122
report_tns_metric
2223
report_tns_metric -hold
2324

@@ -36,7 +37,7 @@ proc report_metrics { stage when { include_erc true } { include_clock_skew true
3637
report_puts "\n=========================================================================="
3738
report_puts "$when report_clock_min_period"
3839
report_puts "--------------------------------------------------------------------------"
39-
report_clock_min_period -include_port_paths >> $filename
40+
log_cmd report_clock_min_period -include_port_paths >> $filename
4041
report_fmax_metric
4142

4243
if { $include_clock_skew && $::env(REPORT_CLOCK_SKEW) } {
@@ -70,9 +71,9 @@ proc report_metrics { stage when { include_erc true } { include_clock_skew true
7071
report_puts "\n=========================================================================="
7172
report_puts "$when report_check_types -max_slew -max_cap -max_fanout -violators"
7273
report_puts "--------------------------------------------------------------------------"
73-
report_check_types -max_slew -max_capacitance -max_fanout -violators >> $filename
74+
log_cmd report_check_types -max_slew -max_capacitance -max_fanout -violators >> $filename
7475

75-
report_erc_metrics
76+
log_cmd report_erc_metrics
7677

7778
report_puts "\n=========================================================================="
7879
report_puts "$when max_slew_check_slack"
@@ -163,16 +164,18 @@ proc report_metrics { stage when { include_erc true } { include_clock_skew true
163164
report_puts "\n=========================================================================="
164165
report_puts "$when report_checks -path_delay max reg to reg"
165166
report_puts "--------------------------------------------------------------------------"
166-
report_checks -path_delay max -from [all_registers] -to [all_registers] \
167-
-format full_clock_expanded >> $filename
167+
log_cmd eval { report_checks -path_delay max -from [all_registers] -to [all_registers] \
168+
-format full_clock_expanded >> $filename }
168169
report_puts "\n=========================================================================="
169170
report_puts "$when report_checks -path_delay min reg to reg"
170171
report_puts "--------------------------------------------------------------------------"
171-
report_checks -path_delay min -from [all_registers] -to [all_registers] \
172-
-format full_clock_expanded >> $filename
172+
log_cmd eval { report_checks -path_delay min -from [all_registers] -to [all_registers] \
173+
-format full_clock_expanded >> $filename }
173174

174175
set inp_to_reg_critical_path \
175-
[lindex [find_timing_paths -path_delay max -from [all_inputs] -to [all_registers]] 0]
176+
[lindex [log_cmd eval {
177+
find_timing_paths -path_delay max -from [all_inputs] -to [all_registers]
178+
}] 0]
176179
if { $inp_to_reg_critical_path != "" } {
177180
set target_clock_latency_max \
178181
[sta::format_time [$inp_to_reg_critical_path target_clk_delay] 4]
@@ -182,7 +185,9 @@ proc report_metrics { stage when { include_erc true } { include_clock_skew true
182185

183186

184187
set inp_to_reg_critical_path [lindex \
185-
[find_timing_paths -path_delay min -from [all_inputs] -to [all_registers]] 0]
188+
[log_cmd eval {
189+
find_timing_paths -path_delay min -from [all_inputs] -to [all_registers]
190+
}] 0]
186191
if { $inp_to_reg_critical_path != "" } {
187192
set target_clock_latency_min \
188193
[sta::format_time [$inp_to_reg_critical_path target_clk_delay] 4]
@@ -237,12 +242,12 @@ proc report_metrics { stage when { include_erc true } { include_clock_skew true
237242
if { [env_var_exists_and_non_empty CORNERS] } {
238243
foreach corner $::env(CORNERS) {
239244
report_puts "Corner: $corner"
240-
report_power -corner $corner >> $filename
245+
log_cmd report_power -corner $corner >> $filename
241246
report_power_metric -corner $corner
242247
}
243248
unset corner
244249
} else {
245-
report_power >> $filename
250+
log_cmd report_power >> $filename
246251
report_power_metric
247252
}
248253

@@ -251,5 +256,4 @@ proc report_metrics { stage when { include_erc true } { include_clock_skew true
251256
puts "$when report_design_area"
252257
puts "--------------------------------------------------------------------------"
253258
report_design_area
254-
report_design_area_metrics
255259
}

‎flow/scripts/variables.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎flow/scripts/variables.yaml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,13 @@ REPORT_ENDPOINT_SLACK:
128128
default: 0
129129
SKIP_REPORT_METRICS:
130130
description: >
131-
If set to 1, then metrics, report_metrics does nothing. Useful to speed up
132-
builds.
131+
If set to 1, report_metrics writes only the metrics that cost no
132+
analysis: design area, instance counts and utilization. Timing, power,
133+
clock skew, the max slew/cap/fanout checks and the
134+
reports/<stage>_*.rpt text reports are skipped; they need a timing
135+
update and a power analysis at every stage that calls it. The
136+
counters the tools record as they run (placement, legalization,
137+
routing, repair, warnings) are written either way.
133138
stages:
134139
- synth
135140
- floorplan

0 commit comments

Comments
 (0)