Compare commits

...

3 Commits

Author SHA1 Message Date
Jean-Paul Chaput 72b5de88c4 Fix bugs in AutoSegment::isMiddleStack() and canReduce().
* Bug: In AutoSegment::canReduce(), in the repair stage, segments are
    allowed to go beyond their GCell bondaries, so global segments can
    end up in zero length. So now allow globals less than one P-Pitch
    to be flagged as reduced.
* Bug: In AutoSegment::isMiddleStack(), systematically reject non-canonical
    segment. If it is non-canonical, then is aligned with a canonical one.
    Then we will perform the check on it.
      There seems to be another porblem of update of the length of the
    associated TrackElement, the increase of size of the non-canonical is
    not taken into account. This is enough to prevent the problem to
    arise but we should invsetigate further.
* Hack: In AutoSegment::canMoveUp(), prevent segment id:6378409 to be
    moved up so the last antenna effect is avoided. This is not a clean
    way to do it.
2021-06-17 23:49:54 +02:00
Jean-Paul Chaput ddc7aef13b At last make use of cdebug_log() in Track::repair(). 2021-06-17 23:36:35 +02:00
Jean-Paul Chaput f873e616cb Use of tset() manipulator instead of setw() when printing in cdebug_log. 2021-06-17 23:36:22 +02:00
3 changed files with 36 additions and 33 deletions

View File

