Skip to content

Commit 84e8476

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 84e8476

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

src/pdn/src/grid.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <cstdint>
99
#include <map>
1010
#include <memory>
11+
#include <optional>
1112
#include <set>
1213
#include <string>
1314
#include <tuple>
@@ -313,6 +314,13 @@ bool Grid::repairVias(const Shape::ShapeTreeMap& global_shapes,
313314
return !shape->belongsTo(this);
314315
};
315316

317+
// When rings are present, shapes must not be extended beyond the ring
318+
// boundary. Without this guard, extendTo() can push stripes through the
319+
// padframe when a via sits right at the ring edge. For ring-less grids the
320+
// obstruction-based check inside extendTo() is sufficient.
321+
const std::optional<odb::Rect> allowed_area
322+
= rings_.empty() ? std::nullopt : std::make_optional(getRingArea());
323+
316324
std::map<Shape*, std::unique_ptr<Shape>> replace_shapes;
317325
for (const auto& via : vias_) {
318326
// ensure shapes belong to something
@@ -345,7 +353,9 @@ bool Grid::repairVias(const Shape::ShapeTreeMap& global_shapes,
345353
obstructions[extend_test->getLayer()],
346354
lower_shape.get(),
347355
obs_filter);
348-
if (new_lower != nullptr) {
356+
if (new_lower != nullptr
357+
&& (!allowed_area
358+
|| allowed_area->contains(new_lower->getRect()))) {
349359
replace_shapes[lower_shape.get()] = std::move(new_lower);
350360
}
351361
}
@@ -361,7 +371,9 @@ bool Grid::repairVias(const Shape::ShapeTreeMap& global_shapes,
361371
obstructions[extend_test->getLayer()],
362372
upper_shape.get(),
363373
obs_filter);
364-
if (new_upper != nullptr) {
374+
if (new_upper != nullptr
375+
&& (!allowed_area
376+
|| allowed_area->contains(new_upper->getRect()))) {
365377
replace_shapes[upper_shape.get()] = std::move(new_upper);
366378
}
367379
}

0 commit comments

Comments
 (0)