Skip to content

Commit 45083c0

Browse files
committed
drt: fix lef58_area bugs
Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
1 parent e6b3b9c commit 45083c0

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

src/drt/src/gc/FlexGC_main.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,26 +2116,26 @@ void FlexGCWorker::Impl::checkMetalShape_lef58Area(gcPin* pin)
21162116
if (!drWorker_->getDrcBox().contains(bbox2)) {
21172117
return;
21182118
}
2119-
const frCoord width = bbox2.minDXDY();
2119+
const bool is_rect = poly->size() == 4;
21202120
const auto curr_area = gtl::area(*poly);
2121-
// iterate through rectwidth constraints first
2122-
for (auto con : layer->getLef58AreaConstraintsRectWidth()) {
2123-
odb::dbTechLayerAreaRule* db_rule = con->getODBRule();
2124-
if (width < db_rule->getRectWidth()) {
2125-
auto min_area = db_rule->getArea();
2126-
if (curr_area < min_area
2127-
&& checkMetalShape_lef58Area_rectWidth(poly, db_rule)) {
2128-
checkMetalShape_addPatch(pin, min_area);
2121+
if (is_rect) { // iterate through rectwidth constraints first
2122+
for (auto con : layer->getLef58AreaConstraintsRectWidth()) {
2123+
odb::dbTechLayerAreaRule* db_rule = con->getODBRule();
2124+
if (checkMetalShape_lef58Area_rectWidth(poly, db_rule)) {
2125+
// we found a rectwidth constraint that is satisfied
2126+
const auto min_area = db_rule->getArea();
2127+
if (curr_area < min_area) {
2128+
checkMetalShape_addPatch(pin, min_area);
2129+
}
2130+
return;
21292131
}
2130-
// if any rectwidth constraint is satisfied, return
2131-
return;
21322132
}
21332133
}
21342134
// Iterate through area constraints which are sorted by area in a descending
21352135
// order
21362136
for (auto con : layer->getLef58AreaConstraints()) {
21372137
odb::dbTechLayerAreaRule* db_rule = con->getODBRule();
2138-
auto min_area = db_rule->getArea();
2138+
const auto min_area = db_rule->getArea();
21392139

21402140
if (curr_area >= min_area) {
21412141
break;
@@ -2184,7 +2184,7 @@ bool FlexGCWorker::Impl::checkMetalShape_lef58Area_rectWidth(
21842184
const auto& rect = rects.back();
21852185
auto xLen = gtl::delta(rect, gtl::HORIZONTAL);
21862186
auto yLen = gtl::delta(rect, gtl::VERTICAL);
2187-
return std::min(xLen, yLen) < min_width;
2187+
return std::min(xLen, yLen) <= min_width;
21882188
}
21892189
return false;
21902190
}

0 commit comments

Comments
 (0)