Skip to content

Commit 30edbc8

Browse files
authored
Merge pull request #8687 from eder-matheus/grt_crash
grt: avoid adding resources for macro pins close to the south/west edges
2 parents dd4bb98 + 7d1fe56 commit 30edbc8

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/grt/src/GlobalRouter.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,6 +1879,14 @@ void GlobalRouter::addResourcesForPinAccess()
18791879
const bool north_pin = pin.getEdge() == PinEdge::north;
18801880
const int pin_y1 = north_pin ? pin_y : pin_y - 1;
18811881
const int pin_y2 = north_pin ? pin_y + 1 : pin_y;
1882+
1883+
// Ensure we do not go out of bounds when the pin is at the edge of
1884+
// the grid. If the pin is on the south edge and at y=0, there is no
1885+
// room for adding resources.
1886+
if (pin_y1 < 0) {
1887+
continue;
1888+
}
1889+
18821890
const int edge_cap = fastroute_->getEdgeCapacity(
18831891
pin_x, pin_y1, pin_x, pin_y2, layer);
18841892
fastroute_->addAdjustment(
@@ -1887,6 +1895,14 @@ void GlobalRouter::addResourcesForPinAccess()
18871895
const bool east_pin = pin.getEdge() == PinEdge::east;
18881896
const int pin_x1 = east_pin ? pin_x : pin_x - 1;
18891897
const int pin_x2 = east_pin ? pin_x + 1 : pin_x;
1898+
1899+
// Ensure we do not go out of bounds when the pin is at the edge of
1900+
// the grid. If the pin is on the west edge and at x=0, there is no
1901+
// room for adding resources.
1902+
if (pin_x1 < 0) {
1903+
continue;
1904+
}
1905+
18901906
const int edge_cap = fastroute_->getEdgeCapacity(
18911907
pin_x1, pin_y, pin_x2, pin_y, layer);
18921908
fastroute_->addAdjustment(

0 commit comments

Comments
 (0)