Skip to content

Commit 0daf216

Browse files
authored
Merge pull request #10226 from gudeh/dpl-negotiation-default
dpl: modify default algorithm to negotiation legalizer
2 parents a65b06e + dd72b97 commit 0daf216

154 files changed

Lines changed: 91843 additions & 91153 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/cts/test/array.ok

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -155,25 +155,32 @@ Dummys used:
155155
[INFO RSZ-0058] Using max wire length 693um.
156156
[INFO RSZ-0047] Found 60 long wires.
157157
[INFO RSZ-0048] Inserted 80 buffers in 60 nets.
158-
[INFO DPL-0006] Core area: 24399648.00 um^2, Instances area: 20262357.03 um^2, Utilization: 83.0%
158+
[INFO DPL-0006] Core area: 24399648.00 um^2
159+
[INFO DPL-0007] Movable instances area: 12357.03 um^2
160+
[INFO DPL-0008] Fixed instances area within core: 20250000.00 um^2
161+
[INFO DPL-0009] Utilization: 83.0%
159162
[INFO DPL-0005] Diamond search max displacement: +/- 500 sites horizontally, +/- 100 rows vertically.
160-
[INFO DPL-1101] Legalizing using diamond search.
161-
Movements Summary
162-
---------------------------------------
163-
Total cells: 3289
164-
Diamond Move Success: 3289 (100.00%)
165-
Diamond Move Failure: 0
166-
Rip-up and replace Success: 0 ( 0.00% of diamond failures)
167-
Rip-up and replace Failure: 0
168-
Total Placement Failures: 0
169-
---------------------------------------
163+
[INFO DPL-1102] Legalizing using negotiation legalizer.
164+
[INFO DPL-1103] Negotiation base search window: +/-20 sites horizontally, +/-5 rows vertically
165+
Automatic search window extension enabled.
166+
Search window extendable up to the max displacement cap of +/-500 sites, +/-100 rows near walls.
167+
[INFO DPL-1104] NegotiationLegalizer DRC penalty: 5.
168+
[INFO DPL-0392] Negotiation cell height distribution (2 unique row-count(s)):
169+
[INFO DPL-0393] height 1 row(s): 3289 cells
170+
[INFO DPL-0393] height 215 row(s): 225 cells
171+
| Total | Illegal | Illegal
172+
Iteration | Violations | Cells | Sites
173+
---------------------------------------------
174+
0 | 80 | 8 | 72
175+
1 | 0 | 0 | 0
176+
Negotiation phase 1 converged at iteration 1.
170177
Placement Analysis
171178
---------------------------------
172-
total displacement 6490.1 u
173-
average displacement 1.8 u
174-
max displacement 146.4 u
179+
total displacement 8669.8 u
180+
average displacement 2.5 u
181+
max displacement 146.6 u
175182
original HPWL 290370.4 u
176-
legalized HPWL 290768.2 u
183+
legalized HPWL 290788.9 u
177184
delta HPWL 0 %
178185

179186
Clock clk

