Skip to content

Commit 80cdb5c

Browse files
authored
Merge pull request #8804 from gadfort/init-fp
ifp: remove old tracks when floorplan is changed
2 parents 2e8db52 + 3fa5fbb commit 80cdb5c

File tree

8 files changed

+368
-18
lines changed

8 files changed

+368
-18
lines changed

src/ifp/include/ifp/InitFloorplan.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class InitFloorplan
126126
int y_offset,
127127
int y_pitch,
128128
int first_last_pitch);
129+
void resetTracks() const;
129130

130131
odb::dbSite* findSite(const char* site_name);
131132

src/ifp/src/InitFloorplan.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ void InitFloorplan::makeDie(const odb::Rect& die)
186186
snapToMfgGrid(die.xMax()),
187187
snapToMfgGrid(die.yMax()));
188188
block_->setDieArea(die_area);
189+
190+
resetTracks();
189191
}
190192

191193
void InitFloorplan::makePolygonDie(const odb::Polygon& polygon)
@@ -214,6 +216,8 @@ void InitFloorplan::makePolygonDie(const odb::Polygon& polygon)
214216

215217
// Set the die area using the polygon
216218
block_->setDieArea(polygon);
219+
220+
resetTracks();
217221
}
218222

219223
void InitFloorplan::makePolygonRows(
@@ -977,6 +981,16 @@ void InitFloorplan::makeTracks()
977981
}
978982
}
979983

984+
void InitFloorplan::resetTracks() const
985+
{
986+
for (auto layer : block_->getDataBase()->getTech()->getLayers()) {
987+
auto grid = block_->findTrackGrid(layer);
988+
if (grid) {
989+
odb::dbTrackGrid::destroy(grid);
990+
}
991+
}
992+
}
993+
980994
void InitFloorplan::makeTracks(odb::dbTechLayer* layer,
981995
int x_offset,
982996
int x_pitch,

src/ifp/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ COMPULSORY_TESTS = [
1818
"init_floorplan8",
1919
"init_floorplan9",
2020
"init_floorplan10",
21+
"init_floorplan11",
2122
"init_floorplan_dbl_row",
2223
"init_floorplan_even_rows",
2324
"init_floorplan_flip_sites",

src/ifp/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ or_integration_tests(
1313
init_floorplan8
1414
init_floorplan9
1515
init_floorplan10
16+
init_floorplan11
1617
init_floorplan_dbl_row
1718
init_floorplan_even_rows
1819
init_floorplan_flip_sites

src/ifp/test/init_floorplan11.defok

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

src/ifp/test/init_floorplan11.ok

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[WARNING IFP-0028] Core area lower left (110.000, 110.000) snapped to (110.010, 110.600).
3+
[INFO IFP-0001] Added 563 rows of 4157 site FreePDK45_38x28_10R_NP_162NW_34O.
4+
[WARNING IFP-0028] Core area lower left (110.000, 110.000) snapped to (110.010, 110.600).
5+
[INFO IFP-0001] Added 271 rows of 1999 site FreePDK45_38x28_10R_NP_162NW_34O.
6+
No differences found.

src/ifp/test/init_floorplan11.tcl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# init_floorplan ensure only one set of tracks appear after initialize_floorplan
2+
source "helpers.tcl"
3+
read_lef Nangate45/Nangate45.lef
4+
read_liberty Nangate45/Nangate45_typ.lib
5+
read_verilog reg1.v
6+
link_design top
7+
initialize_floorplan -die_area "0 0 1000 1000" \
8+
-core_area "110 110 900 900" \
9+
-site FreePDK45_38x28_10R_NP_162NW_34O
10+
make_tracks
11+
12+
# Repeat with diffent size
13+
initialize_floorplan -die_area "0 0 500 500" \
14+
-core_area "110 110 490 490" \
15+
-site FreePDK45_38x28_10R_NP_162NW_34O
16+
make_tracks
17+
18+
set def_file [make_result_file init_floorplan11.def]
19+
write_def $def_file
20+
diff_files init_floorplan11.defok $def_file

src/pdn/test/core_grid_with_single_edge_pins.defok

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,6 @@ ROW ROW_68 FreePDK45_38x28_10R_NP_162NW_34O 0 190400 N DO 527 BY 1 STEP 380 0 ;
7676
ROW ROW_69 FreePDK45_38x28_10R_NP_162NW_34O 0 193200 FS DO 527 BY 1 STEP 380 0 ;
7777
ROW ROW_70 FreePDK45_38x28_10R_NP_162NW_34O 0 196000 N DO 527 BY 1 STEP 380 0 ;
7878
ROW ROW_71 FreePDK45_38x28_10R_NP_162NW_34O 0 198800 FS DO 527 BY 1 STEP 380 0 ;
79-
TRACKS X 190 DO 527 STEP 380 LAYER metal1 ;
80-
TRACKS Y 140 DO 720 STEP 280 LAYER metal1 ;
81-
TRACKS X 190 DO 527 STEP 380 LAYER metal2 ;
82-
TRACKS Y 140 DO 720 STEP 280 LAYER metal2 ;
83-
TRACKS X 190 DO 527 STEP 380 LAYER metal3 ;
84-
TRACKS Y 140 DO 720 STEP 280 LAYER metal3 ;
85-
TRACKS X 190 DO 358 STEP 560 LAYER metal4 ;
86-
TRACKS Y 140 DO 360 STEP 560 LAYER metal4 ;
87-
TRACKS X 190 DO 358 STEP 560 LAYER metal5 ;
88-
TRACKS Y 140 DO 360 STEP 560 LAYER metal5 ;
89-
TRACKS X 190 DO 358 STEP 560 LAYER metal6 ;
90-
TRACKS Y 140 DO 360 STEP 560 LAYER metal6 ;
91-
TRACKS X 190 DO 126 STEP 1600 LAYER metal7 ;
92-
TRACKS Y 140 DO 126 STEP 1600 LAYER metal7 ;
93-
TRACKS X 190 DO 126 STEP 1600 LAYER metal8 ;
94-
TRACKS Y 140 DO 126 STEP 1600 LAYER metal8 ;
95-
TRACKS X 190 DO 63 STEP 3200 LAYER metal9 ;
96-
TRACKS Y 140 DO 63 STEP 3200 LAYER metal9 ;
9779
VIAS 10 ;
9880
- via1_2_960_340_1_3_300_300 + VIARULE Via1Array-0 + CUTSIZE 140 140 + LAYERS metal1 via1 metal2 + CUTSPACING 160 160 + ENCLOSURE 70 100 70 70 + ROWCOL 1 3 ;
9981
- via2_3_960_340_1_3_320_320 + VIARULE Via2Array-0 + CUTSIZE 140 140 + LAYERS metal2 via2 metal3 + CUTSPACING 180 180 + ENCLOSURE 70 70 70 70 + ROWCOL 1 3 ;

0 commit comments

Comments
 (0)