Fix overlap of non-used RoutinPads in VH,2RL styles.

* New: In KatanaEngine::digitalInit(), when using a "VH,2RL" style,
    protect all RoutingPads of each net, because unlike "2RL+" style,
    the standard cell RoutingPads are not in a "below" layer only
    used inside the cell, but on the V layer. So the area of the RP,
    even if not fully used to connect, must be protected.
* Change: In NegociateOverlapCost(), when computing cost from a fixed
    or blockage, do not set the infinite flag if it's the *same* net.
* New: In KatanaEngine::protectRoutingPads(), add a new "flags" argument
    to pass on whether we want to protect the the RP candidates or just
    the non-used ones.
* Change: In protectRoutingpad(), change the formula (again) to compute
    the berth to give to a fixed segment... Should really try to
    summarize all the case.
* Change: In TrackFixedSegment::getNet(), no longer return the blockage
    net if the real net is tagged as clock.
This commit is contained in:
Jean-Paul Chaput 2023-01-18 23:42:38 +01:00
parent 047bf14921
commit 96fe367cc0
7 changed files with 46 additions and 24 deletions

View File

@ -39,6 +39,7 @@ namespace Katana {
const Hurricane::BaseFlags Flags::ShowOverloadedEdges = (1L << 35); const Hurricane::BaseFlags Flags::ShowOverloadedEdges = (1L << 35);
const Hurricane::BaseFlags Flags::ShowOverloadedGCells = (1L << 36); const Hurricane::BaseFlags Flags::ShowOverloadedGCells = (1L << 36);
const Hurricane::BaseFlags Flags::ShowBloatedInstances = (1L << 37); const Hurricane::BaseFlags Flags::ShowBloatedInstances = (1L << 37);
const Hurricane::BaseFlags Flags::ProtectSelf = (1L << 38);
} // Anabatic namespace. } // Anabatic namespace.

View File

@ -243,6 +243,7 @@ namespace Katana {
void KatanaEngine::digitalInit () void KatanaEngine::digitalInit ()
{ {
cdebug_log(155,1) << "KatanaEngine::_initDataBase()" << endl; cdebug_log(155,1) << "KatanaEngine::_initDataBase()" << endl;
_runKatanaInit();
setRoutingMode( DigitalMode ); setRoutingMode( DigitalMode );
@ -260,10 +261,11 @@ namespace Katana {
} else { } else {
if (not isChannelStyle()) { if (not isChannelStyle()) {
setupPowerRails(); setupPowerRails();
protectRoutingPads(); Flags flags = (getConfiguration()->getNetBuilderStyle() == "VH,2RL")
? Flags::ProtectSelf : Flags::NoFlags;
protectRoutingPads( flags );
} }
} }
_runKatanaInit();
cdebug_tabw(155,-1); cdebug_tabw(155,-1);
} }

View File

@ -55,22 +55,29 @@ namespace {
void NegociateOverlapCost ( const TrackElement* segment, TrackCost& cost ) 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(); Interval intersect = segment->getCanonicalInterval();
if (not intersect.intersect(cost.getInterval())) return; if (not intersect.intersect(cost.getInterval())) {
cdebug_tabw(159,-1);
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 ();
return; 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().getVMax() > intersect.getVMax()) cost.setLeftOverlap();
if (cost.getInterval().getVMin() < intersect.getVMin()) cost.setRightOverlap(); if (cost.getInterval().getVMin() < intersect.getVMin()) cost.setRightOverlap();
@ -85,7 +92,10 @@ namespace {
} }
DataNegociate* data = segment->getDataNegociate(); DataNegociate* data = segment->getDataNegociate();
if (not data) return; if (not data) {
cdebug_tabw(159,-1);
return;
}
TrackElement* refSegment = cost.getRefElement(); TrackElement* refSegment = cost.getRefElement();
DataNegociate* refData = refSegment->getDataNegociate(); DataNegociate* refData = refSegment->getDataNegociate();
@ -129,6 +139,7 @@ namespace {
cost.setInfinite (); cost.setInfinite ();
cost.setOverlap (); cost.setOverlap ();
cost.setHardOverlap(); cost.setHardOverlap();
cdebug_tabw(159,-1);
return; return;
} }
} }
@ -165,6 +176,7 @@ namespace {
cdebug_log(159,0) << "Infinite cost from (RP access)" << segment << endl; cdebug_log(159,0) << "Infinite cost from (RP access)" << segment << endl;
} }
cdebug_tabw(159,-1);
} }

View File

