rsz: Global sizing#10599
Conversation
Signed-off-by: Eren Dogan <erendogan@google.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a Lagrangian-Relaxation-driven global sizing and Vt assignment optimization phase (GLOBAL_SIZING) to the resizer. It adds the LRSubproblem class to evaluate per-gate Lagrangian subproblems concurrently and the GlobalSizingPolicy class to drive the outer optimization loop. It also introduces worker-safe overloads for gate delay calculations in Resizer to support parallel evaluation. The review comments correctly identify critical null-pointer dereference risks in both LRSubproblem::isDataArc and GlobalSizingPolicy::isDataArc where edge->role() can be null.
| const sta::TimingRole* role = edge->role(); | ||
| if (role->isTimingCheck()) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
The edge->role() pointer can be nullptr for standard combinational arcs that do not have a specific timing role. Calling role->isTimingCheck() without a null check will cause a segmentation fault. Please add a null check for role before calling isTimingCheck().
| const sta::TimingRole* role = edge->role(); | |
| if (role->isTimingCheck()) { | |
| return false; | |
| } | |
| const sta::TimingRole* role = edge->role(); | |
| if (role != nullptr && role->isTimingCheck()) { | |
| return false; | |
| } |
| const sta::TimingRole* role = edge->role(); | ||
| if (role->isTimingCheck()) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
The edge->role() pointer can be nullptr for standard combinational arcs that do not have a specific timing role. Calling role->isTimingCheck() without a null check will cause a segmentation fault. Please add a null check for role before calling isTimingCheck().
| const sta::TimingRole* role = edge->role(); | |
| if (role->isTimingCheck()) { | |
| return false; | |
| } | |
| const sta::TimingRole* role = edge->role(); | |
| if (role != nullptr && role->isTimingCheck()) { | |
| return false; | |
| } |
|
@QuantamHD @mguthaus FYI |
Signed-off-by: Eren Dogan <erendogan@google.com>
|
I've merged with master and started a secure CI where the repair_timing in cts.tcl uses the above phases. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c3e619379
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| = r.best_is_downsize ? downsize_accept_tol : upsize_accept_tol; | ||
| if (r.best_cost < r.baseline_cost * (1.0f - tol)) { | ||
| sta::LibertyCell* prev = network_->libertyCell(r.inst); | ||
| if (subproblem_->applyReplacement(r.inst, r.best_cell)) { |
There was a problem hiding this comment.
Re-check DRC before applying stale Jacobi decisions
When a driver and one of its fanout loads are both resized in the same Jacobi sweep, each GateDecision was DRC-filtered against the pre-sweep snapshot, but this serial apply step installs the cell without revalidating against the live design after earlier replacements. A load upsized earlier in the loop can increase the driver's actual output load after the driver's snapshot passed checkOutputMaxCap/slew, so GLOBAL_SIZING can leave max-cap/max-slew violations that repair_timing does not check at finish.
Useful? React with 👍 / 👎.
| = r.best_is_downsize ? downsize_accept_tol : upsize_accept_tol; | ||
| if (r.best_cost < r.baseline_cost * (1.0f - tol)) { | ||
| sta::LibertyCell* prev = network_->libertyCell(r.inst); | ||
| if (subproblem_->applyReplacement(r.inst, r.best_cell)) { |
There was a problem hiding this comment.
Stop applying upsizes once max utilization is reached
For repair_timing -setup -max_utilization ... -phases GLOBAL_SIZING, this loop can keep accepting area-increasing replacements without any resizer_.overMaxArea() guard or rollback. Other setup policies stop when the area limit is hit, but here the phase may run past the requested utilization and then fail in OptimizationPolicy::finish() with RSZ-0025, even though a partial set of replacements could have respected the user limit.
Useful? React with 👍 / 👎.
|
The two significant issues in the public CI are cva6/asap7 crashed: and ibex/ihp fails in legalization To reproduce, use your branch with |


Summary
This PR introduces a new repair timing policy, Lagrangian relaxation-based global sizing.
Type of Change
Impact
The new global sizing policy is disabled by default now. Initial QoR experiments show promising results when enabled with
repair_timing -phases "GLOBAL_SIZING LEGACY LAST_GASP".Verification
./etc/Build.sh).