Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/user/FlowVariables.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ configuration file.
| <a name="SYNTH_HDL_FRONTEND"></a>SYNTH_HDL_FRONTEND| Select an alternative language frontend to ingest the design. Available option is "slang". If the variable is empty, design is read with the Yosys read_verilog command.| |
| <a name="SYNTH_HIERARCHICAL"></a>SYNTH_HIERARCHICAL| Enable to Synthesis hierarchically, otherwise considered flat synthesis.| 0|
| <a name="SYNTH_HIER_SEPARATOR"></a>SYNTH_HIER_SEPARATOR| Separator used for the synthesis flatten stage.| .|
| <a name="SYNTH_KEEP_MODULES"></a>SYNTH_KEEP_MODULES| Mark modules to keep from getting removed in flattening.| |
| <a name="SYNTH_KEEP_MODULES"></a>SYNTH_KEEP_MODULES| Mark modules to keep from getting removed in flattening. This option applies when SYNTH_HIERARCHICAL is enabled.| |
| <a name="SYNTH_MEMORY_MAX_BITS"></a>SYNTH_MEMORY_MAX_BITS| Maximum number of bits for memory synthesis.| 4096|
| <a name="SYNTH_MINIMUM_KEEP_SIZE"></a>SYNTH_MINIMUM_KEEP_SIZE| For hierarchical synthesis, we keep modules of larger area than given by this variable and flatten smaller modules. The area unit used is the size of a basic nand2 gate from the platform's standard cell library. The default value is platform specific.| 0|
| <a name="SYNTH_NETLIST_FILES"></a>SYNTH_NETLIST_FILES| Skips synthesis and uses the supplied netlist files. If the netlist files contains duplicate modules, which can happen when using hierarchical synthesis on indvidual netlist files and combining here, subsequent modules are silently ignored and only the first module is used.| |
Expand Down
2 changes: 2 additions & 0 deletions flow/designs/asap7/swerv_wrapper/config.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export DESIGN_NAME = swerv_wrapper
export PLATFORM = asap7

export SYNTH_HIERARCHICAL = 1

# SYNTH_KEEP_MODULES below is a captured list of kept modules
# with:
#
Expand Down
16 changes: 7 additions & 9 deletions flow/scripts/synth.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ if { [env_var_equals SYNTH_GUT 1] } {
delete $::env(DESIGN_NAME)/c:*
}

if { [env_var_exists_and_non_empty SYNTH_KEEP_MODULES] } {
foreach module $::env(SYNTH_KEEP_MODULES) {
select -module $module
setattr -mod -set keep_hierarchy 1
select -clear
}
}

if { [env_var_exists_and_non_empty SYNTH_HIER_SEPARATOR] } {
scratchpad -set flatten.separator $::env(SYNTH_HIER_SEPARATOR)
}
Expand All @@ -37,7 +29,13 @@ if { ![env_var_equals SYNTH_HIERARCHICAL 1] } {
# defer flattening until we have decided what hierarchy to keep
synth -run :fine

if { [env_var_exists_and_non_empty SYNTH_MINIMUM_KEEP_SIZE] } {
if { [env_var_exists_and_non_empty SYNTH_KEEP_MODULES] } {
foreach module $::env(SYNTH_KEEP_MODULES) {
select -module $module
setattr -mod -set keep_hierarchy 1
select -clear
}
} elseif { [env_var_exists_and_non_empty SYNTH_MINIMUM_KEEP_SIZE] } {
set ungroup_threshold $::env(SYNTH_MINIMUM_KEEP_SIZE)
puts "Keep modules above estimated size of $ungroup_threshold gate equivalents"

Expand Down
3 changes: 2 additions & 1 deletion flow/scripts/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,8 @@ DONT_USE_LIBS:
Set liberty files as `dont_use`.
SYNTH_KEEP_MODULES:
description: |
Mark modules to keep from getting removed in flattening.
Mark modules to keep from getting removed in flattening. This option applies
when SYNTH_HIERARCHICAL is enabled.
stages:
- synth
SYNTH_ARGS:
Expand Down