@@ -1644,16 +1644,7 @@ void FlexGCWorker::Impl::checkMetalShape_minArea(gcPin* pin,
16441644 if (allow_patching) {
16451645 checkMetalShape_addPatch (pin, reqArea);
16461646 } else {
1647- auto net = poly->getNet ();
1648- auto marker = std::make_unique<frMarker>();
1649- marker->setBBox (bbox2);
1650- marker->setLayerNum (layerNum);
1651- marker->setConstraint (con);
1652- marker->addSrc (net->getOwner ());
1653- marker->addVictim (net->getOwner (), std::make_tuple (layerNum, bbox2, false ));
1654- marker->addAggressor (net->getOwner (),
1655- std::make_tuple (layerNum, bbox2, false ));
1656- addMarker (std::move (marker));
1647+ checkMetalShape_addMarker (pin, con, bbox2);
16571648 }
16581649}
16591650
@@ -2095,9 +2086,15 @@ void FlexGCWorker::Impl::checkMetalShape_minEnclosedArea(gcPin* pin)
20952086 }
20962087}
20972088
2098- void FlexGCWorker::Impl::checkMetalShape_lef58Area (gcPin* pin)
2089+ void FlexGCWorker::Impl::checkMetalShape_lef58Area (gcPin* pin,
2090+ bool allow_patching)
20992091{
2100- if (ignoreMinArea_ || !targetNet_) {
2092+ if (ignoreMinArea_) {
2093+ return ;
2094+ }
2095+ // Patching requires a target net (and an associated drWorker); marking does
2096+ // not.
2097+ if (allow_patching && !targetNet_) {
21012098 return ;
21022099 }
21032100
@@ -2113,7 +2110,7 @@ void FlexGCWorker::Impl::checkMetalShape_lef58Area(gcPin* pin)
21132110 gtl::extents (bbox, *pin->getPolygon ());
21142111 const odb::Rect bbox2 (
21152112 gtl::xl (bbox), gtl::yl (bbox), gtl::xh (bbox), gtl::yh (bbox));
2116- if (!drWorker_-> getDrcBox () .contains (bbox2)) {
2113+ if (!drcBox_ .contains (bbox2)) {
21172114 return ;
21182115 }
21192116 const bool is_rect = poly->size () == 4 ;
@@ -2125,7 +2122,11 @@ void FlexGCWorker::Impl::checkMetalShape_lef58Area(gcPin* pin)
21252122 // we found a rectwidth constraint that is satisfied
21262123 const auto min_area = db_rule->getArea ();
21272124 if (curr_area < min_area) {
2128- checkMetalShape_addPatch (pin, min_area);
2125+ if (allow_patching) {
2126+ checkMetalShape_addPatch (pin, min_area);
2127+ } else {
2128+ checkMetalShape_addMarker (pin, con, bbox2);
2129+ }
21292130 }
21302131 return ;
21312132 }
@@ -2142,7 +2143,11 @@ void FlexGCWorker::Impl::checkMetalShape_lef58Area(gcPin* pin)
21422143 }
21432144 if (!db_rule->isExceptRectangle ()
21442145 || checkMetalShape_lef58Area_exceptRectangle (poly, db_rule)) {
2145- checkMetalShape_addPatch (pin, min_area);
2146+ if (allow_patching) {
2147+ checkMetalShape_addPatch (pin, min_area);
2148+ } else {
2149+ checkMetalShape_addMarker (pin, con, bbox2);
2150+ }
21462151 break ;
21472152 }
21482153 }
@@ -2283,6 +2288,24 @@ void FlexGCWorker::Impl::checkMetalShape_addPatch(gcPin* pin, int min_area)
22832288 pwires_.push_back (std::move (patch));
22842289}
22852290
2291+ void FlexGCWorker::Impl::checkMetalShape_addMarker (gcPin* pin,
2292+ frConstraint* con,
2293+ const odb::Rect& bbox)
2294+ {
2295+ auto poly = pin->getPolygon ();
2296+ auto layer_num = poly->getLayerNum ();
2297+ auto net = poly->getNet ();
2298+ auto marker = std::make_unique<frMarker>();
2299+ marker->setBBox (bbox);
2300+ marker->setLayerNum (layer_num);
2301+ marker->setConstraint (con);
2302+ marker->addSrc (net->getOwner ());
2303+ marker->addVictim (net->getOwner (), std::make_tuple (layer_num, bbox, false ));
2304+ marker->addAggressor (net->getOwner (),
2305+ std::make_tuple (layer_num, bbox, false ));
2306+ addMarker (std::move (marker));
2307+ }
2308+
22862309void FlexGCWorker::Impl::checkMetalShape_patchOwner_helper (
22872310 drPatchWire* patch,
22882311 const std::vector<drNet*>* dr_nets)
@@ -2353,9 +2376,7 @@ void FlexGCWorker::Impl::checkMetalShape_main(gcPin* pin, bool allow_patching)
23532376 checkMetalShape_minEnclosedArea (pin);
23542377
23552378 // lef58 area
2356- if (allow_patching) {
2357- checkMetalShape_lef58Area (pin);
2358- }
2379+ checkMetalShape_lef58Area (pin, allow_patching);
23592380}
23602381
23612382void FlexGCWorker::Impl::checkMetalShape (bool allow_patching)
0 commit comments