Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 32 additions & 0 deletions src/drt/src/dr/FlexDR_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2722,13 +2722,25 @@ void FlexDRWorker::initMazeCost_fixedObj(const frDesign* design)
result.clear();
if (getTech()->getLayer(layerNum)->getType() == dbTechLayerType::ROUTING) {
isRoutingLayer = true;
// The grid graph need not span the full layer stack: TOP_ROUTING_LAYER
// can trim routing layers above it out of the grid. Skip fixed-shape
// costing on layers absent from the grid so getMazeZIdx / getLayerNum
// stay in range. No-op when the grid spans every routing layer.
if (layerNum < gridGraph_.getMinLayerNum()
|| layerNum > gridGraph_.getMaxLayerNum()) {
continue;
}
zIdx = gridGraph_.getMazeZIdx(layerNum);
} else if (getTech()->getLayer(layerNum)->getType()
== dbTechLayerType::CUT) {
isRoutingLayer = false;
if (getTech()->getBottomLayerNum() <= layerNum - 1
&& getTech()->getLayer(layerNum - 1)->getType()
== dbTechLayerType::ROUTING) {
if (layerNum - 1 < gridGraph_.getMinLayerNum()
|| layerNum - 1 > gridGraph_.getMaxLayerNum()) {
continue;
}
zIdx = gridGraph_.getMazeZIdx(layerNum - 1);
} else {
continue;
Expand Down Expand Up @@ -2894,13 +2906,23 @@ void FlexDRWorker::initMazeCost_terms(
if (getTech()->getLayer(layerNum)->getType()
== dbTechLayerType::ROUTING) {
isRoutingLayer = true;
// Grid may not span the full stack (TOP_ROUTING_LAYER trim);
// skip layers absent from the grid. No-op when fully spanned.
if (layerNum < gridGraph_.getMinLayerNum()
|| layerNum > gridGraph_.getMaxLayerNum()) {
continue;
}
zIdx = gridGraph_.getMazeZIdx(layerNum);
} else if (getTech()->getLayer(layerNum)->getType()
== dbTechLayerType::CUT) {
isRoutingLayer = false;
if (getTech()->getBottomLayerNum() <= layerNum - 1
&& getTech()->getLayer(layerNum - 1)->getType()
== dbTechLayerType::ROUTING) {
if (layerNum - 1 < gridGraph_.getMinLayerNum()
|| layerNum - 1 > gridGraph_.getMaxLayerNum()) {
continue;
}
zIdx = gridGraph_.getMazeZIdx(layerNum - 1);
} else {
continue;
Expand Down Expand Up @@ -2971,13 +2993,23 @@ void FlexDRWorker::initMazeCost_terms(
if (getTech()->getLayer(layerNum)->getType()
== dbTechLayerType::ROUTING) {
isRoutingLayer = true;
// Grid may not span the full stack (TOP_ROUTING_LAYER trim);
// skip layers absent from the grid. No-op when fully spanned.
if (layerNum < gridGraph_.getMinLayerNum()
|| layerNum > gridGraph_.getMaxLayerNum()) {
continue;
}
zIdx = gridGraph_.getMazeZIdx(layerNum);
} else if (getTech()->getLayer(layerNum)->getType()
== dbTechLayerType::CUT) {
isRoutingLayer = false;
if (getTech()->getBottomLayerNum() <= layerNum - 1
&& getTech()->getLayer(layerNum - 1)->getType()
== dbTechLayerType::ROUTING) {
if (layerNum - 1 < gridGraph_.getMinLayerNum()
|| layerNum - 1 > gridGraph_.getMaxLayerNum()) {
continue;
}
zIdx = gridGraph_.getMazeZIdx(layerNum - 1);
} else {
continue;
Expand Down
11 changes: 11 additions & 0 deletions src/drt/src/dr/FlexGridGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,17 @@ void FlexGridGraph::initTracks(
continue;
}
frLayerNum currLayerNum = layer->getLayerNum();
// Layers above TOP_ROUTING_LAYER carry no routing edges or access vias
// (initEdges and the special-access via loop already cap work at
// TOP_ROUTING_LAYER), yet they were still added to the grid here, sizing
// nodes_, the per-node arrays, and the maze search bounds across the full
// layer stack. Skip them so the grid graph spans only the routing range,
// cutting detailed-route memory and runtime when the design's top routing
// layer is below the technology top. Default TOP_ROUTING_LAYER is INT_MAX,
// so this is a no-op unless the top routing layer is explicitly lowered.
if (currLayerNum > router_cfg_->TOP_ROUTING_LAYER) {
continue;
}
dbTechLayerDir currPrefRouteDir = layer->getDir();
for (auto& tp : design->getTopBlock()->getTrackPatterns(currLayerNum)) {
// allow wrongway if global variable and design rule allow
Expand Down
Loading