src/cts/test/array_ins_delay.ok

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -146,25 +146,32 @@
146146
[INFO RSZ-0058] Using max wire length 693um.
147147
[INFO RSZ-0047] Found 60 long wires.
148148
[INFO RSZ-0048] Inserted 80 buffers in 60 nets.
149-
[INFO DPL-0006] Core area: 24399648.00 um^2, Instances area: 20262357.03 um^2, Utilization: 83.0%
149+
[INFO DPL-0006] Core area: 24399648.00 um^2
150+
[INFO DPL-0007] Movable instances area: 12357.03 um^2
151+
[INFO DPL-0008] Fixed instances area within core: 20250000.00 um^2
152+
[INFO DPL-0009] Utilization: 83.0%
150153
[INFO DPL-0005] Diamond search max displacement: +/- 500 sites horizontally, +/- 100 rows vertically.
151-
[INFO DPL-1101] Legalizing using diamond search.
152-
Movements Summary
153-
---------------------------------------
154-
Total cells: 3289
155-
Diamond Move Success: 3289 (100.00%)
156-
Diamond Move Failure: 0
157-
Rip-up and replace Success: 0 ( 0.00% of diamond failures)
158-
Rip-up and replace Failure: 0
159-
Total Placement Failures: 0
160-
---------------------------------------
154+
[INFO DPL-1102] Legalizing using negotiation legalizer.
155+
[INFO DPL-1103] Negotiation base search window: +/-20 sites horizontally, +/-5 rows vertically
156+
Automatic search window extension enabled.
157+
Search window extendable up to the max displacement cap of +/-500 sites, +/-100 rows near walls.
158+
[INFO DPL-1104] NegotiationLegalizer DRC penalty: 5.
159+
[INFO DPL-0392] Negotiation cell height distribution (2 unique row-count(s)):
160+
[INFO DPL-0393] height 1 row(s): 3289 cells
161+
[INFO DPL-0393] height 215 row(s): 225 cells
162+
| Total | Illegal | Illegal
163+
Iteration | Violations | Cells | Sites
164+
---------------------------------------------
165+
0 | 80 | 8 | 72
166+
1 | 0 | 0 | 0
167+
Negotiation phase 1 converged at iteration 1.
161168
Placement Analysis
162169
---------------------------------
163-
total displacement 6490.1 u
164-
average displacement 1.8 u
165-
max displacement 146.4 u
170+
total displacement 8669.8 u
171+
average displacement 2.5 u
172+
max displacement 146.6 u
166173
original HPWL 290370.4 u
167-
legalized HPWL 290768.2 u
174+
legalized HPWL 290788.9 u
168175
delta HPWL 0 %
169176

170177
Clock clk

src/cts/test/array_max_wl.defok

Lines changed: 3309 additions & 3309 deletions
Large diffs are not rendered by default.

src/cts/test/array_max_wl.ok

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -655,25 +655,32 @@ TritonCTS forced slew degradation on these wires.
655655
[INFO RSZ-0058] Using max wire length 693um.
656656
[INFO RSZ-0047] Found 57 long wires.
657657
[INFO RSZ-0048] Inserted 75 buffers in 57 nets.
658-
[INFO DPL-0006] Core area: 24399648.00 um^2, Instances area: 20262834.77 um^2, Utilization: 83.0%
658+
[INFO DPL-0006] Core area: 24399648.00 um^2
659+
[INFO DPL-0007] Movable instances area: 12834.77 um^2
660+
[INFO DPL-0008] Fixed instances area within core: 20250000.00 um^2
661+
[INFO DPL-0009] Utilization: 83.0%
659662
[INFO DPL-0005] Diamond search max displacement: +/- 500 sites horizontally, +/- 100 rows vertically.
660-
[INFO DPL-1101] Legalizing using diamond search.
661-
Movements Summary
662-
---------------------------------------
663-
Total cells: 3555
664-
Diamond Move Success: 3555 (100.00%)
665-
Diamond Move Failure: 0
666-
Rip-up and replace Success: 0 ( 0.00% of diamond failures)
667-
Rip-up and replace Failure: 0
668-
Total Placement Failures: 0
669-
---------------------------------------
663+
[INFO DPL-1102] Legalizing using negotiation legalizer.
664+
[INFO DPL-1103] Negotiation base search window: +/-20 sites horizontally, +/-5 rows vertically
665+
Automatic search window extension enabled.
666+
Search window extendable up to the max displacement cap of +/-500 sites, +/-100 rows near walls.
667+
[INFO DPL-1104] NegotiationLegalizer DRC penalty: 5.
668+
[INFO DPL-0392] Negotiation cell height distribution (2 unique row-count(s)):
669+
[INFO DPL-0393] height 1 row(s): 3555 cells
670+
[INFO DPL-0393] height 215 row(s): 225 cells
671+
| Total | Illegal | Illegal
672+
Iteration | Violations | Cells | Sites
673+
---------------------------------------------
674+
0 | 40 | 4 | 36
675+
1 | 0 | 0 | 0
676+
Negotiation phase 1 converged at iteration 1.
670677
Placement Analysis
671678
---------------------------------
672-
total displacement 5694.5 u
673-
average displacement 1.5 u
674-
max displacement 121.8 u
679+
total displacement 7944.3 u
680+
average displacement 2.1 u
681+
max displacement 122.8 u
675682
original HPWL 286637.4 u
676-
legalized HPWL 287000.7 u
683+
legalized HPWL 287053.5 u
677684
delta HPWL 0 %
678685

