Skip to content

Commit

Permalink
Merge pull request The-OpenROAD-Project#5800 from gadfort/fix-pad-orient
Browse files Browse the repository at this point in the history
pad: fix make_io_site rotations
  • Loading branch information
maliberty authored Sep 25, 2024
2 parents 536b45a + 0a8d33a commit d27219c
Show file tree
Hide file tree
Showing 11 changed files with 857 additions and 30 deletions.
6 changes: 3 additions & 3 deletions src/pad/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ make_io_sites
| `-vertical_site` | Name of the site for the vertical pads (north and south). |
| `-corner_site` | Name of the site for the corner cells. |
| `-offset` | Offset from the die edge to place the rows. |
| `-rotation_horizontal` | Rotation to apply to the horizontal sites to ensure pads are placed correctly. The default value is `R0`. |
| `-rotation_vertical` | Rotation to apply to the vertical sites to ensure pads are placed correctly. The default value is `R0`. |
| `-rotation_corner` | Rotation to apply to the corner sites to ensure pads are placed correctly. The default value is `R0`. |
| `-rotation_horizontal` | Rotation to apply to the horizontal sites to ensure pads are placed correctly. The default value is `R0` for the western (left) row when different sites are specified for hortizontal and vertical rows, the default value is `MXR90` when the same site is specified. |
| `-rotation_vertical` | Rotation to apply to the vertical sites to ensure pads are placed correctly. The default value is `R0` for the southern (bottom) row. |
| `-rotation_corner` | Rotation to apply to the corner sites to ensure pads are placed correctly. The default value is `R0` for the south west (lower left) corner. |
| `-ring_index` | Used to specify the index of the ring in case of multiple rings. |


