From d8218d06983c7eb72c73908967f7fa069b24c8e4 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Fri, 26 Nov 2021 18:59:46 +0100 Subject: [PATCH] Fix bad computation of gap in Tracks in some special cases. * Bug: In Track::repair(), when closing a same net gap, the amount the "right" segment duSource must be shifted left was incorrectly computed in some instances. The previous calculation was assuming that the right edge of the gap was at the exact same position than the source extension. But when there is a non-preferred direction connected to it, this is wrong. Now compute the delta accounting for a difference between the right edge of the gap and the source extension. --- katana/src/Track.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/katana/src/Track.cpp b/katana/src/Track.cpp index 494f7131..5488684c 100644 --- a/katana/src/Track.cpp +++ b/katana/src/Track.cpp @@ -1003,7 +1003,7 @@ namespace Katana { uint32_t Track::repair () const { - //if ((getIndex() == 6428) and isVertical()) DebugSession::open( 150, 160 ); + if ((getIndex() == 1011) and isHorizontal()) DebugSession::open( 150, 160 ); cdebug_log(159,0) << "Track::repair() " << this << endl; if (_segments.empty()) { @@ -1084,8 +1084,11 @@ namespace Katana { if (segment->getSourcePosition() < first->getSourcePosition()) first = segment; } + spacing += first->getSourceU() - gapsetCurr.sourceU(j+1); + cdebug_log(159,0) << "spacing:" << DbU::getValueString(spacing) << " " << first << endl; cdebug_log(159,0) << "duSource:" << DbU::getValueString(first->getDuSource()) << endl; - first->setDuSource( first->getDuSource() - spacing - minSpacing/2 ); + //first->setDuSource( first->getDuSource() - spacing - minSpacing/2 ); + first->setDuSource( first->getDuSource() - spacing ); } ++gaps; cerr << Warning( " Track::repair(): Closing same net gap in %s near:\n %s" @@ -1119,7 +1122,7 @@ namespace Katana { if (spacing > 10*getLayerGauge()->getPitch()) fillHole( lastTargetU, getMax() ); - //if ((getIndex() == 6428) and isVertical()) DebugSession::close(); + if ((getIndex() == 1011) and isHorizontal()) DebugSession::close(); return gaps; }