Skip to content

Commit 995b782

Browse files
authored
Merge pull request #10727 from Fermions-ASI/fix/6704
dpl: make legalPt() Y-clamp origin-independent + add centered_floorplan test (#6704)
2 parents ab7bb14 + 598a797 commit 995b782

7 files changed

Lines changed: 81 additions & 2 deletions

File tree

src/dpl/src/Place.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,9 +1150,8 @@ DbuPt Opendp::legalPt(const Node* cell, const DbuPt& pt) const
11501150
// Align with row site.
11511151
const GridX grid_x{divRound(core_x.v, site_width.v)};
11521152
const DbuX legal_x{gridToDbu(grid_x, site_width)};
1153-
// Align to row
11541153
const DbuY core_y
1155-
= std::clamp(pt.y, DbuY{0}, DbuY{core_.yMax()} - cell->getHeight());
1154+
= std::clamp(pt.y, DbuY{0}, DbuY{core_.dy()} - cell->getHeight());
11561155
const GridY grid_y = grid_->gridRoundY(core_y);
11571156
DbuY legal_y = grid_->gridYToDbu(grid_y);
11581157

src/dpl/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ COMPULSORY_TESTS = [
1313
"blockage01",
1414
"cell_on_block1",
1515
"cell_on_block2",
16+
"centered_floorplan",
1617
"check1",
1718
"check2",
1819
"check3",

src/dpl/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ or_integration_tests(
88
blockage01
99
cell_on_block1
1010
cell_on_block2
11+
centered_floorplan
1112
check1
1213
check2
1314
check3
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
VERSION 5.8 ;
2+
DIVIDERCHAR "/" ;
3+
BUSBITCHARS "[]" ;
4+
DESIGN centered_dpl ;
5+
UNITS DISTANCE MICRONS 2000 ;
6+
DIEAREA ( 76000 140000 ) ( 91200 151200 ) ;
7+
ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 76000 140000 FS DO 40 BY 1 STEP 380 0 ;
8+
ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 76000 142800 N DO 40 BY 1 STEP 380 0 ;
9+
ROW ROW_2 FreePDK45_38x28_10R_NP_162NW_34O 76000 145600 FS DO 40 BY 1 STEP 380 0 ;
10+
ROW ROW_3 FreePDK45_38x28_10R_NP_162NW_34O 76000 148400 N DO 40 BY 1 STEP 380 0 ;
11+
COMPONENTS 6 ;
12+
- u0 BUF_X1 + PLACED ( 76000 140000 ) N ;
13+
- u1 BUF_X1 + PLACED ( 76380 140000 ) N ;
14+
- u2 BUF_X1 + PLACED ( 76760 140000 ) N ;
15+
- u3 INV_X1 + PLACED ( 77140 140000 ) N ;
16+
- u4 INV_X1 + PLACED ( 77520 140000 ) N ;
17+
- u5 BUF_X1 + PLACED ( 77900 140000 ) N ;
18+
END COMPONENTS
19+
END DESIGN
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
VERSION 5.8 ;
2+
DIVIDERCHAR "/" ;
3+
BUSBITCHARS "[]" ;
4+
DESIGN centered_dpl ;
5+
UNITS DISTANCE MICRONS 2000 ;
6+
DIEAREA ( 76000 140000 ) ( 91200 151200 ) ;
7+
ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 76000 140000 FS DO 40 BY 1 STEP 380 0 ;
8+
ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 76000 142800 N DO 40 BY 1 STEP 380 0 ;
9+
ROW ROW_2 FreePDK45_38x28_10R_NP_162NW_34O 76000 145600 FS DO 40 BY 1 STEP 380 0 ;
10+
ROW ROW_3 FreePDK45_38x28_10R_NP_162NW_34O 76000 148400 N DO 40 BY 1 STEP 380 0 ;
11+
COMPONENTS 6 ;
12+
- u0 BUF_X1 + PLACED ( 76000 142800 ) N ;
13+
- u1 BUF_X1 + PLACED ( 79040 140000 ) FS ;
14+
- u2 BUF_X1 + PLACED ( 76760 140000 ) FS ;
15+
- u3 INV_X1 + PLACED ( 77140 142800 ) N ;
16+
- u4 INV_X1 + PLACED ( 76000 140000 ) FS ;
17+
- u5 BUF_X1 + PLACED ( 77900 140000 ) FS ;
18+
END COMPONENTS
19+
NETS 0 ;
20+
END NETS
21+
END DESIGN

src/dpl/test/centered_floorplan.ok

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[INFO ODB-0128] Design: centered_dpl
3+
[INFO ODB-0131] Created 6 components and 24 component-terminals.
4+
[INFO DPL-0006] Core area: 42.56 um^2, Instances area: 4.26 um^2, Utilization: 10.0%
5+
[INFO DPL-0005] Diamond search max displacement: +/- 500 sites horizontally, +/- 100 rows vertically.
6+
[INFO DPL-1101] Legalizing using diamond search.
7+
Movements Summary
8+
---------------------------------------
9+
Total cells: 6
10+
Diamond Move Success: 6 (100.00%)
11+
Diamond Move Failure: 0
12+
Rip-up and replace Success: 0 ( 0.00% of diamond failures)
13+
Rip-up and replace Failure: 0
14+
Total Placement Failures: 0
15+
---------------------------------------
16+
Placement Analysis
17+
---------------------------------
18+
total displacement 4.9 u
19+
average displacement 0.8 u
20+
max displacement 1.4 u
21+
original HPWL 0.0 u
22+
legalized HPWL 0.0 u
23+
delta HPWL 0 %
24+
25+
No differences found.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Centered (non-origin) floorplan: DIEAREA lower-left is not (0,0).
2+
# Regression guard for #6704 -- detailed_placement must legalize a centered
3+
# floorplan the same way it does an origin-anchored one (no exploded
4+
# displacement, clean check_placement).
5+
source "helpers.tcl"
6+
read_lef Nangate45/Nangate45.lef
7+
read_def centered_floorplan.def
8+
detailed_placement
9+
check_placement
10+
11+
set def_file [make_result_file centered_floorplan.def]
12+
write_def $def_file
13+
diff_file centered_floorplan.defok $def_file

0 commit comments

Comments
 (0)