How does variant-aware legalization actually fix a DRC violation differently from ordinary legalization, and what happens when no matching variant exists?
From PDVerse PnR Interview Handbook · pdVerse Mentor Guide
Short Answer
place.legalize.enable_variant_aware, when true, makes the legalizer fix legalization DRC violations by SWAPPING a cell with an equivalent variant (same function, different mask color or minor geometry, identical timing) rather than moving it. If no variant exists for that cell, the legalizer falls back to the normal behavior: moving the cell. This is a genuinely different repair strategy -- fix-in-place via substitution, versus fix-by-relocation -- and it only works where equivalent variants actually exist in the library.
Technical Explanation
- place.legalize.enable_variant_aware, when true, makes the legalizer fix legalization DRC violations by SWAPPING a cell with an equivalent variant -- same function, different mask color or minor geometry, IDENTICAL timing data.
- This is a genuinely different repair strategy from ordinary legalization: fix-in-place via substitution, rather than fix-by-relocation.
- If no equivalent variant exists for a violating cell, the legalizer falls back to the NORMAL behavior of moving the cell -- variant-aware legalization doesn't fail outright, it just doesn't have its preferred fix available for that specific cell.
- Because variant swapping doesn't require moving the cell at all, it's inherently less disruptive to the surrounding placement than relocation -- which is exactly why it's preferred when available.
What To Check
- Warning sign: a legalization pass with variant-aware enabled still shows significant cell displacement for DRC fixes.
- Inspect: check whether the displaced cells actually have equivalent variants defined in the library -- cells without one always fall back to relocation regardless of this setting.
- Correct: if variant coverage is the limiting factor, consider whether the library's variant cell groups could be expanded, rather than assuming the setting itself isn't working.
Command Checks & Actions
set_app_options -name place.legalize.enable_variant_aware -value trueEnables the legalizer to fix DRC violations by swapping to an equivalent variant cell rather than moving the cell, when a variant is available.
Healthy, Suspicious & Hard-stop Results
- Expected: cells with defined equivalent variants show DRC fixes via swap (no displacement); cells without variants show normal relocation-based fixes, exactly matching the documented fallback behavior.
- Investigate: a cell known to have an equivalent variant still gets displaced during legalization -- worth double-checking that variant-aware legalization was actually enabled for that run.
- Stop: cell displacement from legalization is treated as unavoidable across the board, without checking whether expanding library variant coverage could reduce it via variant-aware legalization instead.
Common Mistake
The Trap: Assuming variant-aware legalization guarantees zero cell movement -- it only avoids movement for cells that actually HAVE an equivalent variant available; cells without one still get moved via the normal fallback.
What The Interviewer Is Testing
Whether you know variant-aware legalization is a genuinely different repair mechanism (substitution vs relocation), and specifically that it has a graceful fallback rather than failing when no variant exists.
Practical Example
Debug Scenario: A legalization pass with place.legalize.enable_variant_aware enabled shows most DRC-violating cells fixed with zero displacement (variant swap), but a handful still get relocated -- checking the library, those specific cells simply don't have equivalent variants defined, so the documented fallback (move the cell) applies to them.
Physical Design & Planning Handbook
Master ASIC Physical Design Planning & Floorplanning
Dive into 14 comprehensive chapters covering netlist sanity, FinFET grids, macro placement, power grids, CTS, and timing budgeting.
Continue practising