Skip to content

Commit eeae9db

Browse files
committed
pdn: add reason to dummy via
Signed-off-by: Peter Gadfort <[email protected]>
1 parent a12276a commit eeae9db

File tree

3 files changed

+38
-19
lines changed

3 files changed

+38
-19
lines changed

src/pdn/src/connect.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,17 @@ void Connect::makeVia(odb::dbSWire* wire,
456456
// check if off grid and don't add one if it is
457457
if (!TechLayer::checkIfManufacturingGrid(tech, x)
458458
|| !TechLayer::checkIfManufacturingGrid(tech, y)) {
459-
DbGenerateDummyVia dummy_via(this, intersection, layer0_, layer1_, true);
459+
DbGenerateDummyVia dummy_via(
460+
this,
461+
intersection,
462+
layer0_,
463+
layer1_,
464+
true,
465+
fmt::format("({:.4f}, {:.4f}) is off manufacturing grid of {:.4f}",
466+
x / static_cast<double>(tech->getLefUnits()),
467+
y / static_cast<double>(tech->getLefUnits()),
468+
tech->getManufacturingGrid()
469+
/ static_cast<double>(tech->getLefUnits())));
460470
dummy_via.generate(
461471
wire->getBlock(), wire, type, 0, 0, ongrid_, grid_->getLogger());
462472
return;
@@ -559,7 +569,7 @@ void Connect::makeVia(odb::dbSWire* wire,
559569
odb::Rect area = intersection;
560570
xfm.apply(area);
561571
stack.push_back(
562-
new DbGenerateDummyVia(this, area, layer0_, layer1_, false));
572+
new DbGenerateDummyVia(this, area, layer0_, layer1_, false, ""));
563573
break;
564574
}
565575
stack.push_back(new_via);

src/pdn/src/via.cpp

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,12 +1108,14 @@ DbGenerateDummyVia::DbGenerateDummyVia(Connect* connect,
11081108
const odb::Rect& shape,
11091109
odb::dbTechLayer* bottom,
11101110
odb::dbTechLayer* top,
1111-
bool add_report)
1111+
bool add_report,
1112+
const std::string& reason)
11121113
: connect_(connect),
11131114
add_report_(add_report),
11141115
shape_(shape),
11151116
bottom_(bottom),
1116-
top_(top)
1117+
top_(top),
1118+
reason_(reason)
11171119
{
11181120
}
11191121

@@ -1132,11 +1134,13 @@ DbVia::ViaLayerShape DbGenerateDummyVia::generate(
11321134
xfm.apply(via_area);
11331135
logger->warn(utl::PDN,
11341136
110,
1135-
"No via inserted between {} and {} at {} on {}",
1137+
"No via inserted between {} and {} at {} on {}{}{}",
11361138
bottom_->getName(),
11371139
top_->getName(),
11381140
Shape::getRectText(via_area, block->getDbUnitsPerMicron()),
1139-
wire->getNet()->getName());
1141+
wire->getNet()->getName(),
1142+
reason_.empty() ? "" : ": ",
1143+
reason_);
11401144
if (add_report_) {
11411145
connect_->addFailedVia(failedViaReason::BUILD, via_area, wire->getNet());
11421146
}
@@ -1491,8 +1495,9 @@ bool ViaGenerator::checkMinCuts(odb::dbTechLayer* layer, int width) const
14911495
utl::PDN,
14921496
"MinCut",
14931497
1,
1494-
"Layer {} of width {:.4f} has {} min cut rules.",
1498+
"Layer {} (below {}) of width {:.4f} has {} min cut rules.",
14951499
layer->getName(),
1500+
is_below,
14961501
tech_layer.dbuToMicron(width),
14971502
min_rules_use == nullptr ? 0 : min_rules_use->size());
14981503

@@ -1505,17 +1510,19 @@ bool ViaGenerator::checkMinCuts(odb::dbTechLayer* layer, int width) const
15051510
for (const auto& min_cut_rule : *min_rules_use) {
15061511
const bool pass = min_cut_rule.cuts <= total_cuts;
15071512

1508-
debugPrint(
1509-
logger_,
1510-
utl::PDN,
1511-
"MinCut",
1512-
2,
1513-
"Rule width {:.4f} above ({}) or below ({}) requires {} vias: {}.",
1514-
tech_layer.dbuToMicron(min_cut_rule.width),
1515-
min_cut_rule.above,
1516-
min_cut_rule.below,
1517-
min_cut_rule.cuts,
1518-
pass);
1513+
debugPrint(logger_,
1514+
utl::PDN,
1515+
"MinCut",
1516+
2,
1517+
"Rule width {:.4f} above ({}) or below ({}) requires {} vias, "
1518+
"has {} vias {}: {}.",
1519+
tech_layer.dbuToMicron(min_cut_rule.width),
1520+
min_cut_rule.above,
1521+
min_cut_rule.below,
1522+
min_cut_rule.cuts,
1523+
total_cuts,
1524+
is_below ? "below" : "above",
1525+
pass);
15191526

15201527
is_valid |= pass;
15211528
}

src/pdn/src/via.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ class DbGenerateDummyVia : public DbVia
382382
const odb::Rect& shape,
383383
odb::dbTechLayer* bottom,
384384
odb::dbTechLayer* top,
385-
bool add_report);
385+
bool add_report,
386+
const std::string& reason);
386387

387388
ViaLayerShape generate(odb::dbBlock* block,
388389
odb::dbSWire* wire,
@@ -400,6 +401,7 @@ class DbGenerateDummyVia : public DbVia
400401
const odb::Rect shape_;
401402
odb::dbTechLayer* bottom_;
402403
odb::dbTechLayer* top_;
404+
std::string reason_;
403405
};
404406

405407
// Class to build a generate via, either as a single group or as an array

0 commit comments

Comments
 (0)