Solved more problems related to GCell not owning north/east boundary.

* Bug: In Anabatic, in AutoHorizontal & AutoVertical, native constraints
    must use GCell::getConstraintsUMax().
* Bug: In Anabatic::GCell, correct terribly bad implementation of
    both getConstraintUmax().
      In getSide(), use getConstraintUMax().
* Bug: In Anabatic::AutoContact, setCBUMax() must be set using the GCell
    getContraintUMax().
This commit is contained in:
Jean-Paul Chaput 2016-08-30 16:05:15 +02:00
parent cbb5e8781d
commit 92522fef0b
9 changed files with 29 additions and 25 deletions

View File

@ -77,7 +77,7 @@ namespace Anabatic {
_gcell = source->getGCell();
setOptimalMax( getGCell()->getYMax() );
resetNativeConstraints( getGCell()->getYMin(), getGCell()->getYMax() );
resetNativeConstraints( getGCell()->getYMin(), getGCell()->getConstraintYMax() );
if (getGCell() != target->getGCell()) {
setFlags( SegGlobal );
@ -88,7 +88,7 @@ namespace Anabatic {
if ( (gcell != getGCell()) and (gcell != target->getGCell()) )
gcell->addHSegment( this );
mergeNativeMin( gcell->getYMin() );
mergeNativeMax( gcell->getYMax() );
mergeNativeMax( gcell->getConstraintYMax() );
}
}
}
@ -440,10 +440,10 @@ namespace Anabatic {
vector<GCell*> gcells;
getGCells( gcells );
resetNativeConstraints( gcells[0]->getYMin(), gcells[0]->getYMax() );
resetNativeConstraints( gcells[0]->getYMin(), gcells[0]->getConstraintYMax() );
for ( GCell* gcell : gcells ) {
mergeNativeMin( gcell->getYMin() );
mergeNativeMax( gcell->getYMax() );
mergeNativeMax( gcell->getConstraintYMax() );
}
}
@ -749,8 +749,10 @@ namespace Anabatic {
if (doglegGCell != end) {
GCell* gcell = doglegGCell;
do {
if (gcell != begin)
if (gcell != begin) {
cdebug_log(149,0) << "| Remove from:" << gcell << endl;
gcell->removeHSegment( this );
}
gcell = gcell->getEast( getNativeMin() );
} while ( gcell and (gcell != end) );
}

View File

@ -1896,7 +1896,7 @@ namespace Anabatic {
}
if (doglegGCell->getSide(getDirection()).intersect(getSpanU())) {
cdebug_log(149,0) << "Dogleg in " << this << endl;
cdebug_log(149,0) << "Dogleg in " << this << " spanU:" << getSpanU() << endl;
rflags = _makeDogleg( doglegGCell, flags );
} else {
cdebug_log(149,0) << "Looking in aligneds." << endl;

View File

@ -71,7 +71,7 @@ namespace Anabatic {
_gcell = source->getGCell();
setOptimalMax( getGCell()->getXMax() );
resetNativeConstraints( getGCell()->getXMin(), getGCell()->getXMax() );
resetNativeConstraints( getGCell()->getXMin(), getGCell()->getConstraintXMax() );
if (getGCell() != target->getGCell()) {
setFlags( SegGlobal );
@ -82,7 +82,7 @@ namespace Anabatic {
if ( (gcell != getGCell()) and (gcell != target->getGCell()) )
gcell->addVSegment( this );
mergeNativeMin( gcell->getXMin() );
mergeNativeMax( gcell->getXMax() );
mergeNativeMax( gcell->getConstraintXMax() );
}
}
}
@ -376,10 +376,10 @@ namespace Anabatic {
vector<GCell*> gcells;
getGCells( gcells );
resetNativeConstraints( gcells[0]->getXMin(), gcells[0]->getXMax() );
resetNativeConstraints( gcells[0]->getXMin(), gcells[0]->getConstraintXMax() );
for ( GCell* gcell : gcells ) {
mergeNativeMin( gcell->getXMin() );
mergeNativeMax( gcell->getXMax() );
mergeNativeMax( gcell->getConstraintXMax() );
}
}

View File

@ -1246,15 +1246,13 @@ namespace Anabatic {
if (_hsegments.size() == end) {
cerr << Bug( "%s do not go through %s."
, getString(segment).c_str()
, _getString().c_str() ) << endl;
, getString(segment).c_str(), _getString().c_str() ) << endl;
return;
}
if (_hsegments.size() - end > 1)
cerr << Bug( "%s has multiple occurrences of %s."
, _getString().c_str()
, getString(segment).c_str() ) << endl;
, _getString().c_str(), getString(segment).c_str() ) << endl;
_hsegments.erase( _hsegments.begin() + end, _hsegments.end() );
}

View File

