diff --git a/katabatic/src/AutoSegment.cpp b/katabatic/src/AutoSegment.cpp index 6eb9f34b..b4c70a24 100644 --- a/katabatic/src/AutoSegment.cpp +++ b/katabatic/src/AutoSegment.cpp @@ -1296,7 +1296,7 @@ namespace Katabatic { if ( isTerminal() and isLocal() ) return false; size_t depth = Session::getRoutingGauge()->getLayerDepth(getLayer()) + 2; - if ( depth >= Session::getRoutingGauge()->getDepth() ) return false; + if ( depth >= Session::getConfiguration()->getAllowedDepth() ) return false; vector gcells; getGCells ( gcells ); diff --git a/katabatic/src/Configuration.cpp b/katabatic/src/Configuration.cpp index 7b21e575..b59b841a 100644 --- a/katabatic/src/Configuration.cpp +++ b/katabatic/src/Configuration.cpp @@ -80,8 +80,12 @@ namespace Katabatic { , _extensionCap (DbU::lambda(1.5)) , _saturateRatio (0.80) , _globalThreshold (29*DbU::lambda(50.0)) // Ugly: direct uses of SxLib gauge. + , _allowedDepth (0) { - if ( rg ) _rg = rg->getClone(); + if ( rg ) { + _rg = rg->getClone(); + _allowedDepth = rg->getDepth(); + } _gmetalh = DataBase::getDB()->getTechnology()->getLayer("gmetalh"); _gmetalv = DataBase::getDB()->getTechnology()->getLayer("gmetalv"); @@ -98,6 +102,7 @@ namespace Katabatic { , _extensionCap (other._extensionCap) , _saturateRatio (other._saturateRatio) , _globalThreshold (other._globalThreshold) + , _allowedDepth (other._allowedDepth) { if ( other._rg ) _rg = other._rg->getClone(); } @@ -130,6 +135,10 @@ namespace Katabatic { { return _rg->getDepth(); } + size_t ConfigurationConcrete::getAllowedDepth () const + { return _allowedDepth; } + + size_t ConfigurationConcrete::getLayerDepth ( const Layer* layer ) const { return _rg->getLayerDepth(layer); } @@ -162,6 +171,10 @@ namespace Katabatic { { return _globalThreshold; } + void ConfigurationConcrete::setAllowedDepth ( size_t allowedDepth ) + { _allowedDepth = (allowedDepth > getDepth()) ? getDepth() : allowedDepth; } + + void ConfigurationConcrete::setSaturateRatio ( float ratio ) { _saturateRatio = ratio; } diff --git a/katabatic/src/LayerAssign.cpp b/katabatic/src/LayerAssign.cpp index 423e06fe..05bb9170 100644 --- a/katabatic/src/LayerAssign.cpp +++ b/katabatic/src/LayerAssign.cpp @@ -93,7 +93,7 @@ namespace Katabatic { , unsigned long& total , unsigned long& globals ) { - if ( depth+2 >= Session::getRoutingGauge()->getDepth() ) { + if ( depth+2 >= Session::getConfiguration()->getAllowedDepth() ) { cerr << Warning("Katabatic::_desaturate(): %s, no remaining upper layers." ,getString(Session::getRoutingGauge()->getRoutingLayer(depth)->getName()).c_str() ) << endl; diff --git a/katabatic/src/katabatic/Configuration.h b/katabatic/src/katabatic/Configuration.h index 346a6b84..6431da60 100644 --- a/katabatic/src/katabatic/Configuration.h +++ b/katabatic/src/katabatic/Configuration.h @@ -66,6 +66,7 @@ namespace Katabatic { // Methods. virtual bool isGMetal ( const Layer* ) const = 0; virtual size_t getDepth () const = 0; + virtual size_t getAllowedDepth () const = 0; virtual size_t getLayerDepth ( const Layer* ) const = 0; virtual RoutingGauge* getRoutingGauge () const = 0; virtual RoutingLayerGauge* getLayerGauge ( size_t depth ) const = 0; @@ -74,6 +75,7 @@ namespace Katabatic { virtual DbU::Unit getExtensionCap () const = 0; virtual float getSaturateRatio () const = 0; virtual DbU::Unit getGlobalThreshold () const = 0; + virtual void setAllowedDepth ( size_t ) = 0; virtual void setSaturateRatio ( float ) = 0; virtual void setGlobalThreshold ( DbU::Unit ) = 0; virtual void print ( Cell* ) const = 0; @@ -103,6 +105,7 @@ namespace Katabatic { // Methods. virtual bool isGMetal ( const Layer* ) const; virtual size_t getDepth () const; + virtual size_t getAllowedDepth () const; virtual size_t getLayerDepth ( const Layer* ) const; virtual RoutingGauge* getRoutingGauge () const; virtual RoutingLayerGauge* getLayerGauge ( size_t depth ) const; @@ -111,6 +114,7 @@ namespace Katabatic { virtual DbU::Unit getExtensionCap () const; virtual float getSaturateRatio () const; virtual DbU::Unit getGlobalThreshold () const; + virtual void setAllowedDepth ( size_t ); virtual void setSaturateRatio ( float ); virtual void setGlobalThreshold ( DbU::Unit ); virtual void print ( Cell* ) const; @@ -128,6 +132,7 @@ namespace Katabatic { DbU::Unit _extensionCap; float _saturateRatio; DbU::Unit _globalThreshold; + size_t _allowedDepth; private: ConfigurationConcrete ( const ConfigurationConcrete& ); ConfigurationConcrete& operator= ( const ConfigurationConcrete& );