@@ -313,18 +313,30 @@ bool Grid::repairVias(const Shape::ShapeTreeMap& global_shapes,
313313 }
314314
315315 if (lower_belongs_to_grid && lower_shape->isModifiable ()) {
316+ Shape* extend_test = lower_shape.get ();
317+ auto find_replace = replace_shapes.find (extend_test);
318+ if (find_replace != replace_shapes.end ()) {
319+ extend_test = find_replace->second .get ();
320+ }
316321 auto new_lower
317- = lower_shape->extendTo (upper_shape->getRect (),
318- obstructions[lower_shape->getLayer ()],
322+ = extend_test->extendTo (upper_shape->getRect (),
323+ obstructions[extend_test->getLayer ()],
324+ lower_shape.get (),
319325 obs_filter);
320326 if (new_lower != nullptr ) {
321327 replace_shapes[lower_shape.get ()] = std::move (new_lower);
322328 }
323329 }
324330 if (upper_belongs_to_grid && upper_shape->isModifiable ()) {
331+ Shape* extend_test = upper_shape.get ();
332+ auto find_replace = replace_shapes.find (extend_test);
333+ if (find_replace != replace_shapes.end ()) {
334+ extend_test = find_replace->second .get ();
335+ }
325336 auto new_upper
326- = upper_shape->extendTo (lower_shape->getRect (),
327- obstructions[upper_shape->getLayer ()],
337+ = extend_test->extendTo (lower_shape->getRect (),
338+ obstructions[extend_test->getLayer ()],
339+ upper_shape.get (),
328340 obs_filter);
329341 if (new_upper != nullptr ) {
330342 replace_shapes[upper_shape.get ()] = std::move (new_upper);
@@ -773,7 +785,8 @@ void Grid::makeVias(const Shape::ShapeTreeMap& global_shapes,
773785void Grid::makeVias (const Shape::ShapeTreeMap& global_shapes,
774786 const Shape::ObstructionTreeMap& obstructions)
775787{
776- debugPrint (getLogger (), utl::PDN, " Make" , 1 , " Making vias in \" {}\" " , name_);
788+ debugPrint (
789+ getLogger (), utl::PDN, " Make" , 1 , " Making vias in \" {}\" - start" , name_);
777790 Shape::ShapeTreeMap search_shapes = getShapes ();
778791
779792 odb::Rect search_area = getDomainBoundary ();
@@ -896,6 +909,8 @@ void Grid::makeVias(const Shape::ShapeTreeMap& global_shapes,
896909 via->getLowerShape ()->addVia (via);
897910 via->getUpperShape ()->addVia (via);
898911 }
912+ debugPrint (
913+ getLogger (), utl::PDN, " Make" , 1 , " Making vias in \" {}\" - end" , name_);
899914}
900915
901916void Grid::getVias (std::vector<ViaPtr>& vias) const
0 commit comments