@ -71,7 +71,7 @@ namespace {
using namespace Katana; using namespace Katana;
void protectRoutingPad ( RoutingPad* rp ) void protectRoutingPad ( RoutingPad* rp, Flags flags )
{ {
cdebug_log(145,1) << "::protectRoutingPad() " << rp << endl; cdebug_log(145,1) << "::protectRoutingPad() " << rp << endl;
@ -87,6 +87,7 @@ namespace {
, getString(rp->getNet()->getName()).c_str() , getString(rp->getNet()->getName()).c_str()
, getString(usedComponent).c_str() , getString(usedComponent).c_str()
) << endl; ) << endl;
cdebug_tabw(145,-1);
return; return;
} }
if (Session::getRoutingGauge()->getLayerType(usedComponent->getLayer()) == Constant::PinOnly) { if (Session::getRoutingGauge()->getLayerType(usedComponent->getLayer()) == Constant::PinOnly) {
@ -111,7 +112,8 @@ namespace {
RoutingPlane* plane = Session::getKatanaEngine()->getRoutingPlaneByLayer(segment->getLayer()); RoutingPlane* plane = Session::getKatanaEngine()->getRoutingPlaneByLayer(segment->getLayer());
if (not plane) continue; if (not plane) continue;
if (usedComponent == dynamic_cast<Component*>(segment)) continue; if (usedComponent == dynamic_cast<Component*>(segment)
and not (flags & Flags::ProtectSelf)) continue;
if (not NetExternalComponents::isExternal(segment)) continue; if (not NetExternalComponents::isExternal(segment)) continue;
segments.push_back( segment ); segments.push_back( segment );
@ -121,8 +123,8 @@ namespace {
RoutingPlane* plane = Session::getKatanaEngine()->getRoutingPlaneByLayer(segments[i]->getLayer()); RoutingPlane* plane = Session::getKatanaEngine()->getRoutingPlaneByLayer(segments[i]->getLayer());
Flags direction = plane->getDirection(); Flags direction = plane->getDirection();
DbU::Unit wireWidth = plane->getLayerGauge()->getWireWidth(); DbU::Unit wireWidth = plane->getLayerGauge()->getWireWidth();
DbU::Unit delta = plane->getLayerGauge()->getHalfPitch() DbU::Unit delta = plane->getLayerGauge()->getPitch()
+ wireWidth/2 - wireWidth/2
- DbU::fromLambda(0.1); - DbU::fromLambda(0.1);
DbU::Unit extension = segments[i]->getLayer()->getExtentionCap(); DbU::Unit extension = segments[i]->getLayer()->getExtentionCap();
Box bb ( segments[i]->getBoundingBox() ); Box bb ( segments[i]->getBoundingBox() );
@ -130,6 +132,7 @@ namespace {
transformation.applyOn ( bb ); transformation.applyOn ( bb );
cdebug_log(145,0) << "@ " << segments[i] << " bb:" << bb << endl; cdebug_log(145,0) << "@ " << segments[i] << " bb:" << bb << endl;
cdebug_log(145,0) << "delta=" << DbU::getValueString(delta) << endl;
if ( direction == Flags::Horizontal ) { if ( direction == Flags::Horizontal ) {
DbU::Unit axisMin = bb.getYMin() - delta; DbU::Unit axisMin = bb.getYMin() - delta;
@ -181,7 +184,7 @@ namespace Katana {
using Anabatic::NetData; using Anabatic::NetData;
void KatanaEngine::protectRoutingPads () void KatanaEngine::protectRoutingPads ( Flags flags )
{ {
cmess1 << " o Protect external components not useds as RoutingPads." << endl; cmess1 << " o Protect external components not useds as RoutingPads." << endl;
@ -191,22 +194,24 @@ namespace Katana {
if (net->isSupply()) continue; if (net->isSupply()) continue;
DebugSession::open( net, 145, 150 ); DebugSession::open( net, 145, 150 );
cdebug_log(145,0) << "Protect RoutingPads of " << net << endl;
NetData* data = getNetData( net ); NetData* data = getNetData( net );
if (data and data->isFixed()) continue; if (data and data->isFixed()) continue;
vector<RoutingPad*> rps; vector<RoutingPad*> rps;
for ( RoutingPad* rp : net->getRoutingPads() ) { for ( RoutingPad* rp : net->getRoutingPads() )
rps.push_back( rp ); rps.push_back( rp );
}
for ( size_t i=0 ; i<rps.size() ; ++i ) for ( size_t i=0 ; i<rps.size() ; ++i )
protectRoutingPad( rps[i] ); protectRoutingPad( rps[i], flags );
DebugSession::close(); DebugSession::close();
} }
Session::close(); Session::close();
cerr.flush();
cout.flush();
} }

View File

@ -198,7 +198,8 @@ namespace Katana {
Net* TrackFixedSegment::getNet () const Net* TrackFixedSegment::getNet () const
{ {
Net* realNet = _segment->getNet(); Net* realNet = _segment->getNet();
if (realNet->isSupply() or realNet->isClock()) //if (realNet->isSupply() or realNet->isClock())
if (realNet->isSupply())
return Session::getBlockageNet(); return Session::getBlockageNet();
return realNet; return realNet;
} }

View File

@ -48,6 +48,7 @@ namespace Katana {
static const Hurricane::BaseFlags ShowOverloadedEdges; static const Hurricane::BaseFlags ShowOverloadedEdges;
static const Hurricane::BaseFlags ShowOverloadedGCells; static const Hurricane::BaseFlags ShowOverloadedGCells;
static const Hurricane::BaseFlags ShowBloatedInstances; static const Hurricane::BaseFlags ShowBloatedInstances;
static const Hurricane::BaseFlags ProtectSelf;
public: public:
inline Flags ( uint64_t ); inline Flags ( uint64_t );
inline Flags ( const Super& ); inline Flags ( const Super& );

View File

@ -121,7 +121,7 @@ namespace Katana {
DataSymmetric* addDataSymmetric ( Net* ); DataSymmetric* addDataSymmetric ( Net* );
void setupChannelMode (); void setupChannelMode ();
void setupPowerRails (); void setupPowerRails ();
void protectRoutingPads (); void protectRoutingPads ( Flags flags=Flags::NoFlags );
void preProcess (); void preProcess ();
void setInterrupt ( bool ); void setInterrupt ( bool );
void createChannels (); void createChannels ();