@@ -352,12 +352,10 @@ CostT GridGraph::getViaCost(const int layer_index, const PointT loc) const
352352 return cost;
353353}
354354
355- void GridGraph::selectAccessPoints (
356- const GRNet* net,
357- robin_hood::unordered_map<uint64_t , AccessPoint>& selected_access_points)
358- const
355+ AccessPointSet GridGraph::selectAccessPoints (const GRNet* net) const
359356{
360- selected_access_points.clear ();
357+ AccessPointHash hasher (y_size_);
358+ AccessPointSet selected_access_points (0 , hasher);
361359 // cell hash (2d) -> access point, fixed layer interval
362360 selected_access_points.reserve (net->getNumPins ());
363361 const auto & boundingBox = net->getBoundingBox ();
@@ -395,11 +393,9 @@ void GridGraph::selectAccessPoints(
395393 logger_->warn (utl::GRT, 274 , " pin is hard to access." );
396394 }
397395 const PointT selectedPoint = accessPoints[bestIndex];
398- const uint64_t hash = hashCell (selectedPoint.x (), selectedPoint.y ());
399- if (selected_access_points.find (hash) == selected_access_points.end ()) {
400- selected_access_points.emplace (hash, AccessPoint{selectedPoint, {}});
401- }
402- IntervalT& fixedLayerInterval = selected_access_points[hash].layers ;
396+ const AccessPoint ap{selectedPoint, {}};
397+ auto it = selected_access_points.emplace (ap).first ;
398+ IntervalT& fixedLayerInterval = it->layers ;
403399 for (const auto & point : accessPoints) {
404400 if (point.x () == selectedPoint.x () && point.y () == selectedPoint.y ()) {
405401 fixedLayerInterval.Update (point.getLayerIdx ());
@@ -408,10 +404,11 @@ void GridGraph::selectAccessPoints(
408404 }
409405 // Extend the fixed layers to 2 layers higher to facilitate track switching
410406 for (auto & accessPoint : selected_access_points) {
411- IntervalT& fixedLayers = accessPoint.second . layers ;
407+ IntervalT& fixedLayers = accessPoint.layers ;
412408 fixedLayers.SetHigh (
413409 std::min (fixedLayers.high () + 2 , (int ) getNumLayers () - 1 ));
414410 }
411+ return selected_access_points;
415412}
416413
417414void GridGraph::commit (const int layer_index,
0 commit comments