Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
209cce6
odb: add isBackside() for LEF58_BACKSIDE property
mguthaus May 28, 2026
a1c0207
drt: filter LEF58_BACKSIDE layers from the front-side router
mguthaus May 28, 2026
5a5bc72
pdn: warn when add_pdn_connect spans front/back side
mguthaus May 28, 2026
38afcce
psm: skip backside layers when picking ITerm base layer
mguthaus May 28, 2026
f49de72
psm: multi-seed connectivity BFS from every top-layer node
mguthaus May 28, 2026
68493c8
psm: regression test for backside-power connectivity + null-guard on …
mguthaus May 28, 2026
6b46b16
pdn: regression test for backside cross-boundary warning
mguthaus May 28, 2026
1fc7ac2
odb: add isBacksideBridge() for LEF58_BACKSIDE_BRIDGE macro property
mguthaus May 29, 2026
395e032
review: address gemini code review nits
mguthaus May 29, 2026
7f57f9b
pdn: promote PDN-1200 backside boundary to error
mguthaus May 29, 2026
06926d9
odb,psm: add dbTech::firstRoutingLayer / firstBacksideLayer helpers
mguthaus May 29, 2026
8c0eae4
psm: bridge-cell-aware connectivity, drop multi-seed BFS
mguthaus May 29, 2026
dde4ed8
pdn: make add_pdn_connect_backside_err self-contained for Bazel
mguthaus May 29, 2026
df6deec
odb,drt: track is_backside in schema; guard null cut-via in TA
mguthaus May 29, 2026
8f3ae2c
drt: avoid int32 overflow in FlexGridGraph prevDirs indexing
mguthaus May 30, 2026
1925824
odb: skip backside layers when picking gcell tile size
mguthaus May 30, 2026
d37c1a3
drt: skip backside block vias in io::Parser::setVias
mguthaus May 30, 2026
86ed417
odb: rename and clarify backside routing layer accessors
mguthaus May 30, 2026
168313a
psm: switch to renamed routing-layer accessors and drop fallback
mguthaus May 30, 2026
a81adcf
odb: drop unneeded PROPERTYDEFINITIONS from backside-bridge test LEF
mguthaus May 30, 2026
cd9a62b
psm: simplify iterm pin side detection and shorten master lookup
mguthaus May 30, 2026
b6bf791
pdn: move backside-crossing guard from add_pdn_connect to Connect()
mguthaus May 30, 2026
9580ec3
test: sort backside_data entries in psm/pdn BUILD files
mguthaus Jun 2, 2026
41f4fc4
drt,odb: silence clang-tidy on bspdn-touched files
mguthaus Jun 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/drt/src/db/tech/frLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ class frLayer
? false
: db_layer_->getType() == odb::dbTechLayerType::ROUTING;
}
// True for layers tagged with the LEF58_BACKSIDE property (BPR,
// backside metals and their cut layers in BSPDN flows). The detailed
// router does not currently route on these layers; they are treated
// as invisible to TA/DRT.
bool isBackside() const
{
return (fakeCut_ || fakeMasterslice_) ? false : db_layer_->isBackside();
}
bool isUnidirectional() const
{
// We don't handle coloring so any multiple patterned
Expand Down
2 changes: 1 addition & 1 deletion src/drt/src/dr/FlexGridGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void FlexGridGraph::initGrids(const frLayerCoordTrackPatternMap& xMap,
srcs_.clear();
dsts_.clear();

prevDirs_.resize(capacity * 3, false);
prevDirs_.resize(static_cast<std::size_t>(capacity) * 3, false);
srcs_.resize(capacity, false);
dsts_.resize(capacity, false);
guides_.clear();
Expand Down
5 changes: 3 additions & 2 deletions src/drt/src/dr/FlexGridGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ class FlexGridGraph
// unsafe access, no idx check
void setPrevAstarNodeDir(frMIdx x, frMIdx y, frMIdx z, frDirEnum dir)
{
auto baseIdx = 3 * getIdx(x, y, z);
auto baseIdx = static_cast<std::size_t>(getIdx(x, y, z)) * 3;
prevDirs_[baseIdx] = ((uint16_t) dir >> 2) & 1;
prevDirs_[baseIdx + 1] = ((uint16_t) dir >> 1) & 1;
prevDirs_[baseIdx + 2] = ((uint16_t) dir) & 1;
Expand All @@ -1168,7 +1168,8 @@ class FlexGridGraph
// unsafe access, no check
frDirEnum getPrevAstarNodeDir(const FlexMazeIdx& idx) const
{
auto baseIdx = 3 * getIdx(idx.x(), idx.y(), idx.z());
auto baseIdx
= static_cast<std::size_t>(getIdx(idx.x(), idx.y(), idx.z())) * 3;
return (frDirEnum) (((uint16_t) (prevDirs_[baseIdx]) << 2)
+ ((uint16_t) (prevDirs_[baseIdx + 1]) << 1)
+ ((uint16_t) (prevDirs_[baseIdx + 2]) << 0));
Expand Down
115 changes: 108 additions & 7 deletions src/drt/src/io/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ void io::Parser::setTracks(odb::dbBlock* block)
{
auto tracks = block->getTrackGrids();
for (auto track : tracks) {
// Skip track grids on backside layers; DRT filters those layers
// out of its frTech entirely (see setLayers).
if (track->getTechLayer()->isBackside()) {
continue;
}
if (getTech()->name2layer_.find(track->getTechLayer()->getName())
== getTech()->name2layer_.end()) {
logger_->error(
Expand Down Expand Up @@ -202,6 +207,13 @@ void io::Parser::setVias(odb::dbBlock* block)
for (auto via : block->getVias()) {
if (via->getViaGenerateRule() != nullptr && via->hasParams()) {
const odb::dbViaParams params = via->getViaParams();
// Skip block vias whose cut/top/bottom layer is on the backside;
// those layers are filtered out of frTech by setLayers().
if (params.getCutLayer()->isBackside()
|| params.getBottomLayer()->isBackside()
|| params.getTopLayer()->isBackside()) {
continue;
}
frLayerNum cutLayerNum = 0;
frLayerNum botLayerNum = 0;
frLayerNum topLayerNum = 0;
Expand Down Expand Up @@ -346,6 +358,17 @@ void io::Parser::setVias(odb::dbBlock* block)
utl::DRT, 337, "Duplicated via definition for {}", via->getName());
}
} else {
// Skip box-defined block vias touching backside layers.
bool any_backside = false;
for (auto box : via->getBoxes()) {
if (box->getTechLayer()->isBackside()) {
any_backside = true;
break;
}
}
if (any_backside) {
continue;
}
std::map<frLayerNum, odb::PtrSet<odb::dbBox>> lNum2Int;
for (auto box : via->getBoxes()) {
if (getTech()->name2layer_.find(box->getTechLayer()->getName())
Expand Down Expand Up @@ -427,6 +450,11 @@ void io::Parser::createNDR(odb::dbTechNonDefaultRule* ndr)
std::vector<odb::dbTechLayerRule*> lr;
ndr->getLayerRules(lr);
for (auto& l : lr) {
// Skip per-layer NDR rules that reference a filtered backside
// layer; DRT has no frLayer entry for it.
if (l->getLayer()->isBackside()) {
continue;
}
auto layer = getTech()->getLayer(l->getLayer()->getName());
z = getZIdx(layer->getLayerNum());
fnd->setWidth(l->getWidth(), z);
Expand All @@ -436,6 +464,10 @@ void io::Parser::createNDR(odb::dbTechNonDefaultRule* ndr)
std::vector<odb::dbTechVia*> vias;
ndr->getUseVias(vias);
for (auto via : vias) {
if (via->getBottomLayer()->isBackside()
|| via->getTopLayer()->isBackside()) {
continue;
}
auto layer = getTech()->getLayer(via->getBottomLayer()->getName());
z = getZIdx(layer->getLayerNum());
fnd->addVia(getTech()->getVia(via->getName()), z);
Expand All @@ -444,6 +476,16 @@ void io::Parser::createNDR(odb::dbTechNonDefaultRule* ndr)
ndr->getUseViaRules(viaRules);
z = std::numeric_limits<int>::max();
for (auto via : viaRules) {
bool any_backside = false;
for (uint32_t i = 0; i < via->getViaLayerRuleCount(); i++) {
if (via->getViaLayerRule(i)->getLayer()->isBackside()) {
any_backside = true;
break;
}
}
if (any_backside) {
continue;
}
for (int i = 0; i < (int) via->getViaLayerRuleCount(); i++) {
if (via->getViaLayerRule(i)->getLayer()->getType()
== odb::dbTechLayerType::CUT) {
Expand Down Expand Up @@ -805,7 +847,13 @@ void io::Parser::updateNetRouting(frNet* netIn, odb::dbNet* net)
endpath = true;
}
} while (!endpath);
auto layerNum = getTech()->name2layer_[layerName]->getLayerNum();
// Skip path segments that reference a backside layer; DRT
// doesn't carry those in its frTech (see setLayers).
auto layer_it = getTech()->name2layer_.find(layerName);
if (layer_it == getTech()->name2layer_.end()) {
continue;
}
auto layerNum = layer_it->second->getLayerNum();
if (hasRect) {
auto tmpPWire = std::make_unique<frPatchWire>();
tmpPWire->setLayerNum(layerNum);
Expand Down Expand Up @@ -892,6 +940,11 @@ void io::Parser::updateNetRouting(frNet* netIn, odb::dbNet* net)
for (auto swire : net->getSWires()) {
for (auto box : swire->getWires()) {
if (!box->isVia()) {
// Skip special-net path segments on backside layers (BPR
// followpins, backside stripes); DRT has no frLayer for them.
if (box->getTechLayer()->isBackside()) {
continue;
}
getSBoxCoords(box, beginX, beginY, endX, endY, width);
auto layerNum = getTech()
->name2layer_[box->getTechLayer()->getName()]
Expand Down Expand Up @@ -929,10 +982,21 @@ void io::Parser::updateNetRouting(frNet* netIn, odb::dbNet* net)
tmpP->setStyle(tmpSegStyle);
netIn->addShape(std::move(tmpP));
} else {
// Skip backside vias (BV0..BV4, BVia*Array etc.) on special
// nets; DRT removes them from name2via_ when its frTech is
// populated.
if (box->getTechVia()) {
viaName = box->getTechVia()->getName();
if (box->getTechVia()->getBottomLayer()->isBackside()
|| box->getTechVia()->getTopLayer()->isBackside()) {
continue;
}
} else if (box->getBlockVia()) {
viaName = box->getBlockVia()->getName();
if (box->getBlockVia()->getBottomLayer()->isBackside()
|| box->getBlockVia()->getTopLayer()->isBackside()) {
continue;
}
}

if (getTech()->name2via_.find(viaName)
Expand Down Expand Up @@ -1001,10 +1065,15 @@ frNet* io::Parser::addNet(odb::dbNet* db_net)
return raw_net_in;
}

void updatefrAccessPoint(odb::dbAccessPoint* db_ap,
frAccessPoint* ap,
frTechObject* tech)
static bool updatefrAccessPoint(odb::dbAccessPoint* db_ap,
frAccessPoint* ap,
frTechObject* tech)
{
// Access points on backside layers (e.g. PG taps) are invisible to
// the front-side router; report so the caller can drop them.
if (db_ap->getLayer()->isBackside()) {
return false;
}
ap->setPoint(db_ap->getPoint());
if (db_ap->hasAccess(odb::dbDirection::NORTH)) {
ap->setAccess(frDirEnum::N, true);
Expand Down Expand Up @@ -1056,6 +1125,7 @@ void updatefrAccessPoint(odb::dbAccessPoint* db_ap,

ap->addPathSeg(path_seg);
}
return true;
}

void io::Parser::setBTerms(odb::dbBlock* block)
Expand Down Expand Up @@ -1089,6 +1159,11 @@ void io::Parser::setBTerms(odb::dbBlock* block)
int bterm_bottom_layer_idx = std::numeric_limits<int>::max();
for (auto bpin : term->getBPins()) {
for (auto box : bpin->getBoxes()) {
// BTerms on backside layers (e.g. PG pins on BPR) have no
// representation in the filtered DRT layer table; skip them.
if (box->getTechLayer()->isBackside()) {
continue;
}
frLayerNum layer_idx = getTech()
->name2layer_[box->getTechLayer()->getName()]
->getLayerNum();
Expand All @@ -1105,6 +1180,9 @@ void io::Parser::setBTerms(odb::dbBlock* block)
} else {
for (auto pin : term->getBPins()) {
for (auto box : pin->getBoxes()) {
if (box->getTechLayer()->isBackside()) {
continue;
}
odb::Rect bbox = box->getBox();
if (getTech()->name2layer_.find(box->getTechLayer()->getName())
== getTech()->name2layer_.end()) {
Expand All @@ -1128,8 +1206,9 @@ void io::Parser::setBTerms(odb::dbBlock* block)
auto db_pin = (odb::dbBPin*) *term->getBPins().begin();
for (auto& db_ap : db_pin->getAccessPoints()) {
auto ap = std::make_unique<frAccessPoint>();
updatefrAccessPoint(db_ap, ap.get(), getTech());
pa->addAccessPoint(std::move(ap));
if (updatefrAccessPoint(db_ap, ap.get(), getTech())) {
pa->addAccessPoint(std::move(ap));
}
}
}
pinIn->addPinAccess(std::move(pa));
Expand Down Expand Up @@ -1217,7 +1296,9 @@ void io::Parser::setAccessPoints(odb::dbDatabase* db)
for (auto db_ap : db_aps) {
std::unique_ptr<frAccessPoint> ap
= std::make_unique<frAccessPoint>();
updatefrAccessPoint(db_ap, ap.get(), getTech());
if (!updatefrAccessPoint(db_ap, ap.get(), getTech())) {
continue;
}
ap->setDbAccessPoint(db_ap);
ap_map[db_ap] = ap.get();
pa->addAccessPoint(std::move(ap));
Expand Down Expand Up @@ -2564,6 +2645,13 @@ void io::Parser::setLayers(odb::dbTech* db_tech)
{
masterSliceLayer_ = nullptr;
for (auto layer : db_tech->getLayers()) {
// Skip layers marked LEF58_BACKSIDE (BPR / BM* / BV* / BRDL on
// backside-power PDKs). DRT only routes the front-side stack;
// backside layers exist in ODB and survive DEF/GDS round-trip,
// but the router treats them as invisible.
if (layer->isBackside()) {
continue;
}
switch (layer->getType().getValue()) {
case odb::dbTechLayerType::ROUTING:
addRoutingLayer(layer);
Expand Down Expand Up @@ -2822,6 +2910,19 @@ void io::Parser::setTechViaRules(odb::dbTech* db_tech)
if (count != 3) {
logger_->error(DRT, 128, "Unsupported viarule {}.", rule->getName());
}
// Skip viarules that reference any backside layer. The DRT layer
// table excludes backside layers entirely (see setLayers), so the
// viarule cannot be honored on the front-side stack.
bool has_backside = false;
for (int i = 0; i < count; i++) {
if (rule->getViaLayerRule(i)->getLayer()->isBackside()) {
has_backside = true;
break;
}
}
if (has_backside) {
continue;
}
std::map<frLayerNum, int> lNum2Int;
for (int i = 0; i < count; i++) {
auto layerRule = rule->getViaLayerRule(i);
Expand Down
44 changes: 28 additions & 16 deletions src/drt/src/ta/FlexTA_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,29 +770,41 @@ void FlexTAWorker::initFixedObjs()
&& getTech()->getLayer(layerNum - 2)->getType()
== dbTechLayerType::ROUTING) {
auto cutLayer = getTech()->getLayer(layerNum - 1);
auto via = std::make_unique<frVia>(cutLayer->getDefaultViaDef());
odb::Rect viaBox = via->getLayer2BBox();
frCoord viaWidth = viaBox.minDXDY();
// only add for fat via
if (viaWidth > width) {
bloatDist = initFixedObjs_calcOBSBloatDistVia(
cutLayer->getDefaultViaDef(), layerNum, bounds, false);
initFixedObjs_helper(box, bloatDist, layerNum, netPtr, true);
// initDefaultVias() only guarantees a defaultViaDef for cut
// layers inside BOTTOM_ROUTING_LAYER..max(TOP_ROUTING_LAYER,
// topPinLayer). Cut layers outside that range (e.g. contact
// cuts below the routing range on PDKs whose MIN_ROUTING_LAYER
// is well above M0) can legitimately have a null default;
// skip them rather than constructing a frVia from nullptr.
auto defaultViaDef = cutLayer->getDefaultViaDef();
if (defaultViaDef != nullptr) {
auto via = std::make_unique<frVia>(defaultViaDef);
odb::Rect viaBox = via->getLayer2BBox();
frCoord viaWidth = viaBox.minDXDY();
// only add for fat via
if (viaWidth > width) {
bloatDist = initFixedObjs_calcOBSBloatDistVia(
defaultViaDef, layerNum, bounds, false);
initFixedObjs_helper(box, bloatDist, layerNum, netPtr, true);
}
}
}
// up-via
if (layerNum + 2 < (int) design_->getTech()->getLayers().size()
&& getTech()->getLayer(layerNum + 2)->getType()
== dbTechLayerType::ROUTING) {
auto cutLayer = getTech()->getLayer(layerNum + 1);
auto via = std::make_unique<frVia>(cutLayer->getDefaultViaDef());
odb::Rect viaBox = via->getLayer1BBox();
frCoord viaWidth = viaBox.minDXDY();
// only add for fat via
if (viaWidth > width) {
bloatDist = initFixedObjs_calcOBSBloatDistVia(
cutLayer->getDefaultViaDef(), layerNum, bounds, false);
initFixedObjs_helper(box, bloatDist, layerNum, netPtr, true);
auto defaultViaDef = cutLayer->getDefaultViaDef();
if (defaultViaDef != nullptr) {
auto via = std::make_unique<frVia>(defaultViaDef);
odb::Rect viaBox = via->getLayer1BBox();
frCoord viaWidth = viaBox.minDXDY();
// only add for fat via
if (viaWidth > width) {
bloatDist = initFixedObjs_calcOBSBloatDistVia(
defaultViaDef, layerNum, bounds, false);
initFixedObjs_helper(box, bloatDist, layerNum, netPtr, true);
}
}
}
}
Expand Down
36 changes: 36 additions & 0 deletions src/odb/include/odb/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -5498,6 +5498,18 @@ class dbMaster : public dbObject
///
void setType(dbMasterType type);

///
/// Marks a cell as physically bridging a front-side power layer to a
/// LEF58_BACKSIDE layer (typical use: BSPDN tap cells). Tools that
/// trace PG-net connectivity should treat the PG pins of such a
/// cell as electrically continuous even when they sit on layers
/// that disagree on dbTechLayer::isBackside(). Set by the
/// LEF58_BACKSIDE_BRIDGE macro property.
///
void setBacksideBridge(bool is_bridge);

bool isBacksideBridge() const;

///
/// Get the Logical equivalent of this master
/// Returns nullptr if no equivalent was set.
Expand Down Expand Up @@ -5920,6 +5932,21 @@ class dbTech : public dbObject
///
dbTechLayer* findRoutingLayer(int level_number);

///
/// Find the frontside (non-LEF58_BACKSIDE) routing layer closest to
/// the substrate (i.e. the lowest routing-level index that is not
/// marked backside). Returns nullptr if there is no such layer.
///
dbTechLayer* firstFrontsideRoutingLayer();

///
/// Find the LEF58_BACKSIDE routing layer closest to the substrate
/// (i.e. the highest routing-level index that is marked backside,
/// since backside metals are stacked outward from M0 toward BRDL in
/// LEF order). Returns nullptr if there is no backside routing layer.
///
dbTechLayer* firstBacksideRoutingLayer();

///
/// Get the technolgy vias. This includes non-default-rule-vias.
///
Expand Down Expand Up @@ -9272,6 +9299,15 @@ class dbTechLayer : public dbObject
LEF58_TYPE getLef58Type() const;
std::string getLef58TypeString() const;

///
/// Backside layers are physically located on the wafer's reverse side,
/// typically used for buried-power-rail (BPR) and backside power
/// delivery (BSPDN). Set by the LEF58_BACKSIDE property.
///
void setBackside(bool is_backside);

bool isBackside() const;

///
/// Get the layer name.
///
Expand Down
Loading
Loading