diff --git a/crlcore/etc/cmos/kite.conf b/crlcore/etc/cmos/kite.conf index 60a09b12..6deac6e4 100644 --- a/crlcore/etc/cmos/kite.conf +++ b/crlcore/etc/cmos/kite.conf @@ -10,14 +10,14 @@ parametersTable = \ ( ("katabatic.globalLengthThreshold",TypeInt ,1450 ) # Katabatic parameters. , ("katabatic.saturateRatio" ,TypePercentage,80 ) , ("katabatic.saturateRp" ,TypeInt ,8 ) - , ('katabatic.topRoutingLayer' , TypeString , 'METAL5') + , ('katabatic.topRoutingLayer' ,TypeString , 'METAL5') # Kite parameters. - , ("kite.hEdgeCapacity" ,TypePercentage,85 , { 'min':0, 'max':110 } ) - , ("kite.vEdgeCapacity" ,TypePercentage,85 , { 'min':0, 'max':110 } ) - , ("kite.eventsLimit" ,TypeInt ,4000002) - , ("kite.ripupCost" ,TypeInt ,3 , { 'min':0 } ) - , ("kite.strapRipupLimit" ,TypeInt ,16 , { 'min':1 } ) - , ("kite.localRipupLimit" ,TypeInt ,9 , { 'min':1 } ) - , ("kite.globalRipupLimit" ,TypeInt ,5 , { 'min':1 } ) - , ("kite.longGlobalRipupLimit" ,TypeInt ,5 , { 'min':1 } ) + , ("kite.hTracksReservedLocal" ,TypeInt ,3 , { 'min':0, 'max':20 } ) + , ("kite.vTracksReservedLocal" ,TypeInt ,3 , { 'min':0, 'max':20 } ) + , ("kite.eventsLimit" ,TypeInt ,4000002 ) + , ("kite.ripupCost" ,TypeInt ,3 , { 'min':0 } ) + , ("kite.strapRipupLimit" ,TypeInt ,16 , { 'min':1 } ) + , ("kite.localRipupLimit" ,TypeInt ,9 , { 'min':1 } ) + , ("kite.globalRipupLimit" ,TypeInt ,5 , { 'min':1 } ) + , ("kite.longGlobalRipupLimit" ,TypeInt ,5 , { 'min':1 } ) ) diff --git a/crlcore/etc/common/kite.conf b/crlcore/etc/common/kite.conf index 8dfac323..b453e659 100644 --- a/crlcore/etc/common/kite.conf +++ b/crlcore/etc/common/kite.conf @@ -10,10 +10,10 @@ layoutTable = \ , (TypeOption , "katabatic.topRoutingLayer" , "Top Routing Layer" , 0, 1 ) , (TypeRule ,) , (TypeTitle , "Kite - Detailed Router" ) - , (TypeOption , "kite.hEdgeCapacity" , "Vert. Edge Capacity (%)", 0 ) - , (TypeOption , "kite.vEdgeCapacity" , "Hor. Edge Capacity (%)" , 0 ) - , (TypeOption , "kite.eventsLimit" , "Events Limit" , 0 ) - , (TypeOption , "kite.ripupCost" , "Ripup Cost" , 1, 1, Cfg.ParameterWidgetFlags.UseSpinBox ) + , (TypeOption , "kite.hTracksReservedLocal", "Vert. Locally Reserved Tracks", 0 ) + , (TypeOption , "kite.vTracksReservedLocal", "Hor. Locally Reserved Tracks" , 0 ) + , (TypeOption , "kite.eventsLimit" , "Events Limit" , 0 ) + , (TypeOption , "kite.ripupCost" , "Ripup Cost" , 1, 1, Cfg.ParameterWidgetFlags.UseSpinBox ) , (TypeSection, "Ripup Limits", 1 ) , (TypeOption , "kite.strapRipupLimit" , "Straps" , 1, 1, Cfg.ParameterWidgetFlags.UseSpinBox ) , (TypeOption , "kite.localRipupLimit" , "Locals" , 1, 1, Cfg.ParameterWidgetFlags.UseSpinBox ) diff --git a/crlcore/etc/common/mauka.conf b/crlcore/etc/common/mauka.conf index 62cbdcd2..46a95367 100644 --- a/crlcore/etc/common/mauka.conf +++ b/crlcore/etc/common/mauka.conf @@ -11,6 +11,7 @@ parametersTable = \ , ('mauka.plotBins' , TypeBool , True ) , ('mauka.searchRatio' , TypePercentage, 50 ) , ('mauka.standardAnnealing', TypeBool , True ) + , ('clockTree.minimumSide' , TypeInt , 300 ) ) @@ -30,9 +31,10 @@ layoutTable = \ , (TypeOption, "metis.Reconst" , "Reconst" , 1 ) # Nimbus part. , (TypeTitle , "Mauka - Placer") - , (TypeOption, "nimbus.pinsPlacement", "Pins Placement" , 0 ) - , (TypeOption, "nimbus.aspectRatio" , "Aspect Ratio, X/Y (%)", 1 ) - , (TypeOption, "nimbus.spaceMargin" , "Space Margin" , 1 ) + , (TypeOption, "nimbus.pinsPlacement" , "Pins Placement" , 0 ) + , (TypeOption, "nimbus.aspectRatio" , "Aspect Ratio, X/Y (%)", 1 ) + , (TypeOption, "nimbus.spaceMargin" , "Space Margin" , 1 ) + , (TypeOption, "clockTree.minimumSide", "Clock Tree Min. Side" , 1 ) , (TypeRule ,) # Mauka part. , (TypeOption, "mauka.standardAnnealing", "Standart Annealing" , 0 ) diff --git a/crlcore/etc/vsc200/kite.conf b/crlcore/etc/vsc200/kite.conf index 47266d05..cfb97161 100644 --- a/crlcore/etc/vsc200/kite.conf +++ b/crlcore/etc/vsc200/kite.conf @@ -10,14 +10,14 @@ parametersTable = \ ( ("katabatic.globalLengthThreshold",TypeInt ,1450 ) # Katabatic parameters. , ("katabatic.saturateRatio" ,TypePercentage,80 ) , ("katabatic.saturateRp" ,TypeInt ,8 ) - , ('katabatic.topRoutingLayer' , TypeString , 'METAL5') + , ('katabatic.topRoutingLayer' ,TypeString , 'METAL5') # Kite parameters. - , ("kite.hEdgeCapacity" ,TypePercentage,85 , { 'min':0, 'max':110 } ) - , ("kite.vEdgeCapacity" ,TypePercentage,85 , { 'min':0, 'max':110 } ) - , ("kite.eventsLimit" ,TypeInt ,4000002) - , ("kite.ripupCost" ,TypeInt ,3 , { 'min':0 } ) - , ("kite.strapRipupLimit" ,TypeInt ,16 , { 'min':1 } ) - , ("kite.localRipupLimit" ,TypeInt ,9 , { 'min':1 } ) - , ("kite.globalRipupLimit" ,TypeInt ,5 , { 'min':1 } ) - , ("kite.longGlobalRipupLimit" ,TypeInt ,5 , { 'min':1 } ) + , ("kite.hTracksReservedLocal" ,TypeInt ,4 , { 'min':0, 'max':18 } ) + , ("kite.vTracksReservedLocal" ,TypeInt ,3 , { 'min':0, 'max':18 } ) + , ("kite.eventsLimit" ,TypeInt ,4000002 ) + , ("kite.ripupCost" ,TypeInt ,3 , { 'min':0 } ) + , ("kite.strapRipupLimit" ,TypeInt ,16 , { 'min':1 } ) + , ("kite.localRipupLimit" ,TypeInt ,9 , { 'min':1 } ) + , ("kite.globalRipupLimit" ,TypeInt ,5 , { 'min':1 } ) + , ("kite.longGlobalRipupLimit" ,TypeInt ,5 , { 'min':1 } ) ) diff --git a/katabatic/src/GCell.cpp b/katabatic/src/GCell.cpp index 1eb66c65..8fbc00c4 100644 --- a/katabatic/src/GCell.cpp +++ b/katabatic/src/GCell.cpp @@ -1007,12 +1007,12 @@ namespace Katabatic { } - bool GCell::checkEdgeSaturation ( float threshold ) const + bool GCell::checkEdgeSaturation ( size_t hreserved, size_t vreserved) const { - unsigned int edgeUpUsage = 0; - unsigned int edgeRightUsage = 0; - float edgeUpSaturation = 0.0; - float edgeRightSaturation = 0.0; + size_t edgeUpUsage = 0; + size_t edgeRightUsage = 0; + size_t edgeUpCapacity = getGCellGrid()->getVEdgeCapacity() - vreserved; + size_t edgeRightCapacity = getGCellGrid()->getHEdgeCapacity() - hreserved; if ( getUp() ) { // Up Edge Density. @@ -1030,7 +1030,6 @@ namespace Katabatic { edgeUpUsage++; } } - edgeUpSaturation = (float)edgeUpUsage/getGCellGrid()->getVEdgeCapacity(); } if ( getRight() ) { @@ -1049,24 +1048,24 @@ namespace Katabatic { edgeRightUsage++; } } - edgeRightSaturation = (float)edgeRightUsage/getGCellGrid()->getHEdgeCapacity(); } bool overload = false; - if ( (edgeUpSaturation > threshold) or (edgeRightSaturation > threshold) ) { + if ( (edgeUpUsage > edgeUpCapacity) or (edgeRightUsage > edgeRightCapacity) ) { overload = true; - cparanoid << Warning("In %s, (over %.2f) ", _getString().c_str(), threshold); + cparanoid << Warning( "In %s, (over h:%d or v:%d)" + , _getString().c_str(), edgeRightCapacity, edgeUpCapacity); ostringstream message; message << setprecision(3); - if ( edgeUpSaturation > threshold ) - message << "up edge: " << edgeUpUsage << "/" << getGCellGrid()->getVEdgeCapacity() - << " " << edgeUpSaturation; - if ( edgeRightSaturation > threshold ) { + if ( edgeUpUsage > edgeUpCapacity ) + message << "up edge: " << edgeUpUsage << " vs. " << getGCellGrid()->getVEdgeCapacity() + << "-" << vreserved; + if ( edgeRightUsage > edgeRightCapacity ) { if ( message.str().size() ) message << " & "; - message << "right edge: " << edgeRightUsage << "/" << getGCellGrid()->getHEdgeCapacity() - << " " << edgeRightSaturation; + message << "right edge: " << edgeRightUsage << " vs. " << getGCellGrid()->getHEdgeCapacity() + << "-" << hreserved; } cparanoid << message.str() << "." << endl; diff --git a/katabatic/src/GCellGrid.cpp b/katabatic/src/GCellGrid.cpp index 6038de52..84bb870f 100644 --- a/katabatic/src/GCellGrid.cpp +++ b/katabatic/src/GCellGrid.cpp @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2013, All Rights Reserved +// Copyright (c) UPMC 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -179,11 +178,11 @@ namespace Katabatic { } - bool GCellGrid::checkEdgeSaturation ( float threshold ) const + bool GCellGrid::checkEdgeOverflow ( size_t hreserved, size_t vreserved) const { bool overload = false; forEach ( GCell*, gcell, const_cast(this)->getGCells() ) { - overload = gcell->checkEdgeSaturation(threshold) or overload; + overload = gcell->checkEdgeSaturation(hreserved,vreserved) or overload; } return overload; } diff --git a/katabatic/src/katabatic/GCell.h b/katabatic/src/katabatic/GCell.h index dff0e8df..4bab378c 100644 --- a/katabatic/src/katabatic/GCell.h +++ b/katabatic/src/katabatic/GCell.h @@ -1,7 +1,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2008-2013, All Rights Reserved +// Copyright (c) UPMC 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -158,7 +158,7 @@ namespace Katabatic { size_t getRoutingPads ( set& ); inline const Key& getKey () const; size_t checkDensity () const; - bool checkEdgeSaturation ( float threshold ) const; + bool checkEdgeSaturation ( size_t hreserved, size_t vreserved) const; // Modifiers. void addBlockage ( unsigned int depth, DbU::Unit ); inline void addHSegment ( AutoSegment* ); diff --git a/katabatic/src/katabatic/GCellGrid.h b/katabatic/src/katabatic/GCellGrid.h index 25d3151c..1d4925c7 100644 --- a/katabatic/src/katabatic/GCellGrid.h +++ b/katabatic/src/katabatic/GCellGrid.h @@ -1,7 +1,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2008-2013, All Rights Reserved +// Copyright (c) UPMC 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -58,7 +58,7 @@ namespace Katabatic { inline size_t getVEdgeCapacity () const; Interval getUSide ( unsigned int ) const; size_t checkDensity () const; - bool checkEdgeSaturation ( float threshold ) const; + bool checkEdgeOverflow ( size_t hreserved, size_t vreserved ) const; size_t updateDensity (); void updateContacts ( unsigned int flags=KbOpenSession ); inline void setDensityMode ( unsigned int ); diff --git a/kite/src/Configuration.cpp b/kite/src/Configuration.cpp index 7cbef5cf..168038b0 100644 --- a/kite/src/Configuration.cpp +++ b/kite/src/Configuration.cpp @@ -1,7 +1,7 @@ // -*- mode: C++; explicit-buffer-name: "Configuration.cpp" -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved +// Copyright (c) UPMC 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -42,11 +42,11 @@ namespace Kite { : Katabatic::Configuration() , _base (base) , _postEventCb () - , _hEdgeCapacityPercent(Cfg::getParamPercentage("kite.hEdgeCapacity", 80.0)->asDouble()) - , _vEdgeCapacityPercent(Cfg::getParamPercentage("kite.vEdgeCapacity", 80.0)->asDouble()) + , _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()) { _ripupLimits[StrapRipupLimit] = Cfg::getParamInt("kite.strapRipupLimit" ,16)->asInt(); _ripupLimits[LocalRipupLimit] = Cfg::getParamInt("kite.localRipupLimit" , 7)->asInt(); @@ -78,8 +78,8 @@ namespace Kite { : Katabatic::Configuration() , _base (base) , _postEventCb (other._postEventCb) - , _hEdgeCapacityPercent(other._hEdgeCapacityPercent) - , _vEdgeCapacityPercent(other._vEdgeCapacityPercent) + , _hTracksReservedLocal(other._hTracksReservedLocal) + , _vTracksReservedLocal(other._vTracksReservedLocal) , _ripupLimits () , _ripupCost (other._ripupCost) , _eventsLimit (other._eventsLimit) @@ -240,23 +240,23 @@ namespace Kite { } - void Configuration::setHEdgeCapacityPercent ( float percent ) + void Configuration::setHTracksReservedLocal ( size_t reserved ) { - if (percent > 1.0) - throw Error( "Configuration::setHEdgeCapacityPercent(): edge capacity ratio greater than 1.0 (%.1f)." - , percent ); + if (reserved > getHEdgeCapacity()) + throw Error( "Configuration::setHTracksReservedLocal(): tracks reserved for local routing (%d) is greater than edge capacity %d." + , reserved, getHEdgeCapacity() ); - _hEdgeCapacityPercent = percent; + _hTracksReservedLocal = reserved; } - void Configuration::setVEdgeCapacityPercent ( float percent ) + void Configuration::setVTracksReservedLocal ( size_t reserved ) { - if (percent > 1.0) - throw Error( "Configuration::setVEdgeCapacityPercent(): edge capacity ratio greater than 1.0 (%.1f)." - , percent ); + if (reserved > 1.0) + throw Error( "Configuration::setVTracksReservedLocal(): tracks reserved for local routing (%d) is greater than edge capacity %d." + , reserved, getVEdgeCapacity() ); - _vEdgeCapacityPercent = percent; + _vTracksReservedLocal = reserved; } @@ -274,13 +274,13 @@ namespace Kite { void Configuration::print ( Cell* cell ) const { cout << " o Configuration of ToolEngine for Cell <" << cell->getName() << ">" << endl; - cout << Dots::asPercentage(" - Global router H edge capacity" ,_hEdgeCapacityPercent) << endl; - cout << Dots::asPercentage(" - Global router V edge capacity" ,_vEdgeCapacityPercent) << endl; - cout << Dots::asULong (" - Events limit (iterations)" ,_eventsLimit) << endl; - cout << Dots::asUInt (" - Ripup limit, straps" ,_ripupLimits[StrapRipupLimit]) << endl; - cout << Dots::asUInt (" - Ripup limit, locals" ,_ripupLimits[LocalRipupLimit]) << endl; - cout << Dots::asUInt (" - Ripup limit, globals" ,_ripupLimits[GlobalRipupLimit]) << endl; - cout << Dots::asUInt (" - Ripup limit, long globals" ,_ripupLimits[LongGlobalRipupLimit]) << endl; + cout << Dots::asUInt (" - Global router H reserved local" ,_hTracksReservedLocal) << endl; + cout << Dots::asUInt (" - Global router V reserved local" ,_vTracksReservedLocal) << endl; + cout << Dots::asULong(" - Events limit (iterations)" ,_eventsLimit) << endl; + cout << Dots::asUInt (" - Ripup limit, straps" ,_ripupLimits[StrapRipupLimit]) << endl; + cout << Dots::asUInt (" - Ripup limit, locals" ,_ripupLimits[LocalRipupLimit]) << endl; + cout << Dots::asUInt (" - Ripup limit, globals" ,_ripupLimits[GlobalRipupLimit]) << endl; + cout << Dots::asUInt (" - Ripup limit, long globals" ,_ripupLimits[LongGlobalRipupLimit]) << endl; _base->print ( cell ); } @@ -305,8 +305,8 @@ namespace Kite { Record* record = _base->_getRecord(); //record->add ( getSlot ( "_rg" , _rg ) ); if ( record ) { - record->add ( getSlot("_hEdgeCapacityPercent" ,_hEdgeCapacityPercent ) ); - record->add ( getSlot("_vEdgeCapacityPercent" ,_vEdgeCapacityPercent ) ); + record->add ( getSlot("_hTracksReservedLocal" ,_hTracksReservedLocal ) ); + record->add ( getSlot("_vTracksReservedLocal" ,_vTracksReservedLocal ) ); record->add ( getSlot("_ripupCost" ,_ripupCost ) ); record->add ( getSlot("_eventsLimit" ,_eventsLimit ) ); diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index c444ec0b..269df917 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -247,8 +247,8 @@ namespace Kite { KatabaticEngine::chipPrep(); - KnikEngine::setHEdgeCapacityPercent( 1.0 ); - KnikEngine::setVEdgeCapacityPercent( 1.0 ); + KnikEngine::setHEdgeReservedLocal( 0 ); + KnikEngine::setVEdgeReservedLocal( 0 ); _knik = KnikEngine::create( cell , 1 // _congestion , 2 // _preCongestion @@ -259,13 +259,13 @@ namespace Kite { _knik->setRoutingGauge( getConfiguration()->getRoutingGauge() ); _knik->setAllowedDepth( getConfiguration()->getAllowedDepth() ); _knik->createRoutingGraph(); - KnikEngine::setHEdgeCapacityPercent( getHEdgeCapacityPercent() ); - KnikEngine::setVEdgeCapacityPercent( getVEdgeCapacityPercent() ); + KnikEngine::setHEdgeReservedLocal( getHTracksReservedLocal() ); + KnikEngine::setVEdgeReservedLocal( getVTracksReservedLocal() ); // Decrease the edge's capacity only under the core area. - const ChipTools& chipTools = getChipTools(); - float corePercent = 1.00; - float coronaPercent = 0.80; + const ChipTools& chipTools = getChipTools(); + size_t coreReserved = 0; + size_t coronaReserved = 4; forEach ( Knik::Vertex*, ivertex, _knik->getRoutingGraph()->getVertexes() ) { for ( int i=0 ; i<2 ; ++i ) { @@ -279,7 +279,7 @@ namespace Kite { edge->setCapacity( 0 ); continue; } - corePercent = getHEdgeCapacityPercent(); + coreReserved = getHTracksReservedLocal(); } else { edge = ivertex->getVEdgeOut(); if (not edge) continue; @@ -288,20 +288,21 @@ namespace Kite { edge->setCapacity( 0 ); continue; } - corePercent = getVEdgeCapacityPercent(); + coreReserved = getVTracksReservedLocal(); } - float edgePercent = 1.00; + size_t edgeReserved = 0; if (chipTools.getCorona().getInnerBox().contains(edge->getBoundingBox())) { - edgePercent = corePercent; + edgeReserved = coreReserved; } else if (chipTools.getCorona().getOuterBox().contains(edge->getBoundingBox())) { - edgePercent = coronaPercent; + edgeReserved = coronaReserved; } - float capacity = edgePercent * (float)edge->getCapacity(); + size_t capacity = (edge->getCapacity()>edgeReserved) + ? (edge->getCapacity()-edgeReserved) : 0; //cerr << "Appling capacity percentage " << (edgePercent*100.0) << "% (" // << capacity << ") on: " << edge << endl; - edge->setCapacity( (unsigned int)capacity ); + edge->setCapacity( capacity ); } } } @@ -547,7 +548,7 @@ namespace Kite { KatabaticEngine::loadGlobalRouting( method, nets ); Session::open( this ); - getGCellGrid()->checkEdgeSaturation( getHEdgeCapacityPercent() ); + getGCellGrid()->checkEdgeOverflow( getHTracksReservedLocal(), getVTracksReservedLocal() ); Session::close(); } @@ -574,15 +575,20 @@ namespace Kite { printMeasures( "algo" ); Session::open( this ); - unsigned int overlaps = 0; - float edgeCapacity = 1.0; - KnikEngine* knik = KnikEngine::get( getCell() ); + unsigned int overlaps = 0; + size_t hTracksReservedLocal = getHTracksReservedLocal(); + size_t vTracksReservedLocal = getVTracksReservedLocal(); + KnikEngine* knik = KnikEngine::get( getCell() ); - if (knik) edgeCapacity = knik->getHEdgeCapacityPercent(); + if (knik) { + hTracksReservedLocal = knik->getHEdgeReservedLocal(); + vTracksReservedLocal = knik->getVEdgeReservedLocal(); + } if (cparanoid.enabled()) { - cparanoid << " o Post-checking Knik capacity overload " << (edgeCapacity*100.0) << "%." << endl; - getGCellGrid()->checkEdgeSaturation( edgeCapacity ); + cparanoid << " o Post-checking Knik capacity overload h:" << hTracksReservedLocal + << " v:." << vTracksReservedLocal << endl; + getGCellGrid()->checkEdgeOverflow( hTracksReservedLocal, vTracksReservedLocal ); } _check( overlaps ); diff --git a/kite/src/kite/Configuration.h b/kite/src/kite/Configuration.h index 1f8196f7..0be4b5ff 100644 --- a/kite/src/kite/Configuration.h +++ b/kite/src/kite/Configuration.h @@ -94,14 +94,14 @@ namespace Kite { inline unsigned long getEventsLimit () const; inline unsigned int getRipupCost () const; unsigned int getRipupLimit ( unsigned int type ) const; - inline float getHEdgeCapacityPercent () const; - inline float getVEdgeCapacityPercent () const; + inline size_t getHTracksReservedLocal () const; + inline size_t getVTracksReservedLocal () const; inline void setEventsLimit ( unsigned long ); inline void setRipupCost ( unsigned int ); void setRipupLimit ( unsigned int limit, unsigned int type ); inline void setPostEventCb ( PostEventCb_t ); - void setHEdgeCapacityPercent ( float ); - void setVEdgeCapacityPercent ( float ); + void setHTracksReservedLocal ( size_t ); + void setVTracksReservedLocal ( size_t ); virtual Record* _getRecord () const; virtual string _getString () const; virtual string _getTypeName () const; @@ -109,9 +109,9 @@ namespace Kite { // Attributes. Katabatic::Configuration* _base; PostEventCb_t _postEventCb; - float _hEdgeCapacityPercent; - float _vEdgeCapacityPercent; - unsigned int _ripupLimits [RipupLimitsTableSize]; + size_t _hTracksReservedLocal; + size_t _vTracksReservedLocal; + unsigned int _ripupLimits [RipupLimitsTableSize]; unsigned int _ripupCost; unsigned long _eventsLimit; private: @@ -125,8 +125,8 @@ namespace Kite { inline Configuration::PostEventCb_t& Configuration::getPostEventCb () { return _postEventCb; } inline unsigned long Configuration::getEventsLimit () const { return _eventsLimit; } inline unsigned int Configuration::getRipupCost () const { return _ripupCost; } - inline float Configuration::getHEdgeCapacityPercent () const { return _hEdgeCapacityPercent; } - inline float Configuration::getVEdgeCapacityPercent () const { return _vEdgeCapacityPercent; } + inline size_t Configuration::getHTracksReservedLocal () const { return _hTracksReservedLocal; } + inline size_t Configuration::getVTracksReservedLocal () const { return _vTracksReservedLocal; } inline void Configuration::setRipupCost ( unsigned int cost ) { _ripupCost = cost; } inline void Configuration::setPostEventCb ( PostEventCb_t cb ) { _postEventCb = cb; } inline void Configuration::setEventsLimit ( unsigned long limit ) { _eventsLimit = limit; } diff --git a/kite/src/kite/KiteEngine.h b/kite/src/kite/KiteEngine.h index a1a54b48..cb07d541 100644 --- a/kite/src/kite/KiteEngine.h +++ b/kite/src/kite/KiteEngine.h @@ -74,8 +74,8 @@ namespace Kite { inline unsigned int getRipupLimit ( unsigned int type ) const; unsigned int getRipupLimit ( const TrackElement* ) const; inline unsigned int getRipupCost () const; - inline float getHEdgeCapacityPercent () const; - inline float getVEdgeCapacityPercent () const; + inline size_t getHTracksReservedLocal () const; + inline size_t getVTracksReservedLocal () const; virtual const Name& getName () const; inline Configuration::PostEventCb_t& getPostEventCb (); @@ -94,8 +94,8 @@ namespace Kite { inline void setMinimumWL ( double ); inline void setRipupLimit ( unsigned int type, unsigned int ); inline void setRipupCost ( unsigned int ); - inline void setHEdgeCapacityPercent ( float ); - inline void setVEdgeCapacityPercent ( float ); + inline void setHTracksReservedLocal ( size_t ); + inline void setVTracksReservedLocal ( size_t ); void buildPowerRails (); void protectRoutingPads (); void preProcess (); @@ -153,8 +153,8 @@ namespace Kite { inline bool KiteEngine::getToolSuccess () const { return _toolSuccess; } inline unsigned long KiteEngine::getEventsLimit () const { return _configuration->getEventsLimit(); } inline unsigned int KiteEngine::getRipupCost () const { return _configuration->getRipupCost(); } - inline float KiteEngine::getHEdgeCapacityPercent () const { return _configuration->getHEdgeCapacityPercent(); } - inline float KiteEngine::getVEdgeCapacityPercent () const { return _configuration->getVEdgeCapacityPercent(); } + inline size_t KiteEngine::getHTracksReservedLocal () const { return _configuration->getHTracksReservedLocal(); } + inline size_t KiteEngine::getVTracksReservedLocal () const { return _configuration->getVTracksReservedLocal(); } 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(); } @@ -162,8 +162,8 @@ namespace Kite { inline void KiteEngine::setEventLimit ( unsigned long limit ) { _configuration->setEventsLimit(limit); } inline void KiteEngine::setRipupLimit ( unsigned int type, unsigned int limit ) { _configuration->setRipupLimit(limit,type); } inline void KiteEngine::setRipupCost ( unsigned int cost ) { _configuration->setRipupCost(cost); } - inline void KiteEngine::setHEdgeCapacityPercent ( float percent ) { _configuration->setHEdgeCapacityPercent(percent); } - inline void KiteEngine::setVEdgeCapacityPercent ( float percent ) { _configuration->setVEdgeCapacityPercent(percent); } + inline void KiteEngine::setHTracksReservedLocal ( size_t reserved ) { _configuration->setHTracksReservedLocal(reserved); } + inline void KiteEngine::setVTracksReservedLocal ( size_t reserved ) { _configuration->setVTracksReservedLocal(reserved); } 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()); } diff --git a/knik/src/Graph.cpp b/knik/src/Graph.cpp index f8bfda09..dc7158f7 100644 --- a/knik/src/Graph.cpp +++ b/knik/src/Graph.cpp @@ -168,6 +168,10 @@ void Graph::_postCreate() throw Error ("Graph::_postCreate(): cannot use another method than MatrixVertex"); #endif } + + cout << Dots::asUInt (" - Global router H edges capacity" ,_lowerLeftVertex->getHEdgeOut()->getCapacity()) << endl; + cout << Dots::asUInt (" - Global router V edges capacity" ,_lowerLeftVertex->getVEdgeOut()->getCapacity()) << endl; + // #ifdef __USE_MATRIXVERTEX__ // _matrixVertex = MatrixVertex::create(this); // if ( _routingGrid ) { @@ -514,13 +518,13 @@ Vertex* Graph::createVertex ( Point position, DbU::Unit halfWidth, DbU::Unit hal return vertex; } - void Graph::createHEdge ( Vertex* from, Vertex* to, float ecp ) -// ************************************************************** + void Graph::createHEdge ( Vertex* from, Vertex* to, size_t reserved ) +// ******************************************************************** { - unsigned int capacity = 0; + size_t capacity = 0; if ( _routingGrid ) { capacity = _routingGrid->getHCapacity(); - //cerr << "createHEdge capacity:" << capacity << " ecp:" << ecp << endl; + //cerr << "createHEdge capacity:" << capacity << " reserved:" << reserved << endl; } else { vector rtLGauges = _engine->getRoutingGauge()->getLayerGauges(); for ( vector::iterator it = rtLGauges.begin() ; it != rtLGauges.end() ; it++ ) { @@ -533,9 +537,9 @@ Vertex* Graph::createVertex ( Point position, DbU::Unit halfWidth, DbU::Unit hal capacity += routingLayerGauge->getTrackNumber ( from->getYMin(), from->getYMax() ) - 1; } - //cerr << "createHEdge capacity:" << capacity << " ecp:" << ecp << endl; + //cerr << "createHEdge capacity:" << capacity << " reserved:" << reserved << endl; } - Edge* newEdge = HEdge::create ( from, to, (unsigned)((float)(capacity)*ecp) ); + Edge* newEdge = HEdge::create ( from, to, capacity-reserved ); _all_edges.push_back ( newEdge ); @@ -552,10 +556,10 @@ Vertex* Graph::createVertex ( Point position, DbU::Unit halfWidth, DbU::Unit hal to->setHEdgeIn ( newEdge ); } -void Graph::createVEdge ( Vertex* from, Vertex* to, float ecp ) -// ************************************************************ +void Graph::createVEdge ( Vertex* from, Vertex* to, size_t reserved ) +// ****************************************************************** { - unsigned int capacity = 0; + size_t capacity = 0; if ( _routingGrid ) capacity = _routingGrid->getVCapacity(); else { @@ -570,9 +574,9 @@ void Graph::createVEdge ( Vertex* from, Vertex* to, float ecp ) capacity += routingLayerGauge->getTrackNumber ( from->getXMin(), from->getXMax() ) - 1; } - //cerr << "createVEdge capacity:" << capacity << " ecp:" << ecp << endl; + //cerr << "createVEdge capacity:" << capacity << " reserved:" << reserved << endl; } - Edge* newEdge = VEdge::create ( from, to, (unsigned)((float)(capacity)*ecp) ); + Edge* newEdge = VEdge::create ( from, to, capacity-reserved ); _all_edges.push_back ( newEdge ); diff --git a/knik/src/KnikEngine.cpp b/knik/src/KnikEngine.cpp index c30bcdd0..37514a33 100644 --- a/knik/src/KnikEngine.cpp +++ b/knik/src/KnikEngine.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2006-2014, All Rights Reserved +// Copyright (c) UPMC 2006-2014, All Rights Reserved // // x-----------------------------------------------------------------x // | C O R I O L I S | @@ -63,9 +63,9 @@ namespace Knik { extern bool __ripupMode__; - const Name KnikEngine::_toolName = "Knik::KnikEngine"; - float KnikEngine::_edgeHCapacityPercent = 1.0; - float KnikEngine::_edgeVCapacityPercent = 1.0; + const Name KnikEngine::_toolName = "Knik::KnikEngine"; + size_t KnikEngine::_hEdgeReservedLocal = 0; + size_t KnikEngine::_vEdgeReservedLocal = 0; KnikEngine::KnikEngine ( Cell* cell diff --git a/knik/src/MatrixVertex.cpp b/knik/src/MatrixVertex.cpp index b84706ee..9e0efc6e 100644 --- a/knik/src/MatrixVertex.cpp +++ b/knik/src/MatrixVertex.cpp @@ -171,8 +171,8 @@ Vertex* MatrixVertex::createRegularMatrix () // << " - latestTileHeight : " << _latestTileHeight << endl; // On cree les vecteurs de vertex en meme temps que les vertex et aussi les edges ! - float hecp = KnikEngine::get( cell )->getHEdgeCapacityPercent(); - float vecp = KnikEngine::get( cell )->getVEdgeCapacityPercent(); + size_t hreserved = KnikEngine::get( cell )->getHEdgeReservedLocal(); + size_t vreserved = KnikEngine::get( cell )->getVEdgeReservedLocal(); for ( unsigned j = 0 ; j < _nbYTiles ; j++ ) { vector vect; for ( unsigned i = 0 ; i < _nbXTiles ; i++ ) { @@ -191,7 +191,7 @@ Vertex* MatrixVertex::createRegularMatrix () assert(from); Vertex* to = vect[i]; assert(to); - _routingGraph->createHEdge ( from, to, hecp ); + _routingGraph->createHEdge ( from, to, hreserved ); } // si j > 0 alors on peut creer une edge verticale entre matrix[i][j-1] et matrix[i][j] c'est a dire _matrix[j-1][i] et vect[i] if ( j > 0 ) { // _matrix est un vecteur de vecteur represantant les lignes -> _matrix[ligne][colonne] @@ -199,7 +199,7 @@ Vertex* MatrixVertex::createRegularMatrix () assert(from); Vertex* to = vect[i]; assert(to); - _routingGraph->createVEdge ( from, to, vecp ); + _routingGraph->createVEdge ( from, to, vreserved ); } } _matrix.push_back ( vect ); diff --git a/knik/src/knik/Configuration.h b/knik/src/knik/Configuration.h index 7565eee9..a6835616 100644 --- a/knik/src/knik/Configuration.h +++ b/knik/src/knik/Configuration.h @@ -1,15 +1,9 @@ - -// -*- C++ -*- +// -*- mode: C++; explicit-buffer-name: "Configuration.h" -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved +// Copyright (c) UPMC 2008-2014, All Rights Reserved // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | C O R I O L I S | // | Knik - Global Router | // | | @@ -17,14 +11,11 @@ // | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Header : "./Configuration.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ -#ifndef __KNIK_CONFIGURATION__ -#define __KNIK_CONFIGURATION__ +#ifndef KNIK_CONFIGURATION_H +#define KNIK_CONFIGURATION_H namespace Hurricane { @@ -71,7 +62,6 @@ namespace Knik { inline const Layer* Configuration::_getGContact () const { return _gContact; } -} // End of Knik namespace. +} // Knik namespace. - -#endif // __KNIK_CONFIGURATION__ +#endif // KNIK_CONFIGURATION_H diff --git a/knik/src/knik/Graph.h b/knik/src/knik/Graph.h index 4141fa36..946abf1d 100644 --- a/knik/src/knik/Graph.h +++ b/knik/src/knik/Graph.h @@ -144,8 +144,8 @@ namespace Knik { void setNetStampConnexID ( Segment* segment, int connexID ); public: Vertex* createVertex ( Point position, DbU::Unit halfWidth, DbU::Unit halfHeight ); - void createHEdge ( Vertex* from, Vertex* to, float ecp=1.0 ); - void createVEdge ( Vertex* from, Vertex* to, float ecp=1.0 ); + void createHEdge ( Vertex* from, Vertex* to, size_t reserved=0 ); + void createVEdge ( Vertex* from, Vertex* to, size_t reserved=0 ); void resetVertexes () { _vertexes_to_route.clear(); }; void setNetStamp ( unsigned netStamp ) { _netStamp = netStamp; }; void incNetStamp () { _netStamp++; }; diff --git a/knik/src/knik/KnikEngine.h b/knik/src/knik/KnikEngine.h index c60ae998..9e61d196 100644 --- a/knik/src/knik/KnikEngine.h +++ b/knik/src/knik/KnikEngine.h @@ -1,7 +1,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2006-2014, All Rights Reserved +// Copyright (c) UPMC 2006-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -120,8 +120,8 @@ typedef vector NetVector; // ********** private: static const Name _toolName; - static float _edgeHCapacityPercent; - static float _edgeVCapacityPercent; + static size_t _hEdgeReservedLocal; + static size_t _vEdgeReservedLocal; RoutingGauge* _routingGauge; unsigned int _allowedDepth; Graph* _routingGraph; @@ -160,8 +160,8 @@ typedef vector NetVector; // private: void createLimitedZone ( Net* net, set gcells, Box vertexCenterBoundingBox, unsigned netStamp ); string adaptString ( string s ); public: - static void setHEdgeCapacityPercent ( float ecp ) { _edgeHCapacityPercent = ecp; }; - static void setVEdgeCapacityPercent ( float ecp ) { _edgeVCapacityPercent = ecp; }; + static void setHEdgeReservedLocal ( size_t reserved ) { _hEdgeReservedLocal = reserved; }; + static void setVEdgeReservedLocal ( size_t reserved ) { _vEdgeReservedLocal = reserved; }; void setRoutingGauge ( RoutingGauge* ); RoutingGauge* getRoutingGauge () const { return _routingGauge; } void setAllowedDepth ( unsigned int ); @@ -199,8 +199,8 @@ typedef vector NetVector; public: static KnikEngine* get ( const Cell* ); static const Name& staticGetName () { return _toolName; }; - static float getHEdgeCapacityPercent () { return _edgeHCapacityPercent; }; - static float getVEdgeCapacityPercent () { return _edgeVCapacityPercent; }; + static float getHEdgeReservedLocal () { return _hEdgeReservedLocal; }; + static float getVEdgeReservedLocal () { return _vEdgeReservedLocal; }; const Name& getName () const { return _toolName; }; void printTime (); void computeOverflow (); diff --git a/unicorn/src/cgt.py b/unicorn/src/cgt.py index 0d050b84..a8d27cc7 100755 --- a/unicorn/src/cgt.py +++ b/unicorn/src/cgt.py @@ -104,8 +104,8 @@ if __name__ == '__main__': parser.add_option( '-G', '--global-route' , action='store_true', dest='globalRoute' , help='Run the global router (Knik).') parser.add_option( '-g', '--load-global' , action='store_true', dest='loadGlobal' , help='Reload a global routing from disk.') parser.add_option( '--save-global' , action='store_true', dest='saveGlobal' , help='Save the global routing solution.') - parser.add_option( '--h-edge' , type='float' , dest='hEdgeCapacity' , help='The horizontal egde density ratio applied on global router\'s edges.') - parser.add_option( '--v-edge' , type='float' , dest='vEdgeCapacity' , help='The vertical egde density ratio applied on global router\'s edges.') + parser.add_option( '--htracks-local' , type='int' , dest='hTracksLocal' , help='The amount of horizontal tracks reserved for the GCell local routing.') + parser.add_option( '--vtracks-local' , type='int' , dest='vTracksLocal' , help='The amount of vertical tracks reserved for the GCell local routing .') parser.add_option( '--events-limit' , type='int' , dest='eventsLimit' , help='The maximum number of iterations (events) that the router is allowed to perform.') parser.add_option( '-R', '--detail-route' , action='store_true', dest='detailRoute' , help='Run the detailed router (Kite).') parser.add_option( '-M', '--dump-measures' , action='store_true', dest='dumpMeasures' , help='Dump some statistical measurements on the disk.') @@ -129,9 +129,9 @@ if __name__ == '__main__': if options.showConf: Cfg.getParamBool ('misc.showConf' ).setBool(True) if options.margin: Cfg.getParamPercentage('nimbus.spaceMargin').setPercentage(options.margin) if options.minPSize: Cfg.getParamInt ('metis.numberOfInstancesStopCriterion').setInt(options.minPSize) - if options.hEdgeCapacity: Cfg.getParamPercentage('kite.hEdgeCapacity').setPercentage(options.hEdgeCapacity) - if options.vEdgeCapacity: Cfg.getParamPercentage('kite.vEdgeCapacity').setPercentage(options.vEdgeCapacity) - if options.eventsLimit: Cfg.getParamInt ('kite.eventsLimit' ).setInt(options.eventsLimit) + if options.hTracksLocal: Cfg.getParamInt ('kite.hTracksReservedLocal').setInt(options.hTracksLocal) + if options.vTracksLocal: Cfg.getParamInt ('kite.vTracksReservedLocal').setInt(options.vTracksLocal) + if options.eventsLimit: Cfg.getParamInt ('kite.eventsLimit' ).setInt(options.eventsLimit) if options.topRoutingLayer: Cfg.getParamString ('katabatic.topRoutingLayer').setString(options.topRoutingLayer) quadPlace = options.quadPlace