diff --git a/anabatic/src/AutoHorizontal.cpp b/anabatic/src/AutoHorizontal.cpp index c16d1a1a..8ddcfc98 100644 --- a/anabatic/src/AutoHorizontal.cpp +++ b/anabatic/src/AutoHorizontal.cpp @@ -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 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) ); } diff --git a/anabatic/src/AutoSegment.cpp b/anabatic/src/AutoSegment.cpp index 5c6d2627..2605e89d 100644 --- a/anabatic/src/AutoSegment.cpp +++ b/anabatic/src/AutoSegment.cpp @@ -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; diff --git a/anabatic/src/AutoVertical.cpp b/anabatic/src/AutoVertical.cpp index ee1f940e..4eaa50b6 100644 --- a/anabatic/src/AutoVertical.cpp +++ b/anabatic/src/AutoVertical.cpp @@ -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 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() ); } } diff --git a/anabatic/src/GCell.cpp b/anabatic/src/GCell.cpp index b59b12e4..8204a2b3 100644 --- a/anabatic/src/GCell.cpp +++ b/anabatic/src/GCell.cpp @@ -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() ); } diff --git a/anabatic/src/anabatic/AutoContact.h b/anabatic/src/anabatic/AutoContact.h index b8027399..eb605a39 100644 --- a/anabatic/src/anabatic/AutoContact.h +++ b/anabatic/src/anabatic/AutoContact.h @@ -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 (xgetOpposite(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 ) diff --git a/katana/src/Manipulator.cpp b/katana/src/Manipulator.cpp index 8761739c..1aa388b7 100644 --- a/katana/src/Manipulator.cpp +++ b/katana/src/Manipulator.cpp @@ -292,7 +292,7 @@ namespace Katana { vector 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() diff --git a/katana/src/RoutingEvent.cpp b/katana/src/RoutingEvent.cpp index 29225644..d5fb1c84 100644 --- a/katana/src/RoutingEvent.cpp +++ b/katana/src/RoutingEvent.cpp @@ -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; diff --git a/katana/src/TrackSegment.cpp b/katana/src/TrackSegment.cpp index c7f6ae20..c8d6ecc8 100644 --- a/katana/src/TrackSegment.cpp +++ b/katana/src/TrackSegment.cpp @@ -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 ); @@ -724,8 +726,8 @@ namespace Katana { TrackElement* TrackSegment::makeDogleg ( Anabatic::GCell* dogLegGCell - , TrackElement*& perpandicular - , TrackElement*& parallel + , TrackElement*& perpandicular + , TrackElement*& parallel ) { cdebug_log(159,0) << "TrackSegment::makeDogleg(GCell*)" << endl;