From 5498ad9ecb9443c9d015f5d2816f74ae2696096e Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 2 Aug 2020 18:13:47 +0200 Subject: [PATCH] Bug fix: Never slacken a segment from a Pin. * New: In Anabatic::AutoContactTerminal, new method "isOnPin()" to know if the terminal contact is on a Pin. Introduced in base class. * Bug: In Anabatic::AutoHorizontal::_canSlacken() & AutoVertical, forbid slackening from a Pin. As Pin are all on the side of the cell (aligneds) and the perpandicular segment will be locked on the Pin, it generates intractable overlaps for the router. --- anabatic/src/AutoContact.cpp | 1 + anabatic/src/AutoContactTerminal.cpp | 9 +++++++++ anabatic/src/AutoHorizontal.cpp | 5 +++-- anabatic/src/AutoSegment.cpp | 4 ++-- anabatic/src/AutoVertical.cpp | 2 ++ anabatic/src/anabatic/AutoContact.h | 1 + anabatic/src/anabatic/AutoContactTerminal.h | 1 + 7 files changed, 19 insertions(+), 4 deletions(-) diff --git a/anabatic/src/AutoContact.cpp b/anabatic/src/AutoContact.cpp index c2a6f973..037e622d 100644 --- a/anabatic/src/AutoContact.cpp +++ b/anabatic/src/AutoContact.cpp @@ -178,6 +178,7 @@ namespace Anabatic { AutoHorizontal* AutoContact::getHorizontal2 () const { return NULL; } AutoVertical* AutoContact::getVertical1 () const { return NULL; } AutoVertical* AutoContact::getVertical2 () const { return NULL; } + bool AutoContact::isOnPin () const { return false; } void AutoContact::getDepthSpan ( size_t& minDepth, size_t& maxDepth ) const diff --git a/anabatic/src/AutoContactTerminal.cpp b/anabatic/src/AutoContactTerminal.cpp index 02d8b228..9e9aad04 100644 --- a/anabatic/src/AutoContactTerminal.cpp +++ b/anabatic/src/AutoContactTerminal.cpp @@ -29,6 +29,7 @@ #include "hurricane/RoutingPad.h" #include "hurricane/Vertical.h" #include "hurricane/Horizontal.h" +#include "hurricane/Pin.h" #include "hurricane/DebugSession.h" #include "crlcore/RoutingGauge.h" #include "anabatic/AutoContactTerminal.h" @@ -47,6 +48,7 @@ namespace Anabatic { using Hurricane::Transformation; using Hurricane::Entity; using Hurricane::Occurrence; + using Hurricane::Pin; // ------------------------------------------------------------------- @@ -129,6 +131,13 @@ namespace Anabatic { } + bool AutoContactTerminal::isOnPin () const + { + RoutingPad* rp = dynamic_cast( getAnchor() ); + return (dynamic_cast(rp->getOccurrence().getEntity()) != NULL); + } + + AutoSegment* AutoContactTerminal::getOpposite ( const AutoSegment* ) const { return NULL; } diff --git a/anabatic/src/AutoHorizontal.cpp b/anabatic/src/AutoHorizontal.cpp index 797b202a..d98fcd9f 100644 --- a/anabatic/src/AutoHorizontal.cpp +++ b/anabatic/src/AutoHorizontal.cpp @@ -247,8 +247,9 @@ namespace Anabatic { { cdebug_tabw(149,1); - AutoContact* source = getAutoSource(); - AutoContact* target = getAutoTarget(); + AutoContact* source = getAutoSource(); + AutoContact* target = getAutoTarget(); + if (source->isOnPin() or target->isOnPin()) { cdebug_tabw(149,-1); return false; } Interval sourceSide = source->getGCell()->getSide( Flags::Vertical ); Interval targetSide = target->getGCell()->getSide( Flags::Vertical ); diff --git a/anabatic/src/AutoSegment.cpp b/anabatic/src/AutoSegment.cpp index d34f274d..d97b8556 100644 --- a/anabatic/src/AutoSegment.cpp +++ b/anabatic/src/AutoSegment.cpp @@ -1729,8 +1729,8 @@ namespace Anabatic { if (_canSlacken()) return true; if ((flags & Flags::Propagate) and not isNotAligned()) { - forEach ( AutoSegment*, isegment, const_cast(this)->getAligneds() ) { - if (isegment->_canSlacken()) return true; + for ( AutoSegment* segment : const_cast(this)->getAligneds() ) { + if (segment->_canSlacken()) return true; } } diff --git a/anabatic/src/AutoVertical.cpp b/anabatic/src/AutoVertical.cpp index d31d0708..bed3c094 100644 --- a/anabatic/src/AutoVertical.cpp +++ b/anabatic/src/AutoVertical.cpp @@ -241,6 +241,8 @@ namespace Anabatic { { cdebug_tabw(149,-1); + if (getAutoSource()->isOnPin() or getAutoTarget()->isOnPin()) { cdebug_tabw(149,-1); return false; } + Interval sourceSide = getAutoSource()->getGCell()->getSide( Flags::Horizontal ); Interval targetSide = getAutoTarget()->getGCell()->getSide( Flags::Horizontal ); Interval sourceConstraints = Interval(getAutoSource()->getCBXMin(),getAutoSource()->getCBXMax()); diff --git a/anabatic/src/anabatic/AutoContact.h b/anabatic/src/anabatic/AutoContact.h index d3d044a9..175feb71 100644 --- a/anabatic/src/anabatic/AutoContact.h +++ b/anabatic/src/anabatic/AutoContact.h @@ -123,6 +123,7 @@ namespace Anabatic { inline bool isUserNativeConstraints () const; inline bool isHDogleg () const; inline bool isVDogleg () const; + virtual bool isOnPin () const; inline bool hasBadTopology () const; bool canDestroy ( Flags flags=Flags::NoFlags ) const; bool canMoveUp ( const AutoSegment* moved ) const; diff --git a/anabatic/src/anabatic/AutoContactTerminal.h b/anabatic/src/anabatic/AutoContactTerminal.h index d2b4d587..697f9845 100644 --- a/anabatic/src/anabatic/AutoContactTerminal.h +++ b/anabatic/src/anabatic/AutoContactTerminal.h @@ -60,6 +60,7 @@ namespace Anabatic { virtual void _invalidate ( Flags flags ); public: bool isEndPoint () const; + virtual bool isOnPin () const; virtual Box getNativeConstraintBox () const; RoutingPad* getRoutingPad () const; inline AutoSegment* getSegment () const;