Skip to content

Commit 6b6a848

Browse files
committed
Adjust interpretation of SYNTH_KEEP_MODULES
Only apply `SYNTH_KEEP_MODULES` when `SYNTH_HIERARCHICAL=1`. Also make this variable override the list of kept modules selected by the `SYNTH_MINIMUM_KEEP_SIZE` threshold. This is done to reduce user confusion. Signed-off-by: Martin Povišer <[email protected]>
1 parent 42a203d commit 6b6a848

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

flow/designs/asap7/swerv_wrapper/config.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
export DESIGN_NAME = swerv_wrapper
22
export PLATFORM = asap7
33

4+
export SYNTH_HIERARCHICAL = 1
5+
46
# SYNTH_KEEP_MODULES below is a captured list of kept modules
57
# with:
68
#

flow/scripts/synth.tcl

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

12-
if { [env_var_exists_and_non_empty SYNTH_KEEP_MODULES] } {
13-
foreach module $::env(SYNTH_KEEP_MODULES) {
14-
select -module $module
15-
setattr -mod -set keep_hierarchy 1
16-
select -clear
17-
}
18-
}
19-
2012
if { [env_var_exists_and_non_empty SYNTH_HIER_SEPARATOR] } {
2113
scratchpad -set flatten.separator $::env(SYNTH_HIER_SEPARATOR)
2214
}
@@ -37,7 +29,13 @@ if { ![env_var_equals SYNTH_HIERARCHICAL 1] } {
3729
# defer flattening until we have decided what hierarchy to keep
3830
synth -run :fine
3931

40-
if { [env_var_exists_and_non_empty SYNTH_MINIMUM_KEEP_SIZE] } {
32+
if { [env_var_exists_and_non_empty SYNTH_KEEP_MODULES] } {
33+
foreach module $::env(SYNTH_KEEP_MODULES) {
34+
select -module $module
35+
setattr -mod -set keep_hierarchy 1
36+
select -clear
37+
}
38+
} elseif { [env_var_exists_and_non_empty SYNTH_MINIMUM_KEEP_SIZE] } {
4139
set ungroup_threshold $::env(SYNTH_MINIMUM_KEEP_SIZE)
4240
puts "Keep modules above estimated size of $ungroup_threshold gate equivalents"
4341

flow/scripts/variables.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,8 @@ DONT_USE_LIBS:
702702
Set liberty files as `dont_use`.
703703
SYNTH_KEEP_MODULES:
704704
description: |
705-
Mark modules to keep from getting removed in flattening.
705+
Mark modules to keep from getting removed in flattening. This option applies
706+
when SYNTH_HIERARCHICAL is enabled.
706707
stages:
707708
- synth
708709
SYNTH_ARGS:

0 commit comments

Comments
 (0)