diff --git a/katana/src/Configuration.cpp b/katana/src/Configuration.cpp index 87f17cc3..a4074d0b 100644 --- a/katana/src/Configuration.cpp +++ b/katana/src/Configuration.cpp @@ -44,6 +44,8 @@ namespace Katana { , _hTracksReservedLocal(Cfg::getParamInt ("katana.hTracksReservedLocal", 3)->asInt()) , _vTracksReservedLocal(Cfg::getParamInt ("katana.vTracksReservedLocal", 3)->asInt()) , _termSatReservedLocal(Cfg::getParamInt ("katana.termSatReservedLocal", 9)->asInt()) + , _hTracksReservedMin (Cfg::getParamInt ("katana.hTracksReservedMin" , 1)->asInt()) + , _vTracksReservedMin (Cfg::getParamInt ("katana.vTracksReservedMin" , 1)->asInt()) , _termSatThreshold (Cfg::getParamInt ("katana.termSatThreshold" , 8)->asInt()) , _ripupLimits () , _ripupCost (Cfg::getParamInt ("katana.ripupCost" , 3)->asInt()) @@ -89,6 +91,8 @@ namespace Katana { , _hTracksReservedLocal(other._hTracksReservedLocal) , _vTracksReservedLocal(other._vTracksReservedLocal) , _termSatReservedLocal(other._termSatReservedLocal) + , _hTracksReservedMin (other._hTracksReservedMin) + , _vTracksReservedMin (other._vTracksReservedMin) , _termSatThreshold (other._termSatThreshold) , _ripupLimits () , _ripupCost (other._ripupCost) @@ -144,6 +148,14 @@ namespace Katana { } + void Configuration::setHTracksReservedMin ( uint32_t reserved ) + { _hTracksReservedMin = reserved; } + + + void Configuration::setVTracksReservedMin ( uint32_t reserved ) + { _vTracksReservedMin = reserved; } + + uint32_t Configuration::getRipupLimit ( uint32_t type ) const { if ( type >= RipupLimitsTableSize ) { diff --git a/katana/src/KatanaEngine.cpp b/katana/src/KatanaEngine.cpp index 012edc3a..609c6f85 100644 --- a/katana/src/KatanaEngine.cpp +++ b/katana/src/KatanaEngine.cpp @@ -536,12 +536,21 @@ namespace Katana { } } } else { + uint32_t hReservedMin = getConfiguration()->getHTracksReservedMin(); + uint32_t vReservedMin = getConfiguration()->getVTracksReservedMin(); + for ( GCell* gcell : getGCells() ) { if (not gcell->isMatrix()) continue; - for ( Edge* edge : gcell->getEdges( Flags::EastSide|Flags::NorthSide) ) { - if (edge->getReservedCapacity() == 0) - edge->reserveCapacity( 1 ); + for ( Edge* edge : gcell->getEdges( Flags::NorthSide) ) { + if (edge->getReservedCapacity() < vReservedMin) { + edge->reserveCapacity( vReservedMin ); + cerr << edge << endl; + } + } + for ( Edge* edge : gcell->getEdges( Flags::EastSide) ) { + if (edge->getReservedCapacity() < hReservedMin) + edge->reserveCapacity( hReservedMin ); } } } diff --git a/katana/src/katana/Configuration.h b/katana/src/katana/Configuration.h index 4952dfcf..2308d5c6 100644 --- a/katana/src/katana/Configuration.h +++ b/katana/src/katana/Configuration.h @@ -79,6 +79,8 @@ namespace Katana { inline uint32_t getHTracksReservedLocal () const; inline uint32_t getVTracksReservedLocal () const; inline uint32_t getTermSatReservedLocal () const; + inline uint32_t getHTracksReservedMin () const; + inline uint32_t getVTracksReservedMin () const; inline uint32_t getTermSatThreshold () const; inline void setEventsLimit ( uint64_t ); inline void setRipupCost ( uint32_t ); @@ -87,6 +89,8 @@ namespace Katana { inline void setBloatOverloadAdd ( uint32_t ); void setHTracksReservedLocal ( uint32_t ); void setVTracksReservedLocal ( uint32_t ); + void setHTracksReservedMin ( uint32_t ); + void setVTracksReservedMin ( uint32_t ); inline void setFlags ( unsigned int ); inline void unsetFlags ( unsigned int ); inline void setProfileEventCosts ( bool ); @@ -101,6 +105,8 @@ namespace Katana { uint32_t _hTracksReservedLocal; uint32_t _vTracksReservedLocal; uint32_t _termSatReservedLocal; + uint32_t _hTracksReservedMin; + uint32_t _vTracksReservedMin; uint32_t _termSatThreshold; uint32_t _ripupLimits [RipupLimitsTableSize]; uint32_t _ripupCost; @@ -125,6 +131,8 @@ namespace Katana { inline uint32_t Configuration::getHTracksReservedLocal () const { return _hTracksReservedLocal; } inline uint32_t Configuration::getVTracksReservedLocal () const { return _vTracksReservedLocal; } inline uint32_t Configuration::getTermSatReservedLocal () const { return _termSatReservedLocal; } + inline uint32_t Configuration::getHTracksReservedMin () const { return _hTracksReservedMin; } + inline uint32_t Configuration::getVTracksReservedMin () const { return _vTracksReservedMin; } inline uint32_t Configuration::getTermSatThreshold () const { return _termSatThreshold; } inline void Configuration::setBloatOverloadAdd ( uint32_t add ) { _bloatOverloadAdd = add; } inline void Configuration::setRipupCost ( uint32_t cost ) { _ripupCost = cost; }