Skip to content

Add explicit do-sdc-clock-period target - #4461

Merged
maliberty merged 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:do-sdc-clock-period
Aug 25, 2026
Merged

maliberty merged 3 commits into
The-OpenROAD-Project:masterfrom
oharboe:do-sdc-clock-period

Conversation

@oharboe

@oharboe oharboe commented Aug 24, 2026 •

Copy link
Copy Markdown
Collaborator

Makes clock-period generation consistent with the rest of the do-* targets (POLA): the do- 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 the do- 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-period standalone, the file rule building clock_period.txt from scratch, regenerating after touching constraint.sdc, and reporting up to date otherwise.

oharboe and others added 2 commits August 24, 2026 14:58
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>

@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 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.

@oharboe
oharboe requested a review from maliberty August 24, 2026 13:10
@openroad-ci

openroad-ci commented Aug 24, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics 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 26ddd5a · Jenkins build #2 · Baseline: build

62 design(s) checked — 4 with regression(s), 0 without a comparable baseline.
Design Variant Verdict local vs inline passed / failed / missing
asap7/aes base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes-block base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes-mbff base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/cva6 base ✅ pass ✅ MATCH 12 / 0 / 0
asap7/ethmac base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/ethmac_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/gcd-ccs base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/jpeg base ❌ fail ⚠️ MISMATCH 18 / 7 / 0
asap7/jpeg_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/mock-alu base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/mock-cpu base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/riscv32i-mock-sram base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/swerv_wrapper base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/uart base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/aes base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/aes-hybrid base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/uart-blocks base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/aes base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/aes base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/i2c-gpio-expander base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/spi base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/aes base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ariane133 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ariane136 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/black_parrot base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_be_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_fe_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_multi_top base ❌ fail ⚠️ MISMATCH 24 / 1 / 0
nangate45/cva6 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/dynamic_node base ❌ fail ⚠️ MISMATCH 17 / 8 / 0
nangate45/gcd base ❌ fail ⚠️ MISMATCH 15 / 10 / 0
nangate45/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/mempool_group base ✅ pass ✅ MATCH 12 / 0 / 0
nangate45/swerv base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/swerv_wrapper base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/tinyRocket base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/aes base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/chameleon base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/microwatt base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/aes base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
❌ asap7/jpeg base — 7 failing metric(s)
Metric target base delta limit band
cts__timing__setup__tns -24318.5 -1.61149 1508969.2464737603% -137.61149 PeriodPadding 20%
cts__timing__setup__ws -95.7394 -1.61149 5841.048346561257% -35.61149 PeriodPadding 5.0%
finish__timing__setup__tns -22664 0 — -136.0 PeriodPadding 20%
finish__timing__setup__ws -89.7057 6.6317 -1452.6803082165961% -34.0 PeriodPadding 5.0%
globalroute__timing__setup__tns -30095.7 -8.03713 374358.2954363062% -144.03713 PeriodPadding 20%
globalroute__timing__setup__ws -101.623 -3.338 2944.42780107849% -37.338 PeriodPadding 5.0%
placeopt__design__instance__count__stdcell 58443 50695 15.283558536344808% 58299.25 Padding 15%
❌ nangate45/bp_multi_top base — 1 failing metric(s)
Metric target base delta limit band
globalroute__timing__setup__ws -0.264436 0.888505 -129.7619034220404% -0.24 PeriodPadding 5.0%
❌ nangate45/dynamic_node base — 8 failing metric(s)
Metric target base delta limit band
cts__timing__setup__tns -793.073 0 — -1.2 PeriodPadding 20%
cts__timing__setup__ws -1.02793 0.0124922 -8328.574630569476% -0.3 PeriodPadding 5.0%
finish__design__instance__area 26850.3 22308.6 20.358516446572175% 25654.89 Padding 15%
finish__timing__setup__tns -820.522 0 — -1.2 PeriodPadding 20%
finish__timing__setup__ws -1.01389 0.0386814 -2721.130569214144% -0.3 PeriodPadding 5.0%
globalroute__timing__setup__tns -799.306 0 — -1.2 PeriodPadding 20%
globalroute__timing__setup__ws -1.04446 0.00328015 -31941.836501379512% -0.3 PeriodPadding 5.0%
placeopt__design__instance__count__stdcell 13006 11305 15.046439628482972% 13000.75 Padding 15%
❌ nangate45/gcd base — 10 failing metric(s)
Metric target base delta limit band
cts__timing__setup__tns -7.02464 0 — -0.092 PeriodPadding 20%
cts__timing__setup__ws -0.156759 0.00545863 -2971.7645269967006% -0.023 PeriodPadding 5.0%
detailedroute__route__wirelength 6277 3625 73.15862068965517% 4168.75 Padding 15%
finish__design__instance__area 969.836 683.354 41.92292720903075% 785.8571 Padding 15%
finish__timing__setup__tns -7.93732 0 — -0.092 PeriodPadding 20%
finish__timing__setup__ws -0.180601 0.016009 -1228.1216815541259% -0.023 PeriodPadding 5.0%
globalroute__timing__setup__tns -8.23991 0 — -0.092 PeriodPadding 20%
globalroute__timing__setup__ws -0.186904 0.000752287 -24944.773337835162% -0.023 PeriodPadding 5.0%
placeopt__design__instance__area 827.526 671.65 23.207920792079207% 772.3975 Padding 15%
placeopt__design__instance__count__stdcell 711 606 17.326732673267326% 696.9 Padding 15%

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>
@maliberty
maliberty merged commit 20d11c6 into The-OpenROAD-Project:master Aug 25, 2026
8 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