From 88613cfa53c99a549bb479adc12cbdfa1e532425 Mon Sep 17 00:00:00 2001 From: Vi-shub Date: Tue, 24 Mar 2026 00:58:44 +0530 Subject: [PATCH] [Flow] Fix potential division-by-zero crash in report_metrics.tcl - Added a protective check before calculating path_slack / path_delay percentage. - Prevents TCL fatal errors on designs with 0-delay critical paths. Signed-off-by: Vi-shub --- flow/scripts/report_metrics.tcl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flow/scripts/report_metrics.tcl b/flow/scripts/report_metrics.tcl index edfa501dd9..5accb72a34 100644 --- a/flow/scripts/report_metrics.tcl +++ b/flow/scripts/report_metrics.tcl @@ -224,7 +224,11 @@ proc report_metrics { stage when { include_erc true } { include_clock_skew true report_puts "\n==========================================================================" report_puts "$when slack div critical path delay" report_puts "--------------------------------------------------------------------------" - report_puts "[format "%4f" [expr $path_slack / $path_delay * 100]]" + if { $path_delay != 0.0 } { + report_puts "[format "%4f" [expr $path_slack / $path_delay * 100]]" + } else { + report_puts "N/A (0 delay)" + } } report_puts "\n=========================================================================="