Skip to content
Merged
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: 2 additions & 0 deletions docs/user/FlowVariables.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ configuration file.
| <a name="SWAP_ARITH_OPERATORS"></a>SWAP_ARITH_OPERATORS| Improve timing QoR by swapping ALU and MULT arithmetic operators.| 0|
| <a name="SYNTH_ARGS"></a>SYNTH_ARGS| Optional synthesis variables for yosys.| |
| <a name="SYNTH_BLACKBOXES"></a>SYNTH_BLACKBOXES| List of cells treated as a black box by Yosys. With Bazel, this can be used to run synthesis in parallel for the large modules of the design. Non-existant modules are ignored silently, useful when listing modules statically, even if modules come and go dynamically.| |
| <a name="SYNTH_BLACKBOXES_FILE"></a>SYNTH_BLACKBOXES_FILE| Path to a file with more modules to treat as black boxes, one name per line, added to SYNTH_BLACKBOXES. For a parallel synthesis whose list is too long for one environment variable: Linux caps one at 128 KiB.| |
| <a name="SYNTH_CANONICALIZE_TCL"></a>SYNTH_CANONICALIZE_TCL| Specifies a Tcl script with commands to run as part of the synth canonicalize step.| |
| <a name="SYNTH_CHECKPOINT"></a>SYNTH_CHECKPOINT| Path to a Yosys RTLIL checkpoint to read in place of the default canonicalization checkpoint at the start of synth.tcl. Intended for parallel synthesis flows that reuse a checkpoint taken after coarse synthesis and `keep_hierarchy` have already been decided, so each partition skips that common prefix. Leave unset for the normal flow.| |
| <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.| 0|
Expand Down Expand Up @@ -374,6 +375,7 @@ configuration file.
- [SKIP_REPORT_METRICS](#SKIP_REPORT_METRICS)
- [SYNTH_ARGS](#SYNTH_ARGS)
- [SYNTH_BLACKBOXES](#SYNTH_BLACKBOXES)
- [SYNTH_BLACKBOXES_FILE](#SYNTH_BLACKBOXES_FILE)
- [SYNTH_CANONICALIZE_TCL](#SYNTH_CANONICALIZE_TCL)
- [SYNTH_CHECKPOINT](#SYNTH_CHECKPOINT)
- [SYNTH_GUT](#SYNTH_GUT)
Expand Down
19 changes: 16 additions & 3 deletions flow/scripts/synth.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,23 @@ if { [env_var_exists_and_non_empty SYNTH_CHECKPOINT] } {
# the checkpoint. In synth_preamble.tcl a single design is being
# synthesised, so an unknown name is almost certainly a user typo and
# should fail loudly — `blackbox $m` without `catch` is intentional.
if { [env_var_exists_and_non_empty SYNTH_BLACKBOXES] } {
foreach m $::env(SYNTH_BLACKBOXES) {
catch { blackbox $m }
#
# An orchestrator with thousands of kept modules gives the list in a file
# instead, SYNTH_BLACKBOXES_FILE, one name per line: Linux caps one
# environment string at 128 KiB, and 2,250 names are 206 KB.
set synth_blackboxes [env_var_or_empty SYNTH_BLACKBOXES]
if { [env_var_exists_and_non_empty SYNTH_BLACKBOXES_FILE] } {
set fid [open $::env(SYNTH_BLACKBOXES_FILE) r]
while { [gets $fid line] >= 0 } {
set m [string trim $line]
if { $m ne "" } {
lappend synth_blackboxes $m
}
}
close $fid
}
Comment thread
oharboe marked this conversation as resolved.
Resolved
foreach m $synth_blackboxes {
catch { blackbox $m }
}

hierarchy -check -top $::env(DESIGN_NAME)
Expand Down
6 changes: 6 additions & 0 deletions flow/scripts/variables.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions flow/scripts/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,13 @@ SYNTH_BLACKBOXES:
statically, even if modules come and go dynamically.
stages:
- synth
SYNTH_BLACKBOXES_FILE:
description: >
Path to a file with more modules to treat as black boxes, one name per
line, added to SYNTH_BLACKBOXES. For a parallel synthesis whose list is
too long for one environment variable: Linux caps one at 128 KiB.
stages:
- synth
SYNTH_CHECKPOINT:
description: >
Path to a Yosys RTLIL checkpoint to read in place of the default
Expand Down