Skip to content

synth: strip src attributes again after techmap under SYNTH_REPEATABLE_BUILD - #4543

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:synth-strip-src-after-techmap
Sep 19, 2026
Merged

maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:synth-strip-src-after-techmap

Conversation

@oharboe

@oharboe oharboe commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

SYNTH_REPEATABLE_BUILD (#3797) strips src attributes in synth_canonicalize.tcl, but the techmap passes in synth.tcl re-attach them pointing into the techmap library, so 1_2_yosys.v still carries absolute build paths.

Strip them again before 1_2_yosys.v is written, under the same guard. Netlists from two Bazel output bases are now byte-identical.

…E_BUILD

SYNTH_REPEATABLE_BUILD strips src attributes in synth_canonicalize.tcl so
source paths and line numbers cannot perturb the canonical RTLIL hash.
The techmap passes that follow in synth.tcl re-attach src attributes,
now pointing into the techmap library files (ADDER_MAP_FILE,
LATCH_MAP_FILE, DFF_MAP_FILE and yosys' own techmap.v). Under Bazel
those live below the output base, so 1_2_yosys.v carries absolute build
paths: the same design synthesised in two output bases produced
netlists that differed only in those strings, defeating the knob's
purpose.

Strip src again, under the same guard, right before 1_2_yosys.v is
written. Verified on a hierarchical design synthesised in two Bazel
output bases: the netlists become byte-identical where they previously
differed only in src paths.

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 a check for the SYNTH_REPEATABLE_BUILD environment variable in flow/scripts/synth.tcl to strip src attributes and ensure repeatable builds. The review feedback correctly identifies that directly accessing the environment variable will cause a Tcl error if it is not defined, and suggests using the env_var_equals helper function to safely check its value.

Comment thread flow/scripts/synth.tcl
@oharboe
oharboe requested a review from maliberty September 18, 2026 09:17
@openroad-ci

Copy link
Copy Markdown
Member

🔍 QoR check

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

Commit cf9d04a · Jenkins build #1 · Baseline: build · View build on dashboard

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

@maliberty
maliberty merged commit 3a964e1 into The-OpenROAD-Project:master Sep 19, 2026
10 of 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