Skip to content

Commit 3212c2c

Browse files
authored
Merge pull request #4212 from oharboe/synth-blackboxes-for-parallel-partition
synth: blackbox SYNTH_BLACKBOXES modules before hierarchy check
2 parents 3dce40a + 269cfcb commit 3212c2c

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

‎flow/scripts/synth.tcl‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,32 @@ 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+
#
48+
# This deliberately differs from the SYNTH_BLACKBOXES handling in
49+
# synth_preamble.tcl's `read_design_sources`, and the difference is correct
50+
# in both places — do not "harmonise" the two:
51+
# * Order: here the design is already elaborated (read from RTLIL), so
52+
# `blackbox` operates on resolved modules and must run before the
53+
# hierarchy check. In synth_preamble.tcl the verilog frontend uses
54+
# `read_verilog -defer`, so `hierarchy -check -top` must run first to
55+
# elaborate from the top before `blackbox` sees a populated module table.
56+
# * Catch: here a missing name is expected because the same list is
57+
# reused across partitions, and only this partition's portion exists in
58+
# the checkpoint. In synth_preamble.tcl a single design is being
59+
# synthesised, so an unknown name is almost certainly a user typo and
60+
# should fail loudly — `blackbox $m` without `catch` is intentional.
61+
if { [env_var_exists_and_non_empty SYNTH_BLACKBOXES] } {
62+
foreach m $::env(SYNTH_BLACKBOXES) {
63+
catch { blackbox $m }
64+
}
65+
}
66+
4167
hierarchy -check -top $::env(DESIGN_NAME)
4268

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

0 commit comments

Comments
 (0)