rsz: stage delay implementation for the Legacy policy#10803
Draft
jfgava wants to merge 5 commits into
Draft
Conversation
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
…ROAD into rsz-stage-delay
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Contributor
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
Contributor
Author
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
Member
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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
Stage_delay = load_delay + wire_delay
OptimizerTypes.hh — added bool use_stage_delay_ranking{false} to OptimizerRunConfig.
SetupLegacyBase.cc — rankPathDrivers() now optionally looks one step ahead in the expanded path to fetch the wire edge after each driver, computes wire_delay = arcDelay(net_edge, ...), and uses load_delay + wire_delay as the ranking key. When the flag is off, wire_delay is 0.0, so the behavior is identical to before.
Resizer.hh — added bool use_stage_delay_ranking = false (with default) to repairSetup().
Resizer.cc — accepts the new param and assigns config.use_stage_delay_ranking.
Resizer.i / Resizer-py.i — forwarded the new bool through the SWIG Tcl and Python bindings.
Resizer.tcl — added -use_stage_delay flag to define_cmd_args, parse_key_args, and the rsz::repair_setup call.
Usage:
repair_timing -setup -use_stage_delayTests for repair_timing -use_stage_delay
C++ Unit Tests — Tier 1
File: src/rsz/test/cpp/TestSetupLegacyBase.cc
Design under test: src/rsz/test/cpp/TestSetupLegacyBase_StageDelay.v — a minimal 2-stage combinational chain (Nangate45, 2 DFF registers with a 2-inverter path in between).
Fixture: tst::IntegratedFixture (kNangate45). Placement uses compact coordinates (stage1 at origin, stage2 at 4000 dbu / 2 µm) so HPWL estimation runs without requiring SPEF.
StageDelayEqualsLoadPlusWireDelay
Verifies the core formula introduced in SetupLegacyBase::rankPathDrivers():
stage_delay[i] == load_delay[i] + wire_delay_after_driver[i]
For every driver stage on the worst-slack path to endpoint out, the test independently re-derives wire_delay by walking the STA graph edge following the gate arc and checking Edge::isWire(). Asserts stage_delay >= load_delay (wire delay is non-negative).
BothModesReturnResultsSortedDescending
Verifies the sort invariant that rankPathDrivers() guarantees for both modes: results must be in descending order by delay (primary key), with ties broken by descending path index (secondary key). Passes the same expanded path through both use_stage_delay=false and use_stage_delay=true and checks the ordering independently for each.
Tcl Integration Test — Tier 2 (PASSFAIL)
File: src/rsz/test/repair_setup_stage_delay.tcl
Golden file: src/rsz/test/repair_setup_stage_delay.ok
Smoke test that
repair_timing -setup -use_stage_delayis accepted as a valid flag, the command completes without error, and produces the expected repair output.Type of Change
Impact
Instead of focusing just on the load_delays, now we also consider wire_delays when ranking the drivers to optimize first.
Verification
./etc/Build.sh).