Skip to content

Commit c100734

Browse files
committed
pdn: correct min width from tech vias during via creation
Signed-off-by: Peter Gadfort <[email protected]>
1 parent f54a059 commit c100734

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/pdn/src/connect.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,15 +321,23 @@ int Connect::getMaxEnclosureFromCutLayer(odb::dbTechLayer* layer,
321321
for (auto* rule : tech_vias_) {
322322
bool use = false;
323323
int max_size = 0;
324+
int max_via_size = 0;
325+
int cnt_vias = 0;
324326
for (auto* box : rule->getBoxes()) {
325-
use |= box->getTechLayer() == layer;
326-
327327
odb::Rect rect = box->getBox();
328+
329+
if (box->getTechLayer() == layer) {
330+
use = true;
331+
cnt_vias += 1;
332+
max_via_size = std::max(max_via_size, static_cast<int>(rect.maxDXDY()));
333+
}
334+
328335
max_size = std::max(max_size, static_cast<int>(rect.maxDXDY()));
329336
}
330337

331-
if (use) {
332-
max_enclosure = std::max(max_enclosure, (max_size - min_width) / 2);
338+
if (use && cnt_vias == 1) {
339+
max_enclosure
340+
= std::max(max_enclosure, (max_size - max_via_size - min_width) / 2);
333341
}
334342
}
335343

0 commit comments

Comments
 (0)