From 551adf4213a4ff24cf09f8935abf42eff143bb67 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 22 Aug 2010 12:38:27 +0000 Subject: [PATCH] * ./kite: - New: In Configuration & RoutingEvent, adds support for minimal break length by layer (METAL1 through METAL7). - New: Added measures for final detailed wirelength, wirelength expansion ratio, failed wirelength, number of processeds events and number of unique events. --- kite/src/Configuration.cpp | 26 +++++++++++++++++++++++++- kite/src/KiteEngine.cpp | 13 +++++++++++-- kite/src/NegociateWindow.cpp | 5 +++++ kite/src/RoutingEvent.cpp | 20 +++++++++++++------- kite/src/kite/Configuration.h | 15 +++++++++------ kite/src/kite/KiteEngine.h | 8 ++++---- 6 files changed, 67 insertions(+), 20 deletions(-) diff --git a/kite/src/Configuration.cpp b/kite/src/Configuration.cpp index 03f7184b..ebf07579 100644 --- a/kite/src/Configuration.cpp +++ b/kite/src/Configuration.cpp @@ -56,7 +56,6 @@ namespace Kite { , _postEventCb () , _edgeCapacityPercent(Cfg::getParamPercentage("kite.edgeCapacity", 80.0)->asDouble()) , _expandStep (Cfg::getParamPercentage("kite.expandStep" ,100.0)->asDouble()) - , _globalMinBreak (DbU::lambda((double)Cfg::getParamInt("kite.globalMinBreak",29*50)->asInt())) // Ugly: direct uses of SxLib gauge. , _ripupLimits () , _ripupCost (Cfg::getParamInt("kite.ripupCost" , 3)->asInt()) , _eventsLimit (Cfg::getParamInt("kite.eventsLimit" ,4000000)->asInt()) @@ -66,6 +65,24 @@ namespace Kite { _ripupLimits[LocalRipupLimit] = Cfg::getParamInt("kite.localRipupLimit" , 7)->asInt(); _ripupLimits[GlobalRipupLimit] = Cfg::getParamInt("kite.globalRipupLimit" , 5)->asInt(); _ripupLimits[LongGlobalRipupLimit] = Cfg::getParamInt("kite.longGlobalRipupLimit" , 5)->asInt(); + + for ( size_t i=0 ; iasInt()); + } } @@ -148,6 +165,13 @@ namespace Kite { DbU::Unit Configuration::getGlobalThreshold () const { return _base->getGlobalThreshold(); } + size_t Configuration::getHEdgeCapacity () const + { return _base->getHEdgeCapacity(); } + + + size_t Configuration::getVEdgeCapacity () const + { return _base->getVEdgeCapacity(); } + void Configuration::setAllowedDepth ( size_t allowedDepth ) { _base->setAllowedDepth(allowedDepth); } diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index d38f2ce2..66af8b5b 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -474,8 +474,9 @@ namespace Kite { << "% [" << totalWireLength << "] " << (totalWireLength - routedWireLength) << " remains." << endl; + float expandRatio = 1.0; if ( _minimumWL != 0.0 ) { - float expandRatio = totalWireLength / _minimumWL; + expandRatio = totalWireLength / _minimumWL; cout << " - Wire Length Expand Ratio := " << setprecision(4) << expandRatio << "% [min:" << setprecision(9) << _minimumWL << "] " @@ -484,7 +485,10 @@ namespace Kite { _toolSuccess = (unrouteds == 0); - addMeasure ( getCell(), "Segs", routeds+unrouteds ); + addMeasure ( getCell(), "Segs" , routeds+unrouteds ); + addMeasure ( getCell(), "DWL(l)" , totalWireLength , 12 ); + addMeasure ( getCell(), "fWL(l)" , totalWireLength-routedWireLength , 12); + addMeasure ( getCell(), "WLER(%)", (expandRatio-1.0)*100.0 ); } @@ -507,6 +511,11 @@ namespace Kite { measuresLabels.push_back ( "algoS" ); measuresLabels.push_back ( "finT" ); measuresLabels.push_back ( "Segs" ); + measuresLabels.push_back ( "DWL(l)" ); + measuresLabels.push_back ( "fWL(l)" ); + measuresLabels.push_back ( "WLER(%)" ); + measuresLabels.push_back ( "Events" ); + measuresLabels.push_back ( "UEvents" ); const MeasuresSet* measures = Measures::get(getCell()); diff --git a/kite/src/NegociateWindow.cpp b/kite/src/NegociateWindow.cpp index e5c02a15..78ebc5af 100644 --- a/kite/src/NegociateWindow.cpp +++ b/kite/src/NegociateWindow.cpp @@ -32,6 +32,7 @@ #include "hurricane/Cell.h" #include "crlcore/Utilities.h" #include "crlcore/AllianceFramework.h" +#include "crlcore/Measures.h" #include "kite/DataNegociate.h" #include "kite/TrackElement.h" @@ -151,6 +152,7 @@ namespace Kite { using Hurricane::ltracein; using Hurricane::ltraceout; using Hurricane::ForEachIterator; + using CRL::addMeasure; // ------------------------------------------------------------------- @@ -544,6 +546,9 @@ namespace Kite { ,(RoutingEvent::getProcesseds() - RoutingEvent::getCloneds())) << endl; cmess1 << Dots::asSizet(" - Biggest Events Chunk" ,biggestEventsCount) << endl; cmess1 << Dots::asSizet(" - Biggest Routing Set" ,biggestRSsize) << endl; + + addMeasure( getCell(), "Events" , RoutingEvent::getProcesseds(), 12 ); + addMeasure( getCell(), "UEvents", RoutingEvent::getProcesseds()-RoutingEvent::getCloneds(), 12 ); } diff --git a/kite/src/RoutingEvent.cpp b/kite/src/RoutingEvent.cpp index 9844e30b..75819dd8 100644 --- a/kite/src/RoutingEvent.cpp +++ b/kite/src/RoutingEvent.cpp @@ -1161,8 +1161,11 @@ namespace { for ( ; (begin < end) ; begin++ ) { other = track->getSegment(begin); - if ( other->getNet() == segment->getNet() ) continue; - if ( !other->getCanonicalInterval().intersect(overlap) ) continue; + if ( other->getNet() == segment->getNet() ) continue; + if ( not other->getCanonicalInterval().intersect(overlap) ) { + if ( otherNet == NULL ) candidates.back().setBegin ( begin ); + continue; + } ltrace(200) << " | Conflict: " << begin << " " << other << endl; if ( otherNet != other->getNet() ) { @@ -1244,12 +1247,15 @@ namespace { //if ( track && (track->getAxis() < constraints.getVMin()) ) track = track->getNext(); //for ( ; !success && track && (track->getAxis() <= constraints.getVMax()) ; track = track->getNext() ) - if ( not success and (segment->getLength() >= Session::getConfiguration()->getGlobalMinBreak()) ) { - ltrace(200) << "Long global wire, break in the middle." << endl; - Interval span; - segment->getCanonical ( span ); + unsigned int depth = Session::getConfiguration()->getRoutingGauge()->getLayerDepth(segment->getLayer()); + if ( not success ) { + if ( (segment->getLength() >= Session::getConfiguration()->getGlobalMinBreak(depth)) ) { + ltrace(200) << "Long global wire, break in the middle." << endl; + Interval span; + segment->getCanonical ( span ); - success = Manipulator(segment,*this).makeDogLeg ( span.getCenter() ); + success = Manipulator(segment,*this).makeDogLeg ( span.getCenter() ); + } } if ( not success and segment->isGlobal() and (_costs.size() <= 1) ) { diff --git a/kite/src/kite/Configuration.h b/kite/src/kite/Configuration.h index 31d93d8c..808caf19 100644 --- a/kite/src/kite/Configuration.h +++ b/kite/src/kite/Configuration.h @@ -59,6 +59,7 @@ namespace Kite { , LongGlobalRipupLimit=4 , RipupLimitsTableSize=5 }; + enum Constants { MaxMetalDepth=20 }; public: // Constructor & Destructor. virtual Configuration* clone () const; @@ -78,6 +79,8 @@ namespace Kite { 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 ); @@ -88,13 +91,13 @@ namespace Kite { inline PostEventCb_t& getPostEventCb (); inline unsigned long getEventsLimit () const; inline float getExpandStep () const; - inline DbU::Unit getGlobalMinBreak () const; + inline DbU::Unit getGlobalMinBreak ( unsigned int depth ) const; inline unsigned int getRipupCost () const; unsigned int getRipupLimit ( unsigned int type ) const; inline float getEdgeCapacityPercent () const; inline void setEventsLimit ( unsigned long ); inline void setExpandStep ( float ); - inline void setGlobalMinBreak ( DbU::Unit ); + inline void setGlobalMinBreak ( unsigned int depth, DbU::Unit ); inline void setRipupCost ( unsigned int ); void setRipupLimit ( unsigned int limit, unsigned int type ); inline void setPostEventCb ( PostEventCb_t ); @@ -108,8 +111,8 @@ namespace Kite { PostEventCb_t _postEventCb; float _edgeCapacityPercent; float _expandStep; - DbU::Unit _globalMinBreak; - unsigned int _ripupLimits[RipupLimitsTableSize]; + DbU::Unit _globalMinBreaks[MaxMetalDepth]; + unsigned int _ripupLimits [RipupLimitsTableSize]; unsigned int _ripupCost; unsigned long _eventsLimit; private: @@ -125,12 +128,12 @@ namespace Kite { inline unsigned int Configuration::getRipupCost () const { return _ripupCost; } inline float Configuration::getExpandStep () const { return _expandStep; } inline float Configuration::getEdgeCapacityPercent () const { return _edgeCapacityPercent; } - inline DbU::Unit Configuration::getGlobalMinBreak () const { return _globalMinBreak; } + inline DbU::Unit Configuration::getGlobalMinBreak ( unsigned int depth ) const { return _globalMinBreaks[ (depth>=MaxMetalDepth) ? MaxMetalDepth-1 : depth ]; } inline void Configuration::setRipupCost ( unsigned int cost ) { _ripupCost = cost; } inline void Configuration::setExpandStep ( float step ) { _expandStep = step; } inline void Configuration::setPostEventCb ( PostEventCb_t cb ) { _postEventCb = cb; } inline void Configuration::setEventsLimit ( unsigned long limit ) { _eventsLimit = limit; } - inline void Configuration::setGlobalMinBreak ( DbU::Unit threshold ) { _globalMinBreak = threshold; } + inline void Configuration::setGlobalMinBreak ( unsigned int depth, DbU::Unit threshold ) { _globalMinBreaks[ (depth>=MaxMetalDepth) ? MaxMetalDepth-1 : depth ] = threshold; } diff --git a/kite/src/kite/KiteEngine.h b/kite/src/kite/KiteEngine.h index 7efb59a0..f7e86ca4 100644 --- a/kite/src/kite/KiteEngine.h +++ b/kite/src/kite/KiteEngine.h @@ -92,7 +92,7 @@ namespace Kite { inline unsigned int getRipupCost () const; inline float getExpandStep () const; inline float getEdgeCapacityPercent () const; - inline DbU::Unit getGlobalMinBreak () const; + inline DbU::Unit getGlobalMinBreak ( unsigned int depth ) const; inline GCellGrid* getGCellGrid () const; virtual const Name& getName () const; inline Configuration::PostEventCb_t& @@ -113,7 +113,7 @@ namespace Kite { inline void setRipupCost ( unsigned int ); inline void setExpandStep ( float ); inline void setEdgeCapacityPercent ( float ); - inline void setGlobalMinBreak ( DbU::Unit ); + inline void setGlobalMinBreak ( unsigned int depth, DbU::Unit ); void preProcess (); void buildBlockages (); void buildPowerRails (); @@ -176,7 +176,7 @@ namespace Kite { inline unsigned int KiteEngine::getRipupCost () const { return _configuration->getRipupCost(); } inline float KiteEngine::getExpandStep () const { return _configuration->getExpandStep(); } inline float KiteEngine::getEdgeCapacityPercent () const { return _configuration->getEdgeCapacityPercent(); } - inline DbU::Unit KiteEngine::getGlobalMinBreak () const { return _configuration->getGlobalMinBreak(); } + inline DbU::Unit KiteEngine::getGlobalMinBreak ( unsigned int depth ) const { return _configuration->getGlobalMinBreak(depth); } inline unsigned int KiteEngine::getRipupLimit ( unsigned int type ) const { return _configuration->getRipupLimit(type); } inline GCellGrid* KiteEngine::getGCellGrid () const { return _kiteGrid; } inline NegociateWindow* KiteEngine::getNegociateWindow () { return _negociateWindow; } @@ -186,7 +186,7 @@ namespace Kite { inline void KiteEngine::setRipupCost ( unsigned int cost ) { _configuration->setRipupCost(cost); } inline void KiteEngine::setExpandStep ( float step ) { _configuration->setExpandStep(step); } inline void KiteEngine::setEdgeCapacityPercent ( float percent ) { _configuration->setEdgeCapacityPercent(percent); } - inline void KiteEngine::setGlobalMinBreak ( DbU::Unit threshold ) { _configuration->setGlobalMinBreak(threshold); } + inline void KiteEngine::setGlobalMinBreak ( unsigned int depth, DbU::Unit threshold ) { _configuration->setGlobalMinBreak(depth,threshold); } inline void KiteEngine::setMinimumWL ( double minimum ) { _minimumWL = minimum; } inline void KiteEngine::setPostEventCb ( Configuration::PostEventCb_t cb ) { _configuration->setPostEventCb(cb); } inline void KiteEngine::printConfiguration () const { _configuration->print(getCell()); }