From fce97bb1d994b1027cbe8b37885edf691e28c625 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 2 Mar 2016 17:15:58 +0100 Subject: [PATCH] Corrections in how to access pads terminals in Katabatic/Kite. * Change: In Katabatic, in GCellTopology::doRp_AccessPad(), if the supporting RoutingPad is big (more than two pitch), do not put the access contact in the center but on the edge. This is to avoid cut violations between the VIAs and the matrix of VIAs that may be generated under the RoutingPad itself. * Change: In Kite, in TrackSegment destructor, if the legnth of the wire, without extensions is less than one picth, enlarge it so it encompass it's source & target VIAs (to avoid notches). * Bug: In Kite, in Track destructor, the TrackElements where detacheds, but not deleted, causing a memory link. --- katabatic/src/LoadGrByNet.cpp | 43 +++++++++++++++++++++++++---------- kite/src/Track.cpp | 4 ++-- kite/src/TrackSegment.cpp | 20 +++++++++++++++- 3 files changed, 52 insertions(+), 15 deletions(-) diff --git a/katabatic/src/LoadGrByNet.cpp b/katabatic/src/LoadGrByNet.cpp index b665d87a..1fdb56f8 100644 --- a/katabatic/src/LoadGrByNet.cpp +++ b/katabatic/src/LoadGrByNet.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2008-2015, All Rights Reserved +// Copyright (c) UPMC 2008-2016, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -182,7 +182,7 @@ namespace { //! //! \image html doRp_Access.png "doRp_Access()" -//! \function AutoContact* GCellTopology::doRp_AccessPad ( Component* rp, unsigned int flags ); +//! \function AutoContact* GCellTopology::doRp_AccessPad ( RoutingPad* rp, unsigned int flags ); //! \param rp The Component onto which anchor the access contact. //! \param flags Relevant flags are: //! - HAccess, the terminal is to be accessed through an horizontal @@ -642,7 +642,7 @@ namespace { inline GCell* getGCell () const; static void doRp_AutoContacts ( GCell*, Component*, AutoContact*& source, AutoContact*& target, unsigned int flags ); static AutoContact* doRp_Access ( GCell*, Component*, unsigned int flags ); - static AutoContact* doRp_AccessPad ( Component*, unsigned int flags ); + static AutoContact* doRp_AccessPad ( RoutingPad*, unsigned int flags ); static void doRp_StairCaseH ( GCell*, Component* rp1, Component* rp2 ); static void doRp_StairCaseV ( GCell*, Component* rp1, Component* rp2 ); private: @@ -769,7 +769,7 @@ namespace { Hook* _west; Hook* _north; Hook* _south; - vector _routingPads; + vector _routingPads; }; @@ -878,7 +878,7 @@ namespace { } ltrace(99) << "| Component to connect: " << anchor << endl; - _routingPads.push_back( anchor ); + _routingPads.push_back( rp ); } } } @@ -1181,7 +1181,7 @@ namespace { } - AutoContact* GCellTopology::doRp_AccessPad ( Component* rp, unsigned int flags ) + AutoContact* GCellTopology::doRp_AccessPad ( RoutingPad* rp, unsigned int flags ) { ltrace(99) << "doRp_AccessPad()" << endl; ltracein(99); @@ -1201,9 +1201,28 @@ namespace { rp->getBodyHook()->detach(); - Point position = rp->getCenter(); - GCell* gcell = Session::getKatabatic()->getGCellGrid()->getGCell(position); - Component* anchor = rp; + Point rpPosition = rp->getCenter(); + Point position = rp->getCenter(); + Box rpbb = rp->getBoundingBox(); + if ( (rpbb.getWidth () > 2*Session::getWireWidth(padDepth)) + or (rpbb.getHeight() > 2*Session::getWireWidth(padDepth)) ) { + //cerr << "doRp_AccessPad(): connecting to non-punctual connector (RoutingPad).\n" + // << " " << rp->getNet() << "pad:" << rp->getOccurrence().getMasterCell() << endl; + + Transformation transf = rp->getOccurrence().getPath().getTransformation(); + switch ( transf.getOrientation() ) { + case Transformation::Orientation::ID: position.setY( rpbb.getYMin() ); break; + case Transformation::Orientation::MY: position.setY( rpbb.getYMax() ); break; + case Transformation::Orientation::YR: + case Transformation::Orientation::R3: position.setX( rpbb.getXMin() ); break; + case Transformation::Orientation::R1: position.setX( rpbb.getXMax() ); break; + default: + break; + } + } + + GCell* gcell = Session::getKatabatic()->getGCellGrid()->getGCell(position); + Component* anchor = rp; if (padDepth != accessDepth) { if (padDepth > accessDepth) { @@ -1213,8 +1232,8 @@ namespace { Contact* target = NULL; Contact* source = Contact::create ( rp , Session::getContactLayer(padDepth) - , 0 - , 0 + , position.getX() - rpPosition.getX() + , position.getY() - rpPosition.getY() , Session::getViaWidth(padDepth) , Session::getViaWidth(padDepth) ); @@ -1423,7 +1442,7 @@ namespace { bool westPad = false; bool northPad = false; bool southPad = false; - Instance* padInstance = dynamic_cast(_routingPads[0])->getOccurrence().getPath().getHeadInstance(); + Instance* padInstance = _routingPads[0]->getOccurrence().getPath().getHeadInstance(); switch ( padInstance->getTransformation().getOrientation() ) { case Transformation::Orientation::ID: northPad = true; break; diff --git a/kite/src/Track.cpp b/kite/src/Track.cpp index 6d5eefb9..a7c220c9 100644 --- a/kite/src/Track.cpp +++ b/kite/src/Track.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2008-2015, All Rights Reserved +// Copyright (c) UPMC 2008-2016, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -98,7 +98,7 @@ namespace Kite { ltracein(90); for ( size_t i=0 ; i<_segments.size() ; i++ ) - if (_segments[i]) _segments[i]->detach(); + if (_segments[i]) { _segments[i]->detach(); _segments[i]->destroy(); } for ( size_t i=0 ; i<_markers.size() ; i++ ) if (_markers[i]) _markers[i]->destroy(); diff --git a/kite/src/TrackSegment.cpp b/kite/src/TrackSegment.cpp index 41d9b451..ee0fec35 100644 --- a/kite/src/TrackSegment.cpp +++ b/kite/src/TrackSegment.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2008-2015, All Rights Reserved +// Copyright (c) UPMC 2008-2016, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -18,6 +18,7 @@ #include #include "hurricane/Bug.h" #include "hurricane/Warning.h" +#include "hurricane/BasicLayer.h" #include "hurricane/Net.h" #include "hurricane/Name.h" #include "hurricane/RoutingPad.h" @@ -43,6 +44,7 @@ namespace Kite { using Hurricane::ForEachIterator; using Hurricane::Bug; using Hurricane::Error; + using Hurricane::BasicLayer; using Hurricane::Net; using Hurricane::Name; using Hurricane::RoutingPad; @@ -102,6 +104,22 @@ namespace Kite { << " [" << (void*)_base << ", " << (void*)(_base?_base->base():NULL) << "]" << endl; + DbU::Unit length = base()->getLength(); + if ( (length > 0) and (length < getPPitch()) ) { + BasicLayer* layer = getLayer()->getBasicLayers().getFirst(); + DbU::Unit width = base()->getWidth(); + Contact* source = base()->getAutoSource()->base(); + Contact* target = base()->getAutoTarget()->base(); + if (isHorizontal()) { + width = std::max( width, source->getBoundingBox(layer).getHeight() ); + width = std::max( width, target->getBoundingBox(layer).getHeight() ); + } else { + width = std::max( width, source->getBoundingBox(layer).getWidth() ); + width = std::max( width, target->getBoundingBox(layer).getWidth() ); + } + base()->base()->setWidth( width ); + } + base()->removeObserver( getObserver() ); TrackElement::_preDestroy(); }