In AutoSegment::_changeDepth(), correct invalidation of GCells.

* Bug: In Anabatic::AutoSegment::_changeDepth(), GCells under the segment
    must be invalidated in order for the density to be recomputed.
    But we were using GCell::invalidate() which is meant for the quad-tree
    and graphic system, so the density almost never updated in case of
    a layer change, leading to over-congested GCells in the top layers
    (110% !).
       Now we directly set the Invalidated flag.
This commit is contained in:
Jean-Paul Chaput 2018-06-08 12:20:37 +02:00
parent ea9a1f3710
commit 2077a19bec
3 changed files with 16 additions and 13 deletions

View File

@ -1632,6 +1632,13 @@ namespace Anabatic {
getAutoTarget()->invalidate( Flags::Topology|Flags::NoCheckLayer );
}
vector<GCell*> gcells;
getGCells( gcells );
for ( size_t i=0 ; i<gcells.size() ; ++i ) {
gcells[i]->flags() |= Flags::Invalidated;
cdebug_log(159,0) << "changeDepth() " << gcells[i] << this << " " << endl;
}
if (not (flags & Flags::WithNeighbors)) {
cdebug_tabw(159,-1);
return;
@ -1659,11 +1666,6 @@ namespace Anabatic {
segment->_changeDepth( depth-1, Flags::NoFlags );
}
vector<GCell*> gcells;
getGCells( gcells );
for ( size_t i=0 ; i<gcells.size() ; ++i )
gcells[i]->invalidate();
cdebug_tabw(149,-1);
}

View File

@ -844,6 +844,7 @@ namespace Anabatic {
{
cdebug_log(110,1) << "GCell::invalidate() " << this << endl;
Super::invalidate( propagateFlag );
_flags |= Flags::Invalidated;
cdebug_log(110,1) << "West side." << endl; for ( Edge* edge : _westEdges ) edge->invalidate(); cdebug_tabw(110,-1);
cdebug_log(110,1) << "East side." << endl; for ( Edge* edge : _eastEdges ) edge->invalidate(); cdebug_tabw(110,-1);
@ -1595,10 +1596,10 @@ namespace Anabatic {
float capacity = getCapacity(depth);
cdebug_log(149,0) << " | hasFreeTrack [" << getId() << "] depth:" << depth << " "
<< Session::getRoutingGauge()->getRoutingLayer(depth)->getName()
//<< " " << (_densities[depth]*capacity) << " vs. " << capacity
<< " " << _feedthroughs[depth] << " vs. " << capacity
<< " " << this << endl;
<< Session::getRoutingGauge()->getRoutingLayer(depth)->getName()
//<< " " << (_densities[depth]*capacity) << " vs. " << capacity
<< " " << _feedthroughs[depth] << " vs. " << capacity
<< " " << this << endl;
return (_feedthroughs[depth] + 0.99 + reserve <= capacity);
}

View File

@ -363,7 +363,7 @@ namespace Anabatic {
inline GCell* GCell::getUnder ( Point p ) const { return getUnder(p.getX(),p.getY()); }
inline const vector<Contact*>& GCell::getGContacts () const { return _gcontacts; }
inline size_t GCell::getDepth () const { return _depth; }
inline const vector<AutoSegment*>& GCell::getVSegments () const { return _vsegments; }
const vector<AutoSegment*>& GCell::getVSegments () const { return _vsegments; }
inline const vector<AutoSegment*>& GCell::getHSegments () const { return _hsegments; }
inline const vector<AutoContact*>& GCell::getContacts () const { return _contacts; }
@ -442,12 +442,12 @@ namespace Anabatic {
inline DbU::Unit GCell::getBlockage ( size_t depth ) const
{ return (depth<_depth) ? _blockages[depth] : 0; }
inline void GCell::addVSegment ( AutoSegment* segment )
{ _flags |= Flags::Invalidated; _vsegments.push_back(segment); }
inline void GCell::addHSegment ( AutoSegment* segment )
{ _flags |= Flags::Invalidated; _hsegments.push_back(segment); }
inline void GCell::addVSegment ( AutoSegment* segment )
{ _flags |= Flags::Invalidated; _vsegments.push_back(segment); }
inline void GCell::addContact ( AutoContact* contact )
{ _flags |= Flags::Invalidated; _contacts.push_back(contact); }