Skip to content

Commit eb2162f

Browse files
committed
synth: allow user to specify custom hier separator for flatten stage
Signed-off-by: Mateusz Gancarz <[email protected]>
1 parent edf3d6b commit eb2162f

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
@@ -187,6 +187,7 @@ configuration file.
187187
| <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.| | |
188188
| <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.| | |
189189
| <a name="SYNTH_HIERARCHICAL"></a>SYNTH_HIERARCHICAL| Enable to Synthesis hierarchically, otherwise considered flat synthesis.| 0| |
190+
| <a name="SYNTH_HIER_SEPARATOR"></a>SYNTH_HIER_SEPARATOR| Separator used for the synthesis flatten stage.| .| |
190191
| <a name="SYNTH_KEEP_MODULES"></a>SYNTH_KEEP_MODULES| Mark modules to keep from getting removed in flattening.| | |
191192
| <a name="SYNTH_MEMORY_MAX_BITS"></a>SYNTH_MEMORY_MAX_BITS| Maximum number of bits for memory synthesis.| 4096| |
192193
| <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| |
@@ -430,6 +431,7 @@ configuration file.
430431
- [SET_RC_TCL](#SET_RC_TCL)
431432
- [SLEW_MARGIN](#SLEW_MARGIN)
432433
- [SYNTH_ARGS](#SYNTH_ARGS)
434+
- [SYNTH_HIER_SEPARATOR](#SYNTH_HIER_SEPARATOR)
433435
- [TAP_CELL_NAME](#TAP_CELL_NAME)
434436
- [TECH_LEF](#TECH_LEF)
435437
- [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
@@ -677,6 +677,10 @@ SYNTH_ARGS:
677677
description: |
678678
Optional synthesis variables for yosys.
679679
default: -flatten
680+
SYNTH_HIER_SEPARATOR:
681+
description: |
682+
Separator used for the synthesis flatten stage.
683+
default: .
680684
VERILOG_TOP_PARAMS:
681685
description: |
682686
Apply toplevel params (if exist).

0 commit comments

Comments
 (0)