@ -1615,6 +1615,7 @@ namespace Anabatic {
bool AutoSegment::isMiddleStack () const
{
cdebug_log(149,0) << "AutoSegment::isMiddleStack() - " << this << endl;
if (not isCanonical()) return false;
if (isNonPref()) return false;
if (isGlobal()) {
if (getLength() > getPPitch()) return false;
@ -1760,7 +1761,10 @@ namespace Anabatic {
cdebug_log(159,0) << "AutoSegment::canReduce():" << this << endl;
cdebug_log(159,0) << " _reduceds:" << _reduceds << endl;
if (isGlobal() or isDrag() or isFixed()) return false;
DbU::Unit length = getAnchoredLength();
if (isGlobal() and (length > getPPitch())) return false;
if (isDrag() or isFixed()) return false;
if (not isSpinTopOrBottom()) return false;
if ((getDepth() == 1) and isSpinBottom()) return false;
if ((flags & Flags::WithPerpands) and _reduceds) return false;
@ -1777,8 +1781,8 @@ namespace Anabatic {
// if ( source->isHTee() or source->isVTee()
// or target->isHTee() or target->isVTee() ) return false;
cdebug_log(159,0) << " length:" << DbU::getValueString(getAnchoredLength()) << endl;
if (flags & Flags::NullLength) return (getAnchoredLength() == 0);
cdebug_log(159,0) << " length:" << DbU::getValueString(length) << endl;
if (flags & Flags::NullLength) return (length == 0);
unsigned int perpandicularDepth = getDepth();
if (isSpinBottom()) {
@ -2116,6 +2120,10 @@ namespace Anabatic {
if (Session::getRoutingGauge()->getName() == "FlexLib")
reserve += 2.0;
// ls180 hard-coded hack.
//if (getId() == 10023986) return false;
if (getId() == 6378409) return false;
bool nLowDensity = true;
bool nLowUpDensity = true;

View File

@ -430,7 +430,7 @@ namespace Katana {
cdebug_log(9000,0) << "Deter| Event "
<< getProcesseds()
<< "," << getEventLevel()
<< "," << setw(6) << getPriority()
<< "," << tsetw(6) << getPriority()
<< ": " << _segment << endl;
_processeds++;

View File

@ -124,9 +124,8 @@ namespace {
uint64_t id = element->getNet()->getId();
if (_spans.empty()) {
//if (id == 317015)
// cerr << "GapSet::merge() new range " << i
// << " " << _track->getSegment(i) << endl;
cdebug_log(159,0) << "GapSet::merge() new range " << i
<< " " << _track->getSegment(i) << endl;
_spans.push_back( make_pair(i,i) );
return;
}
@ -134,33 +133,28 @@ namespace {
size_t ispan = 0;
DbU::Unit segSourceU = element->getSourceU()+_halfSpacing;
DbU::Unit segTargetU = element->getTargetU()-_halfSpacing;
//if (id == 317015)
// cerr << "GapSet::merge() " << element << endl;
cdebug_log(159,0) << "GapSet::merge() " << element << endl;
for ( ; ispan<_spans.size() ; ++ispan ) {
if (targetU(ispan) >= segSourceU) {
if (targetU(ispan) >= segTargetU) {
//if (id == 317015)
// cerr << "GapSet::merge() already inside range" << endl;
cdebug_log(159,0) << "GapSet::merge() already inside range" << endl;
return;
}
_spans[ispan].second = i;
//if (id == 317015)
// cerr << "GapSet::merge() becomes range end" << endl;
cdebug_log(159,0) << "GapSet::merge() becomes range end" << endl;
break;
}
}
if (ispan == _spans.size()) {
_spans.push_back( make_pair(i,i) );
//if (id == 317015)
// cerr << "GapSet::merge() new range" << endl;
cdebug_log(159,0) << "GapSet::merge() new range" << endl;
return;
}
while ( ispan+1 < _spans.size() ) {
if (targetU(ispan) >= sourceU(ispan+1)) {
_spans[ispan].second = std::max( targetU(ispan), targetU(ispan+1) );
_spans.erase( _spans.begin()+ispan+1 );
//if (id == 317015)
// cerr << "GapSet::merge() fuse with next range" << endl;
cdebug_log(159,0) << "GapSet::merge() fuse with next range" << endl;
}
}
}
@ -1003,7 +997,8 @@ namespace Katana {
uint32_t Track::repair () const
{
// cerr << "Track::repair() " << this << endl;
//if ((getIndex() == 6428) and isVertical()) DebugSession::open( 150, 160 );
cdebug_log(159,0) << "Track::repair() " << this << endl;
if (_segments.empty()) return 0;
DbU::Unit minSpacing = getLayer()->getMinimalSpacing();
@ -1013,8 +1008,7 @@ namespace Katana {
GapSet gapsetPrev ( this );
GapSet gapsetCurr ( this );
for ( size_t i=0 ; i<_segments.size()-1 ; i++ ) {
// if (getIndex() == 1750)
// cerr << "[" << i << "] " << _segments[i] << endl;
cdebug_log(159,0) << "[" << i << "] " << _segments[i] << endl;
netChange = false;
gapsetCurr.merge( i );
if ( (_segments[i]->getNet() != _segments[i+1]->getNet())
@ -1050,25 +1044,25 @@ namespace Katana {
if (netChange or (i+2 == _segments.size())) {
if (gapsetCurr.size() > 1) {
// cerr << "potential gap around " << _segments[i] << endl;
cdebug_log(159,0) << "potential gap around " << _segments[i] << endl;
for ( size_t j=0 ; j+1 < gapsetCurr.size() ; ++j ) {
// cerr << j << "=[" << DbU::getValueString(gapsetCurr.sourceU(j))
// << " " << DbU::getValueString(gapsetCurr.targetU(j)) << "], "
// << j+1 << "=[" << DbU::getValueString(gapsetCurr.sourceU(j+1))
// << " " << DbU::getValueString(gapsetCurr.targetU(j+1)) << "]" << endl;
cdebug_log(159,0) << j << "=[" << DbU::getValueString(gapsetCurr.sourceU(j))
<< " " << DbU::getValueString(gapsetCurr.targetU(j)) << "], "
<< j+1 << "=[" << DbU::getValueString(gapsetCurr.sourceU(j+1))
<< " " << DbU::getValueString(gapsetCurr.targetU(j+1)) << "]" << endl;
DbU::Unit spacing = gapsetCurr.sourceU(j+1) - gapsetCurr.targetU(j);
// cerr << "| spacing=" << DbU::getValueString(spacing) << endl;
cdebug_log(159,0) << "| spacing=" << DbU::getValueString(spacing) << endl;
if (spacing < minSpacing) {
// cerr << j << "=[" << DbU::getValueString(gapsetCurr.sourceU(j))
// << " " << DbU::getValueString(gapsetCurr.targetU(j)) << "], "
// << j+1 << "=[" << DbU::getValueString(gapsetCurr.sourceU(j+1))
// << " " << DbU::getValueString(gapsetCurr.targetU(j+1)) << "]" << endl;
cdebug_log(159,0) << j << "=[" << DbU::getValueString(gapsetCurr.sourceU(j))
<< " " << DbU::getValueString(gapsetCurr.targetU(j)) << "], "
<< j+1 << "=[" << DbU::getValueString(gapsetCurr.sourceU(j+1))
<< " " << DbU::getValueString(gapsetCurr.targetU(j+1)) << "]" << endl;
if (gapsetCurr.span(j+1).first >= _segments.size()) {
cerr << Error("gapsetCurr.span(j+1).first >= _segments.size()") << endl;
} else {
AutoSegment* first = _segments[gapsetCurr.span(j+1).first]->base();
// cerr << "spacing:" << DbU::getValueString(spacing) << " " << first << endl;
cdebug_log(159,0) << "spacing:" << DbU::getValueString(spacing) << " " << first << endl;
if (first == NULL) {
cerr << Error("null first, NOT correcting gap") << endl;
} else {
@ -1076,14 +1070,14 @@ namespace Katana {
if (segment->getSourcePosition() < first->getSourcePosition())
first = segment;
}
// cerr << "duSource:" << DbU::getValueString(first->getDuSource()) << endl;
cdebug_log(159,0) << "duSource:" << DbU::getValueString(first->getDuSource()) << endl;
first->setDuSource( first->getDuSource() - spacing - minSpacing/2 );
}
++gaps;
cerr << Warning( " Track::repair(): Closing same net gap in %s near:\n %s"
, getString(this).c_str()
, getString(_segments[(i) ? i-1 : 0]).c_str() ) << endl;
// cerr << first << endl;
cdebug_log(159,0) << first << endl;
}
}
}
@ -1094,6 +1088,7 @@ namespace Katana {
}
}
//if ((getIndex() == 6428) and isVertical()) DebugSession::close();
return gaps;
}