Repository navigation
Add explicit do-sdc-clock-period target - #4461
Conversation
Split the generation of $(SDC_FILE_CLOCK_PERIOD) into a canned recipe shared by two rules: - The existing file rule keeps make's simple dependency checking (regenerate when SDC_FILE changed). Deliberately simple: make cannot consider files that SDC_FILE pulls in. - A new do-sdc-clock-period phony target runs the action by itself, consistent with the other do-* targets (POLA). This gives build systems that orchestrate ORFS stages (e.g. bazel-orfs) a hook to do their own, more precise dependency tracking with full knowledge of the SDC's inputs, so synthesis is not redone when tinkering with the .sdc file in ways that do not change the clock period. A missing clock period is now a hard error instead of silently synthesizing unconstrained (an empty clock_period.txt used to skip abc -D): set ABC_CLOCK_PERIOD_IN_PS explicitly when the default extraction is not sophisticated enough. Documented in variables.yaml, with FlowVariables.md and variables.json regenerated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
test-do-stage.sh has bitrotted on master: - do-yosys-keep-hierarchy no longer exists (hierarchy keeping moved to RUN_YOSYS_ARGS/yosys_keep.tcl); drop it. - do-synth never comes back: the do-step comment in flow/Makefile documents that there is deliberately no do-synth step. Use make synth, which materializes 1_2_yosys.sdc and 1_synth.odb that the subsequent do-floorplan expects. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
There was a problem hiding this comment.
Code Review
This pull request improves the handling of the synthesis clock period (ABC_CLOCK_PERIOD_IN_PS) by introducing a validation step in the Makefile to ensure the clock period is either explicitly set or successfully extracted from the SDC file, raising a hard error if neither is possible. The documentation in FlowVariables.md, variables.json, and variables.yaml has been updated to reflect this behavior. Additionally, the test script test-do-stage.sh was updated to include the new do-sdc-clock-period target and run make synth instead of make do-synth. There are no review comments, and we have no feedback to provide.
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Advisory — results are log-only and do not affect build status. The authoritative QoR gate remains the local rules-file check. Commit 62 design(s) checked — 4 with regression(s), 0 without a comparable baseline.
❌ asap7/jpeg base — 7 failing metric(s)
❌ nangate45/bp_multi_top base — 1 failing metric(s)
❌ nangate45/dynamic_node base — 8 failing metric(s)
❌ nangate45/gcd base — 10 failing metric(s)
|
Use the established file-rule-delegates-to-do-target idiom, as with do-klayout and do-yosys-canonicalize, instead of a canned recipe shared by both rules. Drop the hard error on a missing clock period, along with the variables.yaml/FlowVariables.md/variables.json churn that went with it, so this PR carries a single concern. Also drop the test-do-stage.sh touch-up: the script has no consumers and is removed separately rather than repaired. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Makes clock-period generation consistent with the rest of the
do-*targets (POLA): thedo-action is invokable on its own, while the$(SDC_FILE_CLOCK_PERIOD): $(SDC_FILE)file rule keeps serving make's simple dependency checking (regenerate when SDC_FILE changed), delegating to thedo-target via$(UNSET_AND_MAKE)like the other file rule /do-target pairs. The file rule's checking is deliberately simple — make does not have the sophistication to consider files that SDC_FILE pulls in.This enables more precise and accurate dependency tracking for build systems that orchestrate ORFS stages (e.g. bazel-orfs): the clock period can be generated as its own cheap step, tracked with full knowledge of the SDC's inputs, so synthesis does not have to be redone when tinkering with the .sdc file in ways that don't change the clock period.
Verified on nangate45/gcd:
make do-sdc-clock-periodstandalone, the file rule buildingclock_period.txtfrom scratch, regenerating after touchingconstraint.sdc, and reporting up to date otherwise.