* ./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).
This commit is contained in:
Jean-Paul Chaput 2010-08-22 12:37:48 +00:00
parent a0dce4eceb
commit 1d525fec35
6 changed files with 78 additions and 35 deletions

View File

@ -25,12 +25,14 @@
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include <vector>
#include "vlsisapd/configuration/Configuration.h" #include "vlsisapd/configuration/Configuration.h"
#include "hurricane/Technology.h" #include "hurricane/Technology.h"
#include "hurricane/DataBase.h" #include "hurricane/DataBase.h"
#include "hurricane/Cell.h" #include "hurricane/Cell.h"
#include "crlcore/Utilities.h" #include "crlcore/Utilities.h"
#include "crlcore/RoutingLayerGauge.h"
#include "crlcore/AllianceFramework.h" #include "crlcore/AllianceFramework.h"
#include "katabatic/Configuration.h" #include "katabatic/Configuration.h"
@ -44,11 +46,14 @@ namespace Katabatic {
using std::endl; using std::endl;
using std::setprecision; using std::setprecision;
using std::ostringstream; using std::ostringstream;
using std::vector;
using Hurricane::tab; using Hurricane::tab;
using Hurricane::inltrace; using Hurricane::inltrace;
using Hurricane::Technology; using Hurricane::Technology;
using Hurricane::DataBase; using Hurricane::DataBase;
using CRL::AllianceFramework; using CRL::AllianceFramework;
using CRL::RoutingGauge;
using CRL::RoutingLayerGauge;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -71,6 +76,8 @@ namespace Katabatic {
, _saturateRp (Cfg::getParamInt ("katabatic.saturateRp" ,8 )->asInt()) , _saturateRp (Cfg::getParamInt ("katabatic.saturateRp" ,8 )->asInt())
, _globalThreshold (DbU::lambda((double)Cfg::getParamInt("katabatic.globalLengthThreshold",29*50)->asInt())) // Ugly: direct uses of SxLib gauge. , _globalThreshold (DbU::lambda((double)Cfg::getParamInt("katabatic.globalLengthThreshold",29*50)->asInt())) // Ugly: direct uses of SxLib gauge.
, _allowedDepth (0) , _allowedDepth (0)
, _hEdgeCapacity (0)
, _vEdgeCapacity (0)
{ {
if ( rg == NULL ) rg = AllianceFramework::get()->getRoutingGauge(); if ( rg == NULL ) rg = AllianceFramework::get()->getRoutingGauge();
@ -80,6 +87,18 @@ namespace Katabatic {
_gmetalh = DataBase::getDB()->getTechnology()->getLayer("gmetalh"); _gmetalh = DataBase::getDB()->getTechnology()->getLayer("gmetalh");
_gmetalv = DataBase::getDB()->getTechnology()->getLayer("gmetalv"); _gmetalv = DataBase::getDB()->getTechnology()->getLayer("gmetalv");
_gcontact = DataBase::getDB()->getTechnology()->getLayer("gcontact"); _gcontact = DataBase::getDB()->getTechnology()->getLayer("gcontact");
vector<RoutingLayerGauge*>::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; } { return _globalThreshold; }
size_t ConfigurationConcrete::getHEdgeCapacity () const
{ return _hEdgeCapacity; }
size_t ConfigurationConcrete::getVEdgeCapacity () const
{ return _vEdgeCapacity; }
void ConfigurationConcrete::setAllowedDepth ( size_t allowedDepth ) void ConfigurationConcrete::setAllowedDepth ( size_t allowedDepth )
{ _allowedDepth = (allowedDepth > getDepth()) ? getDepth() : allowedDepth; } { _allowedDepth = (allowedDepth > getDepth()) ? getDepth() : allowedDepth; }

View File

@ -912,7 +912,8 @@ namespace Katabatic {
edgeUpUsage++; edgeUpUsage++;
} }
} }
edgeUpSaturation = (float)edgeUpUsage/((float)getVCapacity()*2.0); //edgeUpSaturation = (float)edgeUpUsage/((float)getVCapacity()*2.0);
edgeUpSaturation = (float)edgeUpUsage/getGCellGrid()->getVEdgeCapacity();
} }
if ( getRight() ) { if ( getRight() ) {
@ -931,7 +932,8 @@ namespace Katabatic {
edgeRightUsage++; edgeRightUsage++;
} }
} }
edgeRightSaturation = (float)edgeRightUsage/((float)getHCapacity()*2.0); //edgeRightSaturation = (float)edgeRightUsage/((float)getHCapacity()*2.0);
edgeRightSaturation = (float)edgeRightUsage/getGCellGrid()->getHEdgeCapacity();
} }
bool overload = false; bool overload = false;
@ -943,11 +945,11 @@ namespace Katabatic {
ostringstream message; ostringstream message;
message << setprecision(3); message << setprecision(3);
if ( edgeUpSaturation > threshold ) if ( edgeUpSaturation > threshold )
message << "up edge: " << edgeUpUsage << "/" << (getVCapacity()*2.0) message << "up edge: " << edgeUpUsage << "/" << getGCellGrid()->getVEdgeCapacity()
<< " " << edgeUpSaturation; << " " << edgeUpSaturation;
if ( edgeRightSaturation > threshold ) { if ( edgeRightSaturation > threshold ) {
if ( message.str().size() ) message << " & "; if ( message.str().size() ) message << " & ";
message << "right edge: " << edgeRightUsage << "/" << (getVCapacity()*2.0) message << "right edge: " << edgeRightUsage << "/" << getGCellGrid()->getHEdgeCapacity()
<< " " << edgeRightSaturation; << " " << edgeRightSaturation;
} }

View File

@ -54,8 +54,10 @@ namespace Katabatic {
GCellGrid::GCellGrid ( KatabaticEngine* ktbt ) GCellGrid::GCellGrid ( KatabaticEngine* ktbt )
: Grid<GCell>(ktbt->getCell()->getAbutmentBox()) : Grid<GCell> (ktbt->getCell()->getAbutmentBox())
, _katabatic(ktbt) , _katabatic (ktbt)
, _hEdgeCapacity(ktbt->getConfiguration()->getHEdgeCapacity())
, _vEdgeCapacity(ktbt->getConfiguration()->getVEdgeCapacity())
{ } { }

View File

@ -277,14 +277,24 @@ namespace Katabatic {
Session::revalidate (); Session::revalidate ();
for ( int i=0 ; i < 3 ; i++ ) { // Look for RoutingPad overload.
_desaturate ( 1, globalNets, total, global ); vector<GCell*> gcells = *(_gcellGrid->getGCellVector());
_desaturate ( 2, globalNets, total, global ); for ( size_t i=0 ; i<gcells.size() ; ++i ) {
gcells[i]->rpDesaturate ( 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 (); Session::revalidate ();
if ( !_gcellGrid->updateDensity () ) break;
} }
//refresh ( false ); //refresh ( false );
@ -297,20 +307,6 @@ namespace Katabatic {
_print ( *inet ); _print ( *inet );
#endif #endif
// Look for RoutingPad overload.
vector<GCell*> gcells = *(_gcellGrid->getGCellVector());
for ( size_t i=0 ; i<gcells.size() ; ++i ) {
gcells[i]->rpDesaturate ( globalNets );
// set<RoutingPad*> rps;
// gcells[i]->getRoutingPads ( rps );
// if ( rps.size() > 7 ) {
// cerr << "[WARNING] " << gcells[i] << "has " << rps.size() << " terminals." << endl;
// }
}
Session::revalidate ();
Session::setWarnGCellOverload ( true ); Session::setWarnGCellOverload ( true );
_gcellGrid->checkDensity (); _gcellGrid->checkDensity ();

View File

@ -74,6 +74,8 @@ namespace Katabatic {
virtual float getSaturateRatio () const = 0; virtual float getSaturateRatio () const = 0;
virtual size_t getSaturateRp () const = 0; virtual size_t getSaturateRp () const = 0;
virtual DbU::Unit getGlobalThreshold () 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 setAllowedDepth ( size_t ) = 0;
virtual void setSaturateRatio ( float ) = 0; virtual void setSaturateRatio ( float ) = 0;
virtual void setSaturateRp ( size_t ) = 0; virtual void setSaturateRp ( size_t ) = 0;
@ -116,6 +118,8 @@ namespace Katabatic {
virtual float getSaturateRatio () const; virtual float getSaturateRatio () const;
virtual size_t getSaturateRp () const; virtual size_t getSaturateRp () const;
virtual DbU::Unit getGlobalThreshold () const; virtual DbU::Unit getGlobalThreshold () const;
virtual size_t getHEdgeCapacity () const;
virtual size_t getVEdgeCapacity () const;
virtual void setAllowedDepth ( size_t ); virtual void setAllowedDepth ( size_t );
virtual void setSaturateRatio ( float ); virtual void setSaturateRatio ( float );
virtual void setSaturateRp ( size_t ); virtual void setSaturateRp ( size_t );
@ -135,6 +139,8 @@ namespace Katabatic {
size_t _saturateRp; size_t _saturateRp;
DbU::Unit _globalThreshold; DbU::Unit _globalThreshold;
size_t _allowedDepth; size_t _allowedDepth;
size_t _hEdgeCapacity;
size_t _vEdgeCapacity;
private: private:
ConfigurationConcrete ( const ConfigurationConcrete& ); ConfigurationConcrete ( const ConfigurationConcrete& );
ConfigurationConcrete& operator= ( const ConfigurationConcrete& ); ConfigurationConcrete& operator= ( const ConfigurationConcrete& );

View File

@ -50,20 +50,25 @@ namespace Katabatic {
class GCellGrid : public Grid<GCell> { class GCellGrid : public Grid<GCell> {
public: public:
Cell* getCell () const; Cell* getCell () const;
Interval getUSide ( unsigned int ) const; inline KatabaticEngine* getKatabatic () const;
void updateContacts ( bool openSession=true ); inline size_t getHEdgeCapacity () const;
size_t checkDensity () const; inline size_t getVEdgeCapacity () const;
size_t updateDensity (); Interval getUSide ( unsigned int ) const;
bool checkEdgeSaturation ( float threshold ) const; void updateContacts ( bool openSession=true );
void _xmlWrite ( ostream& ); size_t checkDensity () const;
virtual Record* _getRecord () const; size_t updateDensity ();
virtual string _getString () const; bool checkEdgeSaturation ( float threshold ) const;
virtual string _getTypeName () const; void _xmlWrite ( ostream& );
virtual Record* _getRecord () const;
virtual string _getString () const;
virtual string _getTypeName () const;
// Attributes. // Attributes.
protected: protected:
KatabaticEngine* _katabatic; KatabaticEngine* _katabatic;
size_t _hEdgeCapacity;
size_t _vEdgeCapacity;
// Constructors & Destructors. // Constructors & Destructors.
protected: 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. } // End of Katabatic namespace.