-
Notifications
You must be signed in to change notification settings - Fork 864
dpl: introduce new legalization algorithm - negotiation based #10064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
maliberty
merged 73 commits into
The-OpenROAD-Project:master
from
gudeh:dpl-negotiation-legalizer
Apr 13, 2026
Merged
Changes from all commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
5131b23
dpl: add HybridLegalizer — Abacus + negotiation-based legalizer
precisionmoon b4402d4
created two pass flow
precisionmoon f0dae4c
dpl: format and tidy hybrid legalizer
maliberty bc80030
enable hybrid legalizer by default
precisionmoon 57f7c19
dpl: hybrid legalizer,
gudeh e52b63c
dpl: hybrid legalizer,
gudeh 5f4becf
dpl: include option to paint hybridLegalizer grid,
gudeh 23eefe5
dpl: snap instances to valid position
gudeh 52c7ec0
dpl: fix seg fault at initFromDb()
gudeh 4eee365
dpl: introduce hybrid rows to HybridLegalizer
gudeh 7776cb2
dpl: set hybridLegalizer as default for DPL
gudeh 007b47c
dpl: hybridLegalizer initialization snap to closest valid site
gudeh 4073a43
dpl: fix pixel grid painting
gudeh 22e1b26
dpl: fix grid inconsistency,
gudeh 464fd0b
dpl: new report messages including json
gudeh 7ae1c3d
dpl: fix runtime by removing unecessary snapToLegal(),
gudeh 94c6d3c
dpl: fix issue with blockage sites after removing costly snapToLegal(…
gudeh 58e4cde
dpl: fix placing instances on top of blockages without exhaustive app…
gudeh 8a6e742
dpl: adjust max iterations
gudeh 724e92a
dpl: cleaner code for debug prints and runtime measurement
gudeh 98ff73f
dpl: detect stuck overflow and use old diamond search to solve stuck …
gudeh 7833da3
dpl: rearrenge a few messages
gudeh e51da1a
dpl: rename new algorithm from hybrid legalizer to negotiation legalizer
gudeh 19bae11
dpl: rename new algorithm from hybrid legalizer to negotiation legalizer
gudeh 2056318
dpl: resolve hybrid nomenclature conflict
gudeh 31e6e59
dpl: code clean-up
gudeh dde3112
Merge remote-tracking branch 'private/master' into dpl-negotiation-le…
gudeh e65caad
Merge remote-tracking branch 'private/master' into dpl-negotiation-le…
gudeh 476d9c1
dpl: break after using diamond recovery
gudeh 1a50097
Merge remote-tracking branch 'private/master' into dpl-negotiation-le…
gudeh d32473e
dpl: edit code to Google C++ style
gudeh 7b07753
dpl: default run with diamond search
gudeh 4a84884
Merge remote-tracking branch 'private/master' into dpl-negotiation-le…
gudeh 79417a8
Merge remote-tracking branch 'private/master' into dpl-negotiation-le…
gudeh e1936d1
dpl: update README
gudeh 09cf0ce
dpl: reorder function calls to maitain no-op with diamond search option
gudeh e6b5b41
dpl: clang-format
gudeh c416a9e
dpl: clang-tidy
gudeh 486bba5
dpl: remove negotiation stand-alone command,
gudeh 8ef8aa8
test: update multiple after DPL log change
gudeh 3291443
dpl: fix licensing style
gudeh 59490e4
dpl: rename variable
gudeh 98c7361
dpl: use DebugScopedTimer for runtime measurement
gudeh 01a30cf
dpl: minor code changes
gudeh 2d142df
dpl: fix mistaken updated tests
gudeh bb8e5ef
dpl: rename constants
gudeh b9b98e1
dpl: use manhattan distance for fence region
gudeh f477048
Merge remote-tracking branch 'private/master' into dpl-negotiation-le…
gudeh 02d8141
dpl: use utl::DebugScopedTimer
gudeh 84a960b
dpl: fix lint
gudeh 01fb91e
dpl: clang-format
gudeh c3beb58
dpl: test, transform test into an error due to high utilization
gudeh bb978c5
dpl: include new source files to bazel build
gudeh 63efa41
Merge remote-tracking branch 'private/master' into dpl-negotiation-le…
gudeh 911f0ee
dpl: fix typo
gudeh ef7dcd7
dpl: alphabetical order
gudeh a003ac3
dpl: clang-format
gudeh 24de6bd
dpl: modify python test to throw error
gudeh d337cd8
dpl: clang-tidy
gudeh f9d7b5b
dpl: fix README heading levels
gudeh 072fd09
dpl: include negotiation header
gudeh ccc7f50
Merge remote-tracking branch 'private/master' into dpl-negotiation-le…
gudeh a6811f2
dpl: fix corner case for instance out of core at initial snapping
gudeh 4563b1a
dpl: debug, draw negotiation window search if instance is selected,
gudeh 434f74a
dpl: clang-format
gudeh 98beee9
dpl: persistent -use_negotiation toggle
gudeh 1ed4b86
dpl: clang-tidy
gudeh d1c0e5c
dpl: fix comment
gudeh eac3d29
dpl: left over renaming from hybrid legalizer to negotiation legalizer
gudeh ef05fd6
dpl: rename variable to snake case
gudeh 05df605
dpl: fix deubg print message
gudeh 9296278
dpl: fix copyright year
gudeh b425768
Merge remote-tracking branch 'private/master' into dpl-negotiation-le…
gudeh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,60 @@ | ||
| # Detailed Placement | ||
|
|
||
| The detailed placement module in OpenROAD (`dpl`) is based on OpenDP, or | ||
| Open-Source Detailed Placement Engine. Its key features are: | ||
| The detailed placement module in OpenROAD (`dpl`) is based on OpenDP, or | ||
| Open-Source Detailed Placement Engine. Its key features are: | ||
|
|
||
| - Fence region. | ||
| - Fragmented ROWs. | ||
| - Fence region support | ||
| - Fragmented row support | ||
| - Mixed-cell-height (1x–4x) legalization | ||
| - Two placement engines selectable at runtime | ||
|
|
||
| ## Commands | ||
| ## Placement Engines | ||
|
|
||
| #### Diamond Search | ||
|
|
||
| The default engine performs a BFS-style diamond search from each cell's | ||
| global placement position, expanding outward in Manhattan order until a | ||
| legal site is found. | ||
|
|
||
| #### NegotiationLegalizer | ||
|
|
||
| An optional two-pass legalizer based on the NBLG paper. Enabled with | ||
| `-use_negotiation` on the `detailed_placement` command. | ||
|
|
||
| ``` | ||
| Global Placement result | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the following diagram still accurate?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I included a |
||
| │ | ||
| ▼ | ||
| ┌───────────────────┐ | ||
| │ Abacus Pass │ Fast DP sweep, row-by-row. | ||
| │ (Skipped) │ Near-optimal for uncongested cells. | ||
| │ │ Mixed-cell-height via row assignment. | ||
| │ Handles: │ Power-rail alignment enforced. | ||
| │ - 1x/2x/3x/4x │ Fence violations → skipped (→ negotiation). | ||
| │ - Fence regions │ | ||
| └────────┬──────────┘ | ||
| │ illegal cells (overlap / fence violated) | ||
| ▼ | ||
| ┌───────────────────┐ | ||
| │ Negotiation Pass │ Iterative rip-up & replace (from NBLG paper). | ||
| │ │ Illegal cells + spatial neighbors compete for | ||
| │ NBLG components: │ grid resources. History cost penalises | ||
| │ - Adaptive pf │ persistent congestion. Isolation point skips | ||
| │ - Isolation pt │ already-legal cells in phase 2. | ||
| │ - History cost │ | ||
| └────────┬──────────┘ | ||
| │ | ||
| ▼ | ||
| ┌───────────────────┐ | ||
| │ Post-optimisation │ Greedy displacement improvement (5 passes). | ||
| │ (Skipped) │ Cell swap via bipartite matching within groups. | ||
| │ │ | ||
| └────────┬──────────┘ | ||
| │ | ||
| ▼ | ||
| Legal placement written back to OpenDB | ||
| ``` | ||
| # Commands | ||
|
|
||
| ```{note} | ||
| - Parameters in square brackets `[-param param]` are optional. | ||
|
|
@@ -23,30 +71,35 @@ detailed_placement | |
| [-max_displacement disp|{disp_x disp_y}] | ||
| [-disallow_one_site_gaps] | ||
| [-report_file_name filename] | ||
| [-use_negotiation] | ||
| [-abacus] | ||
| ``` | ||
|
|
||
| #### Options | ||
|
|
||
| | Switch Name | Description | | ||
| | Switch Name | Description | | ||
| | ----- | ----- | | ||
| | `-max_displacement` | Max distance that an instance can be moved (in microns) when finding a site where it can be placed. Either set one value for both directions or set `{disp_x disp_y}` for individual directions. The default values are `{0, 0}`, and the allowed values within are integers `[0, MAX_INT]`. | | ||
| | `-disallow_one_site_gaps` | Option is deprecated. | | ||
| | `-report_file_name` | File name for saving the report to (e.g. `report.json`.) | | ||
| | `-incremental` | By default DPL initiates with all instances unplaced. With this flag DPL will check for already legalized instances and set them as placed. | | ||
| | `-report_file_name` | File name for saving the report to (e.g. `report.json`.) | | ||
| | `-use_negotiation` | Use the NegotiationLegalizer instead of the default diamond search engine. | | ||
| | `-abacus` | Enable the Abacus pre-pass within the NegotiationLegalizer. Only effective when `-use_negotiation` is set. | | ||
|
|
||
| ### Set Placement Padding | ||
|
|
||
| The `set_placement_padding` command sets left and right padding in multiples | ||
| of the row site width. Use the `set_placement_padding` command before | ||
| legalizing placement to leave room for routing. Use the `-global` flag | ||
| for padding that applies to all instances. Use `-instances` | ||
| for padding that applies to all instances. Use `-instances` | ||
| for instance-specific padding. The instances `insts` can be a list of instance | ||
| names, or an instance object returned by the SDC `get_cells` command. To | ||
| specify padding for all instances of a common master, use the `-filter` | ||
| "ref_name == <name>" option to `get_cells`. | ||
|
|
||
| ```tcl | ||
| set_placement_padding | ||
| set_placement_padding | ||
| -global|-masters masters|-instances insts | ||
| [-right site_count] | ||
| [-left site_count] | ||
|
|
@@ -59,7 +112,7 @@ Either one of these flags must be set: `-global | -masters | -instances`. | |
| The order of preference is `global > masters > instances` | ||
| ``` | ||
|
|
||
| | Switch Name | Description | | ||
| | Switch Name | Description | | ||
| | ----- | ----- | | ||
| | `-global` | Set padding globally using `left` and `right` values. | | ||
| | `-masters` | Set padding only for these masters using `left` and `right` values. | | ||
|
|
@@ -77,7 +130,7 @@ is supported, so `FILL*` will match, e.g., `FILLCELL_X1 FILLCELL_X16 FILLCELL_X2 | |
| FILLCELL_X32 FILLCELL_X4 FILLCELL_X8`. To specify a different naming prefix | ||
| from `FILLER_` use `-prefix <new prefix>`. | ||
|
|
||
| ```tcl | ||
| ```tcl | ||
| filler_placement | ||
| [-prefix prefix] | ||
| [-verbose] | ||
|
|
@@ -90,14 +143,14 @@ filler_placement | |
| | ----- | ----- | | ||
| | `-prefix` | Prefix to name the filler cells. The default value is `FILLER_`. | | ||
| | `-verbose` | Print the filler cell usage. | | ||
| | `filler_masters` | Filler master cells. | | ||
| | `filler_masters` | Filler master cells. | | ||
|
|
||
| ### Remove Fillers | ||
|
|
||
| This command removes all filler cells. | ||
|
|
||
| ```tcl | ||
| remove_fillers | ||
| remove_fillers | ||
| ``` | ||
|
|
||
| ### Check Placement | ||
|
|
@@ -128,6 +181,7 @@ a weak attempt to reduce the total half-perimeter wirelength (HPWL). | |
| ```tcl | ||
| optimize_mirroring | ||
| ``` | ||
|
|
||
| ### Improve Placement | ||
|
|
||
| The `improve_placement` command optimizes a given placed design. | ||
|
|
@@ -150,7 +204,7 @@ If you are a developer, you might find these useful. More details can be found i | |
| | `get_inst_bbox` | Get bounding box of an instance. | | ||
| | `get_inst_grid_bbox` | Get grid bounding box of an instance. | | ||
| | `format_grid` | Format grid (takes in length `x` and site width `w` as inputs). | | ||
| | `get_row_site` | Get row site name. | ||
| | `get_row_site` | Get row site name. | | ||
|
|
||
| ## Example scripts | ||
|
|
||
|
|
@@ -164,14 +218,33 @@ Examples scripts demonstrating how to run `dpl` on a sample design of `aes` as f | |
|
|
||
| There are a set of regression tests in `./test`. Refer to this [section](../../README.md#regression-tests) for more information. | ||
|
|
||
| Simply run the following script: | ||
| Simply run the following script: | ||
|
|
||
| ```shell | ||
| ./test/regression | ||
| ``` | ||
|
|
||
| ## Limitations | ||
|
|
||
| The following limitations apply when using the NegotiationLegalizer (`-use_negotiation`): | ||
|
|
||
| 1. **Abacus cluster chain**: The current Abacus implementation uses a | ||
| simplified cluster structure. A production version should maintain an | ||
| explicit doubly-linked list of cells within each cluster, as in the | ||
| original Spindler et al. paper. | ||
|
|
||
| 2. **Multithreading**: The negotiation pass is single-threaded. | ||
| Extend with the inter-region parallelism from NBLG (Algorithm 2, dynamic | ||
| region adjustment) using OpenMP or std::thread. | ||
|
|
||
| 3. **Fence region R-tree**: Replace linear scan in `FenceRegion::nearestRect()` | ||
| with a spatial index (Boost.Geometry rtree or OpenROAD's existing RTree) | ||
| for large designs with many fence sub-rectangles. | ||
|
|
||
| 4. **Row rail inference**: Currently uses row-index parity as a proxy for | ||
| VDD/VSS. Replace with actual LEF pg_pin parsing once available in the | ||
| build context. | ||
|
|
||
| ## FAQs | ||
|
|
||
| Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+opendp+in%3Atitle) | ||
|
|
@@ -184,7 +257,11 @@ about this tool. | |
| - Rewrite and port to OpenDB/OpenROAD by James Cherry, Parallax Software | ||
|
|
||
| ## References | ||
|
|
||
| 1. Do, S., Woo, M., & Kang, S. (2019, May). Fence-region-aware mixed-height standard cell legalization. In Proceedings of the 2019 on Great Lakes Symposium on VLSI (pp. 259-262). [(.pdf)](https://dl.acm.org/doi/10.1145/3299874.3318012) | ||
| 2. P. Spindler et al., "Abacus: Fast legalization of standard cell circuits with minimal movement," ISPD 2008. | ||
| 3. J. Chen et al., "NBLG: A Robust Legalizer for Mixed-Cell-Height Modern Design," IEEE TCAD, vol. 41, no. 11, 2022. | ||
| 4. L. McMurchie and C. Ebeling, "PathFinder: A negotiation-based performance-driven router for FPGAs," 1995. | ||
|
|
||
| ## License | ||
|
|
||
|
|
||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.