679686
Clock clk

src/cts/test/array_no_blockages.ok

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,25 +145,45 @@
145145
[INFO RSZ-0058] Using max wire length 693um.
146146
[INFO RSZ-0047] Found 58 long wires.
147147
[INFO RSZ-0048] Inserted 78 buffers in 58 nets.
148-
[INFO DPL-0006] Core area: 24399648.00 um^2, Instances area: 20262350.11 um^2, Utilization: 83.0%
148+
[INFO DPL-0006] Core area: 24399648.00 um^2
149+
[INFO DPL-0007] Movable instances area: 12350.11 um^2
150+
[INFO DPL-0008] Fixed instances area within core: 20250000.00 um^2
151+
[INFO DPL-0009] Utilization: 83.0%
149152
[INFO DPL-0005] Diamond search max displacement: +/- 500 sites horizontally, +/- 100 rows vertically.
150-
[INFO DPL-1101] Legalizing using diamond search.
151-
Movements Summary
152-
---------------------------------------
153-
Total cells: 3287
154-
Diamond Move Success: 3287 (100.00%)
155-
Diamond Move Failure: 0
156-
Rip-up and replace Success: 0 ( 0.00% of diamond failures)
157-
Rip-up and replace Failure: 0
158-
Total Placement Failures: 0
159-
---------------------------------------
153+
[INFO DPL-1102] Legalizing using negotiation legalizer.
154+
[INFO DPL-1103] Negotiation base search window: +/-20 sites horizontally, +/-5 rows vertically
155+
Automatic search window extension enabled.
156+
Search window extendable up to the max displacement cap of +/-500 sites, +/-100 rows near walls.
157+
[INFO DPL-1104] NegotiationLegalizer DRC penalty: 5.
158+
[INFO DPL-0392] Negotiation cell height distribution (2 unique row-count(s)):
159+
[INFO DPL-0393] height 1 row(s): 3287 cells
160+
[INFO DPL-0393] height 215 row(s): 225 cells
161+
| Total | Illegal | Illegal
162+
Iteration | Violations | Cells | Sites
163+
---------------------------------------------
164+
0 | 2312 | 54 | 1142
165+
1 | 2286 | 50 | 1120
166+
2 | 2286 | 50 | 1120
167+
3 | 2280 | 48 | 1116
168+
4 | 2280 | 48 | 1116
169+
5 | 2280 | 48 | 1116
170+
6 | 2280 | 48 | 1116
171+
[WARNING DPL-0700] Negotiation phase 1: violations stuck at 2280 for 3 consecutive iterations.
172+
Using old diamond search for 48 remaining illegal cells.
173+
diamond recovery: recovered 44/48 stuck cells.
174+
Negotiation phase 2: isolation point active, 1000 iterations.
175+
400 | 220 | 4 | 108
176+
403 | 220 | 4 | 108
177+
[WARNING DPL-0702] Negotiation phase 2: violations stuck at 220 for 3 consecutive iterations. Using diamond search for 4 remaining illegal cells.
178+
diamond recovery: recovered 0/4 stuck cells.
179+
[WARNING DPL-0701] NegotiationLegalizer did not fully converge. Violations remain: 4
160180
Placement Analysis
161181
---------------------------------
162-
total displacement 5956.5 u
163-
average displacement 1.7 u
164-
max displacement 144.5 u
182+
total displacement 7500.3 u
183+
average displacement 2.1 u
184+
max displacement 138.7 u
165185
original HPWL 289884.5 u
166-
legalized HPWL 290297.7 u
186+
legalized HPWL 290402.1 u
167187
delta HPWL 0 %
168188

169189
Clock clk

