From 21b93ee1fb36c25d240ea1146c3f4b7d9239881c Mon Sep 17 00:00:00 2001 From: clemens Date: Tue, 15 Apr 2025 09:38:04 +0200 Subject: [PATCH 1/3] fix sequential area not being included in addition/multiplication Fixes a bug where the sequential area isn't part of the Stat_numeric_members that are used to automatically add/mul the statdata_t members. --- passes/cmds/stat.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/passes/cmds/stat.cc b/passes/cmds/stat.cc index 7e51b6cb1..d68eda70a 100644 --- a/passes/cmds/stat.cc +++ b/passes/cmds/stat.cc @@ -40,7 +40,7 @@ struct statdata_t X(num_ports) X(num_port_bits) X(num_memories) X(num_memory_bits) X(num_cells) \ X(num_processes) - #define STAT_NUMERIC_MEMBERS STAT_INT_MEMBERS X(area) + #define STAT_NUMERIC_MEMBERS STAT_INT_MEMBERS X(area) X(sequential_area) #define X(_name) unsigned int _name; STAT_INT_MEMBERS From 01d80c74038dfb727e2ee19af53b813c4de364ef Mon Sep 17 00:00:00 2001 From: clemens Date: Sat, 19 Apr 2025 20:41:10 +0200 Subject: [PATCH 2/3] add testcase --- tests/various/stat.ys | 49 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/tests/various/stat.ys b/tests/various/stat.ys index ad96fe8d4..7c8700494 100644 --- a/tests/various/stat.ys +++ b/tests/various/stat.ys @@ -1,4 +1,4 @@ -read_rtlil << EOF +read_rtlil << EOT module \top wire input 1 \A wire output 2 \Y @@ -8,7 +8,52 @@ module \top connect \Y \Y end end -EOF +EOT logger -expect log "Chip area for module '\\top': 9.072000" 1 logger -expect-no-warnings stat -liberty ../../tests/liberty/foundry_data/sg13g2_stdcell_typ_1p20V_25C.lib.filtered.gz + + +design -reset +read_rtlil < Date: Sun, 20 Apr 2025 16:44:22 +0200 Subject: [PATCH 3/3] create testcase to check correct addition of areas. --- tests/various/stat.ys | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/tests/various/stat.ys b/tests/various/stat.ys index 7c8700494..cf084a986 100644 --- a/tests/various/stat.ys +++ b/tests/various/stat.ys @@ -15,20 +15,35 @@ stat -liberty ../../tests/liberty/foundry_data/sg13g2_stdcell_typ_1p20V_25C.lib. design -reset -read_rtlil <