Skip to content

Commit

Permalink
Merge pull request #5414 from The-OpenROAD-Project-staging/TR-access-…
Browse files Browse the repository at this point in the history
…dir-aware

Fix blocked edges
  • Loading branch information
maliberty authored Jul 22, 2024
2 parents dd421e4 + e0f76b6 commit 27c2eb9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
21 changes: 19 additions & 2 deletions src/drt/src/dr/FlexDR_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3465,6 +3465,23 @@ void FlexDRWorker::initMazeCost_planarTerm(const frDesign* design)
// term no bloat
switch (obj->typeId()) {
case frcBTerm: {
auto bterm = static_cast<frBTerm*>(obj);
bool hasHorizontalAccess = false;
bool hasVerticalAccess = false;
for (const auto& pin : bterm->getPins()) {
for (int i = 0; i < pin->getNumPinAccess(); i++) {
const auto& pa = pin->getPinAccess(i);
for (const auto& ap : pa->getAccessPoints()) {
if (ap->getLayerNum() != layerNum) {
continue;
}
hasVerticalAccess |= ap->hasAccess(frDirEnum::N);
hasVerticalAccess |= ap->hasAccess(frDirEnum::S);
hasHorizontalAccess |= ap->hasAccess(frDirEnum::W);
hasHorizontalAccess |= ap->hasAccess(frDirEnum::E);
}
}
}
FlexMazeIdx mIdx1, mIdx2;
gridGraph_.getIdxBox(mIdx1, mIdx2, box);
const bool isLayerHorz = layer->isHorizontal();
Expand All @@ -3473,10 +3490,10 @@ void FlexDRWorker::initMazeCost_planarTerm(const frDesign* design)
FlexMazeIdx mIdx(i, j, zIdx);
gridGraph_.setBlocked(i, j, zIdx, frDirEnum::U);
gridGraph_.setBlocked(i, j, zIdx, frDirEnum::D);
if (isLayerHorz) {
if (isLayerHorz && hasHorizontalAccess) {
gridGraph_.setBlocked(i, j, zIdx, frDirEnum::N);
gridGraph_.setBlocked(i, j, zIdx, frDirEnum::S);
} else {
} else if (!isLayerHorz && hasVerticalAccess) {
gridGraph_.setBlocked(i, j, zIdx, frDirEnum::W);
gridGraph_.setBlocked(i, j, zIdx, frDirEnum::E);
}
Expand Down
5 changes: 4 additions & 1 deletion src/drt/test/ta_pin_aligned.defok
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ NETS 2 ;
- Metal2_in ( PIN Metal2_out ) ( PIN Metal2_in ) + USE SIGNAL
+ ROUTED metal2 ( 97850 19740 0 ) ( * 180180 0 ) ;
- Metal3_in ( PIN Metal3_out ) ( PIN Metal3_in ) + USE SIGNAL
+ ROUTED metal3 ( 19790 97860 0 ) ( 180510 * 0 ) ;
+ ROUTED metal3 ( 176400 97580 ) ( * 97860 )
NEW metal3 ( 180510 97580 ) ( * 97860 0 )
NEW metal3 ( 176400 97580 ) ( 180510 * )
NEW metal3 ( 19790 97860 0 ) ( 176400 * ) ;
END NETS
END DESIGN

0 comments on commit 27c2eb9

Please sign in to comment.