@@ -366,10 +366,11 @@ CostT GridGraph::getViaCost(const int layer_index, const PointT loc) const
366366 return cost;
367367}
368368
369- void GridGraph::convertODBtoCUGR (AccessPointSet& selected_access_points,
370- odb::dbAccessPoint* ap,
371- int x,
372- int y) const
369+ void GridGraph::translateAccessPointsToGrid (
370+ odb::dbAccessPoint* ap,
371+ int x,
372+ int y,
373+ AccessPointSet& selected_access_points) const
373374{
374375 const int amount_per_x = design_->getDieRegion ().hx () / x_size_;
375376 const int amount_per_y = design_->getDieRegion ().hy () / y_size_;
@@ -405,7 +406,7 @@ bool GridGraph::findODBAccessPoints(
405406 access_points.insert (
406407 access_points.begin (), bpin_pas.begin (), bpin_pas.end ());
407408 for (auto ap : bpin_pas) {
408- convertODBtoCUGR (selected_access_points, ap, 0 , 0 );
409+ translateAccessPointsToGrid ( ap, 0 , 0 , selected_access_points );
409410 }
410411 }
411412 }
@@ -420,7 +421,7 @@ bool GridGraph::findODBAccessPoints(
420421 for (auto ap : pref_access_points) {
421422 int x, y;
422423 iterms->getInst ()->getLocation (x, y);
423- convertODBtoCUGR (selected_access_points, ap, x, y);
424+ translateAccessPointsToGrid ( ap, x, y, selected_access_points );
424425 }
425426 }
426427 // Currently ignoring non preferred APs
@@ -432,7 +433,7 @@ bool GridGraph::findODBAccessPoints(
432433 return true ;
433434}
434435
435- AccessPointSet GridGraph::selectAccessPoints (const GRNet* net) const
436+ AccessPointSet GridGraph::selectAccessPoints (GRNet* net) const
436437{
437438 AccessPointHash hasher (y_size_);
438439 AccessPointSet selected_access_points (0 , hasher);
@@ -442,6 +443,7 @@ AccessPointSet GridGraph::selectAccessPoints(const GRNet* net) const
442443 const PointT netCenter (boundingBox.cx (), boundingBox.cy ());
443444 // Skips calculations if DRT already created APs in ODB
444445 if (!findODBAccessPoints (net, selected_access_points)) {
446+ int pin_idx = 0 ;
445447 for (const std::vector<GRPoint>& accessPoints : net->getPinAccessPoints ()) {
446448 std::pair<int , int > bestAccessDist = {0 , std::numeric_limits<int >::max ()};
447449 int bestIndex = -1 ;
@@ -492,6 +494,9 @@ AccessPointSet GridGraph::selectAccessPoints(const GRNet* net) const
492494 fixedLayerInterval.Update (point.getLayerIdx ());
493495 }
494496 }
497+
498+ net->addPreferredAccessPoint (pin_idx, *it);
499+ pin_idx++;
495500 }
496501 }
497502 return selected_access_points;
0 commit comments