From 7ad26f1a377443b26c591a13ef8e311ecae529a1 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 11 May 2021 14:19:27 +0200 Subject: [PATCH] Ignore short overlaping same-net segments in realign stage. * Change: In Track::addOverlapCost(), in some configuration, we can have two overlapping short segments that can *both* be realigned. But they prevent that because we account their shared length on the track. So now, in realign mode only, do not account same-net shared length if the segment length is less than *two perpandicular pitches*. This helps the antenna protection by making the diode connected directly to METAL2 long stripes, and not keeping them isolated. --- katana/src/RoutingEvent.cpp | 2 ++ katana/src/Track.cpp | 10 +++++++++- katana/src/TrackCost.cpp | 2 ++ katana/src/katana/TrackCost.h | 3 +++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/katana/src/RoutingEvent.cpp b/katana/src/RoutingEvent.cpp index 6fdd0181..f6d299c3 100644 --- a/katana/src/RoutingEvent.cpp +++ b/katana/src/RoutingEvent.cpp @@ -671,6 +671,8 @@ namespace Katana { and (fsm.getCost(0)->getTrack() != getSegment()->getTrack())) { cdebug_log(159,0) << "Insert in free space." << endl; fsm.moveToTrack( 0 ); + cdebug_log(155,0) << " @" << DbU::getValueString(getSegment()->getAxis()) + << " -> " << DbU::getValueString(fsm.getCost(0)->getTrack()->getAxis()) << endl; fsm.doActions(); queue.commit(); } diff --git a/katana/src/Track.cpp b/katana/src/Track.cpp index 37c7b155..b8a4e042 100644 --- a/katana/src/Track.cpp +++ b/katana/src/Track.cpp @@ -566,7 +566,15 @@ namespace Katana { cdebug_log(155,0) << "Segment istself in track, skip." << endl; continue; } - cdebug_log(155,0) << "Same net overlap, increase delta shared." << endl; + if ( cost.doIgnoreShort() + and (_segments[begin]->getLength() < 2*_segments[begin]->getPPitch())) { + cdebug_log(155,0) << "Overlap with same net and less than one p-pitch, skip." << endl; + continue; + } + cdebug_log(155,0) << "Same net overlap, increase delta shared (" + << DbU::getValueString(_segments[begin]->getLength()) + << " > 2*" << DbU::getValueString(_segments[begin]->getPPitch()) + << ")" << endl; cost.incDeltaShared ( overlap.getSize() ); } _segments[begin]->incOverlapCost( cost ); diff --git a/katana/src/TrackCost.cpp b/katana/src/TrackCost.cpp index f8bd55e9..a7cee832 100644 --- a/katana/src/TrackCost.cpp +++ b/katana/src/TrackCost.cpp @@ -63,6 +63,8 @@ namespace Katana { , _selectFlags (NoFlags) , _selectIndex (0) { + if (Session::getStage() == StageRealign) _flags |= IgnoreShort; + if (refSegment->isNonPref()) { DbU::Unit axisShift = getRefCandidateAxis() - refSegment->getAxis(); _interval1.translate( axisShift ); diff --git a/katana/src/katana/TrackCost.h b/katana/src/katana/TrackCost.h index be6f9686..510940c2 100644 --- a/katana/src/katana/TrackCost.h +++ b/katana/src/katana/TrackCost.h @@ -60,6 +60,7 @@ namespace Katana { , GlobalEnclosed = (1 << 17) , AtRipupLimit = (1 << 18) , IgnoreTerminals = (1 << 19) + , IgnoreShort = (1 << 20) , MergeMask = ForGlobal |Blockage|Fixed |Infinite |HardOverlap |Overlap |RightOverlap|LeftOverlap|OverlapGlobal |GlobalEnclosed |AtRipupLimit @@ -104,6 +105,7 @@ namespace Katana { bool isFree () const; inline bool isSymmetric () const; inline bool isWide () const; + inline bool doIgnoreShort () const; inline uint32_t getFlags () const; inline size_t getSpan () const; inline Net* getNet () const; @@ -208,6 +210,7 @@ namespace Katana { inline bool TrackCost::isAtRipupLimit () const { return _flags & AtRipupLimit; } inline bool TrackCost::isSymmetric () const { return _flags & Symmetric; } inline bool TrackCost::isWide () const { return (_span > 1); } + inline bool TrackCost::doIgnoreShort () const { return _flags & IgnoreShort; } inline uint32_t TrackCost::getFlags () const { return _flags; } inline size_t TrackCost::getSpan () const { return _span; } inline Net* TrackCost::getNet () const { return (_selectFlags & Symmetric) ? getNet2() : getNet1(); }