From 3069af8a6326f5c3de03cfff542c6cff590dfb64 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Mon, 12 Apr 2010 11:22:11 +0000 Subject: [PATCH] * ./katabatic: - New: In GCell & LayerAssign, adds a supplemental desaturation steps when a GCell containts too many (more than 7) RoutingPads in M1. This is especially useful for the eFPGA matrix with it's custom made cells. --- katabatic/src/GCell.cpp | 53 +++++++++++++++++++++++++++++++-- katabatic/src/LayerAssign.cpp | 16 +++++++++- katabatic/src/LoadGrByNet.cpp | 24 ++++++++++++++- katabatic/src/katabatic/GCell.h | 6 +++- 4 files changed, 94 insertions(+), 5 deletions(-) diff --git a/katabatic/src/GCell.cpp b/katabatic/src/GCell.cpp index e6cdd6b5..5b5bdc90 100644 --- a/katabatic/src/GCell.cpp +++ b/katabatic/src/GCell.cpp @@ -34,6 +34,7 @@ #include "hurricane/Layer.h" #include "hurricane/Horizontal.h" #include "hurricane/Vertical.h" +#include "hurricane/RoutingPad.h" #include "crlcore/RoutingGauge.h" #include "katabatic/AutoContact.h" #include "katabatic/AutoSegment.h" @@ -304,6 +305,18 @@ namespace Katabatic { } + size_t GCell::getRoutingPads ( set& rps ) + { + for ( size_t i=0 ; i<_contacts.size() ; ++i ) { + RoutingPad* rp = dynamic_cast(_contacts[i]->getAnchor()); + if ( rp ) { + rps.insert ( rp ); + } + } + return rps.size(); + } + + float GCell::getHCapacity () const { return (float)( _box.getHeight() / DbU::lambda(5.0) + 1 ); @@ -684,6 +697,42 @@ namespace Katabatic { } + void GCell::rpDesaturate ( set& globalNets ) + { + set rps; + getRoutingPads ( rps ); + + set rpNets; + set::iterator irp = rps.begin(); + for ( ; irp != rps.end() ; ++irp ) { + if ( (*irp)->getLayer() != Session::getRoutingLayer(0) ) continue; + rpNets.insert ( (*irp)->getNet() ); + } + + if ( rpNets.size() < 8 ) return; + + cerr << "[WARNING] " << this << " has " << rps.size() << " terminals h:" + << _hsegments.size() << endl; + + irp = rps.begin(); + for ( ; irp != rps.end() ; ++irp ) + cerr << " " << *irp << endl; + + AutoSegment* segment; + while ( stepDesaturate ( 1, globalNets, segment, true ) ) { + //cerr << "Moved up: " << segment << endl; + } + +#if 0 + set::iterator ipad = rps.begin(); + for ( ; ipad != rps.end() ; ++ipad ) { + forEach ( Segment*, isegment, (*ipad)->getSlaveComponents().getSubSet() ) { + } + } +#endif + } + + bool GCell::hasFreeTrack ( size_t depth ) const { if (_invalid) const_cast(this)->updateDensity(); @@ -732,7 +781,7 @@ namespace Katabatic { } - bool GCell::stepDesaturate ( unsigned int depth, set& globalNets, AutoSegment*& moved ) + bool GCell::stepDesaturate ( unsigned int depth, set& globalNets, AutoSegment*& moved, bool force ) { #if defined(CHECK_DETERMINISM) cerr << "Order: stepDesaturate [" << getIndex() << "] depth:" << depth << endl; @@ -743,7 +792,7 @@ namespace Katabatic { //float density = _densities[depth]; //float densityUp = _densities[depth+2]; - if ( !isSaturated(depth) ) return false; + if ( not force and not isSaturated(depth) ) return false; float capacity; vector::iterator isegment; diff --git a/katabatic/src/LayerAssign.cpp b/katabatic/src/LayerAssign.cpp index 4dbf3eb6..77e783b7 100644 --- a/katabatic/src/LayerAssign.cpp +++ b/katabatic/src/LayerAssign.cpp @@ -256,7 +256,7 @@ namespace Katabatic { switch ( method ) { case LayerAssignByLength: _layerAssignByLength(total,global,globalNets); break; - case LayerAssignByTrunk: _layerAssignByTrunk (total,global,globalNets); break; + case LayerAssignByTrunk: _layerAssignByTrunk (total,global,globalNets); break; case NoNetLayerAssign: break; default: stopMeasures (); @@ -294,6 +294,20 @@ namespace Katabatic { _print ( _routingNets[i] ); #endif + // Look for RoutingPad overload. + vector gcells = *(_gcellGrid->getGCellVector()); + for ( size_t i=0 ; irpDesaturate ( globalNets ); + // set rps; + // gcells[i]->getRoutingPads ( rps ); + + // if ( rps.size() > 7 ) { + // cerr << "[WARNING] " << gcells[i] << "has " << rps.size() << " terminals." << endl; + // } + } + + Session::revalidate (); + Session::setWarnGCellOverload ( true ); _gcellGrid->checkDensity (); diff --git a/katabatic/src/LoadGrByNet.cpp b/katabatic/src/LoadGrByNet.cpp index bca0d66e..e688b8bd 100644 --- a/katabatic/src/LoadGrByNet.cpp +++ b/katabatic/src/LoadGrByNet.cpp @@ -1988,16 +1988,38 @@ namespace { AutoContact* localContact = (_south) ? _southWestContact : _northEastContact; //localContact->setHAlignate ( true ); + bool doTurn = (_topology & GLOBAL_SPLIT) and (_routingPads.size() == 1); for ( unsigned int i = 0 ; i < _routingPads.size() ; i++ ) { AutoContact* rpContact = _GCell_rp_Access ( _gcell, _routingPads[i], true, false ); + AutoContact* turn1 + = (doTurn) ? AutoContact::create(_gcell,_net,Session::getContactLayer(1)) : localContact; + segment = AutoSegment::create ( rpContact - , localContact + , turn1 , Constant::Horizontal , AutoSegment::Local , true , false ); setIsRoutingPadSmall ( _routingPads[i], hsmall, vsmall, punctual ); if ( not vsmall ) segment->setStrap ( true ); + + if ( doTurn ) { + AutoContact* turn2 = AutoContact::create ( _gcell, _net, Session::getContactLayer(1) ); + segment = AutoSegment::create ( turn1 + , turn2 + , Constant::Vertical + , AutoSegment::Local + , true + , false ); + segment->setStrap ( true ); + segment = AutoSegment::create ( turn2 + , localContact + , Constant::Horizontal + , AutoSegment::Local + , true + , false ); + segment->setStrap ( true ); + } } if ( _topology & (GLOBAL_VERTICAL|GLOBAL_FORK) ) { diff --git a/katabatic/src/katabatic/GCell.h b/katabatic/src/katabatic/GCell.h index 959049bd..0dec185d 100644 --- a/katabatic/src/katabatic/GCell.h +++ b/katabatic/src/katabatic/GCell.h @@ -38,6 +38,7 @@ #include "hurricane/ExtensionGo.h" namespace Hurricane { class Name; + class RoutingPad; } #include "crlcore/RoutingLayerGauge.h" @@ -59,6 +60,7 @@ namespace Katabatic { using Hurricane::Box; using Hurricane::Interval; using Hurricane::ExtensionGo; + using Hurricane::RoutingPad; class GCellGrid; class AutoContact; @@ -145,6 +147,7 @@ namespace Katabatic { AutoSegments getVStopSegments (); inline AutoSegments getStartSegments ( unsigned int direction ); inline AutoSegments getStopSegments ( unsigned int direction ); + size_t getRoutingPads ( set& ); inline const Key& getKey () const; size_t checkDensity () const; bool checkEdgeSaturation ( float threshold ) const; @@ -162,7 +165,8 @@ namespace Katabatic { size_t updateDensity (); inline void updateKey ( unsigned int depth ); void desaturate ( unsigned int depth, set& ); - bool stepDesaturate ( unsigned int depth, set&, AutoSegment*& moved ); + bool stepDesaturate ( unsigned int depth, set&, AutoSegment*& moved, bool force=false ); + void rpDesaturate ( set& ); inline void invalidate (); // Inspector Management. Record* _getRecord () const;