Add management for very rare segment cross blocking (ripup loop).
* New: In Katana::DataNegociate, add a "sameRipup" counter to keep the *consecutive* number of time a segment is put in the same track. * New: In TrackSegment::setAxis(), update/reset the "sameRipup" counter of the DataNegociate. * New: In TrackCost, add new flag "Blacklisted" to mark Tracks that have been riped up too much in a consecutive row. TrackCost::Compare::operator() will then sort the blacklisted track after the non-blacklisted ones. * New: In SegmentFsm CTOR, raise the Blacklist flag on the TrackCost if the "sameRipup" is above 10. This to get away from a state well in the ripup.
This commit is contained in:
parent
c877d7e980
commit
c17c4c3f6e
|
@ -52,6 +52,7 @@ namespace Katana {
|
|||
, _stateCount (1)
|
||||
, _terminals (0)
|
||||
, _ripupCount (0)
|
||||
, _sameRipup (0)
|
||||
, _leftMinExtend (DbU::Max)
|
||||
, _rightMinExtend (DbU::Min)
|
||||
, _attractors ()
|
||||
|
|
|
@ -594,6 +594,11 @@ namespace Katana {
|
|||
}
|
||||
|
||||
_costs.push_back( new TrackCost(segment1,segment2,track1,track2,track1->getAxis(),symAxis) );
|
||||
cdebug_log(155,0) << "Same Ripup:" << _data1->getSameRipup() << endl;
|
||||
if ((_data1->getSameRipup() > 10) and (track1->getAxis() == segment1->getAxis())) {
|
||||
cdebug_log(155,0) << "Track blacklisted" << endl;
|
||||
_costs.back()->setBlacklisted();
|
||||
}
|
||||
|
||||
cdebug_log(155,0) << "AxisWeight:" << DbU::getValueString(_costs.back()->getRefCandidateAxis())
|
||||
<< " sum:" << DbU::getValueString(_costs.back()->getAxisWeight())
|
||||
|
|
|
@ -110,17 +110,18 @@ namespace Katana {
|
|||
|
||||
bool TrackCost::Compare::operator() ( const TrackCost* lhs, const TrackCost* rhs )
|
||||
{
|
||||
if ( lhs->isInfinite () xor rhs->isInfinite () ) return rhs->isInfinite();
|
||||
if ( lhs->isAtRipupLimit() xor rhs->isAtRipupLimit() ) return rhs->isAtRipupLimit();
|
||||
if (lhs->isInfinite () xor rhs->isInfinite ()) return rhs->isInfinite();
|
||||
if (lhs->isAtRipupLimit() xor rhs->isAtRipupLimit()) return rhs->isAtRipupLimit();
|
||||
if (lhs->isBlacklisted() xor rhs->isBlacklisted ()) return rhs->isBlacklisted();
|
||||
|
||||
if ( (_flags & TrackCost::DiscardGlobals)
|
||||
and (lhs->isOverlapGlobal() xor rhs->isOverlapGlobal()) )
|
||||
return rhs->isOverlapGlobal();
|
||||
|
||||
if ( lhs->isHardOverlap() xor rhs->isHardOverlap() ) return rhs->isHardOverlap();
|
||||
if (lhs->isHardOverlap() xor rhs->isHardOverlap()) return rhs->isHardOverlap();
|
||||
|
||||
if ( lhs->_ripupCount + (int)Session::getRipupCost() < rhs->_ripupCount ) return true;
|
||||
if ( lhs->_ripupCount > (int)Session::getRipupCost() + rhs->_ripupCount ) return false;
|
||||
if (lhs->_ripupCount + (int)Session::getRipupCost() < rhs->_ripupCount) return true;
|
||||
if (lhs->_ripupCount > (int)Session::getRipupCost() + rhs->_ripupCount) return false;
|
||||
|
||||
//int lhsRipupCost = (lhs->_dataState<<2) + lhs->_ripupCount;
|
||||
//int rhsRipupCost = (rhs->_dataState<<2) + rhs->_ripupCount;
|
||||
|
@ -132,7 +133,7 @@ namespace Katana {
|
|||
// if ( lhs->_longuestOverlap > rhs->_longuestOverlap ) return false;
|
||||
//}
|
||||
|
||||
if ( lhs->isOverlap() xor rhs->isOverlap() ) return rhs->isOverlap();
|
||||
if (lhs->isOverlap() xor rhs->isOverlap()) return rhs->isOverlap();
|
||||
|
||||
if (not (_flags & TrackCost::IgnoreTerminals)) {
|
||||
if ( lhs->_terminals < rhs->_terminals ) return true;
|
||||
|
@ -166,15 +167,15 @@ namespace Katana {
|
|||
#endif
|
||||
|
||||
if ( not (_flags & TrackCost::IgnoreAxisWeight) ) {
|
||||
if ( lhs->_axisWeight < rhs->_axisWeight ) return true;
|
||||
if ( lhs->_axisWeight > rhs->_axisWeight ) return false;
|
||||
if (lhs->_axisWeight < rhs->_axisWeight) return true;
|
||||
if (lhs->_axisWeight > rhs->_axisWeight) return false;
|
||||
}
|
||||
|
||||
if ( lhs->_deltaPerpand < rhs->_deltaPerpand ) return true;
|
||||
if ( lhs->_deltaPerpand > rhs->_deltaPerpand ) return false;
|
||||
if (lhs->_deltaPerpand < rhs->_deltaPerpand) return true;
|
||||
if (lhs->_deltaPerpand > rhs->_deltaPerpand) return false;
|
||||
|
||||
if ( lhs->_distanceToFixed > rhs->_distanceToFixed ) return true;
|
||||
if ( lhs->_distanceToFixed < rhs->_distanceToFixed ) return false;
|
||||
if (lhs->_distanceToFixed > rhs->_distanceToFixed) return true;
|
||||
if (lhs->_distanceToFixed < rhs->_distanceToFixed) return false;
|
||||
|
||||
return lhs->getTrack(0)->getAxis() < rhs->getTrack(0)->getAxis();
|
||||
}
|
||||
|
|
|
@ -510,6 +510,10 @@ namespace Katana {
|
|||
|
||||
void TrackSegment::setAxis ( DbU::Unit axis, uint32_t flags )
|
||||
{
|
||||
if (_data) {
|
||||
if (axis == getAxis()) _data->incSameRipup();
|
||||
else _data->resetSameRipup();
|
||||
}
|
||||
_base->setAxis( axis, flags );
|
||||
invalidate();
|
||||
}
|
||||
|
|
|
@ -75,6 +75,7 @@ namespace Katana {
|
|||
inline uint32_t getState () const;
|
||||
inline uint32_t getStateCount () const;
|
||||
inline uint32_t getRipupCount () const;
|
||||
inline uint32_t getSameRipup () const;
|
||||
inline uint32_t getStateAndRipupCount () const;
|
||||
DbU::Unit getWiringDelta ( DbU::Unit axis ) const;
|
||||
inline const vector<TrackElement*>& getPerpandiculars () const;
|
||||
|
@ -87,6 +88,8 @@ namespace Katana {
|
|||
inline void decRipupCount ();
|
||||
inline void resetRipupCount ();
|
||||
inline void resetStateCount ();
|
||||
inline void resetSameRipup ();
|
||||
inline void incSameRipup ();
|
||||
void update ();
|
||||
static string getStateString ( uint32_t state, unsigned int stateCount );
|
||||
static string getStateString ( DataNegociate* );
|
||||
|
@ -103,6 +106,7 @@ namespace Katana {
|
|||
unsigned int _stateCount : 5;
|
||||
unsigned int _terminals : 5;
|
||||
unsigned int _ripupCount : 16;
|
||||
unsigned int _sameRipup : 8;
|
||||
DbU::Unit _leftMinExtend;
|
||||
DbU::Unit _rightMinExtend;
|
||||
vector<DbU::Unit> _attractors;
|
||||
|
@ -124,6 +128,7 @@ namespace Katana {
|
|||
inline uint32_t DataNegociate::getState () const { return _state; }
|
||||
inline uint32_t DataNegociate::getTerminals () const { return _terminals; }
|
||||
inline uint32_t DataNegociate::getRipupCount () const { return _ripupCount; }
|
||||
inline uint32_t DataNegociate::getSameRipup () const { return _sameRipup; }
|
||||
inline DbU::Unit DataNegociate::getLeftMinExtend () const { return _leftMinExtend; }
|
||||
inline DbU::Unit DataNegociate::getRightMinExtend () const { return _rightMinExtend; }
|
||||
inline Net* DataNegociate::getNet () const { return _net; }
|
||||
|
@ -137,6 +142,8 @@ namespace Katana {
|
|||
inline void DataNegociate::incRipupCount () { _ripupCount++; }
|
||||
inline void DataNegociate::decRipupCount () { if (_ripupCount) _ripupCount--; }
|
||||
inline void DataNegociate::resetRipupCount () { _ripupCount = 0; }
|
||||
inline void DataNegociate::incSameRipup () { _sameRipup++; }
|
||||
inline void DataNegociate::resetSameRipup () { _sameRipup = 0; }
|
||||
inline string DataNegociate::_getTypeName () const { return "DataNegociate"; }
|
||||
|
||||
inline void DataNegociate::setState ( uint32_t state, Flags flags )
|
||||
|
|
|
@ -61,6 +61,7 @@ namespace Katana {
|
|||
, AtRipupLimit = (1 << 18)
|
||||
, IgnoreTerminals = (1 << 19)
|
||||
, IgnoreShort = (1 << 20)
|
||||
, Blacklisted = (1 << 21)
|
||||
, MergeMask = ForGlobal |Blockage|Fixed |Infinite
|
||||
|HardOverlap |Overlap |RightOverlap|LeftOverlap|OverlapGlobal
|
||||
|GlobalEnclosed |AtRipupLimit
|
||||
|
@ -102,6 +103,7 @@ namespace Katana {
|
|||
inline bool isOverlapGlobal () const;
|
||||
inline bool isGlobalEnclosed () const;
|
||||
inline bool isAtRipupLimit () const;
|
||||
inline bool isBlacklisted () const;
|
||||
bool isFree () const;
|
||||
inline bool isSymmetric () const;
|
||||
inline bool isWide () const;
|
||||
|
@ -148,6 +150,7 @@ namespace Katana {
|
|||
inline void setOverlapGlobal ();
|
||||
inline void setGlobalEnclosed ();
|
||||
inline void setAtRipupLimit ();
|
||||
inline void setBlacklisted ();
|
||||
inline void incTerminals ( uint32_t );
|
||||
inline void incDelta ( DbU::Unit );
|
||||
inline void incDeltaPerpand ( DbU::Unit );
|
||||
|
@ -208,6 +211,7 @@ namespace Katana {
|
|||
inline bool TrackCost::isOverlapGlobal () const { return _flags & OverlapGlobal; }
|
||||
inline bool TrackCost::isGlobalEnclosed () const { return _flags & GlobalEnclosed; }
|
||||
inline bool TrackCost::isAtRipupLimit () const { return _flags & AtRipupLimit; }
|
||||
inline bool TrackCost::isBlacklisted () const { return _flags & Blacklisted; }
|
||||
inline bool TrackCost::isSymmetric () const { return _flags & Symmetric; }
|
||||
inline bool TrackCost::isWide () const { return (_span > 1); }
|
||||
inline bool TrackCost::doIgnoreShort () const { return _flags & IgnoreShort; }
|
||||
|
@ -245,6 +249,7 @@ namespace Katana {
|
|||
inline void TrackCost::setOverlapGlobal () { _flags |= OverlapGlobal; }
|
||||
inline void TrackCost::setGlobalEnclosed () { _flags |= GlobalEnclosed; }
|
||||
inline void TrackCost::setAtRipupLimit () { _flags |= AtRipupLimit; }
|
||||
inline void TrackCost::setBlacklisted () { _flags |= Blacklisted; }
|
||||
inline void TrackCost::incTerminals ( uint32_t terminals ) { _terminals += terminals; }
|
||||
inline void TrackCost::incDelta ( DbU::Unit delta ) { _delta += delta; }
|
||||
inline void TrackCost::incDeltaPerpand ( DbU::Unit delta ) { _deltaPerpand += delta; }
|
||||
|
|
Loading…
Reference in New Issue