Bug in KatanaEngine::annotateGlobalGraph(), bad edge capacity computation.

* Bug: In KatanaEngine::annotateGlobalGraph(), overlapping blockages or
    fixed segments where taken into account as separate ones. This was
    making the edge capacity reservation too high. Creating false
    zero-capacity edges at some points.
      Didn't show up until now because we did not have overlaps.
This commit is contained in:
Jean-Paul Chaput 2021-02-01 16:43:42 +01:00
parent 7a7a3b9f1b
commit e0bae89a81
1 changed files with 55 additions and 17 deletions

View File

@ -462,12 +462,18 @@ namespace Katana {
if (rp->getLayerGauge()->getType() == Constant::PinOnly) continue;
if (rp->getLayerGauge()->getDepth() > getConfiguration()->getAllowedDepth()) continue;
size_t tracksSize = rp->getTracksSize();
int elementCapacity = 1;
size_t tracksSize = rp->getTracksSize();
for ( size_t itrack=0 ; itrack<tracksSize ; ++itrack ) {
Track* track = rp->getTrackByIndex( itrack );
Track* track = rp->getTrackByIndex( itrack );
DbU::Unit axis = track->getAxis();
Flags side = (track->getDirection() == Flags::Vertical) ? Flags::NorthSide
: Flags::EastSide;
Point source;
Point target;
cdebug_log(159,0) << "Capacity from: " << track << endl;
Interval uspan;
for ( size_t ielement=0 ; ielement<track->getSize() ; ++ielement ) {
TrackElement* element = track->getSegment( ielement );
@ -482,23 +488,55 @@ namespace Katana {
continue;
}
Segment* segment = element->getSegment();
Flags side = Flags::EastSide;
DbU::Unit axis = track->getAxis();
Point source = segment->getSourcePosition();
Point target = segment->getTargetPosition();
if (track->getDirection() == Flags::Vertical) {
side = Flags::NorthSide;
source.setX( axis );
target.setX( axis );
cdebug_log(159,0) << "Capacity from: " << element << ":" << elementCapacity << endl;
Segment* segment = element->getSegment();
Interval segmentUSpan;
source = segment->getSourcePosition();
target = segment->getTargetPosition();
if (track->getDirection() == Flags::Vertical)
segmentUSpan = Interval( source.getY(), target.getY() );
else
segmentUSpan = Interval( source.getX(), target.getX() );
if (uspan.isEmpty()) {
uspan = segmentUSpan;
continue;
} else {
source.setY( axis );
target.setY( axis );
if (uspan.contains(segmentUSpan)) continue;
if (uspan.intersect(segmentUSpan)) {
uspan.merge( segmentUSpan );
continue;
}
}
int elementCapacity = 1;
cdebug_log(159,0) << "Capacity from: " << element << ":" << elementCapacity << endl;
if (track->getDirection() == Flags::Vertical) {
source = Point( axis, uspan.getVMin() );
target = Point( axis, uspan.getVMax() );
} else {
source = Point( uspan.getVMin(), axis );
target = Point( uspan.getVMax(), axis );
}
GCellsUnder gcells = getGCellsUnder( source, target );
if (not gcells->empty()) {
for ( size_t i=0 ; i<gcells->size()-1 ; ++i ) {
Edge* edge = gcells->gcellAt(i)->getEdgeAt( side, axis );
edge->reserveCapacity( elementCapacity );
}
}
uspan = segmentUSpan;
}
if (not uspan.isEmpty()) {
if (track->getDirection() == Flags::Vertical) {
source = Point( axis, uspan.getVMin() );
target = Point( axis, uspan.getVMax() );
} else {
source = Point( uspan.getVMin(), axis );
target = Point( uspan.getVMax(), axis );
}
GCellsUnder gcells = getGCellsUnder( source, target );
if (not gcells->empty()) {