diff --git a/katana/src/Constants.cpp b/katana/src/Constants.cpp index 6a100773..694f5a6d 100644 --- a/katana/src/Constants.cpp +++ b/katana/src/Constants.cpp @@ -39,6 +39,7 @@ namespace Katana { const Hurricane::BaseFlags Flags::ShowOverloadedEdges = (1L << 35); const Hurricane::BaseFlags Flags::ShowOverloadedGCells = (1L << 36); const Hurricane::BaseFlags Flags::ShowBloatedInstances = (1L << 37); + const Hurricane::BaseFlags Flags::ProtectSelf = (1L << 38); } // Anabatic namespace. diff --git a/katana/src/KatanaEngine.cpp b/katana/src/KatanaEngine.cpp index a3cd399a..3cfb2ae6 100644 --- a/katana/src/KatanaEngine.cpp +++ b/katana/src/KatanaEngine.cpp @@ -243,6 +243,7 @@ namespace Katana { void KatanaEngine::digitalInit () { cdebug_log(155,1) << "KatanaEngine::_initDataBase()" << endl; + _runKatanaInit(); setRoutingMode( DigitalMode ); @@ -260,10 +261,11 @@ namespace Katana { } else { if (not isChannelStyle()) { setupPowerRails(); - protectRoutingPads(); + Flags flags = (getConfiguration()->getNetBuilderStyle() == "VH,2RL") + ? Flags::ProtectSelf : Flags::NoFlags; + protectRoutingPads( flags ); } } - _runKatanaInit(); cdebug_tabw(155,-1); } diff --git a/katana/src/NegociateWindow.cpp b/katana/src/NegociateWindow.cpp index 806a6932..4e71a9e4 100644 --- a/katana/src/NegociateWindow.cpp +++ b/katana/src/NegociateWindow.cpp @@ -55,22 +55,29 @@ namespace { void NegociateOverlapCost ( const TrackElement* segment, TrackCost& cost ) { - cdebug_log(9000,0) << "Deter| NegociateOverlapCost() " << segment << endl; + cdebug_log(159,1) << "NegociateOverlapCost() " << segment << endl; Interval intersect = segment->getCanonicalInterval(); - if (not intersect.intersect(cost.getInterval())) return; - - if ( segment->isBlockage() - or (segment->isFixed() - and not (segment->isVertical() and Session::getKatanaEngine()->isChannelStyle()))) { - cdebug_log(159,0) << "Infinite cost from: " << segment << endl; - cost.setInfinite (); - cost.setOverlap (); - cost.setHardOverlap(); - cost.setBlockage (); + if (not intersect.intersect(cost.getInterval())) { + cdebug_tabw(159,-1); return; } + if (segment->getNet() != cost.getNet()) { + cdebug_log(159,0) << segment->getNet() << " vs. " << cost.getNet() << endl; + if ( segment->isBlockage() + or (segment->isFixed() + and not (segment->isVertical() and Session::getKatanaEngine()->isChannelStyle()))) { + cdebug_log(159,0) << "Infinite cost from: " << segment << endl; + cost.setInfinite (); + cost.setOverlap (); + cost.setHardOverlap(); + cost.setBlockage (); + cdebug_tabw(159,-1); + return; + } + } + if (cost.getInterval().getVMax() > intersect.getVMax()) cost.setLeftOverlap(); if (cost.getInterval().getVMin() < intersect.getVMin()) cost.setRightOverlap(); @@ -85,7 +92,10 @@ namespace { } DataNegociate* data = segment->getDataNegociate(); - if (not data) return; + if (not data) { + cdebug_tabw(159,-1); + return; + } TrackElement* refSegment = cost.getRefElement(); DataNegociate* refData = refSegment->getDataNegociate(); @@ -129,6 +139,7 @@ namespace { cost.setInfinite (); cost.setOverlap (); cost.setHardOverlap(); + cdebug_tabw(159,-1); return; } } @@ -165,6 +176,7 @@ namespace { cdebug_log(159,0) << "Infinite cost from (RP access)" << segment << endl; } + cdebug_tabw(159,-1); } diff --git a/katana/src/ProtectRoutingPads.cpp b/katana/src/ProtectRoutingPads.cpp index 5b6a1426..af848695 100644 --- a/katana/src/ProtectRoutingPads.cpp +++ b/katana/src/ProtectRoutingPads.cpp @@ -71,7 +71,7 @@ namespace { using namespace Katana; - void protectRoutingPad ( RoutingPad* rp ) + void protectRoutingPad ( RoutingPad* rp, Flags flags ) { cdebug_log(145,1) << "::protectRoutingPad() " << rp << endl; @@ -87,6 +87,7 @@ namespace { , getString(rp->getNet()->getName()).c_str() , getString(usedComponent).c_str() ) << endl; + cdebug_tabw(145,-1); return; } if (Session::getRoutingGauge()->getLayerType(usedComponent->getLayer()) == Constant::PinOnly) { @@ -111,7 +112,8 @@ namespace { RoutingPlane* plane = Session::getKatanaEngine()->getRoutingPlaneByLayer(segment->getLayer()); if (not plane) continue; - if (usedComponent == dynamic_cast(segment)) continue; + if (usedComponent == dynamic_cast(segment) + and not (flags & Flags::ProtectSelf)) continue; if (not NetExternalComponents::isExternal(segment)) continue; segments.push_back( segment ); @@ -121,8 +123,8 @@ namespace { RoutingPlane* plane = Session::getKatanaEngine()->getRoutingPlaneByLayer(segments[i]->getLayer()); Flags direction = plane->getDirection(); DbU::Unit wireWidth = plane->getLayerGauge()->getWireWidth(); - DbU::Unit delta = plane->getLayerGauge()->getHalfPitch() - + wireWidth/2 + DbU::Unit delta = plane->getLayerGauge()->getPitch() + - wireWidth/2 - DbU::fromLambda(0.1); DbU::Unit extension = segments[i]->getLayer()->getExtentionCap(); Box bb ( segments[i]->getBoundingBox() ); @@ -130,6 +132,7 @@ namespace { transformation.applyOn ( bb ); cdebug_log(145,0) << "@ " << segments[i] << " bb:" << bb << endl; + cdebug_log(145,0) << "delta=" << DbU::getValueString(delta) << endl; if ( direction == Flags::Horizontal ) { DbU::Unit axisMin = bb.getYMin() - delta; @@ -181,7 +184,7 @@ namespace Katana { using Anabatic::NetData; - void KatanaEngine::protectRoutingPads () + void KatanaEngine::protectRoutingPads ( Flags flags ) { cmess1 << " o Protect external components not useds as RoutingPads." << endl; @@ -191,22 +194,24 @@ namespace Katana { if (net->isSupply()) continue; DebugSession::open( net, 145, 150 ); + cdebug_log(145,0) << "Protect RoutingPads of " << net << endl; NetData* data = getNetData( net ); if (data and data->isFixed()) continue; vector rps; - for ( RoutingPad* rp : net->getRoutingPads() ) { + for ( RoutingPad* rp : net->getRoutingPads() ) rps.push_back( rp ); - } for ( size_t i=0 ; igetNet(); - if (realNet->isSupply() or realNet->isClock()) + //if (realNet->isSupply() or realNet->isClock()) + if (realNet->isSupply()) return Session::getBlockageNet(); return realNet; } diff --git a/katana/src/katana/Constants.h b/katana/src/katana/Constants.h index 46934281..a16e5bbd 100644 --- a/katana/src/katana/Constants.h +++ b/katana/src/katana/Constants.h @@ -48,6 +48,7 @@ namespace Katana { static const Hurricane::BaseFlags ShowOverloadedEdges; static const Hurricane::BaseFlags ShowOverloadedGCells; static const Hurricane::BaseFlags ShowBloatedInstances; + static const Hurricane::BaseFlags ProtectSelf; public: inline Flags ( uint64_t ); inline Flags ( const Super& ); diff --git a/katana/src/katana/KatanaEngine.h b/katana/src/katana/KatanaEngine.h index d67a944a..ba99c207 100644 --- a/katana/src/katana/KatanaEngine.h +++ b/katana/src/katana/KatanaEngine.h @@ -121,7 +121,7 @@ namespace Katana { DataSymmetric* addDataSymmetric ( Net* ); void setupChannelMode (); void setupPowerRails (); - void protectRoutingPads (); + void protectRoutingPads ( Flags flags=Flags::NoFlags ); void preProcess (); void setInterrupt ( bool ); void createChannels ();