dpl: introduce new legalization algorithm - negotiation based#10064
Open
gudeh wants to merge 70 commits intoThe-OpenROAD-Project:masterfrom
Open
dpl: introduce new legalization algorithm - negotiation based#10064gudeh wants to merge 70 commits intoThe-OpenROAD-Project:masterfrom
gudeh wants to merge 70 commits intoThe-OpenROAD-Project:masterfrom
Conversation
Introduces a two-pass hybrid legalizer into the dpl (detailed placement) module: 1. **Abacus pass** — O(n log n) row-by-row sweep that handles single- and mixed-cell-height cells with power-rail alignment and fence regions. Illegal cells (overlaps / fence violations) are forwarded to the negotiation pass. 2. **Negotiation pass** — iterative rip-up & replace adapted from the NBLG algorithm (Chen et al., IEEE TCAD 2022). Active cells compete for grid resources; history costs penalise persistent congestion and an isolation-point mechanism skips already-legal cells in phase 2. 3. **Post-optimisation** — greedy displacement improvement (5 passes) and cell-swap via bipartite matching. New files (src/dpl/src/): HybridLegalizer.h — class definition, structs, constants HybridLegalizer.cpp — initialisation, grid, Abacus pass, metrics HybridLegalizerNeg.cpp — negotiation pass, post-optimisation CMakeLists.txt: add HybridLegalizer.cpp and HybridLegalizerNeg.cpp to the dpl_lib target. Call site (Opendp.cpp, not wired in this PR): dpl::HybridLegalizer hybrid(db_, logger_); hybrid.setMf(1.5); hybrid.setTh(30); hybrid.setMaxIterNeg(600); hybrid.legalize(); References: - Spindler et al., "Abacus", ISPD 2008. - Chen et al., "NBLG", IEEE TCAD vol. 41 no. 11, 2022. - McMurchie & Ebeling, "PathFinder", 1995. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Cho Moon <cmoon@precisioninno.com>
Signed-off-by: Cho Moon <cmoon@precisioninno.com>
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
Signed-off-by: Cho Moon <cmoon@precisioninno.com>
incorporate debug mode inyo hybrid legalizer, skip abacus consider original DPL DRCs into hybrid legalizer stand-alone hybrid legalizer Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
fix orientation, abacus parameter for detailed_placement command: Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
also includes a failed attempt to solve it placing instances on inexisting sites Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
incorporate DRCs into cost function for negotiation a few variable renamings debug: paint outline of selecte instance final position debug: iterative mode for negotiation legalizer Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
iterative debug together with debug instance Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
debug: include runtime measurements debug: use iterative for main iterations, and deep iterative for cell moves Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
…), now we use snapToLegal() only once, not every iteartion, fixing both runtime and the issue of not legalizing instances on top of blockages Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
…roach Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
…instances Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
fix deep_iterative to pause at every iteration if no debug inst is given, if deep_iterative is active and debug inst set, only pause at debug inst moves Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
maliberty
reviewed
Apr 11, 2026
| `-use_negotiation` on the `detailed_placement` command. | ||
|
|
||
| ``` | ||
| Global Placement result |
Member
There was a problem hiding this comment.
Is the following diagram still accurate?
Comment on lines
+218
to
+221
| "negotiation_runtime", | ||
| 1, | ||
| "{} illegal cells", | ||
| illegal.size()); |
| // The snapping here is actually quite similar to the "hopeless" approach | ||
| // in original DPL. | ||
| // they achieve the same objective, and the previous is more simple, | ||
| // consider replacing this. |
Member
There was a problem hiding this comment.
I thought you had replaced this due to performance concern.
| @@ -0,0 +1,909 @@ | |||
| // SPDX-License-Identifier: BSD-3-Clause | |||
| // Copyright (c) 2018-2025, The OpenROAD Authors | |||
Member
There was a problem hiding this comment.
New files should be 2026 (same elsewhere)
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
This PR introduces a new algorithm option to DPL which shows better legalization capabilities on designs with higher density.
As default we still use the original diamond search. To use the new DPL option just add
-use_negotiation.Type of Change
Impact
Far better legalization capability on denser designs. Experiments show reduced displacement with increased HPWL. Negotiation legalizer is also more runtime costly compared to the simpler diamond search.
Verification
./etc/Build.sh).Negotiation legalizer
An iterative rip-up-and-replace algorithm where illegal cells compete with their spatial neighbors for grid resources. The algorithm proceeds in iterations, allowing overlaps among instances and progressively reducing them. The cost function incorporates a history term: sites that have been repeatedly over-capacity accumulate a higher cost, preventing the algorithm from thrashing. The implementation also integrates OpenROAD's existing DPL DRC checks directly into the cost function.
The DPL debug mode was also extended to paint sites (a.k.a. pixels) depending on their state (free, occupied, overflowing, DRC)
TODO and limitations:
Nodeobject, use the existing object from original DPL implementation.