Skip to content

Commit d8d5492

Browse files
committed
synthesis: keep memory information on hierarchical synthesis
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent defc349 commit d8d5492

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

flow/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,9 @@ do-synth-report:
461461

462462
.PHONY: memory
463463
memory:
464+
if [ -f $(RESULTS_DIR)/mem_hierarchical.json ]; then \
465+
python3 $(SCRIPTS_DIR)/mem_dump.py $(RESULTS_DIR)/mem_hierarchical.json; \
466+
fi
464467
python3 $(SCRIPTS_DIR)/mem_dump.py $(RESULTS_DIR)/mem.json
465468

466469
# ==============================================================================
@@ -516,7 +519,7 @@ $(RESULTS_DIR)/1_synth.v: $(RESULTS_DIR)/1_1_yosys.v
516519

517520
.PHONY: clean_synth
518521
clean_synth:
519-
rm -f $(RESULTS_DIR)/1_* $(RESULTS_DIR)/mem.json
522+
rm -f $(RESULTS_DIR)/1_* $(RESULTS_DIR)/mem*.json
520523
rm -f $(REPORTS_DIR)/synth_*
521524
rm -f $(LOG_DIR)/1_*
522525
rm -f $(SYNTH_STOP_MODULE_SCRIPT)

flow/scripts/synth.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if { [env_var_equals SYNTH_GUT 1] } {
99
delete $::env(DESIGN_NAME)/c:*
1010
}
1111

12-
synthesize_check $::env(SYNTH_FULL_ARGS)
12+
synthesize_check mem $::env(SYNTH_FULL_ARGS)
1313

1414
# rename registers to have the verilog register name in its name
1515
# of the form \regName$_DFF_P_. We should fix yosys to make it the reg name.

flow/scripts/synth_hier_report.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ proc write_keep_hierarchy {} {
99

1010
source $::env(SCRIPTS_DIR)/synth_preamble.tcl
1111

12-
synthesize_check {}
12+
synthesize_check mem_hierarchical {}
1313

1414
if { [env_var_exists_and_non_empty ADDER_MAP_FILE] && [file isfile $::env(ADDER_MAP_FILE)] } {
1515
techmap -map $::env(ADDER_MAP_FILE)

flow/scripts/synth_preamble.tcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ puts $constr "set_driving_cell $::env(ABC_DRIVER_CELL)"
107107
puts $constr "set_load $::env(ABC_LOAD_IN_FF)"
108108
close $constr
109109

110-
proc synthesize_check {synth_args} {
110+
proc synthesize_check {report synth_args} {
111111
# Generic synthesis
112112
log_cmd synth -top $::env(DESIGN_NAME) -run :fine {*}$synth_args
113-
json -o $::env(RESULTS_DIR)/mem.json
113+
json -o $::env(RESULTS_DIR)/$report.json
114114
# Run report and check here so as to fail early if this synthesis run is doomed
115-
exec -- python3 $::env(SCRIPTS_DIR)/mem_dump.py --max-bits $::env(SYNTH_MEMORY_MAX_BITS) $::env(RESULTS_DIR)/mem.json
115+
exec -- python3 $::env(SCRIPTS_DIR)/mem_dump.py --max-bits $::env(SYNTH_MEMORY_MAX_BITS) $::env(RESULTS_DIR)/$report.json
116116
synth -top $::env(DESIGN_NAME) -run fine: {*}$synth_args
117117
# Get rid of indigestibles
118118
chformal -remove

0 commit comments

Comments
 (0)