feat: ship compute_floorplan_shape + compute_slack_margin scripts#713
Merged
Conversation
Two ready-to-use Tcl scripts at the repo root for use with the existing
orfs_arguments rule. They compute CORE_UTILIZATION, CORE_MARGIN, and
SETUP/HOLD_SLACK_MARGIN from prior-stage ODB data instead of taking
them as static numbers in user BUILD.bazel files.
Wired into gallery/smoketest:counter as a worked example with a
default-set py_test that asserts the JSON outputs have the expected
keys. Calibration constants are parameterised via env vars; defaults
are documented in docs/orfs_arguments.md.
Adds a use-case write-up at the bottom of docs/orfs_arguments.md
("A way out of parameter guess, pray, stare at logs hell") framing
the scripts as a mechanism for the upstream ORFS goal of "moving
variables upwards in the Trivial / Easy / Complex taxonomy," and
describing how computed arguments compose with AutoTuner / external
DSE.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Replaces a phrase that could be misread as implying a particular downstream relationship; the intended meaning was just "designs that use this script." Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
35b6959 to
5e217fc
Compare
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.
Summary
Two ready-to-use Tcl scripts at the repo root for use with the existing
orfs_argumentsrule:compute_floorplan_shape.tcl— emitsCORE_UTILIZATIONandCORE_MARGINfrom synth-stage ODB area, accounting forrepair_designstd-cell growth.compute_slack_margin.tcl— emitsSETUP_SLACK_MARGINandHOLD_SLACK_MARGINfrom the previous stage's worst slack with a Δ safety budget that prevents theSLACK_MARGIN=0futile-loop.Both scripts parameterise their calibration constants via env vars (defaults documented in
docs/orfs_arguments.md); per-design overrides via theargumentsattr onorfs_arguments.What's in the diff
compute_floorplan_shape.tcl— new (~110 lines, mostly comments).compute_slack_margin.tcl— new (~85 lines).BUILDexports_filesblock alongsidesynth.tcl/mock_area.tcl.gallery/smoketest:counteradopts both scripts as a worked example.lint = False(real-yosys flow only) since the scripts use real OpenDB / OpenSTA queries;SYNTH_HDL_FRONTENDoverridden to""to avoid the slang plugin dependency.bazelisk testtargets in smoketest::counter_computed_arguments_build_test— confirms the twoorfs_argumentsinvocations build and emit JSON.:counter_computed_arguments_test(py_test) — asserts the JSON outputs contain the expected ORFS variable keys with sensible values.docs/orfs_arguments.md— appends a use-case write-up: "A way out of parameter guess, pray, stare at logs hell". Frames the scripts as a mechanism for the upstream ORFS goal of "moving variables upwards in the Trivial / Easy / Complex taxonomy" (citingOpenROAD-flow-scripts/docs/user/FlowVariables.md), and discusses composition with AutoTuner / external DSE.README.md— one-paragraph cross-reference in the existing DSE section.Why this is being proposed
The scripts have been validated on a production ASIC flow on ASAP7 across a range of core counts. In that context they replaced ~7 hand-tuned per-configuration constants and removed a recurring failure mode where
SLACK_MARGIN=0triggered hundreds of repair-timing passes and an ODB-1200 crash. Defaults shipped here are the values that worked for that flow; they should be treated as a starting point, not a universal truth.Honest about the limits
PLACE_DENSITY(the marquee Easy variable in the upstream taxonomy) is not yet computed; that would be a natural follow-on.Test plan
bazelisk build //smoketest:counter_floorplan_shape //smoketest:counter_floorplan_slack(gallery) — green; emits JSON with the expected keys.bazelisk build //smoketest:counter_floorplan(gallery) — green; floorplan args.mk merges the computed values and synth/floorplan/PDN run cleanly (Design area 27 µm², 19% utilization on the counter).bazelisk test //smoketest:counter_computed_arguments_test //smoketest:counter_computed_arguments_build_test(gallery) — green.buildifier --mode=diffon modifiedBUILDfiles — clean.bazelisk test ...in gallery — not run by submitter; relying on PR CI for the gallery sweep.🤖 Generated with Claude Code