Skip to content

Commit 1888719

Browse files
committed
pdn: grid: limit via-repair shape extension to ring/domain boundary
Shape::extendTo() had no awareness of the grid boundary, allowing repairVias() to extend stripes through the padframe when a via landed at the ring edge. Now the extended shape is accepted only if it stays within getRingArea() (or getDomainBoundary() for ring-less grids). Signed-off-by: Daniel Schultz <dnltz@aesc-silicon.de>
1 parent 76065ea commit 1888719

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/pdn/src/grid.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,13 @@ bool Grid::repairVias(const Shape::ShapeTreeMap& global_shapes,
313313
return !shape->belongsTo(this);
314314
};
315315

316+
// Shapes must not be extended beyond the grid's allowed area: respect the
317+
// ring boundary (if rings exist) or the domain boundary otherwise. Without
318+
// this guard, extendTo() can push stripes through the padframe when a via
319+
// sits right at the ring/domain edge.
320+
const odb::Rect allowed_area
321+
= rings_.empty() ? getDomainBoundary() : getRingArea();
322+
316323
std::map<Shape*, std::unique_ptr<Shape>> replace_shapes;
317324
for (const auto& via : vias_) {
318325
// ensure shapes belong to something
@@ -345,7 +352,7 @@ bool Grid::repairVias(const Shape::ShapeTreeMap& global_shapes,
345352
obstructions[extend_test->getLayer()],
346353
lower_shape.get(),
347354
obs_filter);
348-
if (new_lower != nullptr) {
355+
if (new_lower != nullptr && allowed_area.contains(new_lower->getRect())) {
349356
replace_shapes[lower_shape.get()] = std::move(new_lower);
350357
}
351358
}
@@ -361,7 +368,7 @@ bool Grid::repairVias(const Shape::ShapeTreeMap& global_shapes,
361368
obstructions[extend_test->getLayer()],
362369
upper_shape.get(),
363370
obs_filter);
364-
if (new_upper != nullptr) {
371+
if (new_upper != nullptr && allowed_area.contains(new_upper->getRect())) {
365372
replace_shapes[upper_shape.get()] = std::move(new_upper);
366373
}
367374
}

0 commit comments

Comments
 (0)