Skip to content

synth: a partition can read its blackbox list from a file, for lists over Linux's 128 KiB - #4798

Merged
maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
oharboe:synth-blackboxes-file
Nov 6, 2026
Merged

maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
oharboe:synth-blackboxes-file

Conversation

@oharboe

@oharboe oharboe commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

A parallel synthesis of XiangShan's XSTile with 2,250 kept modules fails on every partition before yosys starts:

synth.sh: Argument list too long

Each partition gets the other partitions' modules to blackbox in SYNTH_BLACKBOXES, one environment variable. Here that's 206 KB of names, and Linux caps one environment string at 128 KiB (MAX_ARG_STRLEN), so execve fails with E2BIG on any machine.

SYNTH_BLACKBOXES_FILE names a file with more modules to blackbox, one per line, added to SYNTH_BLACKBOXES. Nothing changes for flows that don't set it.

  • flow/scripts/synth.tcl: reads the file before the hierarchy check, next to SYNTH_BLACKBOXES, with the same silent skip of names not in the checkpoint.
  • variables.yaml, with FlowVariables.md and variables.json regenerated.

Tested in bazel-orfs, whose partition synthesis is the orchestrator that sets these: The-OpenROAD-Project/bazel-orfs#1536 carries this change. Its test requires each kept module of a two-partition design to be defined exactly once in the merged netlist. It fails without this change, because each partition then synthesises the other partition's module too, and passes with it. The same PR checks a 2,250-name list through the partition script.

🤖 Generated with Claude Code

A partition of a parallel synthesis takes the modules to blackbox in
SYNTH_BLACKBOXES, one environment variable. Linux caps one environment
string at 128 KiB (MAX_ARG_STRLEN): XiangShan's XSTile, synthesised with
2,250 kept modules, is 206 KB of names, and starting synthesis fails with
"Argument list too long" on every partition.

SYNTH_BLACKBOXES_FILE names a file with more modules to blackbox, one per
line, added to SYNTH_BLACKBOXES.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the SYNTH_BLACKBOXES_FILE configuration option, allowing users to specify black-box modules via an external file to circumvent environment variable length limitations. The implementation updates the documentation, variable definitions, and the synth.tcl script. The reviewer provided an improvement suggestion for the file-reading logic in synth.tcl, recommending the use of 'gets' for better robustness against line endings and whitespace.

Comment thread flow/scripts/synth.tcl Resolved
A CRLF line or stray spaces would have made a name that blackbox then
skipped silently.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe marked this pull request as ready for review November 6, 2026 10:10
@openroad-ci

openroad-ci commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch.

Commit 8c9ef1e · Jenkins build #2 · Baseline: build · View build on dashboard

62 design(s) checked — 0 with regression(s), 0 without a comparable baseline.

@oharboe
oharboe requested a review from maliberty November 6, 2026 12:16
@maliberty
maliberty merged commit c5310d7 into The-OpenROAD-Project:master Nov 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants