Skip to content

Commit 5e46aa2

Browse files
committed
dpl: remove independent rail checking from negotiation which seems incosistent with legacy rail checking at checkRowPowerCompatible
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
1 parent 5293d48 commit 5e46aa2

6 files changed

Lines changed: 168 additions & 18 deletions

File tree

src/dpl/src/NegotiationLegalizer.cpp

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,12 +1250,11 @@ RowRejection NegotiationLegalizer::rowRejectionReason(int rowIdx,
12501250
return RowRejection::kDeadRow;
12511251
}
12521252
}
1253-
// Bottom-row site type must match the cell's declared site. Upper rows
1254-
// of a multi-height cell legitimately span heterogeneous row types in
1255-
// hybrid-row designs (the cell's master declares one site, matching the
1256-
// bottom row, and is designed to cover rows of differing types above).
1257-
// Rail/power compatibility is enforced separately by the rail check
1258-
// below; this matches CheckPlacement's first-row-only site check.
1253+
// Bottom-row site type must match the cell's declared site. The returned
1254+
// orientation also implicitly handles rail alignment for single-row
1255+
// cells: R0 vs MX flips the cell's power pins so a VSS-bottom master can
1256+
// legally land on an MX (VDD-bottom) row, etc. Matches the first-row-only
1257+
// site check in Opendp::checkPixels / CheckPlacement.
12591258
if (cell.db_inst != nullptr && opendp_ && opendp_->grid_) {
12601259
odb::dbSite* site = cell.db_inst->getMaster()->getSite();
12611260
if (site != nullptr
@@ -1264,18 +1263,21 @@ RowRejection NegotiationLegalizer::rowRejectionReason(int rowIdx,
12641263
return RowRejection::kSiteTypeMismatch;
12651264
}
12661265
}
1267-
const NLPowerRailType row_bottom_rail = row_rail_[rowIdx];
1268-
const bool bottom_rail_ok
1269-
= (row_bottom_rail == cell.rail_type)
1270-
|| (cell.flippable && row_bottom_rail == cell.rail_type_flipped);
1271-
if (!bottom_rail_ok) {
1272-
return RowRejection::kRailMismatch;
1273-
}
1274-
// For multi-row cells, also verify the master's power-pin stack lines
1275-
// up with the PDN rail stack across the entire span. Mirrors the check
1276-
// in Opendp::isPlacementLegal(); without it, the bottom-rail check
1277-
// above can let wrong-parity landings through on cells whose top and
1278-
// bottom rails differ.
1266+
//
1267+
// const NLPowerRailType row_bottom_rail = row_rail_[rowIdx];
1268+
// const bool bottom_rail_ok
1269+
// = (row_bottom_rail == cell.rail_type)
1270+
// || (cell.flippable && row_bottom_rail == cell.rail_type_flipped);
1271+
// if (!bottom_rail_ok) {
1272+
// return RowRejection::kRailMismatch;
1273+
// }
1274+
//
1275+
1276+
// For multi-row cells, verify the master's power-pin stack lines up with
1277+
// the PDN rail stack across the entire span. Mirrors the check in
1278+
// Opendp::checkPixels (which diamond search ultimately uses); the
1279+
// single-row rail constraint is already captured by getSiteOrientation
1280+
// above (orientation encodes which power pin sits at the bottom).
12791281
if (cell.db_inst != nullptr && network_ != nullptr && opendp_ != nullptr) {
12801282
if (Node* node = network_->getNode(cell.db_inst)) {
12811283
if (node->getMaster()->isMultiRow()

src/dpl/src/infrastructure/network.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,13 @@ std::pair<int, int> getMasterPwrs(odb::dbMaster* master)
310310
}
311311
return Architecture::Row::Power_UNK;
312312
};
313+
std::cout << "master:" << master->getName()
314+
<< " height:" << master->getHeight()
315+
<< " top_has_pwr:" << top_has_pwr
316+
<< " top_has_gnd:" << top_has_gnd
317+
<< " bot_has_pwr:" << bot_has_pwr
318+
<< " bot_has_gnd:" << bot_has_gnd << std::endl;
319+
313320
return {resolve(top_has_pwr, top_has_gnd), resolve(bot_has_pwr, bot_has_gnd)};
314321
}
315322

src/dpl/test/neg.log

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
OpenROAD 26Q2-1860-g5293d481c4
2+
Features included (+) or not (-): +GPU +GUI +Python
3+
This program is licensed under the BSD-3 license. See the LICENSE file for details.
4+
Components of this program may be licensed under more restrictive licenses which must be honored.
5+
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
6+
[INFO ODB-0227] LEF file: Nangate45/fake_macros.lef, created 11 library cells
7+
[INFO ODB-0128] Design: top
8+
[INFO ODB-0131] Created 7 components and 35 component-terminals.
9+
master:MOCK_DOUBLE height:5600 top_has_pwr:0 top_has_gnd:0 bot_has_pwr:0 bot_has_gnd:0
10+
master:MOCK_QUAD height:11200 top_has_pwr:0 top_has_gnd:0 bot_has_pwr:0 bot_has_gnd:0
11+
master:MOCK_SINGLE height:2800 top_has_pwr:0 top_has_gnd:0 bot_has_pwr:0 bot_has_gnd:0
12+
master:MOCK_TRIPLE height:8400 top_has_pwr:0 top_has_gnd:0 bot_has_pwr:0 bot_has_gnd:0
13+
[INFO DPL-0388] Cell height distribution (4 unique micron height(s)):
14+
[INFO DPL-0389] height 1.400 um: 3 cells
15+
[INFO DPL-0389] height 2.800 um: 1 cells
16+
[INFO DPL-0389] height 4.200 um: 1 cells
17+
[INFO DPL-0389] height 5.600 um: 2 cells
18+
[INFO DPL-0006] Core area: 108.53 um^2, Instances area: 17.02 um^2, Utilization: 15.7%
19+
[INFO DPL-0007] All instances area (incl. macros/pads/fixed): 17.02 um^2, Utilization: 15.7%
20+
[INFO DPL-0005] Diamond search max displacement: +/- 500 sites horizontally, +/- 100 rows vertically.
21+
[INFO DPL-1102] Legalizing using negotiation legalizer.
22+
[INFO DPL-1103] NegotiationLegalizer search window: +/-20 sites horizontally, +/-5 rows vertically.
23+
[INFO DPL-1104] NegotiationLegalizer DRC penalty: 5.
24+
[INFO DPL-0392] Negotiation cell height distribution (4 unique row-count(s)):
25+
[INFO DPL-0393] height 1 row(s): 3 cells
26+
[INFO DPL-0393] height 2 row(s): 1 cells
27+
[INFO DPL-0393] height 3 row(s): 1 cells
28+
[INFO DPL-0393] height 4 row(s): 2 cells
29+
Pause after initFromDb.
30+
Committing post-init positions to odb; debug move line drawings will exclude gpl-to-init displacement.
31+
Pause after initialization: Abacus skipped.
32+
Pause before negotiation phase 1.
33+
| Total | Illegal | Illegal
34+
Iteration | Violations | Cells | Sites
35+
---------------------------------------------
36+
[neg-search 1/50] q2 master=MOCK_QUAD site=QuadHeightSite extended_search_rows.size=3 seed_valid=true nearest_below_step=4 nearest_above_step=-1 rej_oob=32 rej_dead=0 rej_site=6 rej_rail=0 win_y=[0,12) (rows=12, below_cell=0, above_cell=8) win_x=[-14,27) (sites=41, half=20) row_search_cap=20 row_search_window=5 cell.height=4 cell.width=4 max_disp_y=100 rail_type=kVss rail_type_flipped=kVdd flippable=true fence_id=-1 init_y=0 init_x=6 cur_y=0 cur_x=6
37+
Pause at placing of cell q2. orig=(2280,0) target=(2280,11200) dbu. rowidx=4.
38+
[neg-search 2/50] t1 master=MOCK_TRIPLE site=TripleHeightSite extended_search_rows.size=4 seed_valid=true nearest_below_step=3 nearest_above_step=-1 rej_oob=21 rej_dead=0 rej_site=6 rej_rail=0 win_y=[0,12) (rows=12, below_cell=0, above_cell=9) win_x=[-13,28) (sites=41, half=20) row_search_cap=15 row_search_window=5 cell.height=3 cell.width=4 max_disp_y=100 rail_type=kVss rail_type_flipped=kVdd flippable=true fence_id=-1 init_y=0 init_x=7 cur_y=0 cur_x=7
39+
Pause at placing of cell t1. orig=(2660,0) target=(380,0) dbu. rowidx=0.
40+
[neg-search 3/50] q1 master=MOCK_QUAD site=QuadHeightSite extended_search_rows.size=3 seed_valid=true nearest_below_step=4 nearest_above_step=-1 rej_oob=32 rej_dead=0 rej_site=6 rej_rail=0 win_y=[0,12) (rows=12, below_cell=0, above_cell=8) win_x=[-15,26) (sites=41, half=20) row_search_cap=20 row_search_window=5 cell.height=4 cell.width=4 max_disp_y=100 rail_type=kVss rail_type_flipped=kVdd flippable=true fence_id=-1 init_y=0 init_x=5 cur_y=0 cur_x=5
41+
Pause at placing of cell q1. orig=(1900,0) target=(1900,0) dbu. rowidx=0.
42+
[neg-search 4/50] d1 master=MOCK_DOUBLE site=DoubleHeightSite extended_search_rows.size=6 seed_valid=true nearest_below_step=2 nearest_above_step=-1 rej_oob=10 rej_dead=0 rej_site=5 rej_rail=0 win_y=[0,12) (rows=12, below_cell=0, above_cell=10) win_x=[-12,29) (sites=41, half=20) row_search_cap=10 row_search_window=5 cell.height=2 cell.width=4 max_disp_y=100 rail_type=kVss rail_type_flipped=kVdd flippable=true fence_id=-1 init_y=0 init_x=8 cur_y=0 cur_x=8
43+
Pause at placing of cell d1. orig=(3040,0) target=(4940,0) dbu. rowidx=0.
44+
[neg-search 5/50] s2 master=MOCK_SINGLE site=FreePDK45_38x28_10R_NP_162NW_34O extended_search_rows.size=7 seed_valid=true nearest_below_step=1 nearest_above_step=1 rej_oob=4 rej_dead=0 rej_site=0 rej_rail=0 win_y=[0,7) (rows=7, below_cell=1, above_cell=5) win_x=[-11,30) (sites=41, half=20) row_search_cap=5 row_search_window=5 cell.height=1 cell.width=4 max_disp_y=100 rail_type=kVss rail_type_flipped=kVdd flippable=true fence_id=-1 init_y=1 init_x=9 cur_y=1 cur_x=9
45+
Pause at placing of cell s2. orig=(3420,2800) target=(3420,2800) dbu. rowidx=1.
46+
[neg-search 6/50] s1 master=MOCK_SINGLE site=FreePDK45_38x28_10R_NP_162NW_34O extended_search_rows.size=6 seed_valid=true nearest_below_step=1 nearest_above_step=-1 rej_oob=5 rej_dead=0 rej_site=0 rej_rail=0 win_y=[0,6) (rows=6, below_cell=0, above_cell=5) win_x=[-11,30) (sites=41, half=20) row_search_cap=5 row_search_window=5 cell.height=1 cell.width=4 max_disp_y=100 rail_type=kVss rail_type_flipped=kVdd flippable=true fence_id=-1 init_y=0 init_x=9 cur_y=0 cur_x=9
47+
Pause at placing of cell s1. orig=(3420,0) target=(3420,0) dbu. rowidx=0.
48+
[neg-search 7/50] s3 master=MOCK_SINGLE site=FreePDK45_38x28_10R_NP_162NW_34O extended_search_rows.size=8 seed_valid=true nearest_below_step=1 nearest_above_step=1 rej_oob=3 rej_dead=0 rej_site=0 rej_rail=0 win_y=[0,8) (rows=8, below_cell=2, above_cell=5) win_x=[-10,31) (sites=41, half=20) row_search_cap=5 row_search_window=5 cell.height=1 cell.width=4 max_disp_y=100 rail_type=kVss rail_type_flipped=kVdd flippable=true fence_id=-1 init_y=2 init_x=10 cur_y=2 cur_x=10
49+
Pause at placing of cell s3. orig=(3800,5600) target=(3800,5600) dbu. rowidx=2.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
VERSION 5.8 ;
2+
DIVIDERCHAR "/" ;
3+
BUSBITCHARS "[]" ;
4+
DESIGN top ;
5+
UNITS DISTANCE MICRONS 2000 ;
6+
DIEAREA ( 0 0 ) ( 13050 33600 ) ;
7+
ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 0 0 N DO 34 BY 1 STEP 380 0 ;
8+
ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 0 2800 FS DO 34 BY 1 STEP 380 0 ;
9+
ROW ROW_2 FreePDK45_38x28_10R_NP_162NW_34O 0 5600 N DO 34 BY 1 STEP 380 0 ;
10+
ROW ROW_3 FreePDK45_38x28_10R_NP_162NW_34O 0 8400 FS DO 34 BY 1 STEP 380 0 ;
11+
ROW ROW_4 FreePDK45_38x28_10R_NP_162NW_34O 0 11200 N DO 34 BY 1 STEP 380 0 ;
12+
ROW ROW_5 FreePDK45_38x28_10R_NP_162NW_34O 0 14000 FS DO 34 BY 1 STEP 380 0 ;
13+
ROW ROW_6 FreePDK45_38x28_10R_NP_162NW_34O 0 16800 N DO 34 BY 1 STEP 380 0 ;
14+
ROW ROW_7 FreePDK45_38x28_10R_NP_162NW_34O 0 19600 FS DO 34 BY 1 STEP 380 0 ;
15+
ROW ROW_8 FreePDK45_38x28_10R_NP_162NW_34O 0 22400 N DO 34 BY 1 STEP 380 0 ;
16+
ROW ROW_9 FreePDK45_38x28_10R_NP_162NW_34O 0 25200 FS DO 34 BY 1 STEP 380 0 ;
17+
ROW ROW_10 FreePDK45_38x28_10R_NP_162NW_34O 0 28000 N DO 34 BY 1 STEP 380 0 ;
18+
ROW ROW_11 FreePDK45_38x28_10R_NP_162NW_34O 0 30800 FS DO 34 BY 1 STEP 380 0 ;
19+
ROW ROW_D0 DoubleHeightSite 0 0 N DO 34 BY 1 STEP 380 0 ;
20+
ROW ROW_D1 DoubleHeightSite 0 5600 N DO 34 BY 1 STEP 380 0 ;
21+
ROW ROW_D2 DoubleHeightSite 0 11200 N DO 34 BY 1 STEP 380 0 ;
22+
ROW ROW_D3 DoubleHeightSite 0 16800 N DO 34 BY 1 STEP 380 0 ;
23+
ROW ROW_D4 DoubleHeightSite 0 22400 N DO 34 BY 1 STEP 380 0 ;
24+
ROW ROW_D5 DoubleHeightSite 0 28000 N DO 34 BY 1 STEP 380 0 ;
25+
ROW ROW_T0 TripleHeightSite 0 0 N DO 34 BY 1 STEP 380 0 ;
26+
ROW ROW_T1 TripleHeightSite 0 8400 FS DO 34 BY 1 STEP 380 0 ;
27+
ROW ROW_T2 TripleHeightSite 0 16800 N DO 34 BY 1 STEP 380 0 ;
28+
ROW ROW_T3 TripleHeightSite 0 25200 FS DO 34 BY 1 STEP 380 0 ;
29+
ROW ROW_Q0 QuadHeightSite 0 0 N DO 34 BY 1 STEP 380 0 ;
30+
ROW ROW_Q1 QuadHeightSite 0 11200 N DO 34 BY 1 STEP 380 0 ;
31+
ROW ROW_Q2 QuadHeightSite 0 22400 N DO 34 BY 1 STEP 380 0 ;
32+
COMPONENTS 7 ;
33+
- q1 MOCK_QUAD + PLACED ( 1900 0 ) N ;
34+
- q2 MOCK_QUAD + PLACED ( 2280 0 ) N ;
35+
- t1 MOCK_TRIPLE + PLACED ( 2660 0 ) N ;
36+
- d1 MOCK_DOUBLE + PLACED ( 3040 0 ) N ;
37+
- s1 MOCK_SINGLE + PLACED ( 3420 0 ) N ;
38+
- s2 MOCK_SINGLE + PLACED ( 3420 2800 ) FS ;
39+
- s3 MOCK_SINGLE + PLACED ( 3800 5600 ) N ;
40+
END COMPONENTS
41+
END DESIGN
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Exercise the negotiation legalizer with a 4-row tall cell (MOCK_QUAD).
2+
# Overlapping multi-height cells (quad, triple, double, single) on the same
3+
# rows force the negotiation loop to resolve conflicts across cells whose
4+
# heights span up to four standard rows.
5+
source "helpers.tcl"
6+
read_lef Nangate45/Nangate45.lef
7+
read_lef Nangate45/fake_macros.lef
8+
read_def negotiation_quad_height.def
9+
set_debug_level DPL negtotiation 1
10+
dpl::detailed_placement_debug -deep_iterative -paint_negotiation_pixels
11+
detailed_placement
12+
check_placement
13+
14+
set def_file [make_result_file negotiation_quad_height.def]
15+
write_def $def_file
16+
# diff_file negotiation_quad_height.defok $def_file

test/Nangate45/fake_macros.lef

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ SITE TripleHeightSite
132132
END TripleHeightSite
133133

134134

135+
SITE QuadHeightSite
136+
SYMMETRY Y ;
137+
CLASS core ;
138+
SIZE 0.19 BY 5.6 ;
139+
END QuadHeightSite
140+
141+
135142
SITE HybridG
136143
SYMMETRY X Y ;
137144
CLASS core ;
@@ -258,6 +265,34 @@ MACRO MOCK_TRIPLE
258265
END VSS
259266
END MOCK_TRIPLE
260267

268+
MACRO MOCK_QUAD
269+
CLASS CORE ;
270+
ORIGIN 0 0 ;
271+
FOREIGN AND2_X1 0 0 ;
272+
SIZE 0.76 BY 5.6 ;
273+
SYMMETRY X Y ;
274+
SITE QuadHeightSite ;
275+
PIN A1
276+
PORT
277+
LAYER metal1 ;
278+
RECT 0 0.1 0.1 0.2 ;
279+
END
280+
END A1
281+
PIN A2
282+
DIRECTION INPUT ;
283+
PORT
284+
LAYER metal1 ;
285+
RECT 0 1.8 0.1 1.9 ;
286+
END
287+
END A2
288+
PIN ZN
289+
END ZN
290+
PIN VDD
291+
END VDD
292+
PIN VSS
293+
END VSS
294+
END MOCK_QUAD
295+
261296
MACRO MOCK_HYBRID_A
262297
CLASS CORE ;
263298
ORIGIN 0 0 ;

0 commit comments

Comments
 (0)