From 2077a19becb534cf87201d1c36932f81c2d89ca7 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Fri, 8 Jun 2018 12:20:37 +0200 Subject: [PATCH] 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. --- anabatic/src/AutoSegment.cpp | 12 +++++++----- anabatic/src/GCell.cpp | 9 +++++---- anabatic/src/anabatic/GCell.h | 8 ++++---- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/anabatic/src/AutoSegment.cpp b/anabatic/src/AutoSegment.cpp index a82c2b62..e3f1bade 100644 --- a/anabatic/src/AutoSegment.cpp +++ b/anabatic/src/AutoSegment.cpp @@ -1632,6 +1632,13 @@ namespace Anabatic { getAutoTarget()->invalidate( Flags::Topology|Flags::NoCheckLayer ); } + vector gcells; + getGCells( gcells ); + for ( size_t i=0 ; iflags() |= 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 gcells; - getGCells( gcells ); - for ( size_t i=0 ; iinvalidate(); - cdebug_tabw(149,-1); } diff --git a/anabatic/src/GCell.cpp b/anabatic/src/GCell.cpp index 9275b03f..3e80d156 100644 --- a/anabatic/src/GCell.cpp +++ b/anabatic/src/GCell.cpp @@ -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); } diff --git a/anabatic/src/anabatic/GCell.h b/anabatic/src/anabatic/GCell.h index 07516ea5..e2d0d42b 100644 --- a/anabatic/src/anabatic/GCell.h +++ b/anabatic/src/anabatic/GCell.h @@ -363,7 +363,7 @@ namespace Anabatic { inline GCell* GCell::getUnder ( Point p ) const { return getUnder(p.getX(),p.getY()); } inline const vector& GCell::getGContacts () const { return _gcontacts; } inline size_t GCell::getDepth () const { return _depth; } - inline const vector& GCell::getVSegments () const { return _vsegments; } + const vector& GCell::getVSegments () const { return _vsegments; } inline const vector& GCell::getHSegments () const { return _hsegments; } inline const vector& 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); }