Skip to content

Commit 970de8f

Browse files
committed
synth: blackbox SYNTH_BLACKBOXES modules before hierarchy check
Adds an optional SYNTH_BLACKBOXES env var that, when set, blackboxes the listed modules before `hierarchy -check`. Intended for external orchestrators that drive parallel partition synthesis: every partition loads the same canonical RTLIL checkpoint, then blackboxes the modules that belong to other partitions so it only synthesises its own subhierarchy. Names not present in the loaded design are skipped silently, so the same list can be reused across partitions without per-partition filtering. No behaviour change when the env var is unset.
1 parent 523bbbb commit 970de8f

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

flow/scripts/synth.tcl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ if { [env_var_exists_and_non_empty SYNTH_CHECKPOINT] } {
3838
read_checkpoint $::env(RESULTS_DIR)/1_1_yosys_canonicalize.rtlil
3939
}
4040

41+
# When this synthesis run is one partition of a parallel split (driven by
42+
# an external orchestrator), `SYNTH_BLACKBOXES` lists modules outside this
43+
# partition. Blackboxing them before the hierarchy check lets each
44+
# partition load the same canonical RTLIL checkpoint while only synthesising
45+
# its own subhierarchy. Names not present in the loaded design are skipped
46+
# silently so the same list can be passed to every partition.
47+
if { [env_var_exists_and_non_empty SYNTH_BLACKBOXES] } {
48+
foreach m $::env(SYNTH_BLACKBOXES) {
49+
catch {blackbox $m}
50+
}
51+
}
52+
4153
hierarchy -check -top $::env(DESIGN_NAME)
4254

4355
if { $::env(SYNTH_GUT) } {

flow/scripts/variables.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,17 @@ SYNTH_KEEP_MODULES:
983983
Mark modules to keep from getting removed in flattening.
984984
stages:
985985
- synth
986+
SYNTH_BLACKBOXES:
987+
description: |
988+
Space-separated list of module names to blackbox before the hierarchy
989+
check. Used by external orchestrators that drive parallel partition
990+
synthesis: each partition loads the shared canonical RTLIL checkpoint
991+
and blackboxes the modules that belong to other partitions, so it only
992+
synthesises its own subhierarchy. Names not present in the loaded
993+
design are skipped silently, so the same list can be reused across
994+
partitions.
995+
stages:
996+
- synth
986997
SYNTH_ARGS:
987998
description: |
988999
Optional synthesis variables for yosys.

0 commit comments

Comments
 (0)