Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the SYNTH_BLACKBOXES environment variable to support parallel partition synthesis by blackboxing modules before the hierarchy check. Feedback points out that SYNTH_BLACKBOXES is already defined in variables.yaml, leading to a duplicate entry. Furthermore, the implementation in synth.tcl is inconsistent with synth_preamble.tcl regarding error handling and execution order relative to the hierarchy check, requiring alignment for consistent behavior.
| SYNTH_BLACKBOXES: | ||
| description: | | ||
| Space-separated list of module names to blackbox before the hierarchy | ||
| check. Used by external orchestrators that drive parallel partition | ||
| synthesis: each partition loads the shared canonical RTLIL checkpoint | ||
| and 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. | ||
| stages: | ||
| - synth |
There was a problem hiding this comment.
The variable SYNTH_BLACKBOXES is already defined at line 251 of this file. Adding it again here creates a duplicate entry in the YAML configuration, which can lead to parsing errors or confusion. Please merge any improvements to the description into the existing definition at line 251 and remove this duplicate block.
| if { [env_var_exists_and_non_empty SYNTH_BLACKBOXES] } { | ||
| foreach m $::env(SYNTH_BLACKBOXES) { | ||
| catch {blackbox $m} | ||
| } | ||
| } |
There was a problem hiding this comment.
The implementation of SYNTH_BLACKBOXES logic here is inconsistent with the implementation in flow/scripts/synth_preamble.tcl (lines 129-134).
- This block uses
catch {blackbox $m}to silently skip missing modules, whereassynth_preamble.tclcallsblackbox $mdirectly, which would cause a Tcl error if a listed module is not found in the design. - This block runs before
hierarchy -check, while the one insynth_preamble.tclruns after it.
To ensure consistent behavior between the source-based flow and the checkpoint-based flow, these implementations should be aligned. The "before" order and the use of catch are generally more robust for the intended use case of parallel partition synthesis where the list of modules might be shared across partitions.
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 <oyvind.harboe@zylin.com>
970de8f to
6ccadbe
Compare
|
Closing — after running the numbers on a real partition synth (8-slice ProcessingUnit, 46 partitions): the shared-canonicalize optimization that bazel-orfs is built around saves only ~5% total CPU and 0-2% wall time, because slang's |
|
Reopening — measured the cost on a real partition synth (8-slice ProcessingUnit, 46 partitions; data in the previous comment). Per-partition canonicalize from a bare top doesn't actually work without a brittle rename pass: slang elaborates parameterized modules to mangled names like Also addressed Gemini's consistency feedback by aligning the existing |
Summary
Adds an optional
SYNTH_BLACKBOXESenv var that, when set, blackboxes the listed modules beforehierarchy -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 (
catch {blackbox $m}), so the same list can be reused across all partitions without per-partition filtering. No behaviour change when the env var is unset.This block is currently carried as a vendored modification of
synth.tclinbazel-orfs. Upstreaming it letsbazel-orfsdrop the vendored copy and sourceflow/scripts/synth.tcldirectly from ORFS.Test plan
SYNTH_BLACKBOXESis unset (theifblock is skipped)