Repository navigation
Write 3_place.sdc and 6_final.sdc from their stage scripts - #4353
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the build flow to write SDC constraints directly during the detailed placement and final report steps, rather than copying them from previous steps. Feedback on the Makefile changes highlights that the new recipe-less rules for 3_place.sdc and 6_final.sdc may fail to regenerate these files if they are deleted while their prerequisites are up-to-date. It is recommended to add recipes to handle these cases and ensure build robustness.
place and final were the only stages whose SDC was produced by a Makefile do-copy of a prior stage's file (3_place.sdc <- 2_floorplan.sdc, 6_final.sdc <- 5_route.sdc) rather than written by the stage script itself. Every other stage self-writes its SDC via orfs_write_sdc (synth, floorplan, cts, grt), and the single-process flow.tcl already wrote 3_place.sdc / 6_final.sdc directly. Retire the copy-forward special case so SDC production is uniform and co-located with the .odb write, mirroring how synth writes 1_synth.sdc alongside 1_synth.odb. - detail_place.tcl writes 3_place.sdc after 3_5_place_dp.odb - final_report.tcl writes 6_final.sdc after 6_final.odb (after the orfs_* procs are in scope, i.e. after final_connect.tcl) - Makefile: drop the two do-copy .sdc recipes; tie each aggregate .sdc to the step that now writes it via a recipe-less order rule (3_place.sdc: 3_5_place_dp.odb ; 6_final.sdc: 6_report.log), the same shape as the existing 1_synth.sdc: 1_synth.odb rule - flow.tcl: move the single-process 6_final.sdc write to just after the 6_final.odb write so both flows write it from identical design state, preserving the final-stage byte-equivalence invariant Constraints do not change during placement or finishing, so the serialized SDC is unchanged: on nangate45/gcd the new 3_place.sdc and 6_final.sdc are byte-identical (constraints) to the files the do-copy previously produced. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
The recipe-less .sdc order rules relied on the .sdc being produced as a side-effect of building the prerequisite .odb/.log. If the .sdc alone is deleted while the prerequisite is up-to-date, GNU Make runs no recipe and leaves it missing, so downstream steps (e.g. CTS reading 3_place.sdc) fail. Add a recovery recipe that removes and rebuilds the prerequisite when the target is absent, forcing the side-effect .sdc to regenerate. Addresses gemini-code-assist review feedback on The-OpenROAD-Project#4353. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
|
/gemini review |
47c6275 to
3173fd8
Compare
There was a problem hiding this comment.
Code Review
This pull request updates the flow to write SDC constraints directly during the detail placement and final report steps, rather than copying them from previous steps. It also introduces Makefile rules to regenerate these SDC files if they are deleted while their corresponding target files are up-to-date. The feedback suggests replacing raw
I am having trouble creating individual review comments. Click here to see my feedback.
flow/Makefile (484-485)
Using raw $(MAKE) directly bypasses the UNSET_VARS environment cleanup and command-line argument escaping/forwarding logic defined in UNSET_AND_MAKE and SUB_MAKE. This can lead to subtle bugs or environment contamination, especially in hierarchical or containerized/sandboxed flows. Please use $(UNSET_AND_MAKE) instead.
$(RESULTS_DIR)/3_place.sdc: $(RESULTS_DIR)/3_5_place_dp.odb
@if [ ! -f $@ ]; then rm -f $<; $(UNSET_AND_MAKE) $<; fi
flow/Makefile (628-629)
Using raw $(MAKE) directly bypasses the UNSET_VARS environment cleanup and command-line argument escaping/forwarding logic defined in UNSET_AND_MAKE and SUB_MAKE. This can lead to subtle bugs or environment contamination, especially in hierarchical or containerized/sandboxed flows. Please use $(UNSET_AND_MAKE) instead.
$(RESULTS_DIR)/6_final.sdc: $(LOG_DIR)/6_report.log
@if [ ! -f $@ ]; then rm -f $<; $(UNSET_AND_MAKE) $<; fi
|
@gemini-code-assist Thanks — but we're intentionally leaving the recipe-less There's no such thing as a perfectly-correct Makefile. Bazel covers every base — missing-output recovery included — but that completeness comes at a real cognitive cost. Make doesn't cover every base, and we accept that: the payoff is that a reader can follow it. Congruence with the surrounding rules and lower cognitive load win here over guarding a pathological hand-deletion. |
|
That is a fair point, and I agree with your assessment. Prioritizing the readability and consistency of the |
|
@maliberty Gemini didn't like its own suggestions (it failed above to apply them as comments on a second pass). Funny. Gemini(any LLM) is prone to fuzzing: pass in a modified PR and you get a different result, hence you can't get all review comments on first try, you have to hope that it converges... |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the flow to write SDC files directly during the detailed placement and final report steps instead of copying them from previous steps in the Makefile. Specifically, 3_place.sdc is now written by detail_place.tcl and 6_final.sdc is written by final_report.tcl. The Makefile has been updated to reflect these new dependencies and targets, and flow.tcl was adjusted to write 6_final.sdc at the correct step. I have no feedback to provide as there are no review comments.
|
@maliberty It is perhaps possible to configure Gemini with some instructions to converge on PR reviews by modifying instructions, rather than use a modified PR as a fuzzed input to the review process, thus converging faster(and perhaps missing out on some review feedback). Less maddening though. 😅 |
|
@maliberty I think this is a failure on master, not this PR. |
|
@maliberty pr-merge green, ready for review. Never mind pr-head. |
|
@eder-matheus Ping? pr-merge is green. |
efb9eed
into
The-OpenROAD-Project:master
|
🥳 |
Summary
placeandfinalwere the only stages whose SDC was produced by a Makefiledo-copyof a prior stage's file (3_place.sdc ← 2_floorplan.sdc,6_final.sdc ← 5_route.sdc) instead of being written by the stage script itself. Every other stage self-writes its SDC viaorfs_write_sdc(synth, floorplan, cts, grt), and the single-processflow.tclalready wrote3_place.sdc/6_final.sdcdirectly.This retires the copy-forward special case so SDC production is uniform and co-located with the
.odbwrite — mirroring how synth writes1_synth.sdcalongside1_synth.odb.Changes
detail_place.tclwrites3_place.sdcafter3_5_place_dp.odb.final_report.tclwrites6_final.sdcafter6_final.odb(after theorfs_*procs come into scope viafinal_connect.tcl).Makefile: drop the twodo-copy … .sdcrecipes; tie each aggregate.sdcto the step that now writes it with a recipe-less order rule (3_place.sdc: 3_5_place_dp.odb,6_final.sdc: 6_report.log) — the same shape as the existing1_synth.sdc: 1_synth.odbrule.flow.tcl: move the single-process6_final.sdcwrite to just after the6_final.odbwrite, so both flows write it from identical design state (preserving the final-stage byte-equivalence invariant documented indesigns/asap7/gcd/BUILD).Rationale / no behavior change
Timing constraints don't change during placement or finishing, so the serialized SDC is unchanged. On
nangate45/gcd, the new3_place.sdcand6_final.sdcare byte-identical (constraints) to the files thedo-copypreviously produced.Validation
nangate45/gcd:3_place.sdcand6_final.sdcare produced by their stage scripts (exit 0), and downstream stages that consume them (cts reads3_place.sdc) succeed.Note: the
gcd_single_flow_{place,final}_testbyte-equivalence checks indesigns/asap7/gcdare not expected to pass until the pending OpenROAD STA/DRT equivalence fixes land; they should not gate review of this change.