src/cts/test/array_repair_clock_nets.ok

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -158,25 +158,32 @@ Dummys used:
158158
BUF_X4: 42
159159
INV_X8: 10
160160
[INFO RSZ-0058] Using max wire length 693um.
161-
[INFO DPL-0006] Core area: 24399648.00 um^2, Instances area: 20262357.03 um^2, Utilization: 83.0%
161+
[INFO DPL-0006] Core area: 24399648.00 um^2
162+
[INFO DPL-0007] Movable instances area: 12357.03 um^2
163+
[INFO DPL-0008] Fixed instances area within core: 20250000.00 um^2
164+
[INFO DPL-0009] Utilization: 83.0%
162165
[INFO DPL-0005] Diamond search max displacement: +/- 500 sites horizontally, +/- 100 rows vertically.
163-
[INFO DPL-1101] Legalizing using diamond search.
164-
Movements Summary
165-
---------------------------------------
166-
Total cells: 3289
167-
Diamond Move Success: 3289 (100.00%)
168-
Diamond Move Failure: 0
169-
Rip-up and replace Success: 0 ( 0.00% of diamond failures)
170-
Rip-up and replace Failure: 0
171-
Total Placement Failures: 0
172-
---------------------------------------
166+
[INFO DPL-1102] Legalizing using negotiation legalizer.
167+
[INFO DPL-1103] Negotiation base search window: +/-20 sites horizontally, +/-5 rows vertically
168+
Automatic search window extension enabled.
169+
Search window extendable up to the max displacement cap of +/-500 sites, +/-100 rows near walls.
170+
[INFO DPL-1104] NegotiationLegalizer DRC penalty: 5.
171+
[INFO DPL-0392] Negotiation cell height distribution (2 unique row-count(s)):
172+
[INFO DPL-0393] height 1 row(s): 3289 cells
173+
[INFO DPL-0393] height 215 row(s): 225 cells
174+
| Total | Illegal | Illegal
175+
Iteration | Violations | Cells | Sites
176+
---------------------------------------------
177+
0 | 80 | 8 | 72
178+
1 | 0 | 0 | 0
179+
Negotiation phase 1 converged at iteration 1.
173180
Placement Analysis
174181
---------------------------------
175-
total displacement 6490.1 u
176-
average displacement 1.8 u
177-
max displacement 146.4 u
182+
total displacement 8669.8 u
183+
average displacement 2.5 u
184+
max displacement 146.6 u
178185
original HPWL 290370.4 u
179-
legalized HPWL 290768.2 u
186+
legalized HPWL 290788.9 u
180187
delta HPWL 0 %
181188

182189
Clock clk

src/dpl/README.md

Lines changed: 24 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,34 @@
11
# Detailed Placement
22

3-
The detailed placement module in OpenROAD (`dpl`) is based on OpenDP, or
4-
Open-Source Detailed Placement Engine. Its key features are:
5-
6-
- Fence region support
7-
- Fragmented row support
8-
- Mixed-cell-height (1x–4x) legalization
9-
- Two placement engines selectable at runtime
3+
The detailed placement module in OpenROAD (`dpl`) legalizes the result of
4+
global placement: it moves instances to legal sites on rows while
5+
minimizing displacement. It is also used to re-legalize the design after
6+
incremental changes such as resizing and buffer insertion. It originated from OpenDP (Open-Source Detailed
7+
Placement Engine) and now uses a negotiation-based legalizer (NBLG) by
8+
default, with the original OpenDP diamond search available as a legacy
9+
engine. It supports:
10+
11+
- Mixed-cell-height (1x–4x) designs
12+
- Fence regions
13+
- Fragmented rows
14+
- Placement padding and filler insertion
1015

1116
## Placement Engines
1217

18+
DPL provides two options for legalization. Negotiation legalizer is the default and is slightly slower, but can handle dense designs. Diamond search is faster (linear runtime), although it is not able to handle dense designs. Diamond search is also used at the end of Negotiation for handling potential failed corner cases.
19+
20+
#### NegotiationLegalizer
21+
22+
The default two-pass legalizer based on the NBLG paper. Used on
23+
the `detailed_placement` command. The legacy diamond search engine can be
24+
selected with `-use_diamond_legalizer`.
25+
1326
#### Diamond Search
1427

15-
The default engine performs a BFS-style diamond search from each cell's
28+
Former engine performs a BFS-style diamond search from each cell's
1629
global placement position, expanding outward in Manhattan order until a
1730
legal site is found.
1831

