Skip to content

Commit 9e5fb7d

Browse files
committed
grt: add resources for pins on the south and west edges of macros
Signed-off-by: Eder Monteiro <[email protected]>
1 parent 541c3d0 commit 9e5fb7d

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

src/grt/src/GlobalRouter.cpp

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,34 +1858,43 @@ 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.
18661867
void 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 east_north_pin = pin.getEdge() == PinEdge::east
1880+
|| pin.getEdge() == PinEdge::north;
1881+
int pin_y1, pin_y2;
1882+
pin_y1 = east_north_pin ? pin_y : pin_y - 1;
1883+
pin_y2 = east_north_pin ? pin_y + 1 : pin_y;
18801884
const int edge_cap = fastroute_->getEdgeCapacity(
1881-
pin_x, pin_y, pin_x, pin_y + 1, layer);
1885+
pin_x, pin_y1, pin_x, pin_y2, layer);
18821886
fastroute_->addAdjustment(
1883-
pin_x, pin_y, pin_x, pin_y + 1, layer, edge_cap + 1, false);
1887+
pin_x, pin_y1, pin_x, pin_y2, layer, edge_cap + 1, false);
18841888
} else {
1889+
const bool east_north_pin = pin.getEdge() == PinEdge::east
1890+
|| pin.getEdge() == PinEdge::north;
1891+
int pin_x1, pin_x2;
1892+
pin_x1 = east_north_pin ? pin_x : pin_x - 1;
1893+
pin_x2 = east_north_pin ? pin_x + 1 : pin_x;
18851894
const int edge_cap = fastroute_->getEdgeCapacity(
1886-
pin_x, pin_y, pin_x + 1, pin_y, layer);
1895+
pin_x1, pin_y, pin_x2, pin_y, layer);
18871896
fastroute_->addAdjustment(
1888-
pin_x, pin_y, pin_x + 1, pin_y, layer, edge_cap + 1, false);
1897+
pin_x1, pin_y, pin_x2, pin_y, layer, edge_cap + 1, false);
18891898
}
18901899
}
18911900
}

0 commit comments

Comments
 (0)