From eddefa79eefa16bb675513dfe06a7b1464e9c7f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Thu, 2 Apr 2026 06:42:31 +0200 Subject: [PATCH 1/2] fix: use stat -hierarchy for hierarchical synth to report area MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When SYNTH_HIERARCHICAL=1, the yosys stat command reports zero area for the top module because all cells are in submodules. Adding -hierarchy makes stat include submodule area, so synth__design__instance__area__stdcell is no longer N/A. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Øyvind Harboe --- flow/scripts/synth.tcl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flow/scripts/synth.tcl b/flow/scripts/synth.tcl index 8554f6d61c..bc1a4db0d1 100644 --- a/flow/scripts/synth.tcl +++ b/flow/scripts/synth.tcl @@ -226,7 +226,11 @@ if { $::env(SYNTH_INSBUF) } { # Reports tee -o $::env(REPORTS_DIR)/synth_check.txt check -tee -o $::env(REPORTS_DIR)/synth_stat.txt stat {*}$lib_args +if { $::env(SYNTH_HIERARCHICAL) } { + tee -o $::env(REPORTS_DIR)/synth_stat.txt stat -hierarchy {*}$lib_args +} else { + tee -o $::env(REPORTS_DIR)/synth_stat.txt stat {*}$lib_args +} # check the design is composed exclusively of target cells, and # check for other problems From 658cd90905d39cb94d6b852788db0774873e636a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Tue, 7 Apr 2026 21:37:42 +0200 Subject: [PATCH 2/2] fix: always use stat -hierarchy for synth area reporting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no harm in always using -hierarchy flag. It reports the same results for flat designs and correctly includes submodule area for hierarchical designs. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Øyvind Harboe --- flow/scripts/synth.tcl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/flow/scripts/synth.tcl b/flow/scripts/synth.tcl index bc1a4db0d1..6d444a7174 100644 --- a/flow/scripts/synth.tcl +++ b/flow/scripts/synth.tcl @@ -226,11 +226,7 @@ if { $::env(SYNTH_INSBUF) } { # Reports tee -o $::env(REPORTS_DIR)/synth_check.txt check -if { $::env(SYNTH_HIERARCHICAL) } { - tee -o $::env(REPORTS_DIR)/synth_stat.txt stat -hierarchy {*}$lib_args -} else { - tee -o $::env(REPORTS_DIR)/synth_stat.txt stat {*}$lib_args -} +tee -o $::env(REPORTS_DIR)/synth_stat.txt stat -hierarchy {*}$lib_args # check the design is composed exclusively of target cells, and # check for other problems