@@ -1027,7 +1027,8 @@ Rudy* GlobalRouter::getRudy()
10271027
10281028bool GlobalRouter::findPinAccessPointPositions (
10291029 const Pin& pin,
1030- std::map<int , std::vector<PointPair>>& ap_positions)
1030+ std::map<int , std::vector<PointPair>>& ap_positions,
1031+ bool all_access_points)
10311032{
10321033 std::vector<odb::dbAccessPoint*> access_points;
10331034 // get APs from odb
@@ -1038,7 +1039,7 @@ bool GlobalRouter::findPinAccessPointPositions(
10381039 access_points.insert (
10391040 access_points.begin (), bpin_pas.begin (), bpin_pas.end ());
10401041 }
1041- } else if (pin.isCorePin ()) {
1042+ } else if (pin.isCorePin () && !all_access_points ) {
10421043 access_points = pin.getITerm ()->getPrefAccessPoints ();
10431044 } else {
10441045 // For non-core cells, DRT does not assign preferred APs.
@@ -2336,7 +2337,8 @@ void GlobalRouter::ensurePinsPositions(odb::dbNet* db_net)
23362337 if (!netIsCovered (db_net, pins_not_covered)) {
23372338 Net* net = db_net_map_[db_net];
23382339 for (Pin& pin : net->getPins ()) {
2339- if (pins_not_covered.find (pin.getName ()) != std::string::npos) {
2340+ if (pins_not_covered.find (pin.getName ()) != std::string::npos
2341+ && !findCoveredAccessPoint (net, pin)) {
23402342 bool has_aps;
23412343 odb::Point pos_on_grid;
23422344 std::vector<RoutePt> pin_positions_on_grid
@@ -2348,6 +2350,27 @@ void GlobalRouter::ensurePinsPositions(odb::dbNet* db_net)
23482350 }
23492351}
23502352
2353+ bool GlobalRouter::findCoveredAccessPoint (const Net* net, Pin& pin)
2354+ {
2355+ std::map<int , std::vector<PointPair>> ap_positions;
2356+ if (findPinAccessPointPositions (pin, ap_positions, true )) {
2357+ const GRoute& segments = routes_[net->getDbNet ()];
2358+ for (const auto & [layer, aps] : ap_positions) {
2359+ pin.setConnectionLayer (layer);
2360+ for (const auto & point_pair : aps) {
2361+ pin.setOnGridPosition (grid_->getPositionOnGrid (point_pair.second ));
2362+ for (const GSegment& seg : segments) {
2363+ if (segmentCoversPin (seg, pin)) {
2364+ return true ;
2365+ }
2366+ }
2367+ }
2368+ }
2369+ }
2370+
2371+ return false ;
2372+ }
2373+
23512374void GlobalRouter::updateVias ()
23522375{
23532376 for (auto & net_route : routes_) {
0 commit comments