From 6ccadbebf00453a3809d7fed68761fe8607f4370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Wed, 6 May 2026 05:29:22 +0200 Subject: [PATCH] synth: blackbox SYNTH_BLACKBOXES modules before hierarchy check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Øyvind Harboe --- flow/scripts/synth.tcl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flow/scripts/synth.tcl b/flow/scripts/synth.tcl index 1c9e548c5d..20eae1ed23 100644 --- a/flow/scripts/synth.tcl +++ b/flow/scripts/synth.tcl @@ -38,6 +38,18 @@ if { [env_var_exists_and_non_empty SYNTH_CHECKPOINT] } { read_checkpoint $::env(RESULTS_DIR)/1_1_yosys_canonicalize.rtlil } +# When this synthesis run is one partition of a parallel split (driven by +# an external orchestrator), `SYNTH_BLACKBOXES` lists modules outside this +# partition. Blackboxing them before the hierarchy check lets each +# partition load the same canonical RTLIL checkpoint while only synthesising +# its own subhierarchy. Names not present in the loaded design are skipped +# silently so the same list can be passed to every partition. +if { [env_var_exists_and_non_empty SYNTH_BLACKBOXES] } { + foreach m $::env(SYNTH_BLACKBOXES) { + catch { blackbox $m } + } +} + hierarchy -check -top $::env(DESIGN_NAME) if { $::env(SYNTH_GUT) } {