Skip to content

Commit 745f72f

Browse files
Merge pull request #9227 from gudeh/dpl-fix-one-site-gap
dpl: fix one site gap false positive
2 parents e872bb8 + 702e355 commit 745f72f

File tree

7 files changed

+2669
-29
lines changed

7 files changed

+2669
-29
lines changed

src/dpl/src/Place.cpp

Lines changed: 47 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -915,38 +915,56 @@ bool Opendp::checkPixels(const Node* cell,
915915
return false;
916916
}
917917
}
918-
if (disallow_one_site_gaps_) {
919-
// here we need to check for abutting first, if there is an abutting
920-
// cell then we continue as there is nothing wrong with it if there is
921-
// no abutting cell, we will then check cells at 1+ distances we only
922-
// need to check on the left and right sides
923-
const GridX x_begin = max(GridX{0}, x - 1);
924-
const GridY y_begin = max(GridY{0}, y - 1);
925-
// inclusive search, so we don't add 1 to the end
926-
const GridX x_finish = min(x_end, grid_->getRowSiteCount() - 1);
927-
const GridY y_finish = min(y_end, grid_->getRowCount() - 1);
928-
929-
auto isAbutted = [this](const GridX x, const GridY y) {
930-
const Pixel* pixel = grid_->gridPixel(x, y);
931-
return (pixel == nullptr || pixel->cell);
932-
};
933-
934-
auto cellAtSite = [this](const GridX x, const GridY y) {
935-
const Pixel* pixel = grid_->gridPixel(x, y);
936-
return (pixel != nullptr && pixel->cell);
937-
};
938-
for (GridY y = y_begin; y <= y_finish; ++y) {
939-
// left side
940-
if (!isAbutted(x_begin, y) && cellAtSite(x_begin - 1, y)) {
941-
return false;
942-
}
943-
// right side
944-
if (!isAbutted(x_finish, y) && cellAtSite(x_finish + 1, y)) {
945-
return false;
946-
}
918+
}
919+
920+
if (disallow_one_site_gaps_) {
921+
// here we need to check for abutting first, if there is an abutting
922+
// cell then we continue as there is nothing wrong with it if there is
923+
// no abutting cell, we will then check cells at 1+ distances we only
924+
// need to check on the left and right sides
925+
const GridX x_begin = max(GridX{0}, x - 1);
926+
const GridY y_begin = max(GridY{0}, y);
927+
// inclusive search, so we don't add 1 to the end
928+
const GridX x_finish = min(x_end, grid_->getRowSiteCount() - 1);
929+
const GridY y_finish = min(y_end, grid_->getRowCount() - 1);
930+
931+
auto isAbutted = [this](const GridX x, const GridY y) {
932+
const Pixel* pixel = grid_->gridPixel(x, y);
933+
return (pixel == nullptr || pixel->cell);
934+
};
935+
936+
auto cellAtSite = [this](const GridX x, const GridY y) {
937+
const Pixel* pixel = grid_->gridPixel(x, y);
938+
return (pixel != nullptr && pixel->cell);
939+
};
940+
for (GridY y = y_begin; y < y_finish; ++y) {
941+
// left side
942+
if (!isAbutted(x_begin, y) && cellAtSite(x_begin - 1, y)) {
943+
debugPrint(logger_,
944+
DPL,
945+
"one_site_gap",
946+
1,
947+
"One site gap left of {} at ({}, {})",
948+
cell->name(),
949+
x,
950+
y);
951+
return false;
952+
}
953+
// right side
954+
if (!isAbutted(x_finish, y) && cellAtSite(x_finish + 1, y)) {
955+
debugPrint(logger_,
956+
DPL,
957+
"one_site_gap",
958+
1,
959+
"One site gap right of {} at ({}, {})",
960+
cell->name(),
961+
x,
962+
y);
963+
return false;
947964
}
948965
}
949966
}
967+
950968
const auto orient = grid_->getSiteOrientation(x, y, site).value();
951969
return drc_engine_->checkDRC(cell, x, y, orient);
952970
}

src/dpl/src/dbToOpendp.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ void Opendp::importDb()
4141
grid_->setCore(core_);
4242
have_fillers_ = false;
4343
disallow_one_site_gaps_ = !odb::hasOneSiteMaster(db_);
44+
debugPrint(logger_,
45+
utl::DPL,
46+
"one_site_gap",
47+
1,
48+
"one_site_gaps disallowed: {}",
49+
disallow_one_site_gaps_ ? "true" : "false");
4450
importClear();
4551
grid_->examineRows(block_);
4652
initPlacementDRC();

src/dpl/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ or_integration_tests(
7777
blockage1-opt
7878
gcd-opt
7979
gcd_no_one_site_gaps-opt
80+
gcd_no_one_site_sanity
8081
ibex-opt
8182
multi_height1-opt
8283
edge_spacing-opt

0 commit comments

Comments
 (0)