Expand Down
20 changes: 11 additions & 9 deletions src/pad/src/ICeWall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ void ICeWall::makeIORow(odb::dbSite* horizontal_site,
const odb::dbRowDir& direction,
int site_width) {
const std::string row_name = getRowName(name, ring_index);
odb::dbTransform rotation(orient);
rotation.concat(row_rotation);
odb::dbTransform rotation(row_rotation);
rotation.concat(orient);
odb::dbRow::create(block,
row_name.c_str(),
site,
Expand All @@ -459,19 +459,22 @@ void ICeWall::makeIORow(odb::dbSite* horizontal_site,
sites,
site_width);
};
const odb::dbOrientType south_rotation_ver = odb::dbOrientType::R0;
const odb::dbOrientType north_rotation_ver = south_rotation_ver.flipX();
odb::dbOrientType west_rotation_hor = odb::dbOrientType::MXR90;
if (vertical_site != horizontal_site) {
west_rotation_hor = odb::dbOrientType::R0;
}
const odb::dbOrientType east_rotation_hor = west_rotation_hor.flipY();
create_row(row_north_,
vertical_site,
x_sites,
{nw->getBBox().xMax(),
outer_io.yMax() - static_cast<int>(vertical_box.maxDXDY())},
odb::dbOrientType::MX,
north_rotation_ver,
rotation_ver,
odb::dbRowDir::HORIZONTAL,
vertical_box.minDXDY());
odb::dbOrientType east_rotation_hor = odb::dbOrientType::R90;
if (vertical_site != horizontal_site) {
east_rotation_hor = odb::dbOrientType::R0;
}
create_row(row_east_,
horizontal_site,
y_sites,
Expand All @@ -485,11 +488,10 @@ void ICeWall::makeIORow(odb::dbSite* horizontal_site,
vertical_site,
x_sites,
{sw->getBBox().xMax(), outer_io.yMin()},
odb::dbOrientType::R0,
south_rotation_ver,
rotation_ver,
odb::dbRowDir::HORIZONTAL,
vertical_box.minDXDY());
const odb::dbOrientType west_rotation_hor = east_rotation_hor.flipY();
create_row(row_west_,
horizontal_site,
y_sites,
Expand Down
6 changes: 6 additions & 0 deletions src/pad/test/Nangate45_io/dummy_pads.lef
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ SITE IOSITE
SIZE 1.000 BY 140.000 ;
END IOSITE

SITE IOSITE2
SYMMETRY Y ;
CLASS PAD ;
SIZE 1.000 BY 140.000 ;
END IOSITE2

MACRO PAD
CLASS COVER ;
ORIGIN 0 0 ;
Expand Down
16 changes: 8 additions & 8 deletions src/pad/test/make_corner_sites.defok
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ BUSBITCHARS "[]" ;
DESIGN soc_bsg_black_parrot ;
UNITS DISTANCE MICRONS 2000 ;
DIEAREA ( 0 0 ) ( 6000000 6000000 ) ;
ROW IO_CORNER_NORTH_WEST IOSITE 30000 5690000 FW DO 140 BY 1 STEP 2000 0 ;
ROW IO_CORNER_NORTH_EAST IOSITE 5690000 5690000 W DO 140 BY 1 STEP 2000 0 ;
ROW IO_CORNER_SOUTH_EAST IOSITE 5690000 30000 FE DO 140 BY 1 STEP 2000 0 ;
ROW IO_CORNER_SOUTH_WEST IOSITE 30000 30000 E DO 140 BY 1 STEP 2000 0 ;
ROW IO_NORTH IOSITE 588000 5690000 FS DO 2690 BY 1 STEP 2000 0 ;
ROW IO_EAST IOSITE 5690000 32000 W DO 1 BY 2690 STEP 0 2000 ;
ROW IO_SOUTH IOSITE 588000 30000 N DO 2690 BY 1 STEP 2000 0 ;
ROW IO_WEST IOSITE 30000 32000 FW DO 1 BY 2690 STEP 0 2000 ;
ROW IO_CORNER_NORTH_WEST IOSITE 30000 5690000 S DO 140 BY 1 STEP 2000 0 ;
ROW IO_CORNER_NORTH_EAST IOSITE 5690000 5690000 FS DO 140 BY 1 STEP 2000 0 ;
ROW IO_CORNER_SOUTH_EAST IOSITE 5690000 30000 N DO 140 BY 1 STEP 2000 0 ;
ROW IO_CORNER_SOUTH_WEST IOSITE 30000 30000 FN DO 140 BY 1 STEP 2000 0 ;
ROW IO_NORTH IOSITE 310000 5690000 FS DO 2690 BY 1 STEP 2000 0 ;
ROW IO_EAST IOSITE 5690000 310000 W DO 1 BY 2690 STEP 0 2000 ;
ROW IO_SOUTH IOSITE 310000 30000 N DO 2690 BY 1 STEP 2000 0 ;
ROW IO_WEST IOSITE 30000 310000 FW DO 1 BY 2690 STEP 0 2000 ;
TRACKS X 190 DO 21428 STEP 280 LAYER metal1 ;
TRACKS Y 140 DO 21428 STEP 280 LAYER metal1 ;
TRACKS X 190 DO 15789 STEP 380 LAYER metal2 ;
Expand Down
2 changes: 1 addition & 1 deletion src/pad/test/make_corner_sites.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ make_io_sites \
-vertical_site IOSITE \
-corner_site IOSITE \
-offset 15 \
-rotation_corner R270
-rotation_corner MY

set def_file [make_result_file "make_corner_sites.def"]
write_def $def_file
Expand Down
16 changes: 8 additions & 8 deletions src/pad/test/make_io_sites_different_sites.defok
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ BUSBITCHARS "[]" ;
DESIGN soc_bsg_black_parrot ;
UNITS DISTANCE MICRONS 2000 ;
DIEAREA ( 0 0 ) ( 6000000 6000000 ) ;
ROW IO_CORNER_NORTH_WEST IOSITE 30000 5690000 FS DO 50 BY 1 STEP 2000 0 ;
ROW IO_CORNER_NORTH_EAST IOSITE 5968000 5690000 S DO 50 BY 1 STEP 2000 0 ;
ROW IO_CORNER_SOUTH_EAST IOSITE 5968000 30000 FN DO 50 BY 1 STEP 2000 0 ;
ROW IO_CORNER_SOUTH_WEST IOSITE 30000 30000 N DO 50 BY 1 STEP 2000 0 ;
ROW IO_NORTH VERTICAL 130000 5870000 FS DO 2968 BY 1 STEP 2000 0 ;
ROW IO_EAST HORIZONTAL 5870000 310000 N DO 1 BY 2690 STEP 0 2000 ;
ROW IO_SOUTH VERTICAL 130000 30000 N DO 2968 BY 1 STEP 2000 0 ;
ROW IO_WEST HORIZONTAL 30000 310000 FN DO 1 BY 2690 STEP 0 2000 ;
ROW IO_CORNER_NORTH_WEST CORNER 30000 5870000 FS DO 1 BY 1 STEP 100000 0 ;
ROW IO_CORNER_NORTH_EAST CORNER 5870000 5870000 S DO 1 BY 1 STEP 100000 0 ;
ROW IO_CORNER_SOUTH_EAST CORNER 5870000 30000 FN DO 1 BY 1 STEP 100000 0 ;
ROW IO_CORNER_SOUTH_WEST CORNER 30000 30000 N DO 1 BY 1 STEP 100000 0 ;
ROW IO_NORTH VERTICAL 130000 5870000 FS DO 2870 BY 1 STEP 2000 0 ;
ROW IO_EAST HORIZONTAL 5870000 130000 FN DO 1 BY 2870 STEP 0 2000 ;
ROW IO_SOUTH VERTICAL 130000 30000 N DO 2870 BY 1 STEP 2000 0 ;
ROW IO_WEST HORIZONTAL 30000 130000 N DO 1 BY 2870 STEP 0 2000 ;
TRACKS X 190 DO 21428 STEP 280 LAYER metal1 ;
TRACKS Y 140 DO 21428 STEP 280 LAYER metal1 ;
TRACKS X 190 DO 15789 STEP 380 LAYER metal2 ;
Expand Down
3 changes: 2 additions & 1 deletion src/pad/test/make_io_sites_different_sites.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ read_def Nangate45_blackparrot/floorplan.def

make_fake_io_site -name HORIZONTAL -width 50 -height 1
make_fake_io_site -name VERTICAL -width 1 -height 50
make_fake_io_site -name CORNER -width 50 -height 50

# Test make_io_sites
make_io_sites -horizontal_site HORIZONTAL -vertical_site VERTICAL -corner_site IOSITE -offset 15
make_io_sites -horizontal_site HORIZONTAL -vertical_site VERTICAL -corner_site CORNER -offset 15

set def_file [make_result_file "make_io_sites_different_sites.def"]
write_def $def_file
Expand Down
Loading

0 comments on commit d27219c

Please sign in to comment.