From 1d525fec35be1a205112fe1f54cb9d17b5d3749b Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 22 Aug 2010 12:37:48 +0000 Subject: [PATCH] * ./katabatic: - Change: In LayerAssign, desaturate until the last two top layers are reacheds instead of only METAL2 & METAL3. - Change: In Configuration/GCellGrid/GCell, correct computation of the edges capacity (based on the numbers of avalaibles layers and not hard-wired to 4). --- katabatic/src/Configuration.cpp | 27 ++++++++++++++++++++ katabatic/src/GCell.cpp | 10 +++++--- katabatic/src/GCellGrid.cpp | 6 +++-- katabatic/src/LayerAssign.cpp | 34 +++++++++++-------------- katabatic/src/katabatic/Configuration.h | 6 +++++ katabatic/src/katabatic/GCellGrid.h | 30 ++++++++++++++-------- 6 files changed, 78 insertions(+), 35 deletions(-) diff --git a/katabatic/src/Configuration.cpp b/katabatic/src/Configuration.cpp index 89d9d87e..72f530b8 100644 --- a/katabatic/src/Configuration.cpp +++ b/katabatic/src/Configuration.cpp @@ -25,12 +25,14 @@ #include #include +#include #include "vlsisapd/configuration/Configuration.h" #include "hurricane/Technology.h" #include "hurricane/DataBase.h" #include "hurricane/Cell.h" #include "crlcore/Utilities.h" +#include "crlcore/RoutingLayerGauge.h" #include "crlcore/AllianceFramework.h" #include "katabatic/Configuration.h" @@ -44,11 +46,14 @@ namespace Katabatic { using std::endl; using std::setprecision; using std::ostringstream; + using std::vector; using Hurricane::tab; using Hurricane::inltrace; using Hurricane::Technology; using Hurricane::DataBase; using CRL::AllianceFramework; + using CRL::RoutingGauge; + using CRL::RoutingLayerGauge; // ------------------------------------------------------------------- @@ -71,6 +76,8 @@ namespace Katabatic { , _saturateRp (Cfg::getParamInt ("katabatic.saturateRp" ,8 )->asInt()) , _globalThreshold (DbU::lambda((double)Cfg::getParamInt("katabatic.globalLengthThreshold",29*50)->asInt())) // Ugly: direct uses of SxLib gauge. , _allowedDepth (0) + , _hEdgeCapacity (0) + , _vEdgeCapacity (0) { if ( rg == NULL ) rg = AllianceFramework::get()->getRoutingGauge(); @@ -80,6 +87,18 @@ namespace Katabatic { _gmetalh = DataBase::getDB()->getTechnology()->getLayer("gmetalh"); _gmetalv = DataBase::getDB()->getTechnology()->getLayer("gmetalv"); _gcontact = DataBase::getDB()->getTechnology()->getLayer("gcontact"); + + vector::const_iterator ilayerGauge = rg->getLayerGauges().begin(); + for ( ; ilayerGauge != rg->getLayerGauges().end() ; ++ilayerGauge ) { + RoutingLayerGauge* layerGauge = (*ilayerGauge); + if ( layerGauge->getType() != Constant::Default ) continue; + + if ( layerGauge->getDirection() == Constant::Horizontal ) { + _hEdgeCapacity += layerGauge->getTrackNumber ( 0, DbU::lambda(50.0) ) - 1; + } else if ( layerGauge->getDirection() == Constant::Vertical ) { + _vEdgeCapacity += layerGauge->getTrackNumber ( 0, DbU::lambda(50.0) ) - 1; + } + } } @@ -165,6 +184,14 @@ namespace Katabatic { { return _globalThreshold; } + size_t ConfigurationConcrete::getHEdgeCapacity () const + { return _hEdgeCapacity; } + + + size_t ConfigurationConcrete::getVEdgeCapacity () const + { return _vEdgeCapacity; } + + void ConfigurationConcrete::setAllowedDepth ( size_t allowedDepth ) { _allowedDepth = (allowedDepth > getDepth()) ? getDepth() : allowedDepth; } diff --git a/katabatic/src/GCell.cpp b/katabatic/src/GCell.cpp index 4e2b37f6..75bb8b6c 100644 --- a/katabatic/src/GCell.cpp +++ b/katabatic/src/GCell.cpp @@ -912,7 +912,8 @@ namespace Katabatic { edgeUpUsage++; } } - edgeUpSaturation = (float)edgeUpUsage/((float)getVCapacity()*2.0); + //edgeUpSaturation = (float)edgeUpUsage/((float)getVCapacity()*2.0); + edgeUpSaturation = (float)edgeUpUsage/getGCellGrid()->getVEdgeCapacity(); } if ( getRight() ) { @@ -931,7 +932,8 @@ namespace Katabatic { edgeRightUsage++; } } - edgeRightSaturation = (float)edgeRightUsage/((float)getHCapacity()*2.0); + //edgeRightSaturation = (float)edgeRightUsage/((float)getHCapacity()*2.0); + edgeRightSaturation = (float)edgeRightUsage/getGCellGrid()->getHEdgeCapacity(); } bool overload = false; @@ -943,11 +945,11 @@ namespace Katabatic { ostringstream message; message << setprecision(3); if ( edgeUpSaturation > threshold ) - message << "up edge: " << edgeUpUsage << "/" << (getVCapacity()*2.0) + message << "up edge: " << edgeUpUsage << "/" << getGCellGrid()->getVEdgeCapacity() << " " << edgeUpSaturation; if ( edgeRightSaturation > threshold ) { if ( message.str().size() ) message << " & "; - message << "right edge: " << edgeRightUsage << "/" << (getVCapacity()*2.0) + message << "right edge: " << edgeRightUsage << "/" << getGCellGrid()->getHEdgeCapacity() << " " << edgeRightSaturation; } diff --git a/katabatic/src/GCellGrid.cpp b/katabatic/src/GCellGrid.cpp index c3c7ef67..f07bb5f1 100644 --- a/katabatic/src/GCellGrid.cpp +++ b/katabatic/src/GCellGrid.cpp @@ -54,8 +54,10 @@ namespace Katabatic { GCellGrid::GCellGrid ( KatabaticEngine* ktbt ) - : Grid(ktbt->getCell()->getAbutmentBox()) - , _katabatic(ktbt) + : Grid (ktbt->getCell()->getAbutmentBox()) + , _katabatic (ktbt) + , _hEdgeCapacity(ktbt->getConfiguration()->getHEdgeCapacity()) + , _vEdgeCapacity(ktbt->getConfiguration()->getVEdgeCapacity()) { } diff --git a/katabatic/src/LayerAssign.cpp b/katabatic/src/LayerAssign.cpp index 05bb9170..57626f8e 100644 --- a/katabatic/src/LayerAssign.cpp +++ b/katabatic/src/LayerAssign.cpp @@ -277,14 +277,24 @@ namespace Katabatic { Session::revalidate (); - for ( int i=0 ; i < 3 ; i++ ) { - _desaturate ( 1, globalNets, total, global ); - _desaturate ( 2, globalNets, total, global ); + // Look for RoutingPad overload. + vector gcells = *(_gcellGrid->getGCellVector()); + for ( size_t i=0 ; irpDesaturate ( globalNets ); + } - globalNets.clear (); + if ( getConfiguration()->getAllowedDepth() > 2) { + for ( int i=0 ; i < 3 ; i++ ) { + for ( size_t depth=1 ; depth < getConfiguration()->getAllowedDepth()-2; ++depth ) { + _desaturate ( depth, globalNets, total, global ); + if ( (depth > 1) and ((depth-1)%2 == 1) ) Session::revalidate (); + } + globalNets.clear (); + + if ( not _gcellGrid->updateDensity () ) break; + } Session::revalidate (); - if ( !_gcellGrid->updateDensity () ) break; } //refresh ( false ); @@ -297,20 +307,6 @@ namespace Katabatic { _print ( *inet ); #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/katabatic/Configuration.h b/katabatic/src/katabatic/Configuration.h index 0bfcce57..7026417b 100644 --- a/katabatic/src/katabatic/Configuration.h +++ b/katabatic/src/katabatic/Configuration.h @@ -74,6 +74,8 @@ namespace Katabatic { virtual float getSaturateRatio () const = 0; virtual size_t getSaturateRp () const = 0; virtual DbU::Unit getGlobalThreshold () const = 0; + virtual size_t getHEdgeCapacity () const = 0; + virtual size_t getVEdgeCapacity () const = 0; virtual void setAllowedDepth ( size_t ) = 0; virtual void setSaturateRatio ( float ) = 0; virtual void setSaturateRp ( size_t ) = 0; @@ -116,6 +118,8 @@ namespace Katabatic { virtual float getSaturateRatio () const; virtual size_t getSaturateRp () const; virtual DbU::Unit getGlobalThreshold () const; + virtual size_t getHEdgeCapacity () const; + virtual size_t getVEdgeCapacity () const; virtual void setAllowedDepth ( size_t ); virtual void setSaturateRatio ( float ); virtual void setSaturateRp ( size_t ); @@ -135,6 +139,8 @@ namespace Katabatic { size_t _saturateRp; DbU::Unit _globalThreshold; size_t _allowedDepth; + size_t _hEdgeCapacity; + size_t _vEdgeCapacity; private: ConfigurationConcrete ( const ConfigurationConcrete& ); ConfigurationConcrete& operator= ( const ConfigurationConcrete& ); diff --git a/katabatic/src/katabatic/GCellGrid.h b/katabatic/src/katabatic/GCellGrid.h index 281f63a0..94f1bd7b 100644 --- a/katabatic/src/katabatic/GCellGrid.h +++ b/katabatic/src/katabatic/GCellGrid.h @@ -50,20 +50,25 @@ namespace Katabatic { class GCellGrid : public Grid { public: - Cell* getCell () const; - Interval getUSide ( unsigned int ) const; - void updateContacts ( bool openSession=true ); - size_t checkDensity () const; - size_t updateDensity (); - bool checkEdgeSaturation ( float threshold ) const; - void _xmlWrite ( ostream& ); - virtual Record* _getRecord () const; - virtual string _getString () const; - virtual string _getTypeName () const; + Cell* getCell () const; + inline KatabaticEngine* getKatabatic () const; + inline size_t getHEdgeCapacity () const; + inline size_t getVEdgeCapacity () const; + Interval getUSide ( unsigned int ) const; + void updateContacts ( bool openSession=true ); + size_t checkDensity () const; + size_t updateDensity (); + bool checkEdgeSaturation ( float threshold ) const; + void _xmlWrite ( ostream& ); + virtual Record* _getRecord () const; + virtual string _getString () const; + virtual string _getTypeName () const; // Attributes. protected: KatabaticEngine* _katabatic; + size_t _hEdgeCapacity; + size_t _vEdgeCapacity; // Constructors & Destructors. protected: @@ -81,6 +86,11 @@ namespace Katabatic { }; + inline KatabaticEngine* GCellGrid::getKatabatic () const { return _katabatic; } + inline size_t GCellGrid::getHEdgeCapacity () const { return _hEdgeCapacity; } + inline size_t GCellGrid::getVEdgeCapacity () const { return _vEdgeCapacity; } + + } // End of Katabatic namespace.