Repository navigation
Conversation
PARALLEL_EVAL ranked SizeUpMt and VtSwapMt candidates by timing gain alone, while SizeUpGenerator::upsizeCell (LEGACY, The-OpenROAD-Project#11916) already picks the size with the best gain per unit of cost. Without a cost, a target could take the largest size or jump over several VTs when a cheaper option gave a similar gain. A raw leakage ratio cannot be shared between the two moves: in ASAP7 one VT step multiplies a cell's leakage by about 10x and one size step by about 1.3x, so dividing the scores by the raw ratio drops VT swaps from the shared pool. What and how: - MoveGenerator::cellCostRatio() returns the new/old cell cost: leakage, else LEF area, else Liberty area, as upsizeCell compares them. It runs on the main thread because cellLeakage() fills a cache. - relativeCellCosts() turns the ratios of one move's options for a target into score divisors max(1, r / r_min), where r_min is the smallest ratio above 1. The cheapest costlier option keeps its full score, a costlier one pays only its extra cost, and no divisor drops below 1, so the cost never raises a score. - SizeUpMtGenerator and VtSwapMtGenerator find the ratios in prepareInputs(), cache them per library cell, and pass the divisors of the options that fit the max-cap budgets to the candidates, which divide positive scores by them after the side costs. - As the cost only orders the options of a move, the move weights set the balance between moves: VtSwapMt gets its own weight (vt_swap_mt_score_scale = 1.25) and SizeUpMt goes from 0.75 to 0.60, tuned on post-placement setup repair benchmarks. - Resizer::inputCapBudgets() now skips ideal register clock pins and scan pins the same way as replacementPreservesMaxCap(), through the new skipsFaninMaxCap(), so the generation-time max-cap screen matches the apply-time check. - Add unit tests for the move weights, the divisors and relativeCellCosts(), and update the PARALLEL_EVAL goldens. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
The SizeUpMt and VtSwapMt generators screen each replacement with Resizer::inputCapBudgets(). Before skipsFaninMaxCap() was shared, that screen did not skip the scan-enable and scan-in pins as replacementPreservesMaxCap() does, so PARALLEL_EVAL kept a scan flop at its size when its scan pin drivers had no max-cap headroom, while LEGACY sized it up. No test covered the PARALLEL_EVAL side. repair_setup_parallel_eval_fanin_max_cap sizes up three sky130hd sdfxbp_1 flops with -sequence sizeup. sdfxbp_2 has larger CLK, SCE and SCD pins, and output port loads push the driver of each tested pin past its max cap: - ff_scan, on its SCE and SCD drivers, sizes up as in LEGACY. Without the scan pin skip it keeps sdfxbp_1. - ff_ideal, on its ideal clock driver, sizes up: STA does not check the max cap of an ideal clock net. - ff_prop, on its propagated clock driver, keeps sdfxbp_1. With headroom on that driver it sizes up. Every flop input has a gate driver because the flop estimator replays a pin cap change only through a gate model, and a hold false path keeps the late propagated clock from blocking ff_prop for another reason. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Five Mt candidates took their move weight (*_mt_score_scale) through the constructor and multiplied their own score by it, so the candidates, their generators and chargeCellSwapSideCosts() all carried the same plumbing. The weights only balance the moves in the policy's shared score pool, so the policy now owns them. - OptimizationPolicyConfig::scoreScale() maps a MoveType to its weight, 1 for SwapPinsMt, UnbufferMt and the moves without one. The switch has no default, so a new move type must pick a weight. - SetupParallelEvalPolicy::estimateTarget() multiplies each estimate by the weight of its move right after estimate(). It is static and runs on the workers, so it takes the policy config as an argument. - The candidates score their own gain and cost. SizeUpMt and VtSwapMt still divide a positive score by their relative cell cost inside the move; SplitLoadMt, SizeDownFanoutMt and RebufferMt drop the weight member and constructor parameter, and the generators stop passing it. The RebufferMt debug message prints the unweighted score. - The candidate unit test checks only the cell cost. New tests check the weight of each move type and that estimateTargets() applies it. The weight now follows the cost divisor, (gain / divisor) x weight instead of (gain x weight) / divisor. The rsz goldens and the QoR and move counts of 34 post-placement benchmark designs are unchanged. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the parallel evaluation setup policy in the Resizer to scale candidate scores dynamically based on relative cell costs (leakage, LEF area, or Liberty area) rather than static move-specific scales. It also centralizes the fanin max-cap exemption logic and applies move weights at the policy level. Feedback on the changes suggests optimizing MoveGenerator::cellCostRatio by caching the costs of the source cell to avoid redundant computations inside generator loops.
buildSizeUpOptions() and buildVtSwapOptions() called cellCostRatio() for every candidate cell, and each call looked up the costs of the current cell again, although that cell is the same for the whole loop. MoveGenerator::cellCosts() now returns a cell's costs (leakage, LEF area, Liberty area), and cellCostRatio() takes the current cell's costs with the candidate cell. Each builder finds the current cell's costs once before its loop, as SizeUpGenerator::upsizeCell already does. The ratios do not change. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
The relative leakage cost came with retuned move weights, VtSwapMt 1.25 and SizeUpMt 0.60. On 29 public designs at the nominal clock period and at 98% and 95% of it, the existing weights (VtSwapMt 1.0, SizeUpMt 0.75) with the relative cost give lower leakage at every period (-2.34%, -1.33% and -1.45% against master, versus -1.33%, -1.23% and -1.17%) and about the same Fmax. They also keep ihp-sg13g2 ibex closing as master does: with SizeUpMt at 0.60, other moves win the targets that size-ups fix on master, and setup repair stalls at -165 ps WNS. Restore the existing weights in OptimizationPolicyConfig, note why a VtSwapMt weight above 1 is not wanted, and update the PARALLEL_EVAL goldens. The max_util golden matches master again. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Resolve the VtSwapMtGenerator conflict with the VT candidate cache of master: the cost ratios join the cached candidate cells, which isApplicable() fills on the main thread, and the separate cache that prepareInputs() filled is dropped. Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
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
Apply #11916 changes in PARALLEL_EVAL policy.
Problem
upsizeCellranks by gain per cost (#11916).inputCapBudgets()checks the scan pins thatreplacementPreservesMaxCap()skips.Changes
gain x 0.75gain x 0.75 / divisorgain x 1.0gain x 1.0 / divisormax(1, r / r_min)per target and moveResizer::skipsFaninMaxCap()Related
Details
ris the new/old leakage of an option (else LEF area, else Liberty area), andr_minis the smallestrabove 1 among the target's options of the same move.r_mingives the option with the smallest leakage increase no penalty (divisor 1).OptimizationPolicyConfig::scoreScale()and are applied in the policy, while each move applies its own divisor.