Skip to content

Commit

Permalink
Merge pull request The-OpenROAD-Project#5757 from The-OpenROAD-Projec…
Browse files Browse the repository at this point in the history
…t-staging/TR-fix-gc-patch

fixes The-OpenROAD-Project#5723
  • Loading branch information
maliberty authored Sep 18, 2024
2 parents 32fa681 + 76ffbc9 commit 642cdeb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/drt/src/gc/FlexGC_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2131,6 +2131,14 @@ bool FlexGCWorker::Impl::checkMetalShape_lef58Area_rectWidth(
return false;
}

namespace gc_patch {
bool isPatchValid(drPatchWire* pwire, const Rect& boundary_box)
{
return pwire->getBBox().intersects(boundary_box)
|| boundary_box.intersects(pwire->getOrigin());
}
} // namespace gc_patch

void FlexGCWorker::Impl::checkMetalShape_addPatch(gcPin* pin, int min_area)
{
auto poly = pin->getPolygon();
Expand Down Expand Up @@ -2208,6 +2216,9 @@ void FlexGCWorker::Impl::checkMetalShape_addPatch(gcPin* pin, int min_area)
return;
}

if (!gc_patch::isPatchValid(patch.get(), getDRWorker()->getRouteBox())) {
return;
}
pwires_.push_back(std::move(patch));
}

Expand Down Expand Up @@ -3659,6 +3670,9 @@ void FlexGCWorker::Impl::patchMetalShape_cornerSpacing()
patch->setOrigin(origin);
patch->setOffsetBox(markerBBox);
patch->addToNet(net);
if (!gc_patch::isPatchValid(patch.get(), getDRWorker()->getRouteBox())) {
continue;
}
pwires_.push_back(std::move(patch));
}
}
Expand Down Expand Up @@ -3781,6 +3795,9 @@ void FlexGCWorker::Impl::patchMetalShape_minStep()
patch->setOrigin(origin);
patch->setOffsetBox(markerBBox);
patch->addToNet(net);
if (!gc_patch::isPatchValid(patch.get(), getDRWorker()->getRouteBox())) {
continue;
}
pwires_.push_back(std::move(patch));
}
}
Expand Down

0 comments on commit 642cdeb

Please sign in to comment.