19-
#### NegotiationLegalizer
20-
21-
An optional two-pass legalizer based on the NBLG paper. Enabled with
22-
`-use_negotiation` on the `detailed_placement` command.
23-
24-
```
25-
Global Placement result
26-
27-
28-
┌───────────────────┐
29-
│ Abacus Pass │ Fast DP sweep, row-by-row.
30-
│ (Skipped) │ Near-optimal for uncongested cells.
31-
│ │ Mixed-cell-height via row assignment.
32-
│ Handles: │ Power-rail alignment enforced.
33-
│ - 1x/2x/3x/4x │ Fence violations → skipped (→ negotiation).
34-
│ - Fence regions │
35-
└────────┬──────────┘
36-
│ illegal cells (overlap / fence violated)
37-
38-
┌───────────────────┐
39-
│ Negotiation Pass │ Iterative rip-up & replace (from NBLG paper).
40-
│ │ Illegal cells + spatial neighbors compete for
41-
│ NBLG components: │ grid resources. History cost penalises
42-
│ - Adaptive pf │ persistent congestion. Isolation point skips
43-
│ - Isolation pt │ already-legal cells in phase 2.
44-
│ - History cost │
45-
└────────┬──────────┘
46-
47-
48-
┌───────────────────┐
49-
│ Post-optimisation │ Greedy displacement improvement (5 passes).
50-
│ (Skipped) │ Cell swap via bipartite matching within groups.
51-
│ │
52-
└────────┬──────────┘
53-
54-
55-
Legal placement written back to OpenDB
56-
```
5732
# Commands
5833

5934
```{note}
@@ -71,7 +46,7 @@ detailed_placement
7146
[-max_displacement disp|{disp_x disp_y}]
7247
[-disallow_one_site_gaps]
7348
[-report_file_name filename]
74-
[-use_negotiation]
49+
[-use_diamond_legalizer]
7550
[-abacus]
7651
[-site_search_window sites]
7752
[-row_search_window rows]
@@ -88,7 +63,7 @@ detailed_placement
8863
| `-report_file_name` | File name for saving the report to (e.g. `report.json`.) |
8964
| `-incremental` | By default DPL initiates with all instances unplaced. With this flag DPL will check for already legalized instances and set them as placed. |
9065
| `-report_file_name` | File name for saving the report to (e.g. `report.json`.) |
91-
| `-use_negotiation` | Use the NegotiationLegalizer instead of the default diamond search engine. |
66+
| `-use_diamond_legalizer` | Use the legacy diamond search engine instead of the default NegotiationLegalizer. |
9267
| `-abacus` | Enable the Abacus pre-pass within the NegotiationLegalizer. Only effective when `-use_negotiation` is set. |
9368
| `-site_search_window` | NegotiationLegalizer: base number of sites a cell may be moved left or right of its initial position, capped by `-max_displacement`. Default `20`, `0` allowed (no horizontal movement). |
9469
| `-row_search_window` | NegotiationLegalizer: base number of rows a cell may be moved up or down from its initial position, capped by `-max_displacement`. Default `5`, `0` allowed (no row changes). |
@@ -234,7 +209,7 @@ Simply run the following script:
234209

235210
## Limitations
236211

237-
The following limitations apply when using the NegotiationLegalizer (`-use_negotiation`):
212+
The following limitations apply when using the NegotiationLegalizer (default):
238213

239214
1. **Abacus cluster chain**: The current Abacus implementation uses a
240215
simplified cluster structure. A production version should maintain an

src/dpl/include/dpl/Opendp.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class Opendp
112112
int max_displacement_y,
113113
const std::string& report_file_name = std::string(""),
114114
bool incremental = false,
115-
bool use_negotiation = false,
115+
bool use_diamond_legalizer = false,
116116
bool run_abacus = false,
117117
int site_search_window = -1,
118118
int row_search_window = -1,
@@ -182,6 +182,8 @@ class Opendp
182182
odb::Point getOdbLocation(const Node* cell) const;
183183
odb::Point getDplLocation(const Node* cell) const;
184184

185+
bool isUseNegotiationLegalizer() { return !use_diamond_legalizer_; }
186+
185187
private:
186188
using bgPoint
187189
= boost::geometry::model::d2::point_xy<int,
@@ -412,7 +414,7 @@ class Opendp
412414
int negotiation_debug_interval_ = 1;
413415
int negotiation_debug_start_ = 0;
414416
bool incremental_ = false;
415-
bool use_negotiation_ = false;
417+
bool use_diamond_legalizer_ = false;
416418

417419
// Magic numbers
418420
static constexpr double group_refine_percent_ = .05;

0 commit comments

Comments
 (0)