Skip to content

Commit c62be3f

Browse files
authored
Merge pull request #8608 from gadfort/pad-corner-check-overlaps
pad: check for overlapping fixed instances in corners before placing corner cells
2 parents 3fb02c0 + 1e4dc2f commit c62be3f

File tree

6 files changed

+999
-2
lines changed

6 files changed

+999
-2
lines changed

src/pad/src/ICeWall.cpp

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,12 +515,40 @@ void ICeWall::placeCorner(odb::dbMaster* master, int ring_index)
515515

516516
const std::string corner_name = fmt::format("{}_INST", row->getName());
517517
odb::dbInst* inst = block->findInst(corner_name.c_str());
518+
519+
const odb::Rect row_bbox = row->getBBox();
520+
521+
// Check for instances overlapping the corner site
522+
bool place_inst = true;
523+
for (auto* check_inst : block->getInsts()) {
524+
if (check_inst == inst) {
525+
continue;
526+
}
527+
if (!check_inst->isFixed()) {
528+
continue;
529+
}
530+
if (check_inst->getMaster()->isCover()) {
531+
continue;
532+
}
533+
const odb::Rect check_rect = check_inst->getBBox()->getBox();
534+
if (row_bbox.overlaps(check_rect)) {
535+
place_inst = false;
536+
break;
537+
}
538+
}
539+
if (!place_inst) {
540+
logger_->warn(
541+
utl::PAD,
542+
44,
543+
"Skipping corner cell placement in {} due to overlapping instances",
544+
row->getName());
545+
continue;
546+
}
547+
518548
if (inst == nullptr) {
519549
inst = odb::dbInst::create(block, master, corner_name.c_str());
520550
}
521551

522-
const odb::Rect row_bbox = row->getBBox();
523-
524552
inst->setOrient(row->getOrient());
525553
inst->setLocation(row_bbox.xMin(), row_bbox.yMin());
526554
inst->setPlacementStatus(odb::dbPlacementStatus::FIRM);

src/pad/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ COMPULSORY_TESTS = [
2222
"non_top_layer",
2323
"place_bondpad",
2424
"place_bondpad_stagger",
25+
"place_corners_avoid_overlap",
2526
"place_io_terminals_empty_call",
2627
"place_pad",
2728
"place_pad_hv",

src/pad/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ or_integration_tests(
1717
non_top_layer
1818
place_bondpad
1919
place_bondpad_stagger
20+
place_corners_avoid_overlap
2021
place_io_terminals_empty_call
2122
place_pad
2223
place_pad_hv

0 commit comments

Comments
 (0)