synth: single writer for 1_synth.sdc, fail hard on missing outputs#754
Merged
Conversation
1_synth.sdc had two writers in ORFS: yosys' synth.tcl copied the user's SDC_FILE into place (a pre-canonicalization leftover), then synth_odb.tcl overwrote it in place with the OpenSTA-canonicalized version. cp preserves mode bits, so with read-only inputs (bazel RBE) the copy is read-only and the canonicalization write fails; on writable local checkouts it only accidentally worked (see OpenROAD PR #10818, which papered over this with chmod +w). Carry the ORFS fix as patches/0037 until it lands upstream: synth.tcl/synth_preamble.tcl no longer produce 1_synth.sdc; synth_odb.tcl/synth_syn.tcl are its sole writers and write 1_synth.odb/.sdc unconditionally, since producing them is the do-1_synth contract (the WRITE_ODB_AND_SDC_EACH_STAGE=0 no-op silently left downstream stages consuming the stale raw copy). The vendored //:synth.tcl test fixture is updated to match. On the rules side, declare 1_synth.sdc with 1_synth.odb only when save_odb=True instead of as a yosys output, and stop touch-masking primary artifacts (1_2_yosys.v/.sdc, 1_synth.odb/.sdc) after make: a synth step that silently produces nothing used to yield empty files that flowed downstream (and let idempotency tests compare two empty files as "identical"); now bazel fails the action early with "declared output was not created". Logs, reports and mem.json remain touch-stubbed since the SYNTH_NETLIST_FILES path legitimately skips them. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This was referenced Jul 6, 2026
Collaborator
Author
|
@hzeller FYI |
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.
Root-cause fix for the read-only
1_synth.sdcfailure hzeller hit on RBE (OpenROAD PR #10818 worked around it withchmod +w).The bug
1_synth.sdchad two writers in ORFS:synth.tclcopied the user'sSDC_FILEinto place — a leftover from before SDC canonicalization existed ("One day a more sophisticated synthesis will write out a modified .sdc").synth_odb.tclthen overwrote it in place with the OpenSTA-canonicalized version (write_sdc -no_timestamp).cppreserves mode bits, so with read-only inputs (bazel RBE) the copy is read-only and the canonicalization write fails. On writable local checkouts it only accidentally worked.The fix
patches/0037 (carried until the identical fix lands in ORFS upstream, then dropped at the next bump):
synth.tcl/synth_preamble.tclno longer produce1_synth.sdc; the yosys stage's SDC output is1_2_yosys.sdc(raw copy), as before.synth_odb.tcl/synth_syn.tclare the sole writers of1_synth.sdc, and write1_synth.odb/.sdcunconditionally: producing them is thedo-1_synthcontract. TheWRITE_ODB_AND_SDC_EACH_STAGE=0no-op silently left downstream stages consuming the stale raw copy.rules.bzl (fail hard and early instead of festering):
1_synth.sdcis declared together with1_synth.odbonly whensave_odb=True, instead of as a yosys output. (save_odb=Falseusers only consume the1_2_yosys.voutput group.)1_2_yosys.v/.sdc,1_synth.odb/.sdc) after make: a synth step that silently produced nothing used to yield empty files that flowed downstream — and would let idempotency tests compare two empty files as "identical". Now bazel fails the action with "declared output was not created". Logs, reports andmem.jsonremain touch-stubbed since theSYNTH_NETLIST_FILESpath legitimately skips them.Testing
bazelisk test //test/...: 43 pass; 17 fail to build locally due to the pre-existing@scipglibc 2.41 compile issue (unrelated — real-OpenROAD targets; covered by CI).@orfsscripts contain a single1_synth.sdcwriter.Follow-ups after merge:
bazelisk run @bazel-orfs//:bumpin OpenROAD (unblocks the RBE tests, replaces #10818), and the same fix as an ORFS PR so patch 0037 can be dropped.🤖 Generated with Claude Code