From f1b2035cb09f0ec76410e4ef13f9fae99e13ee06 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 9 May 2017 18:33:55 +0200 Subject: [PATCH] Support for profiling the priority of events in Kite & Katana. * New: In Katana::Configuration, added "katana.profileEventCosts" to triggers the event's profiling. * New: In Katana::NegociateWindow::_negociate(), save a profiling trace of all the events and their priority, separated by metal, for later analysis (see doChip.py in alliance-check-toolkit). * New: In Katana::RoutingEvent::Key::Compare(), start implementing new segment freedom degree functions. * Change: In Hurricane::Net::_getString(), put a more complete information about the Net instead of just only it's name. * Bug: In Katana, reorder the various stages so that they are executed in the exact same sequence as in "doChip.py" so now routing in graphic mode and text mode gives exactly the same results. * Bug: In Katana::PyKatanaEngine, runGlobalRouter do not take any argument. --- anabatic/src/Configuration.cpp | 2 ++ hurricane/src/hurricane/Net.cpp | 14 +++++++-- .../src/hurricane/hurricane/DebugSession.h | 8 ++--- katana/src/Configuration.cpp | 12 +++++--- katana/src/GlobalRoute.cpp | 3 +- katana/src/GraphicKatanaEngine.cpp | 2 +- katana/src/NegociateWindow.cpp | 24 ++++++++++++++- katana/src/PyKatanaEngine.cpp | 20 +++++-------- katana/src/RoutingEvent.cpp | 30 ++++++++++++------- katana/src/SegmentFsm.cpp | 4 +++ katana/src/Track.cpp | 7 ++--- katana/src/katana/Configuration.h | 7 ++++- katana/src/katana/KatanaEngine.h | 2 ++ kite/src/Configuration.cpp | 10 ++++--- kite/src/NegociateWindow.cpp | 22 +++++++++++++- kite/src/kite/Configuration.h | 5 ++++ kite/src/kite/KiteEngine.h | 2 ++ 17 files changed, 126 insertions(+), 48 deletions(-) diff --git a/anabatic/src/Configuration.cpp b/anabatic/src/Configuration.cpp index 843e6922..b6861a1b 100644 --- a/anabatic/src/Configuration.cpp +++ b/anabatic/src/Configuration.cpp @@ -328,6 +328,8 @@ namespace Anabatic { void Configuration::print ( Cell* cell ) const { + if (not cmess1.enabled()) return; + string topLayerName = "UNKOWN"; const Layer* topLayer = _rg->getRoutingLayer( _allowedDepth ); if (topLayer) diff --git a/hurricane/src/hurricane/Net.cpp b/hurricane/src/hurricane/Net.cpp index 30f682a0..d4861668 100644 --- a/hurricane/src/hurricane/Net.cpp +++ b/hurricane/src/hurricane/Net.cpp @@ -748,9 +748,17 @@ void Net::_preDestroy() string Net::_getString() const // *************************** { - string s = Inherit::_getString(); - s.insert(s.length() - 1, " " + getString(_name)); - return s; + string bs = Inherit::_getString(); + string ds = "\"" + getString(_name) + "\" "; + ds += ((_isExternal ) ? "e" : "-"); + ds += ((_isGlobal ) ? "g" : "-"); + ds += ((_isAutomatic) ? "a" : "-"); + ds += " "; + ds += getString(_type ) + " "; + ds += getString(_direction); + + bs.insert( bs.length() - 1, " " + ds ); + return bs; } Record* Net::_getRecord() const diff --git a/hurricane/src/hurricane/hurricane/DebugSession.h b/hurricane/src/hurricane/hurricane/DebugSession.h index 2b87579e..a01d893b 100644 --- a/hurricane/src/hurricane/hurricane/DebugSession.h +++ b/hurricane/src/hurricane/hurricane/DebugSession.h @@ -126,12 +126,12 @@ namespace Hurricane { DebugSession* DebugSession::get () { return _singleton; } bool DebugSession::isTraced ( const void* symbol ) { return _singleton->_isTraced(symbol); } void DebugSession::addToTrace ( const void* symbol ) { _singleton->_addToTrace(symbol); } - void DebugSession::addToTrace ( const Net* net ) { _singleton->_addToTrace ( net ); } + void DebugSession::addToTrace ( const Net* net ) { _singleton->_addToTrace(net); } void DebugSession::addToTrace ( const Cell* cell - , const Name& name ) { _singleton->_addToTrace ( cell, name ); } + , const Name& name ) { _singleton->_addToTrace( cell, name ); } bool DebugSession::_isTraced ( const void* symbol ) const { return _symbols.find(symbol) != _symbols.end(); } - void DebugSession::_addToTrace ( const void* symbol ) { _symbols.insert ( symbol ); } - void DebugSession::_addToTrace ( const Net* net ) { _addToTrace ( static_cast(net) ); } + void DebugSession::_addToTrace ( const void* symbol ) { _symbols.insert( symbol ); } + void DebugSession::_addToTrace ( const Net* net ) { _addToTrace( static_cast(net) ); } diff --git a/katana/src/Configuration.cpp b/katana/src/Configuration.cpp index d3537fe0..c42f1bf4 100644 --- a/katana/src/Configuration.cpp +++ b/katana/src/Configuration.cpp @@ -40,12 +40,13 @@ namespace Katana { Configuration::Configuration () : Anabatic::Configuration() , _postEventCb () - , _hTracksReservedLocal(Cfg::getParamInt("katana.hTracksReservedLocal", 3)->asInt()) - , _vTracksReservedLocal(Cfg::getParamInt("katana.vTracksReservedLocal", 3)->asInt()) + , _hTracksReservedLocal(Cfg::getParamInt ("katana.hTracksReservedLocal", 3)->asInt()) + , _vTracksReservedLocal(Cfg::getParamInt ("katana.vTracksReservedLocal", 3)->asInt()) , _ripupLimits () - , _ripupCost (Cfg::getParamInt("katana.ripupCost" , 3)->asInt()) - , _eventsLimit (Cfg::getParamInt("katana.eventsLimit" ,4000000)->asInt()) + , _ripupCost (Cfg::getParamInt ("katana.ripupCost" , 3)->asInt()) + , _eventsLimit (Cfg::getParamInt ("katana.eventsLimit" ,4000000)->asInt()) , _flags (0) + , _profileEventCosts (Cfg::getParamBool("katana.profileEventCosts" ,false )->asBool()) { _ripupLimits[StrapRipupLimit] = Cfg::getParamInt("katana.strapRipupLimit" ,16)->asInt(); _ripupLimits[LocalRipupLimit] = Cfg::getParamInt("katana.localRipupLimit" , 7)->asInt(); @@ -81,6 +82,7 @@ namespace Katana { , _ripupLimits () , _ripupCost (other._ripupCost) , _eventsLimit (other._eventsLimit) + , _profileEventCosts (other._profileEventCosts) { _ripupLimits[StrapRipupLimit] = other._ripupLimits[StrapRipupLimit]; _ripupLimits[LocalRipupLimit] = other._ripupLimits[LocalRipupLimit]; @@ -142,6 +144,8 @@ namespace Katana { void Configuration::print ( Cell* cell ) const { + if (not cmess1.enabled()) return; + cout << " o Configuration of ToolEngine for Cell <" << cell->getName() << ">" << endl; cout << Dots::asUInt (" - Global router H reserved local" ,_hTracksReservedLocal) << endl; cout << Dots::asUInt (" - Global router V reserved local" ,_vTracksReservedLocal) << endl; diff --git a/katana/src/GlobalRoute.cpp b/katana/src/GlobalRoute.cpp index a5758363..169b03d1 100644 --- a/katana/src/GlobalRoute.cpp +++ b/katana/src/GlobalRoute.cpp @@ -25,6 +25,7 @@ namespace { using std::cerr; using std::endl; using std::setw; + using std::setfill; using std::left; using std::right; using Hurricane::DbU; @@ -162,7 +163,7 @@ namespace Katana { size_t iteration = 0; size_t netCount = 0; do { - cmess2 << " [" << setw(3) << iteration << "] nets:"; + cmess2 << " [" << setfill(' ') << setw(3) << iteration << "] nets:"; netCount = 0; for ( NetData* netData : getNetOrdering() ) { diff --git a/katana/src/GraphicKatanaEngine.cpp b/katana/src/GraphicKatanaEngine.cpp index a6b03a0b..6070257a 100644 --- a/katana/src/GraphicKatanaEngine.cpp +++ b/katana/src/GraphicKatanaEngine.cpp @@ -194,8 +194,8 @@ namespace Katana { katana = KatanaEngine::create( cell ); katana->setPostEventCb( boost::bind(&GraphicKatanaEngine::postEvent,this) ); katana->setViewer( _viewer ); + katana->printConfiguration(); katana->digitalInit(); - if (cmess1.enabled()) katana->printConfiguration(); } else cerr << Warning( "%s already has a Katana engine.", getString(cell).c_str() ) << endl; diff --git a/katana/src/NegociateWindow.cpp b/katana/src/NegociateWindow.cpp index 3b8cc2a6..eeca94a9 100644 --- a/katana/src/NegociateWindow.cpp +++ b/katana/src/NegociateWindow.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include "hurricane/Warning.h" #include "hurricane/Bug.h" @@ -137,6 +138,7 @@ namespace { namespace Katana { + using std::ofstream; using std::cerr; using std::endl; using std::setw; @@ -425,7 +427,11 @@ namespace Katana { cmess1 << " o Negociation Stage." << endl; - unsigned long limit = _katana->getEventsLimit(); + unsigned long limit = _katana->getEventsLimit(); + bool profiling = _katana->profileEventCosts(); + ofstream ofprofile; + + if (profiling) ofprofile.open( "katana.profile.txt" ); _eventHistory.clear(); _eventQueue.load( _segments ); @@ -453,6 +459,21 @@ namespace Katana { cmess2.flush(); } + if (ofprofile.is_open()) { + size_t depth = _katana->getConfiguration()->getLayerDepth( event->getSegment()->getLayer() ); + if (depth < 6) { + ofprofile << setw(10) << right << count << " "; + for ( size_t i=0 ; i<6 ; ++i ) { + if (i == depth) + ofprofile << setw(10) << right << setprecision(2) << event->getPriority () << " "; + else + ofprofile << setw(10) << right << setprecision(2) << 0.0 << " "; + } + + ofprofile << setw( 2) << right << event->getEventLevel() << endl; + } + } + event->process( _eventQueue, _eventHistory, _eventLoop ); count++; @@ -519,6 +540,7 @@ namespace Katana { cerr << Bug( "%d events remains after clear.", RoutingEvent::getAllocateds() ) << endl; } + if (ofprofile.is_open()) ofprofile.close(); _statistics.setEventsCount( eventsCount ); cdebug_tabw(159,-1); diff --git a/katana/src/PyKatanaEngine.cpp b/katana/src/PyKatanaEngine.cpp index 8222a1da..d9ea2a7c 100644 --- a/katana/src/PyKatanaEngine.cpp +++ b/katana/src/PyKatanaEngine.cpp @@ -167,25 +167,19 @@ extern "C" { } - PyObject* PyKatanaEngine_runGlobalRouter ( PyKatanaEngine* self, PyObject* args ) + PyObject* PyKatanaEngine_runGlobalRouter ( PyKatanaEngine* self ) { cdebug_log(40,0) << "PyKatanaEngine_runGlobalRouter()" << endl; HTRY METHOD_HEAD("KatanaEngine.runGlobalRouter()") - unsigned int flags = 0; - if (PyArg_ParseTuple(args,"I:KatanaEngine.runGlobalRouter", &flags)) { - if (katana->getViewer()) { - if (ExceptionWidget::catchAllWrapper( std::bind(&KatanaEngine::runGlobalRouter,katana) )) { - PyErr_SetString( HurricaneError, "KatanaEngine::runGlobalrouter() has thrown an exception (C++)." ); - return NULL; - } - } else { - katana->runGlobalRouter(); + if (katana->getViewer()) { + if (ExceptionWidget::catchAllWrapper( std::bind(&KatanaEngine::runGlobalRouter,katana) )) { + PyErr_SetString( HurricaneError, "KatanaEngine::runGlobalrouter() has thrown an exception (C++)." ); + return NULL; } } else { - PyErr_SetString(ConstructorError, "KatanaEngine.runGlobalRouter(): Invalid number/bad type of parameter."); - return NULL; + katana->runGlobalRouter(); } HCATCH @@ -311,7 +305,7 @@ extern "C" { , "Display on the console the configuration of Katana." } , { "getToolSuccess" , (PyCFunction)PyKatanaEngine_getToolSuccess , METH_NOARGS , "Returns True if the detailed routing has been successful." } - , { "runGlobalRouter" , (PyCFunction)PyKatanaEngine_runGlobalRouter , METH_VARARGS + , { "runGlobalRouter" , (PyCFunction)PyKatanaEngine_runGlobalRouter , METH_NOARGS , "Run the global router (Katana)." } , { "loadGlobalRouting" , (PyCFunction)PyKatanaEngine_loadGlobalRouting , METH_VARARGS , "Load global routing into the detailed router." } diff --git a/katana/src/RoutingEvent.cpp b/katana/src/RoutingEvent.cpp index f07a4d8e..f161e3ca 100644 --- a/katana/src/RoutingEvent.cpp +++ b/katana/src/RoutingEvent.cpp @@ -15,6 +15,7 @@ #include +#include #include #include #include @@ -79,11 +80,11 @@ namespace Katana { if (lhs._eventLevel < rhs._eventLevel) return true; // Process all M2 (terminal access) before any others. - if ((lhs._layerDepth == 1) and (rhs._layerDepth != 1)) return false; - if ((lhs._layerDepth != 1) and (rhs._layerDepth == 1)) return true; + //if ((lhs._layerDepth == 1) and (rhs._layerDepth != 1)) return false; + //if ((lhs._layerDepth != 1) and (rhs._layerDepth == 1)) return true; - if (lhs._priority > rhs._priority) return false; - if (lhs._priority < rhs._priority) return true; + if (lhs._priority > rhs._priority) return true; + if (lhs._priority < rhs._priority) return false; if (lhs._length > rhs._length) return false; if (lhs._length < rhs._length) return true; @@ -401,11 +402,11 @@ namespace Katana { cdebug_tabw(159,1); cdebug_log(159,0) << "State: *before* " - << DataNegociate::getStateString(_segment->getDataNegociate()) - << " ripup:" << _segment->getDataNegociate()->getRipupCount() - << endl; + << DataNegociate::getStateString(_segment->getDataNegociate()) + << " ripup:" << _segment->getDataNegociate()->getRipupCount() + << endl; cdebug_log(159,0) << "Level: " << getEventLevel() - << ", area: " << _segment->getFreedomDegree() << endl; + << ", area: " << _segment->getFreedomDegree() << endl; //_preCheck( _segment ); _eventLevel = 0; @@ -648,10 +649,17 @@ namespace Katana { _overConstrained = _segment->base()->getAutoSource()->isTerminal() and _segment->base()->getAutoTarget()->isTerminal(); } + + double length = DbU::toLambda(_segment->getLength()); + + // if (length > 200.0) length = 200.0 - std::log(length)*20.0; + // if (length < 0.0) length = 0.0; - _priority - = (DbU::toLambda(_segment->getLength()) + 1.0) - * (DbU::toLambda(_segment->base()->getSlack()) + 1.0); + _priority = (length + 1.0) * (DbU::toLambda(_segment->base()->getSlack()) + 1.0); + + // if (_priority > 10000.0) cerr << "_priority:" << _priority + // << " length:" << DbU::toLambda(_segment->getLength()) + // << " slack:" << DbU::toLambda(_segment->base()->getSlack()) << endl; cdebug_log(159,0) << _segment << " has " << (int)_tracksNb << " choices " << perpandicular << endl; cdebug_tabw(159,-1); diff --git a/katana/src/SegmentFsm.cpp b/katana/src/SegmentFsm.cpp index 8748fe49..73abf1e7 100644 --- a/katana/src/SegmentFsm.cpp +++ b/katana/src/SegmentFsm.cpp @@ -503,8 +503,10 @@ namespace Katana { _event2 = _data2->getRoutingEvent(); _event2->setTracksFree( 0 ); + cdebug_log(159,1) << "Coupled:" << _event2 << endl; _data2->update(); _event2->revalidate(); + cdebug_tabw(159,-1); _sameAxis = (segment1->isVertical() xor symData->isSymVertical()); } @@ -639,6 +641,8 @@ namespace Katana { cdebug_log(159,0) << "TrackCost::Compare() - DiscardGlobals" << endl; } + // FOR ANALOG ONLY. + //flags |= TrackCost::IgnoreSharedLength; sort( _costs.begin(), _costs.end(), CompareCostArray(flags) ); size_t i=0; diff --git a/katana/src/Track.cpp b/katana/src/Track.cpp index 95589186..7424c1eb 100644 --- a/katana/src/Track.cpp +++ b/katana/src/Track.cpp @@ -172,10 +172,8 @@ namespace Katana { TrackElement* Track::getPrevious ( size_t& index, Net* net ) const { for ( index-- ; index != npos ; index-- ) { - if (cdebug.enabled()) { - cerr << tab << index << ":"; cerr.flush(); - cerr << _segments[index] << endl; - } + cdebug_log(140,0) << index << ":" << _segments[index] << endl; + if (_segments[index]->getNet() == net) continue; return _segments[index]; } @@ -437,6 +435,7 @@ namespace Katana { } } } + cdebug_tabw(155,-1); return Interval( minFree, getMaximalPosition(end,state) ); diff --git a/katana/src/katana/Configuration.h b/katana/src/katana/Configuration.h index c76dfa5e..2f6c0bc5 100644 --- a/katana/src/katana/Configuration.h +++ b/katana/src/katana/Configuration.h @@ -10,7 +10,7 @@ // | Author : Jean-Paul CHAPUT | // | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | =============================================================== | -// | C++ Header : "./katana/Configuration.h" | +// | C++ Header : "./katana/Configuration.h" | // +-----------------------------------------------------------------+ @@ -60,6 +60,7 @@ namespace Katana { ~Configuration (); // Decorateds. inline bool useClockTree () const; + inline bool profileEventCosts () const; // Methods. inline Anabatic::Configuration* base (); inline const Anabatic::Configuration* base () const; @@ -77,6 +78,7 @@ namespace Katana { void setVTracksReservedLocal ( size_t ); inline void setFlags ( unsigned int ); inline void unsetFlags ( unsigned int ); + inline void setProfileEventCosts ( bool ); virtual void print ( Cell* ) const; virtual Record* _getRecord () const; virtual string _getString () const; @@ -90,6 +92,7 @@ namespace Katana { unsigned int _ripupCost; unsigned long _eventsLimit; unsigned int _flags; + bool _profileEventCosts; private: Configuration ( const Configuration& other ); Configuration& operator= ( const Configuration& ); @@ -108,8 +111,10 @@ namespace Katana { inline void Configuration::setPostEventCb ( PostEventCb_t cb ) { _postEventCb = cb; } inline void Configuration::setEventsLimit ( unsigned long limit ) { _eventsLimit = limit; } inline bool Configuration::useClockTree () const { return _flags & UseClockTree; } + inline bool Configuration::profileEventCosts () const { return _profileEventCosts; } inline void Configuration::setFlags ( unsigned int flags ) { _flags |= flags; } inline void Configuration::unsetFlags ( unsigned int flags ) { _flags &= ~flags; } + inline void Configuration::setProfileEventCosts ( bool state ) { _profileEventCosts = state; } diff --git a/katana/src/katana/KatanaEngine.h b/katana/src/katana/KatanaEngine.h index fa22d4a2..2b6694a0 100644 --- a/katana/src/katana/KatanaEngine.h +++ b/katana/src/katana/KatanaEngine.h @@ -78,6 +78,7 @@ namespace Katana { inline unsigned int getRipupCost () const; inline size_t getHTracksReservedLocal () const; inline size_t getVTracksReservedLocal () const; + inline bool profileEventCosts () const; virtual const Name& getName () const; inline Configuration::PostEventCb_t& getPostEventCb (); @@ -163,6 +164,7 @@ namespace Katana { inline size_t KatanaEngine::getHTracksReservedLocal () const { return _configuration->getHTracksReservedLocal(); } inline size_t KatanaEngine::getVTracksReservedLocal () const { return _configuration->getVTracksReservedLocal(); } inline unsigned int KatanaEngine::getRipupLimit ( unsigned int type ) const { return _configuration->getRipupLimit(type); } + inline bool KatanaEngine::profileEventCosts () const { return _configuration->profileEventCosts(); } inline const std::map& KatanaEngine::getSymmetrics () const { return _symmetrics; } inline NegociateWindow* KatanaEngine::getNegociateWindow () { return _negociateWindow; } diff --git a/kite/src/Configuration.cpp b/kite/src/Configuration.cpp index 9c2f28d9..bf708b57 100644 --- a/kite/src/Configuration.cpp +++ b/kite/src/Configuration.cpp @@ -41,12 +41,13 @@ namespace Kite { : Katabatic::Configuration() , _base (base) , _postEventCb () - , _hTracksReservedLocal(Cfg::getParamInt("kite.hTracksReservedLocal", 3)->asInt()) - , _vTracksReservedLocal(Cfg::getParamInt("kite.vTracksReservedLocal", 3)->asInt()) + , _hTracksReservedLocal(Cfg::getParamInt ("kite.hTracksReservedLocal", 3)->asInt()) + , _vTracksReservedLocal(Cfg::getParamInt ("kite.vTracksReservedLocal", 3)->asInt()) , _ripupLimits () - , _ripupCost (Cfg::getParamInt("kite.ripupCost" , 3)->asInt()) - , _eventsLimit (Cfg::getParamInt("kite.eventsLimit" ,4000000)->asInt()) + , _ripupCost (Cfg::getParamInt ("kite.ripupCost" , 3)->asInt()) + , _eventsLimit (Cfg::getParamInt ("kite.eventsLimit" ,4000000)->asInt()) , _flags (0) + , _profileEventCosts (Cfg::getParamBool("kite.profileEventCosts" ,false )->asBool()) { _ripupLimits[StrapRipupLimit] = Cfg::getParamInt("kite.strapRipupLimit" ,16)->asInt(); _ripupLimits[LocalRipupLimit] = Cfg::getParamInt("kite.localRipupLimit" , 7)->asInt(); @@ -83,6 +84,7 @@ namespace Kite { , _ripupLimits () , _ripupCost (other._ripupCost) , _eventsLimit (other._eventsLimit) + , _profileEventCosts (other._profileEventCosts) { if ( _base == NULL ) _base = other._base->clone(); diff --git a/kite/src/NegociateWindow.cpp b/kite/src/NegociateWindow.cpp index 1a8d882c..7cbb3f8e 100644 --- a/kite/src/NegociateWindow.cpp +++ b/kite/src/NegociateWindow.cpp @@ -429,7 +429,11 @@ namespace Kite { cmess1 << " o Negociation Stage." << endl; - unsigned long limit = _kite->getEventsLimit(); + unsigned long limit = _kite->getEventsLimit(); + bool profiling = _kite->profileEventCosts(); + ofstream ofprofile; + + if (profiling) ofprofile.open( "kite.profile.txt" ); _eventHistory.clear(); _eventQueue.load( _segments ); @@ -457,6 +461,21 @@ namespace Kite { cmess2.flush(); } + if (ofprofile.is_open()) { + size_t depth = _kite->getConfiguration()->getLayerDepth( event->getSegment()->getLayer() ); + if (depth < 6) { + ofprofile << setw(10) << right << count << " "; + for ( size_t i=0 ; i<6 ; ++i ) { + if (i == depth) + ofprofile << setw(10) << right << setprecision(2) << event->getPriority () << " "; + else + ofprofile << setw(10) << right << setprecision(2) << 0.0 << " "; + } + + ofprofile << setw( 2) << right << event->getEventLevel() << endl; + } + } + event->process( _eventQueue, _eventHistory, _eventLoop ); count++; @@ -523,6 +542,7 @@ namespace Kite { cerr << Bug( "%d events remains after clear.", RoutingEvent::getAllocateds() ) << endl; } + if (ofprofile.is_open()) ofprofile.close(); _statistics.setEventsCount( eventsCount ); cdebug_tabw(159,-1); diff --git a/kite/src/kite/Configuration.h b/kite/src/kite/Configuration.h index b8e0a343..0a21a7e0 100644 --- a/kite/src/kite/Configuration.h +++ b/kite/src/kite/Configuration.h @@ -60,6 +60,7 @@ namespace Kite { virtual bool isGMetal ( const Layer* ) const; virtual bool isGContact ( const Layer* ) const; inline bool useClockTree () const; + inline bool profileEventCosts () const; virtual size_t getDepth () const; virtual size_t getAllowedDepth () const; virtual DbU::Unit getSliceHeight () const; @@ -89,6 +90,7 @@ namespace Kite { virtual void setSaturateRatio ( float ); virtual void setSaturateRp ( size_t ); virtual void setGlobalThreshold ( DbU::Unit ); + inline void setProfileEventCosts ( bool ); virtual void print ( Cell* ) const; // Methods. inline Katabatic::Configuration* base (); @@ -119,6 +121,7 @@ namespace Kite { unsigned int _ripupCost; unsigned long _eventsLimit; unsigned int _flags; + bool _profileEventCosts; private: Configuration ( const Configuration& other, Katabatic::Configuration* base=NULL ); Configuration& operator= ( const Configuration& ); @@ -136,8 +139,10 @@ namespace Kite { inline void Configuration::setPostEventCb ( PostEventCb_t cb ) { _postEventCb = cb; } inline void Configuration::setEventsLimit ( unsigned long limit ) { _eventsLimit = limit; } inline bool Configuration::useClockTree () const { return _flags & UseClockTree; } + inline bool Configuration::profileEventCosts () const { return _profileEventCosts; } inline void Configuration::setFlags ( unsigned int flags ) { _flags |= flags; } inline void Configuration::unsetFlags ( unsigned int flags ) { _flags &= ~flags; } + inline void Configuration::setProfileEventCosts ( bool state ) { _profileEventCosts = state; } diff --git a/kite/src/kite/KiteEngine.h b/kite/src/kite/KiteEngine.h index eba26afd..737ba4b3 100644 --- a/kite/src/kite/KiteEngine.h +++ b/kite/src/kite/KiteEngine.h @@ -78,6 +78,7 @@ namespace Kite { inline unsigned int getRipupCost () const; inline size_t getHTracksReservedLocal () const; inline size_t getVTracksReservedLocal () const; + inline bool profileEventCosts () const; virtual const Name& getName () const; inline Configuration::PostEventCb_t& getPostEventCb (); @@ -161,6 +162,7 @@ namespace Kite { inline unsigned int KiteEngine::getRipupCost () const { return _configuration->getRipupCost(); } inline size_t KiteEngine::getHTracksReservedLocal () const { return _configuration->getHTracksReservedLocal(); } inline size_t KiteEngine::getVTracksReservedLocal () const { return _configuration->getVTracksReservedLocal(); } + inline bool KiteEngine::profileEventCosts () const { return _configuration->profileEventCosts(); } inline unsigned int KiteEngine::getRipupLimit ( unsigned int type ) const { return _configuration->getRipupLimit(type); } inline NegociateWindow* KiteEngine::getNegociateWindow () { return _negociateWindow; } inline size_t KiteEngine::getRoutingPlanesSize () const { return _routingPlanes.size(); }