@ -246,9 +246,9 @@ namespace Anabatic {
inline GCell* AutoContact::getGCell () const { return _gcell; }
inline Box AutoContact::getConstraintBox () const { return Box(getCBXMin(),getCBYMin(),getCBXMax(),getCBYMax()); }
inline void AutoContact::setCBXMin ( DbU::Unit xMin ) { _dxMin = _getDeltaMin(xMin,_gcell->getXMin()); }
inline void AutoContact::setCBXMax ( DbU::Unit xMax ) { _dxMax = _getDeltaMax(xMax,_gcell->getXMin(),_gcell->getXMax()); }
inline void AutoContact::setCBXMax ( DbU::Unit xMax ) { _dxMax = _getDeltaMax(xMax,_gcell->getXMin(),_gcell->getConstraintXMax()); }
inline void AutoContact::setCBYMin ( DbU::Unit yMin ) { _dyMin = _getDeltaMin(yMin,_gcell->getYMin()); }
inline void AutoContact::setCBYMax ( DbU::Unit yMax ) { _dyMax = _getDeltaMax(yMax,_gcell->getYMin(),_gcell->getYMax()); }
inline void AutoContact::setCBYMax ( DbU::Unit yMax ) { _dyMax = _getDeltaMax(yMax,_gcell->getYMin(),_gcell->getConstraintYMax()); }
inline void AutoContact::setFlags ( unsigned int flags ) { _flags|= flags; }
inline void AutoContact::unsetFlags ( unsigned int flags ) { _flags&=~flags; }
inline int AutoContact::_getDeltaMin ( DbU::Unit x, DbU::Unit xMin ) { if (x<xMin) return 0; return (int)DbU::toLambda(x-xMin); }

View File

@ -337,10 +337,10 @@ namespace Anabatic {
: _northEdges[0]->getOpposite(this)->getYMin() - shrink; }
inline DbU::Unit GCell::getConstraintXMax () const
{ return getXMax( _eastEdges .empty() ? -1 : 0 ); }
{ return getXMax( _eastEdges.empty() ? 0 : 1 ); }
inline DbU::Unit GCell::getConstraintYMax () const
{ return getYMax( _northEdges .empty() ? -1 : 0 ); }
{ return getYMax( _northEdges.empty() ? 0 : 1 ); }
inline Point GCell::getCenter () const
{ return Point( (getXMin()+getXMax())/2, (getYMin()+getYMax())/2); }
@ -350,8 +350,8 @@ namespace Anabatic {
inline Interval GCell::getSide ( Flags direction ) const
{
if (direction.isset(Flags::Vertical)) return Interval( getYMin(), getYMax() );
return Interval( getXMin(), getXMax() );
if (direction.isset(Flags::Vertical)) return Interval( getYMin(), getConstraintYMax() );
return Interval( getXMin(), getConstraintXMax() );
}
inline void GCell::setObserver ( size_t slot, BaseObserver* observer )

View File

@ -292,7 +292,7 @@ namespace Katana {
vector<GCell*> gcells;
_segment->getGCells( gcells );
if (gcells.size() < 2 ){
if (gcells.size() < 2) {
cerr << Bug( "relax() Cannot break %s,\n only in %s."
, getString(_segment).c_str()
, getString(gcells[0]).c_str()

View File

@ -622,7 +622,9 @@ namespace Katana {
cdebug_log(159,0) << "Expanding (after):" << _constraints << endl;
}
}
cdebug_log(159,0) << "| Raw Track Constraint: " << _constraints << endl;
cdebug_log(159,0) << "| Raw Track Constraint: " << _constraints
<< " [" << _constraints.getVMin()
<< "," << _constraints.getVMax() << "]" << endl;
_tracksNb = 0;

View File

@ -234,7 +234,7 @@ namespace Katana {
cdebug_log(159,0) << "getGCells(): sourceGCell: " << sourceGCell << endl;
cdebug_log(159,0) << "getGCells(): targetGCell: " << targetGCell << endl;
for( AutoSegment* segment : base()->getAligneds() ) {
for ( AutoSegment* segment : base()->getAligneds() ) {
cdebug_log(159,0) << "| " << segment << endl;
Anabatic::GCell* gcell = segment->getAutoSource()->getGCell();
@ -256,10 +256,12 @@ namespace Katana {
Flags side = (direction & Flags::Horizontal) ? Flags::EastSide : Flags::NorthSide;
DbU::Unit axis = getAxis();
cdebug_log(159,0) << "* dir:" << side._getString() << " @" << DbU::getValueString(axis) << endl;
gcells.push_back( sourceGCell );
while ( sourceGCell != targetGCell ) {
sourceGCell = sourceGCell->getNeighborAt( direction, axis );
cdebug_log(159,0) << "| " << sourceGCell << endl;
if (not sourceGCell) break;
gcells.push_back( sourceGCell );