Skip to content

Commit 3703a45

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 3703a45

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/pdn/src/grid.cpp

Lines changed: 11 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,8 @@ 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
356+
&& allowed_area.contains(new_lower->getRect())) {
349357
replace_shapes[lower_shape.get()] = std::move(new_lower);
350358
}
351359
}
@@ -361,7 +369,8 @@ bool Grid::repairVias(const Shape::ShapeTreeMap& global_shapes,
361369
obstructions[extend_test->getLayer()],
362370
upper_shape.get(),
363371
obs_filter);
364-
if (new_upper != nullptr) {
372+
if (new_upper != nullptr
373+
&& allowed_area.contains(new_upper->getRect())) {
365374
replace_shapes[upper_shape.get()] = std::move(new_upper);
366375
}
367376
}

0 commit comments

Comments
 (0)