Skip to content

Commit f4e241a

Browse files
authored
Merge pull request #2537 from Pinata-Consulting/synth-stats-naming
synthesis: simpler more consistent naming for gathering statistics
2 parents 38b66e0 + 08a8f86 commit f4e241a

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

flow/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ include $(PLATFORM_DIR)/config.mk
181181
# Enables hierarchical yosys
182182
export SYNTH_HIERARCHICAL ?= 0
183183
export SYNTH_STATS = $(RESULTS_DIR)/synth_stats.txt
184-
export HIER_REPORT_SCRIPT = $(SCRIPTS_DIR)/synth_hier_report.tcl
184+
export SYNTH_STATS_SCRIPT = $(SCRIPTS_DIR)/synth_stats.tcl
185185
export MAX_UNGROUP_SIZE ?= 0
186186

187187
# Enables Re-synthesis for area reclaim
@@ -475,11 +475,11 @@ memory:
475475
export SYNTH_SCRIPT ?= $(SCRIPTS_DIR)/synth.tcl
476476
export SYNTH_MEMORY_MAX_BITS ?= 4096
477477

478-
.PHONY: do-yosys-keep-hierarchy
479-
do-yosys-keep-hierarchy:
478+
.PHONY: do-yosys-stats
479+
do-yosys-stats:
480480
mkdir -p $(RESULTS_DIR) $(LOG_DIR) $(REPORTS_DIR)
481481
(export VERILOG_FILES=$(RESULTS_DIR)/1_synth.rtlil; \
482-
$(TIME_CMD) $(YOSYS_EXE) $(YOSYS_FLAGS) -c $(HIER_REPORT_SCRIPT)) 2>&1 | tee $(abspath $(LOG_DIR)/1_1_yosys_hier_report.log)
482+
$(TIME_CMD) $(YOSYS_EXE) $(YOSYS_FLAGS) -c $(SYNTH_STATS_SCRIPT)) 2>&1 | tee $(abspath $(LOG_DIR)/1_1_yosys_stats.log)
483483

484484
export SDC_FILE_CLOCK_PERIOD = $(RESULTS_DIR)/clock_period.txt
485485

@@ -507,7 +507,7 @@ $(RESULTS_DIR)/1_synth.rtlil: $(YOSYS_DEPENDENCIES)
507507
$(UNSET_AND_MAKE) do-yosys-canonicalize
508508

509509
$(RESULTS_DIR)/1_1_yosys.v: $(RESULTS_DIR)/1_synth.rtlil
510-
$(UNSET_AND_MAKE) do-yosys-keep-hierarchy do-yosys
510+
$(UNSET_AND_MAKE) do-yosys-stats do-yosys
511511

512512
.PHONY: do-synth
513513
do-synth:
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Gather statistics, if needed. Gathering the statistics is
2+
# time consuming, because it requires a full synthesis run.
3+
#
4+
# The statistics is needed for SYNTH_HIERARCHICAL=1 flattening/keep
5+
# module policy, and write to $::env(SYNTH_STATS)
16
source $::env(SCRIPTS_DIR)/util.tcl
27

38
proc write_keep_hierarchy {} {
@@ -51,8 +56,8 @@ proc write_keep_hierarchy {} {
5156

5257
set areas {}
5358
foreach module $module_list {
54-
tee -o $::env(OBJECTS_DIR)/synth_hier_stat_temp_module.txt stat -top "$module" {*}$stat_libs
55-
set fptr1 [open $::env(OBJECTS_DIR)/synth_hier_stat_temp_module.txt r]
59+
tee -o $::env(OBJECTS_DIR)/synth_stat_temp_module.txt stat -top "$module" {*}$stat_libs
60+
set fptr1 [open $::env(OBJECTS_DIR)/synth_stat_temp_module.txt r]
5661
set contents1 [read -nonewline $fptr1]
5762
close $fptr1
5863
set split_cont1 [split $contents1 "\n"]
@@ -61,7 +66,7 @@ proc write_keep_hierarchy {} {
6166
lappend areas "$area $module_name"
6267
}
6368
}
64-
file delete -force $::env(OBJECTS_DIR)/synth_hier_stat_temp_module.txt
69+
file delete -force $::env(OBJECTS_DIR)/synth_stat_temp_module.txt
6570
}
6671
set areas [lsort -index 0 -real $areas]
6772

0 commit comments

Comments
 (0)