@@ -1858,34 +1858,39 @@ void GlobalRouter::applyObstructionAdjustment(const odb::Rect& obstruction,
18581858 }
18591859}
18601860
1861- // For macro pins in the east and north edges of the macros, the access for
1862- // them can be blocked by the macro obstructions. This function adds the
1863- // resources necessary to route these pins.
1864- // Only pins in the east and north edges are affected because FastRoute
1865- // routes from left to right, and bottom to top.
1861+ // For macro pins in the east and north edges of the macros, and pins on west
1862+ // and south edges that have their APs in GCells completely blocked by macro
1863+ // obstructions, the access for them can be blocked by the macro obstructions.
1864+ // This function adds the resources necessary to route these pins. Only pins in
1865+ // the east and north edges are affected because FastRoute routes from left to
1866+ // right, and bottom to top.
18661867void GlobalRouter::addResourcesForPinAccess ()
18671868{
18681869 odb::dbTech* tech = db_->getTech ();
18691870 for (const auto & [db_net, net] : db_net_map_) {
18701871 for (const Pin& pin : net->getPins ()) {
1871- if (pin.isConnectedToPadOrMacro ()
1872- && (pin.getEdge () == PinEdge::east
1873- || pin.getEdge () == PinEdge::north)) {
1872+ if (pin.isConnectedToPadOrMacro () && (pin.getEdge () != PinEdge::none)) {
18741873 const odb::Point& pos = pin.getOnGridPosition ();
18751874 int pin_x = (int ) ((pos.x () - grid_->getXMin ()) / grid_->getTileSize ());
18761875 int pin_y = (int ) ((pos.y () - grid_->getYMin ()) / grid_->getTileSize ());
18771876 const int layer = pin.getConnectionLayer ();
18781877 odb::dbTechLayer* tech_layer = tech->findRoutingLayer (layer);
18791878 if (tech_layer->getDirection () == odb::dbTechLayerDir::VERTICAL) {
1879+ const bool north_pin = pin.getEdge () == PinEdge::north;
1880+ const int pin_y1 = north_pin ? pin_y : pin_y - 1 ;
1881+ const int pin_y2 = north_pin ? pin_y + 1 : pin_y;
18801882 const int edge_cap = fastroute_->getEdgeCapacity (
1881- pin_x, pin_y , pin_x, pin_y + 1 , layer);
1883+ pin_x, pin_y1 , pin_x, pin_y2 , layer);
18821884 fastroute_->addAdjustment (
1883- pin_x, pin_y , pin_x, pin_y + 1 , layer, edge_cap + 1 , false );
1885+ pin_x, pin_y1 , pin_x, pin_y2 , layer, edge_cap + 1 , false );
18841886 } else {
1887+ const bool east_pin = pin.getEdge () == PinEdge::east;
1888+ const int pin_x1 = east_pin ? pin_x : pin_x - 1 ;
1889+ const int pin_x2 = east_pin ? pin_x + 1 : pin_x;
18851890 const int edge_cap = fastroute_->getEdgeCapacity (
1886- pin_x , pin_y, pin_x + 1 , pin_y, layer);
1891+ pin_x1 , pin_y, pin_x2 , pin_y, layer);
18871892 fastroute_->addAdjustment (
1888- pin_x , pin_y, pin_x + 1 , pin_y, layer, edge_cap + 1 , false );
1893+ pin_x1 , pin_y, pin_x2 , pin_y, layer, edge_cap + 1 , false );
18891894 }
18901895 }
18911896 }
0 commit comments