Repository navigation
Conversation
The pin was 100 commit-days behind main, outside //:bump's 30-day supported window. The documented "step forward in 30-day increments" path cannot be walked: the bumper always targets main HEAD, so an intermediate pin is still outside the window. Trialled --allow-stale-pin on a scratch copy first -- it produced a two-line pin diff with no shape migration, so the gate was conservative here rather than protecting a real incompatibility. Three consequences of the three months of drift: - bazel-orfs migrated its verilog/ submodule to rules_chisel and deleted the directory, so the bazel-orfs-verilog git_override fails with "strip_prefix at verilog does not exist in repo". Nothing in ORFS ever referenced that module -- the bazel_dep and git_override were the only mentions -- so both are dropped rather than repointed. - bazel-orfs removed its blender integration, so orfs_design() no longer takes blender; drop the argument. - orfs_update inherits kwargs that still carry user_stages, which is not one of its attributes, so every design with a rules-base.json fails analysis. That one is a bug in bazel-orfs rather than a migration, and is carried here as patches/bazel-orfs/0001 while this branch is in draft; it goes upstream once the draft has been evaluated as a whole. //flow/... analyzes clean afterwards (2377 targets). The bump also restores the <n>_synth_test fast QoR tier, which had regressed out of the tree when the forced-engine hook was removed. Still broken, pre-existing and out of scope here: //flow/designs/asap7:syn_test and :syn_synth_test reference <name>_syn_test targets that design.bzl no longer generates (the extra = _engine_variant_targets hook went away in 5328af2 without asap7/BUILD being updated). Both suites are tags=["manual"], so they do not block wildcard builds. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
bzlmod honours *_override directives only from the root module. ORFS is root, so the archive_override and macro-placement patches that bazel-orfs carries for @openroad were being discarded here silently -- the resolved @openroad marker listed no patch files at all. Anyone checking this branch out got an unpatched OpenROAD and no indication of it. Replace local_path_override(tools/OpenROAD) with a git_override pinned to 3ca581e384, carrying the five patches this work depends on. That is the commit the patches were developed and validated against; it is newer than the tools/OpenROAD submodule pointer (6cb3f2b704) and contains it. All five apply cleanly in sequence -- 23 files, +347 lines -- and the resolved repository now records each of them. init_submodules = True materialises src/sta, third-party/abc and third-party/slang-elab natively, so none of the patch_cmds vendoring an archive_override needs is required. The patches, and why this work needs them: 0045 the scorer is a report-only global placement, and gpl's density scatter was serial at any -threads. Carries the mt_invariance test that makes scores CPU-count-invariant, without which a race is not reproducible. -> OpenROAD#11262 0041 rtl_macro_placer -random_seed: deterministic macro placement per candidate outline, so an outline race measures the outline and not placer noise. -> feature, re-upstreamed later 0040 second rtl_macro_placer call in one process segfaults; unblocks the in-process candidate path. -> OpenROAD#11277 0042 placer winners poke snap residue past the core, so write_macro_placement output is rejected by place_macro on re-injection. -> OpenROAD#11278 0043 the all-fixed skip path omits std-cell seeding, diverging ~2% from the run that generated the placement. -> OpenROAD#11279 Cost of the swap: OpenROAD sources no longer come from the submodule working tree, so in-tree OpenROAD iteration needs the override flipped back. MODULE.bazel keeps the local_path_override form in a comment directly above, with the reason. Also aligns rules_shell (0.6.1 -> 0.8.0) and rules_pycross (0.8.1 -> 0.8.3) with what the newer OpenROAD resolves, silencing two --check_direct_dependencies warnings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Two prerequisites for building the asap7 designs against the pinned toolchain. Both are carried as ORFS patches in bazel-orfs; since ORFS is the root module here they belong in the tree as ordinary changes. synth_preamble.tcl: read_slang is built into Yosys only from 0.67, which vendors the frontend under frontends/slang. BCR still supplies 0.64, and MODULE.bazel hands the same code to it as an out-of-tree plugin on YOSYS_PLUGIN_PATH -- but nothing loaded it, so SYNTH_HDL_FRONTEND=slang died with "No such command: read_slang". Load it when the built-in is absent; the guard makes this a no-op on a Yosys that has the frontend, so either one works. Affects coralnpu, cva6, ibex and uart. swerv_wrapper/config.mk: VERILOG_FILES listed $(CLKGATE_MAP_FILE), which the config.mk parser cannot evaluate -- it expands through $(PRIMARY_VT_TAG), a make word/patsubst chain. The parser did not fail; it emitted the literal string "$(CLKGATE_MAP_FILE)" as a Verilog source entry. Reference the resolved path instead, which now parses to //flow:platforms/asap7/yoSys/cells_clkgate_R.v. R is the platform default (VT_LIST defaults to RVT); a design overriding ASAP7_USE_VT would need the matching file. Deliberately NOT carried: bazel-orfs's ORFS patch 0037, which makes synth_odb.tcl/synth_syn.tcl write 1_synth.odb/.sdc unconditionally. It was written against an older tree. Here scripts/flow.tcl runs the whole flow in one process with WRITE_ODB_AND_SDC_EACH_STAGE=0 and errors if a stage script writes a stage file, being the sole writer itself (flow.tcl:25, :44-46). The single-writer property 0037 was after is already established by a different design, and applying it would break the gcd_single_flow byte-compare tests. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
CORE_UTILIZATION, CORE_ASPECT_RATIO, PLACE_DENSITY and
PLACE_DENSITY_LB_ADDON are the last hand-carried numbers in a config.mk.
Each is a human prediction of downstream behaviour standing where a
measurement should be: the right utilization is "the smallest core in
which this netlist still closes", a question about repair_design, CTS and
routing, none of which have happened when the number is read. ORFS
already computes the honest half of the density answer -- the measured
lower bound in place_density_with_lb_addon -- and then adds a guessed
margin to it.
AUTO_FLOORPLAN=1 (the new default) races candidate outlines and densities
at the floorplan stage, scores each with a report-only global placement,
and overrides whatever config.mk asked for. The config.mk values are left
untouched: they are the AUTO_FLOORPLAN=0 path and they enter the race as
the incumbent, kept unless beaten by more than the measured noise floor.
FLOORPLAN_DEF and FOOTPRINT designs are skipped -- a die that comes from
a DEF or a pad ring is a constraint, not a choice.
PLACE_DENSITY_LB_ADDON is not a separate coordinate from PLACE_DENSITY:
the density ladder races fractions of the headroom above the measured
lower bound, which is exactly what the addon means. Both forms are
emitted so a design keeps whichever it already expresses, and the winner
also becomes RTL-MP's -target_util, so one measurement fixes both
consumers of the knob.
Structure:
auto_floorplan.tcl ladders, job pool, guards, selection,
noise floor, evidence
auto_floorplan_candidate.tcl one candidate in its own process
sample_paths.tcl the aggregate period instrument, ported
from bazel-orfs estimation_ladder
Candidates run as subprocesses that source the *production* stage scripts
rather than a reimplementation, so what is scored is what would be built.
A separate process also sidesteps rtl_macro_placer's non-re-entrancy
(OpenROAD#11277) and leaves the parent ODB untouched, so "only the winner
commits" holds by construction.
Against overfitting a cheap pre-route proxy, three rules: feasibility
guards are hard filters rather than score terms; the objective is the
aggregate sampled-path period, never WNS; and ties break toward headroom
-- among candidates within delta_tie, take the loosest, because that is
the one with room for the repair and CTS growth the proxy never saw.
delta_tie is measured per design by re-running the winner under three
placer seeds, never configured.
Search is coordinate descent (utilization, then density, then aspect),
~14 candidates rather than the 75 a full grid would need. Interactions
between the coordinates are therefore not explored; that limitation is
recorded in the evidence file rather than papered over.
The raced density has to reach the place stage, which is a different
process. Rather than add a stage-boundary artifact that every build
system wrapping ORFS would then have to declare, it goes on the block as
an ODB property and rides along with 2_floorplan.odb for free.
Every ladder is a dimensionless fraction. There is no per-design constant
anywhere in the implementation -- that is the whole point.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
The placement-only scorer was not ranking-accurate. On gcd its score
improved monotonically as the core shrank -- 330.4 -> 325.7 across the
utilization ladder, against a measured noise floor of 0.46, so a
confident separation -- while the flow disagreed at finish: WNS -38.3 ->
-52.5 ps, TNS 2.2x worse, detailed-route wirelength +59%. A rank
inversion, and the selector was rewarding it.
Two flow elements are now used in the candidate rather than approximated:
repair_design (AF_REPAIR=1)
PLACE_DENSITY's headroom exists for growth the flow has not committed
yet, and a proxy stopping at global placement cannot see any of it.
resize.tcl is the reference for what production runs; repair_timing
is deliberately not run because ENABLE_PLACE_REPAIR_TIMING defaults
to 0, and matching production is the point.
global_route + estimate_parasitics -global_routing (AF_GRT=1)
estimate_parasitics -placement prices wires by an ideal-length
estimate, so the score was blind to the congestion a denser core
actually buys. This is the pair global_route.tcl runs. A candidate
whose global route fails is now eliminated rather than scored, which
is the guard doing its job.
Measured effect on gcd: the noise floor rises 0.46 -> 3.79 (routing makes
the measurement more honest and more variable), and against that floor
the density ladder (330.96-332.94) and the aspect ladder (331.27-334.46)
are both ties -- so the tie-break takes the loosest candidate, and
"aspect is a tie here" is reported as the result it is. Utilization
remains separated at 3x the floor.
Notably repair explains none of it on this design: instance count is
304 -> 304, growth 0.0%. That hypothesis is falsified rather than
assumed, which is why the rung records the growth it measures.
Two robustness fixes found while getting the above to be legible:
- The candidate now hands the driver a Tcl dict literal instead of JSON
parsed back with a regexp. Both ends are Tcl; a dict round-trips
exactly and needs no parser. The regexp key class was also [a-z_]+,
which silently dropped every key carrying a digit -- core_um2,
stdcell_um2, n_paths -- i.e. exactly the fields the feasibility guard
and the tie-break read.
- Numeric values are normalised with format before being interpolated
into the evidence JSON. Interpolating a raw double under OpenROAD's
Tcl produced a corrupted field -- a fragment of the mantissa spliced in
after the value -- which broke the evidence JSON. The identical code
and data are correct under stock tclsh.
A failed candidate now echoes the tail of its own log into the stage log,
which is a declared build output; without that a sandboxed build discards
the only record of why a candidate died.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
A bigger core always makes period easier, so an objective that blends area and period is not a trade-off, it is a leak. The first version of the utilization phase minimised the period proxy across the utilization ladder, which is exactly that blend -- and on gcd it duly picked a core 18% smaller and sold 32% of WNS and 56% of TNS to pay for it. Nothing had told the race that period was the goal axis and area the budget. Utilization is now constraint satisfaction: take the smallest core whose score is still within delta_tie of the incumbent's, keep the incumbent if none qualifies, and replace it only when the winner actually buys area. Density and aspect are then scored at that fixed area, which is a like-for-like period comparison; the final selection deliberately does not range back over the utilization candidates, because those differ in area. The reference period is the incumbent's own achieved score rather than the SDC period. The SDC period cannot serve as the gate: most designs here do not meet it -- gcd misses by 34 noise floors -- so gating on it would forbid every candidate and the feature would do nothing on exactly the designs it is for. That raises the question of what the period number means, and the flow cannot answer it. A design with a target it does not yet meet may be mid-tapeout, where giving up period is unacceptable, or mid-development, where the RTL is still moving and the backend was never going to close the gap. Nothing in a config.mk distinguishes them. So AUTO_FLOORPLAN does not guess: it is documented as a design-space exploration tool, it never trades period away in either regime, and it reports which regime you are in -- the distance from the SDC period expressed in units of the design's own measured noise floor, which needs no threshold to be meaningful: design misses its SDC period by 69.34 (379.3 vs 310) = 34 noise floors; period here is a DSE gradient, not a sign-off margin docs/user/AutoFloorplan.md carries the full account, including how to convert a measurement into a decision for sign-off: run once, write the winner into config.mk, set AUTO_FLOORPLAN=0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
global_placement -place_ios leaves pins that global route rejects with
GRT-0080 "Invalid pin placement". With the routing rung in the scorer
that eliminated every candidate on aes, ibex and ethmac -- including
each design's own incumbent configuration, which routes perfectly well
in the real flow. The feature was inert on three of the six designs
swept, and failed safe rather than loudly, which is how it went
unnoticed until the evidence was read per design.
-place_ios was chosen originally because IO_PLACER_H/V are place-stage
variables and erase_non_stage_variables removes them before the
floorplan stage runs. The reasoning that off-track pins do not matter to
a ranking scalar is true of a placement-only score and false as soon as
the scorer routes.
So the candidate now places pins the way io_placement.tcl does, and
IO_PLACER_H, IO_PLACER_V and PLACE_PINS_ARGS are declared for the
floorplan stage as well as place -- the floorplan stage legitimately
needs to place pins now. That is additive: no existing consumer sees a
change, the variables are simply visible in one more stage. A platform
that does not set them still falls back to -place_ios, which remains
usable with AF_GRT=0.
A failed global route now carries its error text up into the stage log
instead of being reported as a bare "global route failed"; the
candidate's own log is discarded by a sandboxed build, so without that
the message that identified this bug would not have existed.
Measured after the fix, with three placer seeds per design:
aes noise floor 118.6 (16.1% of score), 3 noise floors off SDC
ibex noise floor 173.9 (7.1% of score), 10 noise floors off SDC,
utilization 40 -> 52, core 5283 -> 4046 um2
Those noise floors are large enough that most of each ladder is a tie,
which is the tie-break toward headroom doing its job rather than a
selector confidently chasing noise.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
…target
Two things, both driven by what the asap7 sweep showed.
## The selection rule was hollowing itself out
Six designs, both arms: one clean Pareto win (uart, core -29.4% with
period held), one correct no-change (mock-cpu), and four that shrank the
core and paid for it -- ibex worst of all, crossing from meeting timing
(WS +13.8 ps) to missing it (-2.9 ps).
The cause was not the proxy being wrong. It was delta_tie being spent as
an admission budget. "Smallest core whose score is within delta_tie of
the incumbent" is vacuous when delta_tie is large, and it is large:
measured against the clock period rather than against the score, the
noise floors are ethmac 525%, aes 31%, ibex 17%. Every candidate
qualified, so the rule degenerated into pure area minimisation with no
period protection whatsoever -- exactly what the table shows.
Two changes, both of which the design's own vocabulary already implied:
- Admission tolerance is now zero. A candidate must be no worse than the
incumbent on the point estimate. delta_tie decides what is resolved
and what is a tie; it is not slack to hand over.
- A ladder whose score spread does not exceed delta_tie has resolved
nothing, so every candidate on it is interchangeable -- and the honest
response to interchangeable is to keep the incumbent, not to take the
smallest core. aes now correctly reports "utilization ladder did not
resolve" and keeps its config.mk values.
The noise floor is reported against the clock period as well as the
score, because a floor of 173.9 means nothing until you know the clock
is 1000.
## Pinning: turning a measurement into a decision
bazelisk run //flow/designs/asap7/ibex:ibex_core_auto_floorplan_pin
reads the evidence the design's floorplan stage emitted, writes the
winning coordinates into its config.mk between generated markers, and
sets AUTO_FLOORPLAN = 0. Same shape as <name>_update for
rules-base.json. Idempotent, and it refuses to write when the run
selected no winner, because "did not resolve" means the design is
already using the values it should. The block records what it was raced
against, so a reviewer sees what they are approving:
# Raced against a measured noise floor (delta_tie) of 173.9
# at the time of pinning: achieved 2739 against an SDC target of 1000
# (10 noise floors short -- these values were explored, not signed off)
That completes a three-rung ladder, each rung useful alone: explore with
AUTO_FLOORPLAN=1 and never hold stale numbers; pin when the netlist
freezes; then overfit as hard as a tapeout deserves, because once pinned
they are ordinary config.mk entries and AutoTuner and seed sweeps apply
to them like any other knob.
That ladder is also the honest framing for the feature, and
docs/user/AutoFloorplan.md now leads with it: the bar is parity with a
good hand-tuned config.mk reached automatically, not beating it.
Hand-tuned numbers are somebody's sweep of one design, frozen the moment
the RTL moves underneath them; landing near them from a measurement that
re-runs itself whenever synthesis changes is a usability win even when
it costs a little on the Pareto front.
## Also
Fixes the last of the evidence-JSON corruption. Every instance landed
just past offset 4096: a single puts of a string larger than the channel
buffer came back with fragments of itself spliced in ("inst_after":
18704,ter": 18704,). The evidence is now streamed field by field to the
file and echoed to the log line by line, so no long string is ever built
or written at once. The same code is correct under stock tclsh.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
The obvious guard -- "if this design already meets timing by less than the noise floor, do not trade area for period" -- turns out not to be implementable from this scorer, and an unfireable guard is worse than none, so it is replaced with the reason. The score is measured after global route but before CTS and repair_timing. Its absolute period is not merely noisy, it is heavily biased: on ibex the proxy reads wns = -1739 ps where the finished flow lands at +13.8 ps. That is a bias of 1753 ps, 175% of the clock period. A guard conditioned on "the proxy says we meet timing" can never fire, because the proxy says no design meets timing. The estimation-ladder thesis is that an estimator need not be accurate, only ranking-accurate. That holds for comparing candidates at a fixed area, which is what the density and aspect phases do. It does not carry to the area-versus-period trade: deciding whether to spend margin requires knowing how much margin there is, and this measurement is off by more than a clock period. The reference that would answer it -- a design's own last finish__timing__setup__ws -- is not reachable at the floorplan stage, since RULES_JSON is scoped to the test stage and holds a padded bound rather than the measurement. Observed consequence on the asap7 sweep: ibex went from WS +13.8 ps to -2.9 ps while its core shrank 23%. A change in kind, not a Pareto cost. docs/user/AutoFloorplan.md now carries this as a named limitation with the two cases spelled out: a design that does not close (the DSE case this feature is for) loses nothing to it, and a design that does close should be pinned or left alone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
delta_tie is the yardstick every threshold in AUTO_FLOORPLAN is measured against, so a crude reading of it propagates into every decision -- and it was being read crudely. The range of three samples is a poor estimator of spread: biased low, wildly variable run to run, and with an expectation that grows with the sample count, so the guards would have tightened or loosened purely by changing the seed count. Now eight seeds and two standard deviations, a ~95% band that does not move with n. The seeds run concurrently, so eight cost roughly the wall-clock of one. The recalibration moves the numbers materially, which is the point: ibex 173.9 -> 317.8, aes 118.6 -> 85.4. aes now resolves its utilization ladder where before it did not, so guard behaviour genuinely depended on the quality of this estimate. For scale, bazel-orfs#868's stage_variance walk resolves swerv's floor to ~1.1% of the achieved period from 36 leaves. These floors remain 20-32% of the clock period even after the fix, which is not a small-sample artifact: the proxy's sensitivity to the placer seed really is that large, and it bounds what any selection rule reading it can resolve. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
checkMetadata.py asks whether anything got worse than a bound, and its
bounds carry deliberate margin -- 15% on area, 5% of the clock period on
worst slack -- which is right for a regression guard and useless for
asking whether results improved.
What it cannot express is a trade. A change that shrinks the core 8% and
gives up 1% of worst slack fails the slack rule and says nothing at all
about the area rule it just improved: read literally a regression, read
honestly a point that moved along the front. The two are
indistinguishable from rules-base.json today because the file records
padded thresholds rather than measurements.
So genRuleFile.py now records "golden" -- the unpadded metric -- beside
each threshold. Purely additive: checkMetadata.py and updateRules.py
read "value"/"compare" and ignore the rest. checkPareto.py reads the
goldens, treats them as a point in KPI space, and asks where the new
point sits:
- a hard-constraint regression (DRC, placement violations, antenna)
fails outright. Those are not axes you may spend.
- losing timing closure -- crossing from meeting the constraint to
missing it -- fails outright. A change in kind, not a Pareto cost,
and no amount of area buys it back. This is the ibex case from the
AUTO_FLOORPLAN sweep: +13.8 ps to -2.9 ps alongside a 23% smaller
core, which every existing check either tolerates or misreads.
- otherwise the point fails only if dominated: every axis worse-or-
tied, at least one worse beyond its tie band. A genuine trade passes
and is printed as one.
--require-improvement additionally demands that some axis improve, which
is what gates a change whose whole purpose is to move the front.
Tie bands come from a "tie" field when a design has a measured noise
band, and otherwise from conservative defaults mirroring the padding
genRuleFile.py already applies; the verdict says which it used, so a
default is never mistaken for a measurement.
<name>_pareto_test shares the metadata action with <name>_test, so it
costs no extra flow runtime. Designs whose rules-base.json has no
goldens yet warn and pass rather than failing on absence, so this lands
without needing every rules file regenerated first.
11 unit tests cover the cases that separate this from the existing
check: trade passes, dominated fails, lost closure fails, hard
constraint fails, within-tie is no movement.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
There was a problem hiding this comment.
Code Review
This pull request introduces the AUTO_FLOORPLAN feature, which dynamically measures and optimizes floorplan shapes and placement densities instead of relying on static configurations. It includes new scripts for candidate evaluation, path sampling, and pinning winning coordinates, alongside a Pareto front quality-of-results check. Feedback on the changes highlights critical issues, including a race condition in job status tracking, invalid usage of the output_group attribute on Bazel filegroup targets, potential null-block dereferences and infinite loops in the Tcl scripts, duplicate helper functions, and robustness issues in the Python utility scripts.
| set cmd "[join $assigns { }] \ | ||
| [af_shell_quote $::env(OPENROAD_EXE)] -no_init -exit \ | ||
| [af_shell_quote $::env(SCRIPTS_DIR)/auto_floorplan_candidate.tcl] \ | ||
| > [af_shell_quote $work/$tag.log] 2>&1; echo \$? > [af_shell_quote $done]" |
There was a problem hiding this comment.
Writing directly to the $done file using echo $? > $done creates a race condition. The polling loop checks [file exists $done], which becomes true as soon as the file is opened for writing, but before the exit code is actually written and flushed. If the polling loop reads the file in this tiny window, it will read an empty string and eliminate a successful candidate. To prevent this, write to a temporary file first and then perform an atomic rename (mv), which is atomic on Unix systems.
> [af_shell_quote $work/$tag.log] 2>&1; echo \$? > [af_shell_quote $done.tmp] && mv [af_shell_quote $done.tmp] [af_shell_quote $done]"
| native.filegroup( | ||
| name = name + "_auto_floorplan_evidence", | ||
| srcs = [":" + name + "_floorplan"], | ||
| output_group = "2_1_floorplan.log", | ||
| tags = ["manual"], | ||
| ) |
There was a problem hiding this comment.
Bazel's built-in filegroup rule does not support the output_group attribute. Attempting to use it will result in a Bazel analysis error (e.g., no such attribute 'output_group' in 'filegroup' rule). To extract a specific output group from a target, you should use a custom rule or helper that reads OutputGroupInfo from the dependency.
| native.filegroup( | ||
| name = name + "_metadata_json", | ||
| srcs = [":" + name + "_generate_metadata"], | ||
| output_group = "metadata.json", | ||
| tags = ["manual"], | ||
| ) |
There was a problem hiding this comment.
Bazel's built-in filegroup rule does not support the output_group attribute. Attempting to use it will result in a Bazel analysis error (e.g., no such attribute 'output_group' in 'filegroup' rule). To extract a specific output group from a target, you should use a custom rule or helper that reads OutputGroupInfo from the dependency.
| if { $jobs > 8 } { | ||
| set jobs [expr { $jobs / 2 }] | ||
| } | ||
| } |
There was a problem hiding this comment.
If AF_JOBS or NUM_CORES is configured to 0 or a negative value, or if the division results in 0, jobs can become 0 or negative. This will cause an infinite loop in the job spawning logic because [llength $running] < $jobs will never be true. Ensure jobs is at least 1.
if { $jobs > 8 } {
set jobs [expr { $jobs / 2 }]
}
if { $jobs < 1 } {
set jobs 1
}
| set blk [ord::get_db_block] | ||
| set dbu [$blk getDbUnitsPerMicron] |
There was a problem hiding this comment.
If ord::get_db_block returns "NULL" (which can happen if no design is loaded or during early initialization), calling [$blk getDbUnitsPerMicron] will throw a Tcl error. Add a check to handle the "NULL" block gracefully.
set blk [ord::get_db_block]
if { $blk eq "NULL" } {
return 50.0
}
set dbu [$blk getDbUnitsPerMicron]
| proc af_json_num { v } { | ||
| if { $v eq "" } { | ||
| return "null" | ||
| } | ||
| if { [string is double -strict $v] } { | ||
| return [format %.10g $v] | ||
| } | ||
| return $v | ||
| } |
| re.DOTALL, | ||
| ) | ||
| if pattern.search(config_text): | ||
| return pattern.sub(block, config_text, count=1) |
There was a problem hiding this comment.
In Python, re.sub (and Pattern.sub) interprets backslashes in the replacement string as escape sequences or group backreferences (e.g., \1 or \g<...>). If the generated block ever contains a backslash (for example, in a path or comment), re.sub might raise an error or corrupt the output. To safely perform a literal string replacement, pass a lambda function as the replacement argument.
| return pattern.sub(block, config_text, count=1) | |
| return pattern.sub(lambda _: block, config_text, count=1) |
| config_path = os.path.join(root, args.config) if root else args.config | ||
| if not os.path.isfile(config_path): | ||
| sys.exit(f"[ERROR] no config.mk at {config_path}") | ||
|
|
There was a problem hiding this comment.
If the evidence file specified by args.evidence does not exist, the script will crash with a FileNotFoundError and a traceback. It is more user-friendly to check for its existence and exit with a clean error message, similar to how config_path is checked.
| if not os.path.isfile(args.evidence): | |
| sys.exit(f"[ERROR] no evidence file at {args.evidence}") | |
| ev = extract_evidence(args.evidence) |
WNS is a signed quantity that lives near zero, so a fractional change in it is meaningless. A design at +5.8 ps that moves to +0.9 ps has "lost 85%" of nothing; one at -274 ps that moves to -280 ps has "lost 2%" of a great deal. A tie band expressed as a fraction of WNS inherits the pathology exactly backwards: tight where WNS is small, loose where it is large, for no reason connected to the design. clock - WNS -- the achieved period, the thing the design actually runs at -- is a stable positive quantity of order the clock, so a fractional change in it means what it appears to mean and a tie band on it is a fraction of the clock. That is the convention genRuleFile.py already uses for its timing rules (period_padding pads by a percentage of the clock, not of the slack); checkPareto.py now matches it. The difference is not cosmetic. Re-reading the asap7 sweep on the achieved period rather than on WNS turns "ibex catastrophically lost closure" into "+1.69% period", and separates the designs that traded ~1% of period for ~25% of core area (gcd-ccs +0.78%, mock-alu +0.92%, aes_lvt +1.37%) from the ones that genuinely gave up a lot (ethmac +13.37%). On WNS those two groups were indistinguishable. TNS is demoted from an axis to a diagnostic for the same reason and worse: unbounded below, frequently exactly zero, and scaled by the endpoint count. Closure keeps its own check, on WNS alone. "Does this design meet its constraint" is a discrete fact about the sign that the achieved period cannot express, and it stays a hard failure rather than a trade. Adds a regression test for the pathology itself: WNS +5.8 -> +0.9 ps is 0.5% of a 1000 ps clock and must read as no measurable movement. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Replaces both the zero-tolerance admission rule and the area-hysteresis
branch with one scalarised objective:
P_eff = T + tau * ln(1 + e^((p - T)/tau)) tau = 2% of the clock
J = ln(area) + lambda * ln(P_eff) lambda = 3
minimise J
P_eff is a smooth one-sided penalty: it tracks the achieved period when
the design is slower than its target and flattens to the target when it
is faster. Speed nobody asked for has no value, so area spent buying it
is never repaid; a design short of target pays the full rate for every
percent it gives up.
lambda is an exchange rate -- one percent of period is worth three
percent of area -- which is a product decision someone has an opinion
about, rather than a threshold nobody can defend. The derivative says it
plainly:
dA/A = -lambda * sigma((p - T)/tau) * dp/P_eff
The effective rate is lambda*sigma, scaling itself down as the design
gets comfortably faster than target. That removes the regime switch: the
same expression minimises area down to the target on a design that
closes and trades period against area on one that does not.
Two things fall out rather than being coded. A move that gives up period
and returns no area can never lower J, so swerv_wrapper's +1.76% period
for 0.0% area is rejected without a separate guard. And the incumbent is
simply a candidate, so "nothing beat it" is the incumbent winning rather
than a hysteresis branch.
Both constants are validated once against the asap7 sweep rather than
searched per design. lambda = 3 rejects the trades that gave up a lot of
period for little area (ethmac +13.4% period for -16.7% area, aes +5.6%
for -8.7%) and accepts every win and cheap trade (gcd-ccs +0.78% for
-24.2%, mock-alu +0.92% for -28.8%, aes_lvt +1.37% for -28.5%). Every
verdict is unchanged for lambda in [2, 5] and tau in [1%, 10%], and the
smooth form agrees with a hard max(p, T) on all 15 designs -- so the
smoothing costs nothing and removes the cliff where two candidates either
side of the target would be treated very differently on a noisy measure.
tau is deliberately NOT delta_tie, tempting as that is for a resolution
width: a large delta_tie inflates P_eff, which reduces period sensitivity
and would make the policy most aggressive exactly when the instrument is
worst. Whether a difference is measurable belongs in the resolvability
guard; what we want belongs in the objective. Conflating them is the bug
that had delta_tie being spent as an admission budget.
Caveat recorded here because it is not visible in the code: the constants
are fitted against the FLOW's periods, while the selector sees the
proxy's, whose deltas have not been shown to track. The objective is
right; whether the selector can act on it is what the utilization-axis
rho experiment measures.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
🔍 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 — 0 with regression(s), 0 without a comparable baseline.
|
Measured, not suspected. Running the production flow at every rung of
the utilization ladder and correlating it against the proxy score gives,
on the only designs whose noise floor is small enough for an answer to
exist at all:
gcd rho = -1.000 (n=4, delta_tie 1.1% of clock) perfectly inverted
gcd-ccs rho = +0.100 (n=5, delta_tie 0.3% of clock) uncorrelated
On gcd the proxy improves 338 -> 335 across the ladder while the flow
degrades 349.2 -> 355.1 ps. Driving the objective with those numbers duly
picks badly: re-sweeping the 15 asap7 designs with the objective in place
produced three regressions, including aes choosing a core 11.2% LARGER
with a worse period. No objective can be blamed for that.
The objective is fine. Given the flow's own numbers it picks well
everywhere measured -- gcd util 78 (-18.4% core, +2.0% period), gcd-ccs
util 78 (-24.2%, +0.4%), ibex util 56 (-28.7%, +1.0%), zero DRC
throughout. The fault is the instrument, and only on this axis: density
and aspect are compared at fixed area, which is the ranking property
bazel-orfs#868 E1/E3 measured to hold (rho +0.67..+0.72). Utilization
changes the area, and across that change the proxy does not rank.
ideas/auto-floorplan.md always said the oracle here was the flow -- "the
race is the oracle inside a utilization shmoo" -- and using a pre-route
proxy for the outer loop was the shortcut that failed. The correct
derivation runs the production flow at each rung and picks by J, at ~6
flow runs per design (4 min on gcd, 23 on ibex): an offline overnight
artifact to be pinned with <name>_auto_floorplan_pin, not something to
run per build.
So AUTO_FLOORPLAN=1 now races density and aspect at the incumbent
utilization. AF_RACE_UTIL=1 re-enables the axis for anyone reproducing
the above.
Two smaller findings from the same experiment, both recorded in the doc:
gcd's core clamps at 50.0 um2 for utilization >= 78, so the ladder's top
rungs are wasted candidates; and ibex reaches its best J at the top rung,
so {0.9 .. 1.4} is too narrow and leaves area unclaimed.
One invalid row for the record: the rho experiment's uart arm rewrote
CORE_UTILIZATION, which uart's config.mk does not use -- it sets
DIE_AREA/CORE_AREA -- so all six of its "rungs" ran the identical
floorplan. That row is an experiment bug, not a flat axis.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Overnight campaign: the utilization axis does not work with this scorerTwo experiments ran overnight. The headline is a negative result on one 1. Does the proxy rank the utilization axis?The production flow was run at every rung of the utilization ladder and
gcd and gcd-ccs are the only designs in the set whose noise floor is ( 2. Re-sweep with the objective, driven by the proxy15 designs, same AF=0 baseline: 2 wins, 7 trades, 3 no-change, 3 The objective is fine; the instrument is notGiven the flow's numbers,
Those are real Pareto gains. The fault is the scorer, and only on this Re-scope
Also landed
Open
|
A config.mk states its floorplan either as CORE_UTILIZATION (with aspect and margin) or as an explicit DIE_AREA/CORE_AREA rectangle. AUTO_FLOORPLAN now handles both on the way out as well as on the way in. Each candidate reads back the die and core its own initialize_floorplan call produced, in microns, straight off the block. The alternative -- recomputing the rectangle here from utilization, aspect and margin -- would duplicate ifp/src/InitFloorplan.cc's arithmetic including its rounding and row/site snap, and would drift the first time either side changed. Reading the result back means the two forms cannot disagree: verified on gcd, where the recorded rectangle 9.820 x 8.056 (core 0.540 0.540 9.288 7.290) is exactly what the committed floorplan reports. Fixes a bug that was live whether or not anything was raced. The apply block always wrote CORE_UTILIZATION and unset DIE_AREA/CORE_AREA, so every rectangle design had its die silently re-derived: uart's explicit "0 0 17 17" became whatever -utilization produced from an equivalent utilization. That is how uart's core area moved -2.2% and later -30.1% in the asap7 sweeps without the utilization axis ever having won anything -- the number was a form conversion, not a measurement. Converting the form is a change to the design and should only happen because a measurement asked for it. <name>_auto_floorplan_pin matches: it detects the form from the config.mk it is about to write and pins DIE_AREA/CORE_AREA for a rectangle design, CORE_UTILIZATION/CORE_ASPECT_RATIO/CORE_MARGIN otherwise. The measured geometry is recorded as a comment either way, so a reviewer of a utilization pin can see the die it implies without deriving it. Verified round-tripping on uart. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
The config.mk DSL is where a design's values live, so that is where the pin writes them -- as ordinary assignments, indistinguishable from hand-written ones. Somebody reading a config.mk to understand a design should not have to care which numbers were typed and which were measured, and an ORFS or OpenROAD developer changing the flow has no use for that history. It belongs in the commit the pinning run produces. So the generated block, the markers and the "do not edit by hand" banner are gone. An existing assignment is updated in place, keeping its position, its alignment and its assignment operator -- a design that deliberately wrote ?= to let the platform override keeps doing so, since a pin changes a value and not the semantics. A variable the design does not set yet is appended next to the ones it does, rather than at the end of the file. That makes bringing up a new design a two-step job: wire up the strictly necessary variables -- sources, SDC, platform -- and let <name>_auto_floorplan_pin fill in the floorplan. Fixes a bug the rewrite exposed: the previous version wrote both PLACE_DENSITY and PLACE_DENSITY_LB_ADDON. They are not additive. place_density_with_lb_addon() returns the addon form whenever the addon is set and non-empty and only falls back to PLACE_DENSITY otherwise, so writing both left a dead PLACE_DENSITY in the file and handed the flow an addon that gets re-resolved against a lower bound computed at run time -- which need not reproduce the absolute density that was measured. Exactly one is written now: the addon form for a design that already states one, the absolute density otherwise, because a pin should reproduce a measurement rather than re-derive it. 12 tests cover the editing behaviour, which is now parsing rather than templating: position and operator preserved, missing variables appended beside their relatives, a rectangle design not silently converted to a utilization, idempotence, and no-winner refusing to write. Verified on uart, whose config.mk keeps its alignment: -export PLACE_DENSITY = 0.70 -export DIE_AREA = 0 0 17 17 -export CORE_AREA = 1.08 1.08 16 16 +export PLACE_DENSITY = 0.459 +export DIE_AREA = 0.0 0.0 16.919 16.919 +export CORE_AREA = 1.026 1.08 15.876 15.66 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Deriving the floorplan is something you run to produce values, not something the flow does on every build. So the flow feature is gone entirely -- the AUTO_FLOORPLAN variable, the hook in floorplan.tcl, the branch in place_density_with_lb_addon, the ODB property that carried the raced density from floorplan to place, and the IO_PLACER_H/V floorplan stage-scoping that only the in-flow race needed. flow/scripts/floorplan.tcl, util.tcl, variables.yaml and variables.json are byte-identical to master again: this branch changes no flow behaviour. Two reasons, and the second is the stronger one. The cadence is wrong for a per-build feature. What mutates in ORFS is the OpenROAD binary, and binary churn rarely moves the Pareto front, so a per-build race re-derives a number that did not need re-deriving while adding run-to-run variance to a benchmark suite whose value is stable comparison. A real design's RTL mutates daily and wants a nightly re-derivation -- which is a job, not a build flag. And the per-build path could not compute the number that matters anyway. The pre-route proxy does not rank the utilization axis: rho = -1.000 on gcd against the finished flow, +0.100 on gcd-ccs. With utilization disabled the feature could not change area at all, which is most of the point. The utilization axis comes back here, because the oracle changes. The candidate now runs the production flow from floorplan to finish in one process and reports what the flow achieved -- clock - WNS, core area, the die and core rectangles, DRC count -- instead of a proxy score. Selection is the same J objective, now fed measured numbers, which the rho experiment already showed picks well: gcd util 78 (-18.4% core, +2.0% period), gcd-ccs util 78 (-24.2%, +0.4%), ibex util 56 (-28.7%, +1.0%), zero DRC throughout. Density is resolved by production rather than reimplemented: the candidate hands down PLACE_DENSITY_LB_ADDON and wraps place_density_with_lb_addon to capture what the flow actually used, so the recorded density is the one global placement saw and not a second computation of the same rule against a different placement state. auto_floorplan_flow.tcl is flow.tcl's stage sequence with synthesis removed, since candidates share one 1_synth.odb. flow.tcl runs on source and offers no seam to enter after synthesis, so the sequence is duplicated -- and auto_floorplan_flow_test.py extracts the stage order from both files and fails if they diverge, because a stage added to one and not the other would mean the derivation picks a floorplan against a flow that no longer exists. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Two manual targets per design, split so the expensive half is paid once:
bazelisk build //flow/designs/asap7/gcd:gcd_auto_floorplan_data
bazelisk run //flow/designs/asap7/gcd:gcd_auto_floorplan_pin
_data races the candidates and writes auto_floorplan.json as a declared
output, so bazel caches it. Iterating on the pin never re-derives -- the
run above takes 0.6s against cached data -- and several designs' data can
be built in one command, scoped to whatever the machine can take.
_pin depends on _data, which is what stops it from ever writing stale
values: bazel's dependency graph is the freshness check, so a changed
netlist, SDC or toolchain re-derives before the pin sees it. That is
better than the netlist-hash comparison first considered, which was
reimplementing bazel badly. Nothing lands in the source tree but the
config.mk edit; the evidence lives in bazel-out.
Both manual, so no wildcard build ever starts a derivation.
The derivation is ONE bazel action that forks its own candidates. Bazel
provisions roughly one core per action while each candidate runs a
multi-threaded flow, so expressing candidates as targets would
overprovision by the thread count of every concurrent flow. Building
several designs at once still multiplies AF_JOBS by bazel's --jobs, which
is documented rather than hidden.
Measured on gcd: utilization 65 -> 71.5, core 61.31 -> 54.33 um2 (-11.4%)
for an achieved period of 349.3 -> 350.2 (+0.26%), against a measured
noise floor of 3.735 (1.20% of the clock). The proxy version of this
picked 78; the flow oracle can see that 78 costs +1.7% of period and
declines it.
Two bugs found by running it, both of which had made a number look
better than it was:
- The density was recorded as -1. It was captured by wrapping
place_density_with_lb_addon, but load.tcl re-sources util.tcl at the
top of every stage script and redefined the wrapper away. Replaced
with a hook in auto_floorplan_flow.tcl after global_place, where
gpl::get_global_placement_uniform_density gives the same answer
because it is instance area over whitespace and does not depend on the
placement that just ran.
- The noise floor came out at 2 sigma = 1.2e-13, because the candidate
never set GPL_RANDOM_SEED and all eight "seeds" ran an identical flow.
A floor of zero makes the hysteresis inert and every difference look
real. With the seed varied it is 3.735 on gcd, which independently
reproduces the ~1.1% of clock measured for gcd in the rho experiment.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
The document described a flow mode that no longer exists. It now describes two manual targets that write config.mk, with the reasons the per-build version was abandoned stated as the measurements they were: the cadence argument, and rho = -1.000 on gcd for the proxy that version depended on. Also bounds each candidate's own threading. OpenROAD takes every core it can see, so each candidate was running 32 threads -- a pool of two already oversubscribed a 32-core machine twofold, and building several designs at once would have been far worse. AF_THREADS defaults to 2, and the document gives the arithmetic: total concurrency is --jobs times AF_JOBS times AF_THREADS, with two worked shapes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Working notes for the campaign, so the deferred work survives the session that found it. Ordered by expected value, with the bugs and unfinished work listed rather than remembered. The item worth the most is replacing coordinate descent with a joint design over the three coordinates. The current walk goes utilization, then density, then aspect, each conditioned only on the previous winner, so aspect is only ever evaluated at one area point -- which means "does aspect ratio matter?" is not actually being asked, it is being assumed away. A Latin hypercube over the same ~20 evaluations makes no assumption about which coordinates interact and answers the question instead. That is the transferable half of "Attention Is All You Need" with the architecture stripped off: RNNs assume recency, CNNs assume locality, and the contribution was to stop hard-coding which things are relevant to which. Our coordinate order is exactly such an assumption and has never been tested. The ResNet lesson lands on multi-fidelity: reparameterise so the identity is free, and add a cheap path alongside the expensive one rather than replacing it. A per-design fitted correction to the proxy is still open -- what was already tested and failed is a *global* correction, which gave rho = -0.275 across designs, so the estimator's bias is not common-mode. Also records that the two worst defects of this campaign were normalisation failures rather than search failures -- judging period on WNS instead of clock - WNS, and expressing the noise floor against score instead of against the clock -- and, so the borrowing stays honest, why the deep-learning analogies stop where they do: this is derivative-free optimisation over three coordinates where the binding constraint is measurement rather than search, and the literature to read is racing and successive halving under noise. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
The utilization phase substituted addon 0.10 whenever a design expressed no incumbent headroom fraction. For a raced candidate the addon is the coordinate and that is the point; for the incumbent it silently replaced the design's stated PLACE_DENSITY, so the reference point of the whole walk was a floorplan the design has never built. The hysteresis guard exists to keep a design's folklore unless a candidate beats it beyond the noise, and it was comparing against a strawman. On aes_lvt the fabricated incumbent reported achieved 360.3 where the production flow measures 351.0 -- 9.3 ps pessimistic -- which was most of an apparent win that the flow itself scored as a lost timing closure. Hold the design's own density across the utilization ladder, in the design's own form, via af_incumbent_density and an AF_DENSITY passthrough. The two forms stay mutually exclusive because place_density_with_lb_addon returns the addon form whenever the addon is set and only falls back to PLACE_DENSITY otherwise, so a candidate carrying both would run at a density nobody asked for. Verified on aes_lvt: the incumbent now reports achieved 351 against the flow's measured 351.0, and its objective value J = 25.82829 matches the J computed independently from production metadata.json to five decimals. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
checkPareto only accepted a baseline via rules-base.json's golden values. Those describe whatever toolchain last regenerated the file, which on asap7 is between one and seven weeks ago, and the drift is not small: on aes_lvt the checked-in bound implies ws = 0.0 where a fresh run on the same commit measures +9.00, a 9 ps move from toolchain churn alone. That is the same size as the effects this check exists to judge, so a verdict taken against a stale golden can be inverted by drift. It was: back-solving aes_lvt's baseline out of its padded bound gave ws = 0.0 and turned a lost closure into an apparent 2.5% speedup. Add --baseline, taking the reference from a metadata.json measured on the unmodified design, so both arms are measured on the same toolchain on the same day. --rules stays for the case where the file is known fresh, with its risk documented on the flag. The new test pins down what a stale reference actually costs. It is not the closure check -- that reads the sign of WNS and fires either way -- it is the period axis: the same candidate reads "tied, passes" against a stale ws = 0.0 and "dominated, fails" against a measured ws = +9.0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The derivation forks AF_JOBS candidates, each with AF_THREADS threads, and both were driver defaults with no way to raise them. --action_env does not reach them: orfs_run builds the action with a fixed environment, so command-line env settings are silently dropped -- a run launched with --action_env=AF_JOBS=8 ran two at a time and gave no indication why. Declare them in the arguments dict, empty by default so the driver's own defaults still apply and the values stay out of the action key. This matters more than it looks. The phases are serialised, so a design whose ladder does not fit in one batch per phase pays a full candidate's wall time for every extra batch. swerv_wrapper at AF_JOBS=2 needed seven batches and roughly 18 hours; at AF_JOBS=8 it needs four, on a machine that was otherwise 80% idle. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
An attempt to turn aes_lvt into a single-concern upstream PR found four things and filed nothing. Recorded as section 0, ordered by what they cost rather than when they were found: 0a the incumbent ran at a density the design never states -- fixed 0b a 9 ps oracle-vs-flow gap -- withdrawn, it is inside the noise 0c checked-in rules-base.json lags the toolchain -- not a bug 0d the objective accepts a lost timing closure -- open 0d is the one that produced the bad result, and it is the only one that is not a measurement error. Substituting the flow's own numbers for the oracle's, the objective still accepts the losing trade by dJ = -0.309 against a noise band of 0.057: lambda = 3 prices 28.6% of area at ~9.5% of period and the trade costs 2.7%. Correcting the oracle would not have changed the verdict. The cause is P_eff. A soft-plus makes crossing the timing target a slightly steeper slope and never a wall, which is the property it was chosen for -- it removed the regime switch. The cost is that zero slack stops being special, and checkPareto disagrees: it fails a lost closure outright as a change in kind. The selector and the acceptance test hold contradictory definitions of closure, and every derived floorplan is chosen by one and judged by the other. Three ways out are recorded rather than one patched in, because the choice is a real design question and each inherits the same problem: eliminating on a 0.46 ps miss when the noise floor is 6.87 ps is a coin flip, so whichever is chosen has to say what margin counts as missing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Superseded by The-OpenROAD-Project/bazel-orfs#890. The config.mk BUILD DSL moved to bazel-orfs What carried over: the driver, the candidate, the flow tail and its drift What was dropped as unnecessary: This PR filed nothing upstream, and that was the right outcome. An
0c is worth flagging to ORFS independently of any of this: The branch stays on the fork; the measurements cited in |
Draft — work in progress, campaign still running. Filed early so the state is shareable.
Retires the last hand-carried numbers in a
config.mk—CORE_UTILIZATION,DIE_AREA/CORE_AREA,CORE_ASPECT_RATIO,PLACE_DENSITYandPLACE_DENSITY_LB_ADDON— by measuring them instead of reading them.AUTO_FLOORPLAN=1races candidate outlines and densities at the floorplanstage, scores each by running the real flow elements against it, and overrides
whatever
config.mkasked for. Theconfig.mkvalues are untouched: they arethe
AUTO_FLOORPLAN=0path and they enter the race as the incumbent.This implements
ideas/auto-floorplan.mdfrom bazel-orfs, and is themulti-design counterpart to that campaign's Phase B (the utilization shmoo).
Self-contained by construction
bzlmod honours
*_overrideonly from the root module, so bazel-orfs's carriedOpenROAD patches were being silently discarded here — the resolved
@openroadmarker listed no patch files at all, and anyone checking this branchout got an unpatched OpenROAD with no indication. Replaced
local_path_override(tools/OpenROAD)with agit_overridepinned to3ca581e384carrying the five patches inline, so a fresh clone builds thetoolchain this was measured on:
0045gpl parallel density scattermt_invariancetest that makes scores CPU-count-invariant0041rtl_macro_placer -random_seed0040mpl re-run segfault0042snap-inside-coreplace_macro0043all-fixed std-cell seedingAlso carries one bazel-orfs patch (
user_stagesleaking intoorfs_update,which breaks analysis for every design with a
rules-base.json) and twoORFS-side fixes as ordinary commits: the slang plugin load, and
swerv_wrapper's$(CLKGATE_MAP_FILE), which the config.mk parser emitted asa literal unresolved string into
VERILOG_FILES.The design, and the discipline
Three coordinates on dimensionless ladders — no per-design constant anywhere in
the implementation.
it are raced. That fraction is
PLACE_DENSITY_LB_ADDON, now measured. Thewinner also becomes RTL-MP's
-target_util, fixing both consumers.always makes period easier, so an objective blending the two is a leak, not a
trade-off. Take the smallest core no worse than the incumbent; area is a
budget, period is the goal axis.
is a result — the folklore value gets graded rather than assumed.
Candidates run as subprocesses that source the production stage scripts, so
what is scored is what would be built, and the parent ODB is untouched (only the
winner commits).
delta_tieis measured per design as 2σ over 8 placer seeds andevery verdict is published next to it.
Against overfitting a cheap proxy: feasibility guards are hard filters, not score
terms; the objective is an aggregate, never WNS; ties break toward headroom; and
a ladder whose spread does not exceed its own noise floor has resolved nothing,
so the incumbent is kept rather than defaulting to the smallest core.
Three rungs, each useful alone
AUTO_FLOORPLAN=1(default). Measured every run, never stale.bazelisk run //…:<name>_auto_floorplan_pinwrites the winner intoconfig.mk, setsAUTO_FLOORPLAN=0. A measurement becomes a decision.config.mkentries, so AutoTuner and seed sweeps apply as ever — the frozen-RTL endgame.The bar is parity with hand-tuning, reached automatically, not beating it.
Hand-tuned numbers are one person's sweep of one design, frozen the moment the
RTL moves underneath them.
<name>_pareto_test— did the front actually move?checkMetadata.pyasks whether anything got worse than a padded bound, andcannot express a trade: a change that shrinks the core 8% and gives up 1% of
slack fails the slack rule and says nothing about the area rule it improved.
genRuleFile.pynow recordsgolden— the unpadded measurement — beside eachthreshold (purely additive;
checkMetadata.pyandupdateRules.pyignore it).checkPareto.pyreads those and fails only if the point is dominated, whiletreating a hard-constraint regression or a lost timing closure as failures
outright. 11 unit tests.
Results so far — read this before the numbers
The scorer cannot protect timing closure, and this is measured, not
suspected. It scores after global route but before CTS and
repair_timing, soits absolute period is not merely noisy but heavily biased: on
ibexthe proxyreads
wns = -1739 pswhere the finished flow lands at+13.8 ps— a bias of1753 ps, 175% of the clock period. A guard conditioned on "the proxy says we
meet timing" can never fire, because the proxy says no design meets timing. The
obvious guard is therefore not implementable from this measurement, and the
reason is documented in the code rather than left as an absence.
Ranking accuracy at a fixed area is a weaker property that may well hold —
that is what the density and aspect phases rest on. It does not carry to the
area-versus-period trade, which needs to know how much margin exists.
Observed consequence:
ibexwent fromWS +13.8 psto-2.9 pswhile its coreshrank 23%. A change in kind, not a Pareto cost. This is why the feature is
documented as design-space exploration rather than sign-off, why the pin target
exists, and why
checkPareto.pytreats lost closure as a hard failure.The measured noise floors are large — 22–32% of the clock period on the designs
swept, against ~1.1% for a 36-leaf
stage_variancewalk in bazel-orfs#868 — andthat bounds what any rule reading this proxy can resolve. Where the ladder spread
falls below that floor (
aes,ethmac), the race correctly reports "did notresolve" and keeps the
config.mkvalues.An asap7 A/B across both arms is running; the per-design table lands here when it
completes. Known gap:
riscv32i,riscv32i-mock-sramandaes-blockfail inparallel synthesis (
per-module checkpoint missing: partition_*_canonical.rtlil) after the bazel-orfs bump — before the floorplanstage, so unrelated to this feature, but not yet fixed.
Relation to bazel-orfs#868
That PR's E1 found the period axis saturated at swerv's 30% utilization: all
24 candidates tie on achieved period across a 45% proxy spread, so selection
cannot buy period there, and it hands the decisive question to the dense regime
and the utilization shmoo — i.e. here. Its E3 found raw gpl HPWL
ranking-equivalent to the full-STA proxy (ρ +0.67 vs +0.72), which suggests the
scorer in this PR is over-built; that is cheap to test against the evidence
files already produced and is not yet done.
af_ladder_resolves— spread vsdelta_tie— is a crude version of #868 PhaseB's axis-liveness instrument, evaluated across many designs rather than one.
Open questions
better posture is to let the race move and let
<name>_pareto_teston trunk bethe revert trigger.
Status and next steps
Campaign state as of the last update to this description. ETAs are from
that point; "cheap" means no flow runs needed.
asap7 A/B sweep, both armsriscv32i,riscv32i-mock-sram,aes-blocknever reach the floorplan stage, so 3 designs are missing from the table<name>_pareto_testtargets analyserules-base.jsongoldensgoldenthe Pareto test warns and passes vacuouslyrepair_designandglobal_routedelta_tievs utilization across all swept designs; the multi-design counterpart to #868 Phase B, and it explains which designs the race can help at all<name>_pareto_testbe the revert trigger, rather than refusing to move pre-mergedelta_tiemethodologystage_varianceflow reproducibility, and is ~20x largerKnown gaps in the data
riscv32i,riscv32i-mock-sram,aes-block: parallel-synthesis failurefrom the bump (item 2), not from this feature. Every tier consequently
exits non-zero, so exit codes are not a health signal for this campaign —
the per-design captures are.
coralnpu: not yet captured.delta_tieis 8 seeds, not astage_variance-grade walk (item 8).What would falsify the approach
If the axis-liveness table (item 6) shows the period axis is dead at every
operating point these designs run at, then racing utilization cannot buy
period anywhere in this design set, and the honest outcome is to ship the
density and aspect coordinates only — where fixed-area ranking is the
property that has to hold — and to record the utilization result as the
negative finding it is.
Update — overnight campaign complete
The utilization axis is off by default: measured
rho = -1.000on gcdand
+0.100on gcd-ccs against the flow, so the scorer does not rank it.Density and aspect continue to race at fixed area, which is the ranking
property that has been measured to hold. Full results, including the
objective that replaced the threshold rule, are in the results comment
on this PR.