From 38fb1dfdfb12207c88013133ea472ac4976fdc3d Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 18 Aug 2010 20:24:30 +0000 Subject: [PATCH] * ./katabatic: - New: To pass the ibmXX, new parameter "katabatic.saturateRp" which allows to sets the threshold above which a GCell has too much RoutingPads in it and must be further desaturated. Must be 8 for FPGA, and 10 for ibm. - Bug: In LoadGrByNet(), when looking for the starting GCell, the computation of unconnecteds RoutingPads was incorrect, too great and letting the router believe that the routage was incomplete. --- katabatic/src/Configuration.cpp | 9 +++++++++ katabatic/src/GCell.cpp | 22 +++++++++++++++------- katabatic/src/LoadGrByNet.cpp | 5 +++-- katabatic/src/Session.cpp | 4 ++++ katabatic/src/katabatic/Configuration.h | 5 +++++ katabatic/src/katabatic/KatabaticEngine.h | 4 ++++ katabatic/src/katabatic/Session.h | 1 + 7 files changed, 41 insertions(+), 9 deletions(-) diff --git a/katabatic/src/Configuration.cpp b/katabatic/src/Configuration.cpp index 6806937b..89d9d87e 100644 --- a/katabatic/src/Configuration.cpp +++ b/katabatic/src/Configuration.cpp @@ -68,6 +68,7 @@ namespace Katabatic { , _rg (NULL) , _extensionCap (DbU::lambda(1.5)) , _saturateRatio (Cfg::getParamPercentage("katabatic.saturateRatio",80.0)->asDouble()) + , _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) { @@ -156,6 +157,10 @@ namespace Katabatic { { return _saturateRatio; } + size_t ConfigurationConcrete::getSaturateRp () const + { return _saturateRp; } + + DbU::Unit ConfigurationConcrete::getGlobalThreshold () const { return _globalThreshold; } @@ -168,6 +173,10 @@ namespace Katabatic { { _saturateRatio = ratio; } + void ConfigurationConcrete::setSaturateRp ( size_t threshold ) + { _saturateRp = threshold; } + + void ConfigurationConcrete::setGlobalThreshold ( DbU::Unit threshold ) { _globalThreshold = threshold; } diff --git a/katabatic/src/GCell.cpp b/katabatic/src/GCell.cpp index b528d2d9..4e2b37f6 100644 --- a/katabatic/src/GCell.cpp +++ b/katabatic/src/GCell.cpp @@ -709,14 +709,14 @@ namespace Katabatic { rpNets.insert ( (*irp)->getNet() ); } - if ( rpNets.size() < 8 ) return; + if ( rpNets.size() < Session::getSaturateRp() ) return; - // cerr << Warning("%s has %ud terminals (h:%ud, v:%ud)" - // ,getString(this).c_str() - // ,rps.size() - // ,_hsegments.size() - // ,_vsegments.size() - // ) << endl; + cerr << Warning("%s has %zd terminals (h:%zd, v:%zd)" + ,getString(this).c_str() + ,rps.size() + ,_hsegments.size() + ,_vsegments.size() + ) << endl; AutoSegment* segment; while ( stepDesaturate ( 1, globalNets, segment, true ) ) { @@ -780,6 +780,7 @@ namespace Katabatic { #endif updateDensity (); + float density = getDensity(); //float density = _densities[depth]; //float densityUp = _densities[depth+2]; @@ -819,6 +820,13 @@ namespace Katabatic { updateDensity (); + //cmess2 << " - GCell [" << getIndex() << "] @" << getColumn() << "x" << getRow() + // << ":" << setprecision(4) << density + // << " [cap:" << _densities[depth] + // << " M+2: " << (_densities[depth+2] + (1.0 / capacity)) + // << " displaced:" << (*isegment) << "]." + // << endl; + return true; } diff --git a/katabatic/src/LoadGrByNet.cpp b/katabatic/src/LoadGrByNet.cpp index 2ed41d12..d5f73fed 100644 --- a/katabatic/src/LoadGrByNet.cpp +++ b/katabatic/src/LoadGrByNet.cpp @@ -2364,12 +2364,14 @@ namespace Katabatic { size_t connecteds = 0; ltrace(99) << "Start RoutingPad Ring" << endl; forEach ( RoutingPad*, startRp, routingPads ) { + bool segmentFound = false; forEach ( Hook*, ihook, startRp->getBodyHook()->getHooks() ) { ltrace(99) << "Component " << ihook->getComponent() << endl; Segment* segment = dynamic_cast(ihook->getComponent()); if ( segment ) { ++connecteds; + segmentFound = true; GCellConfiguration gcellConf ( getGCellGrid(), *ihook, NULL ); if ( gcellConf.getStateG() == 1 ) { @@ -2380,10 +2382,9 @@ namespace Katabatic { } break; } - } else { - ++unconnecteds; } } + unconnecteds += (segmentFound) ? 0 : 1; if ( (unconnecteds > 10) and (connecteds == 0) ) { cerr << Warning("More than 10 unconnected RoutingPads (%u) on %s, missing global routing?" ,unconnecteds, getString(net->getName()).c_str() ) << endl; diff --git a/katabatic/src/Session.cpp b/katabatic/src/Session.cpp index 55c840e3..423aa9bf 100644 --- a/katabatic/src/Session.cpp +++ b/katabatic/src/Session.cpp @@ -374,6 +374,10 @@ namespace Katabatic { { return get("getSaturateRatio()")->_katabatic->getSaturateRatio(); } + size_t Session::getSaturateRp () + { return get("getSaturateRp()")->_katabatic->getSaturateRp(); } + + bool Session::getWarnGCellOverload () { return get("getWarnGCellOverload()")->_katabatic->getWarnGCellOverload(); } diff --git a/katabatic/src/katabatic/Configuration.h b/katabatic/src/katabatic/Configuration.h index 4a922538..0bfcce57 100644 --- a/katabatic/src/katabatic/Configuration.h +++ b/katabatic/src/katabatic/Configuration.h @@ -72,9 +72,11 @@ namespace Katabatic { virtual Layer* getContactLayer ( size_t depth ) const = 0; virtual DbU::Unit getExtensionCap () const = 0; virtual float getSaturateRatio () const = 0; + virtual size_t getSaturateRp () const = 0; virtual DbU::Unit getGlobalThreshold () const = 0; virtual void setAllowedDepth ( size_t ) = 0; virtual void setSaturateRatio ( float ) = 0; + virtual void setSaturateRp ( size_t ) = 0; virtual void setGlobalThreshold ( DbU::Unit ) = 0; virtual void print ( Cell* ) const = 0; virtual Record* _getRecord () const = 0; @@ -112,9 +114,11 @@ namespace Katabatic { virtual Layer* getContactLayer ( size_t depth ) const; virtual DbU::Unit getExtensionCap () const; virtual float getSaturateRatio () const; + virtual size_t getSaturateRp () const; virtual DbU::Unit getGlobalThreshold () const; virtual void setAllowedDepth ( size_t ); virtual void setSaturateRatio ( float ); + virtual void setSaturateRp ( size_t ); virtual void setGlobalThreshold ( DbU::Unit ); virtual void print ( Cell* ) const; virtual Record* _getRecord () const; @@ -128,6 +132,7 @@ namespace Katabatic { RoutingGauge* _rg; DbU::Unit _extensionCap; float _saturateRatio; + size_t _saturateRp; DbU::Unit _globalThreshold; size_t _allowedDepth; private: diff --git a/katabatic/src/katabatic/KatabaticEngine.h b/katabatic/src/katabatic/KatabaticEngine.h index 62646394..f917ac37 100644 --- a/katabatic/src/katabatic/KatabaticEngine.h +++ b/katabatic/src/katabatic/KatabaticEngine.h @@ -138,6 +138,7 @@ namespace Katabatic { inline const NetSet& getRoutingNets () const; inline DbU::Unit getGlobalThreshold () const; inline float getSaturateRatio () const; + inline size_t getSaturateRp () const; inline DbU::Unit getExtensionCap () const; void xmlWriteGCellGrid ( ostream& ); void xmlWriteGCellGrid ( const string& ); @@ -150,6 +151,7 @@ namespace Katabatic { inline void setWarnGCellOverload ( bool ); inline void setGlobalThreshold ( DbU::Unit ); inline void setSaturateRatio ( float ); + inline void setSaturateRp ( size_t ); void startMeasures (); void stopMeasures (); void printMeasures ( const string& ) const; @@ -238,6 +240,7 @@ namespace Katabatic { inline void KatabaticEngine::setDemoMode ( bool mode ) { _demoMode = mode; } inline void KatabaticEngine::setWarnGCellOverload ( bool mode ) { _warnGCellOverload = mode; } inline void KatabaticEngine::setSaturateRatio ( float ratio ) { _configuration->setSaturateRatio(ratio); } + inline void KatabaticEngine::setSaturateRp ( size_t threshold ) { _configuration->setSaturateRp(threshold); } inline void KatabaticEngine::setGlobalThreshold ( DbU::Unit threshold ) { _configuration->setGlobalThreshold(threshold); } inline bool KatabaticEngine::getDemoMode () { return _demoMode; } inline bool KatabaticEngine::getWarnGCellOverload () { return _warnGCellOverload; } @@ -250,6 +253,7 @@ namespace Katabatic { inline const KatabaticEngine::NetSet& KatabaticEngine::getRoutingNets () const { return _routingNets; } inline DbU::Unit KatabaticEngine::getGlobalThreshold () const { return _configuration->getGlobalThreshold(); } inline float KatabaticEngine::getSaturateRatio () const { return _configuration->getSaturateRatio(); } + inline size_t KatabaticEngine::getSaturateRp () const { return _configuration->getSaturateRp(); } inline DbU::Unit KatabaticEngine::getExtensionCap () const { return _configuration->getExtensionCap(); } inline AutoContactLut& KatabaticEngine::_getAutoContactLut () { return _autoContactLut; } inline AutoSegmentLut& KatabaticEngine::_getAutoSegmentLut () { return _autoSegmentLut; } diff --git a/katabatic/src/katabatic/Session.h b/katabatic/src/katabatic/Session.h index 8fd89756..56506014 100644 --- a/katabatic/src/katabatic/Session.h +++ b/katabatic/src/katabatic/Session.h @@ -101,6 +101,7 @@ namespace Katabatic { static inline KatabaticEngine* getKatabatic (); static bool getDemoMode (); static float getSaturateRatio (); + static size_t getSaturateRp (); static bool getWarnGCellOverload (); static DbU::Unit getExtensionCap (); static const Layer* getRoutingLayer ( size_t );