Skip to content

Commit b81e030

Browse files
authored
Merge pull request #3253 from antmicro/mgan/custom-hier-separator
Allow user to specify a custom hierarchy separator for the synthesis `flatten` pass
2 parents 048202f + eb2162f commit b81e030

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

docs/user/FlowVariables.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ configuration file.
223223
| <a name="SYNTH_GUT"></a>SYNTH_GUT| Load design and remove all internal logic before doing synthesis. This is useful when creating a mock .lef abstract that has a smaller area than the amount of logic would allow. bazel-orfs uses this to mock SRAMs, for instance.| | |
224224
| <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.| | |
225225
| <a name="SYNTH_HIERARCHICAL"></a>SYNTH_HIERARCHICAL| Enable to Synthesis hierarchically, otherwise considered flat synthesis.| 0| |
226+
| <a name="SYNTH_HIER_SEPARATOR"></a>SYNTH_HIER_SEPARATOR| Separator used for the synthesis flatten stage.| .| |
226227
| <a name="SYNTH_KEEP_MODULES"></a>SYNTH_KEEP_MODULES| Mark modules to keep from getting removed in flattening.| | |
227228
| <a name="SYNTH_MEMORY_MAX_BITS"></a>SYNTH_MEMORY_MAX_BITS| Maximum number of bits for memory synthesis.| 4096| |
228229
| <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| |
@@ -464,6 +465,7 @@ configuration file.
464465
- [SET_RC_TCL](#SET_RC_TCL)
465466
- [SLEW_MARGIN](#SLEW_MARGIN)
466467
- [SYNTH_ARGS](#SYNTH_ARGS)
468+
- [SYNTH_HIER_SEPARATOR](#SYNTH_HIER_SEPARATOR)
467469
- [TAP_CELL_NAME](#TAP_CELL_NAME)
468470
- [TECH_LEF](#TECH_LEF)
469471
- [USE_FILL](#USE_FILL)

flow/scripts/synth.tcl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ if {[env_var_exists_and_non_empty SYNTH_KEEP_MODULES]} {
1717
}
1818
}
1919

20+
if {[env_var_exists_and_non_empty SYNTH_HIER_SEPARATOR]} {
21+
scratchpad -set flatten.separator $::env(SYNTH_HIER_SEPARATOR)
22+
}
23+
2024
set synth_full_args $::env(SYNTH_ARGS)
2125
if {[env_var_exists_and_non_empty SYNTH_OPERATIONS_ARGS]} {
2226
set synth_full_args [concat $synth_full_args $::env(SYNTH_OPERATIONS_ARGS)]

flow/scripts/variables.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,10 @@ SYNTH_ARGS:
684684
description: |
685685
Optional synthesis variables for yosys.
686686
default: -flatten
687+
SYNTH_HIER_SEPARATOR:
688+
description: |
689+
Separator used for the synthesis flatten stage.
690+
default: .
687691
VERILOG_TOP_PARAMS:
688692
description: |
689693
Apply toplevel params (if exist).

0 commit comments

Comments
 (0)