Skip to content

Commit 6fb19c9

Browse files
committed
synth: blackbox SYNTH_BLACKBOXES modules before hierarchy check
Adds a checkpoint-based code path for SYNTH_BLACKBOXES to synth.tcl and aligns the existing source-based path in synth_preamble.tcl so both flows behave identically. Use case: external orchestrators that drive parallel partition synthesis. Each partition loads the same canonical RTLIL checkpoint and blackboxes the modules that belong to other partitions, so it only synthesises its own subhierarchy. The same SYNTH_BLACKBOXES list is reused across partitions, so unknown names are skipped silently with `catch { blackbox $m }` instead of erroring. In synth_preamble.tcl the verilog-frontend path is reordered to blackbox before `hierarchy -check -top` (matching the new synth.tcl path) and to use `catch` (matching the slang and synth.tcl paths). SYNTH_BLACKBOXES is already documented in variables.yaml. No behaviour change when the env var is unset. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 523bbbb commit 6fb19c9

2 files changed

Lines changed: 14 additions & 2 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/synth_preamble.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ proc read_design_sources { } {
127127
}
128128

129129
if { [env_var_exists_and_non_empty SYNTH_BLACKBOXES] } {
130-
hierarchy -check -top $::env(DESIGN_NAME)
131130
foreach m $::env(SYNTH_BLACKBOXES) {
132-
blackbox $m
131+
catch { blackbox $m }
133132
}
133+
hierarchy -check -top $::env(DESIGN_NAME)
134134
}
135135
} else {
136136
error "Unrecognized HDL frontend: $::env(SYNTH_HDL_FRONTEND)"

0 commit comments

Comments
 (0)