synth: strip src attributes again after techmap under SYNTH_REPEATABLE_BUILD - #4543
Merged
maliberty merged 1 commit intoSep 19, 2026
Conversation
…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>
Contributor
There was a problem hiding this comment.
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.
Member
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 0 with regression(s), 1 without a comparable baseline. |
maliberty
approved these changes
Sep 19, 2026
maliberty
merged commit Sep 19, 2026
3a964e1
into
The-OpenROAD-Project:master
10 of 12 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SYNTH_REPEATABLE_BUILD (#3797) strips
srcattributes insynth_canonicalize.tcl, but thetechmappasses insynth.tclre-attach them pointing into the techmap library, so1_2_yosys.vstill carries absolute build paths.Strip them again before
1_2_yosys.vis written, under the same guard. Netlists from two Bazel output bases are now byte-identical.