From 9df5fc838cbea20ce4f62f439fd80dbe7a52fc56 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 14 Jan 2023 22:35:57 +0100 Subject: [PATCH] Support for non-stacked VIAs in Katana. * New: In Katana::Configuration, added option: "cfg.katana.disableStackedVias" (default to false), so the router do not stack VIAs on top of each other. * Bug: In NegociateWindow::loadRoutingPads(), create TrackMarkers using the right depth when the gauge starts with non-routable ones. * New: In Track::addOverlapCost(), when disableStackedVias is active, uses the markers from the below terminals to tag the cost as "infinite", so the track *cannot* be used by the marker's net owner. Can be refined by checking that we are not at a segment's end but will do for now. --- katana/src/Configuration.cpp | 2 ++ katana/src/NegociateWindow.cpp | 14 ++++++++------ katana/src/Session.cpp | 4 ++++ katana/src/Track.cpp | 6 ++++++ katana/src/katana/Configuration.h | 3 +++ katana/src/katana/Session.h | 5 +++++ 6 files changed, 28 insertions(+), 6 deletions(-) diff --git a/katana/src/Configuration.cpp b/katana/src/Configuration.cpp index c511437c..0ed4f88a 100644 --- a/katana/src/Configuration.cpp +++ b/katana/src/Configuration.cpp @@ -57,6 +57,7 @@ namespace Katana { , _flags (0) , _profileEventCosts (Cfg::getParamBool ("katana.profileEventCosts" ,false )->asBool()) , _runRealignStage (Cfg::getParamBool ("katana.runRealignStage" ,true )->asBool()) + , _disableStackedVias (Cfg::getParamBool ("katana.disableStackedVias" ,false )->asBool()) { _ripupLimits[StrapRipupLimit] = Cfg::getParamInt("katana.strapRipupLimit" ,16)->asInt(); _ripupLimits[LocalRipupLimit] = Cfg::getParamInt("katana.localRipupLimit" , 7)->asInt(); @@ -108,6 +109,7 @@ namespace Katana { , _flags (other._flags) , _profileEventCosts (other._profileEventCosts) , _runRealignStage (other._runRealignStage) + , _disableStackedVias (other._disableStackedVias) { _ripupLimits[StrapRipupLimit] = other._ripupLimits[StrapRipupLimit]; _ripupLimits[LocalRipupLimit] = other._ripupLimits[LocalRipupLimit]; diff --git a/katana/src/NegociateWindow.cpp b/katana/src/NegociateWindow.cpp index 227b14fc..806a6932 100644 --- a/katana/src/NegociateWindow.cpp +++ b/katana/src/NegociateWindow.cpp @@ -181,13 +181,15 @@ namespace { if (af->isBLOCKAGE(net->getName())) continue; for( RoutingPad* rp : net->getRoutingPads() ) { - size_t depth = rg->getLayerDepth(rp->getLayer()); - if (depth == 0) { - TrackMarker::create( rp, 1 ); - //if (isVH) TrackMarker::create( rp, 2 ); + size_t depth = rg->getLayerDepth(rp->getLayer()); + size_t rlDepth = depth - rg->getFirstRoutingLayer(); + if (rlDepth == 0) { + TrackMarker::create( rp, depth+1 ); + //if (isVH) TrackMarker::create( rp, depth+2 ); } - if (depth == 1) { - TrackMarker::create( rp, 1 ); + if (rlDepth == 1) { + if (depth+1 < rg->getDepth()) + TrackMarker::create( rp, depth+1 ); } } } diff --git a/katana/src/Session.cpp b/katana/src/Session.cpp index 83e42edd..8d7be68f 100644 --- a/katana/src/Session.cpp +++ b/katana/src/Session.cpp @@ -401,6 +401,10 @@ namespace Katana { } + bool Session::_disableStackedVias () + { return _getKatanaEngine()->getConfiguration()->disableStackedVias(); } + + void Session::_addInsertEvent ( TrackMarker* marker, Track* track ) { _insertEvents.push_back( Event(marker,track) ); diff --git a/katana/src/Track.cpp b/katana/src/Track.cpp index 5a79009a..6b39e332 100644 --- a/katana/src/Track.cpp +++ b/katana/src/Track.cpp @@ -543,6 +543,12 @@ namespace Katana { for ( ; (mbegin < _markers.size()) and (_markers[mbegin]->getSourceU() <= interval.getVMax()) ; mbegin++ ) { cdebug_log(155,0) << "| @" << DbU::getValueString(_axis) << " " << _markers[mbegin] << endl; + if (Session::disableStackedVias() + and (_markers[mbegin]->getNet() == cost.getNet()) ) { + cost.setInfinite(); + cdebug_tabw(155,-1); + return cost; + } if (_markers[mbegin]->getNet() != cost.getNet()) { cdebug_log(155,0) << "* Mark: @" << DbU::getValueString(_axis) << " " << _markers[mbegin] << endl; cost.incTerminals( _markers[mbegin]->getWeight(this) ); diff --git a/katana/src/katana/Configuration.h b/katana/src/katana/Configuration.h index 88694041..b33a9f93 100644 --- a/katana/src/katana/Configuration.h +++ b/katana/src/katana/Configuration.h @@ -66,6 +66,7 @@ namespace Katana { inline bool useStaticBloatProfile () const; inline bool profileEventCosts () const; inline bool runRealignStage () const; + inline bool disableStackedVias () const; // Methods. inline Anabatic::Configuration* base (); inline const Anabatic::Configuration* base () const; @@ -121,6 +122,7 @@ namespace Katana { unsigned int _flags; bool _profileEventCosts; bool _runRealignStage; + bool _disableStackedVias; private: Configuration ( const Configuration& other ); Configuration& operator= ( const Configuration& ); @@ -153,6 +155,7 @@ namespace Katana { inline bool Configuration::useStaticBloatProfile () const { return _flags & UseStaticBloatProfile; } inline bool Configuration::profileEventCosts () const { return _profileEventCosts; } inline bool Configuration::runRealignStage () const { return _runRealignStage; } + inline bool Configuration::disableStackedVias () const { return _disableStackedVias; } inline void Configuration::setFlags ( unsigned int flags ) { _flags |= flags; } inline void Configuration::unsetFlags ( unsigned int flags ) { _flags &= ~flags; } inline void Configuration::setProfileEventCosts ( bool state ) { _profileEventCosts = state; } diff --git a/katana/src/katana/Session.h b/katana/src/katana/Session.h index a999bce6..6160ad54 100644 --- a/katana/src/katana/Session.h +++ b/katana/src/katana/Session.h @@ -66,6 +66,7 @@ namespace Katana { static Session* get ( const char* message=NULL ); inline static Super* base (); inline static bool isEmpty (); + inline static bool disableStackedVias (); static uint32_t getStage (); inline static KatanaEngine* getKatanaEngine (); static Configuration* getConfiguration (); @@ -102,6 +103,7 @@ namespace Katana { void _doRemovalEvents ( bool reschedule=false ); virtual size_t _revalidate (); bool _isEmpty () const; + bool _disableStackedVias (); NegociateWindow* _getNegociateWindow (); inline const std::vector& _getIndirectInvalids (); @@ -212,6 +214,9 @@ namespace Katana { inline bool Session::isEmpty () { return get("isEmpty()")->_isEmpty(); } + inline bool Session::disableStackedVias () + { return get("disableStackedVias()")->_disableStackedVias(); } + inline const std::vector& Session::_getIndirectInvalids () { return _indirectInvalids; }