diff --git a/src/drt/src/dr/FlexDR_init.cpp b/src/drt/src/dr/FlexDR_init.cpp index f3303f49af0..4da00ce4537 100644 --- a/src/drt/src/dr/FlexDR_init.cpp +++ b/src/drt/src/dr/FlexDR_init.cpp @@ -3465,6 +3465,23 @@ void FlexDRWorker::initMazeCost_planarTerm(const frDesign* design) // term no bloat switch (obj->typeId()) { case frcBTerm: { + auto bterm = static_cast(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(); @@ -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); } diff --git a/src/drt/test/ta_pin_aligned.defok b/src/drt/test/ta_pin_aligned.defok index f80d9ac14e5..d4e43f88e19 100644 --- a/src/drt/test/ta_pin_aligned.defok +++ b/src/drt/test/ta_pin_aligned.defok @@ -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