From e17a50ca0b607642f7b9a6c70c6bff2c49855933 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 17 Dec 2017 12:51:04 +0100 Subject: [PATCH] Suppress all static attributes & methods from Anabatic::NetBuilder. --- anabatic/src/NetBuilder.cpp | 86 ++++++++++++------------------ anabatic/src/anabatic/NetBuilder.h | 39 +++++++------- 2 files changed, 54 insertions(+), 71 deletions(-) diff --git a/anabatic/src/NetBuilder.cpp b/anabatic/src/NetBuilder.cpp index 3abccd17..2ff8cb42 100644 --- a/anabatic/src/NetBuilder.cpp +++ b/anabatic/src/NetBuilder.cpp @@ -92,18 +92,6 @@ namespace Anabatic { // ------------------------------------------------------------------- // Class : "NetBuilder". - map NetBuilder::_routingPadAutoSegments; - vector NetBuilder::_toFixSegments; - unsigned int NetBuilder::_degree = 0; - - - map& NetBuilder::getRpLookup () - { return _routingPadAutoSegments; } - - - void NetBuilder::clearRpLookup () - { _routingPadAutoSegments.clear(); } - void NetBuilder::getPositions ( Component* anchor, Point& source, Point& target ) { @@ -187,35 +175,23 @@ namespace Anabatic { } - void NetBuilder::fixSegments () - { - for ( size_t i=0 ; i<_toFixSegments.size() ; ++i ) - _toFixSegments[i]->setFlags( AutoSegment::SegFixed ); - _toFixSegments.clear(); - } - - - void NetBuilder::init ( unsigned int degree ) - { - _degree = degree; - _toFixSegments.clear(); - } - - NetBuilder::NetBuilder () - : _forks () - , _connexity () - , _topology (0) - , _gcell (NULL) - , _sourceContact (NULL) - , _southWestContact(NULL) - , _northEastContact(NULL) - , _fromHook (NULL) - , _easts () - , _wests () - , _norths () - , _souths () - , _routingPads () + : _forks () + , _connexity () + , _topology (0) + , _gcell (NULL) + , _sourceContact (NULL) + , _southWestContact (NULL) + , _northEastContact (NULL) + , _fromHook (NULL) + , _easts () + , _wests () + , _norths () + , _souths () + , _routingPads () + , _routingPadAutoSegments() + , _toFixSegments () + , _degree (0) { } @@ -228,14 +204,24 @@ namespace Anabatic { _southWestContact = NULL; _northEastContact = NULL; _fromHook = NULL; - _easts .clear(); - _wests .clear(); - _norths .clear(); - _souths .clear(); - _routingPads.clear(); + _easts .clear(); + _wests .clear(); + _norths .clear(); + _souths .clear(); + _routingPads .clear(); + _toFixSegments .clear(); + _routingPadAutoSegments.clear(); } + void NetBuilder::fixSegments () + { + for ( size_t i=0 ; i<_toFixSegments.size() ; ++i ) + _toFixSegments[i]->setFlags( AutoSegment::SegFixed ); + _toFixSegments.clear(); + } + + NetBuilder& NetBuilder::startFrom ( AnabaticEngine* anbt, Hook* fromHook, AutoContact* sourceContact ) { clear(); @@ -2653,11 +2639,8 @@ namespace Anabatic { Hook* sourceHook = NULL; AutoContact* sourceContact = NULL; - - clearRpLookup(); - - RoutingPads routingPads = net->getRoutingPads(); - size_t degree = routingPads.getSize(); + RoutingPads routingPads = net->getRoutingPads(); + size_t degree = routingPads.getSize(); if (degree == 0) { cmess2 << Warning("Net \"%s\" do not have any RoutingPad (ignored)." @@ -2676,7 +2659,7 @@ namespace Anabatic { size_t unconnecteds = 0; size_t connecteds = 0; - init( degree ); + setDegree( degree ); cdebug_log(145,0) << "Start RoutingPad Ring" << endl; for ( RoutingPad* startRp : routingPads ) { @@ -2745,7 +2728,6 @@ namespace Anabatic { cdebug_log(145,0) << "Popping (to) " << sourceContact << endl; } - clearRpLookup(); Session::revalidate(); //Breakpoint::stop( 0, "After construct" ); diff --git a/anabatic/src/anabatic/NetBuilder.h b/anabatic/src/anabatic/NetBuilder.h index b3ba3de7..b251f61b 100644 --- a/anabatic/src/anabatic/NetBuilder.h +++ b/anabatic/src/anabatic/NetBuilder.h @@ -122,8 +122,6 @@ namespace Anabatic { public: template< typename BuilderT > static void load ( AnabaticEngine*, Net* ); - static void init ( unsigned int degree ); - static void fixSegments (); static void getPositions ( Component* anchor, Point& source, Point& target ); static uint64_t checkRoutingPadSize ( Component* anchor ); static Hook* getSegmentOppositeHook ( Hook* hook ); @@ -132,6 +130,8 @@ namespace Anabatic { NetBuilder (); virtual ~NetBuilder (); void clear (); + inline void setDegree ( unsigned int degree ); + void fixSegments (); NetBuilder& startFrom ( AnabaticEngine* , Hook* fromHook , AutoContact* sourceContact=NULL ); @@ -142,14 +142,13 @@ namespace Anabatic { inline GCell* getGCell () const; inline ForkStack& getForks (); inline vector& getRoutingPads (); - static map& getRpLookup (); + inline map& getRpLookup (); inline unsigned int getTopology () const; inline Hook* north ( size_t i=0 ) const; inline Hook* south ( size_t i=0 ) const; inline Hook* east ( size_t i=0 ) const; inline Hook* west ( size_t i=0 ) const; inline void setBothCornerContacts ( AutoContact* ); - static void clearRpLookup (); bool push ( Hook* to, AutoContact* contact, uint64_t flags=0 ); virtual void doRp_AutoContacts ( GCell*, Component*, AutoContact*& source, AutoContact*& target, uint64_t flags ) = 0; virtual AutoContact* doRp_Access ( GCell*, Component*, uint64_t flags ) = 0; @@ -270,9 +269,6 @@ namespace Anabatic { // Attributes. private: - static map _routingPadAutoSegments; - static vector _toFixSegments; - static unsigned int _degree; ForkStack _forks; UConnexity _connexity; unsigned int _topology; @@ -287,6 +283,9 @@ namespace Anabatic { vector _norths; vector _souths; vector _routingPads; + map _routingPadAutoSegments; + vector _toFixSegments; + unsigned int _degree; // Sort classes. public: @@ -324,18 +323,20 @@ namespace Anabatic { }; - inline NetBuilder::UConnexity NetBuilder::getConnexity () const { return _connexity; } - inline ForkStack& NetBuilder::getForks () { return _forks; } - inline unsigned int NetBuilder::getStateG () const { return _connexity.fields.globals; } - inline GCell* NetBuilder::getGCell () const { return _gcell; } - inline Net* NetBuilder::getNet () const { return _net; } - inline unsigned int NetBuilder::getTopology () const { return _topology; } - inline vector& NetBuilder::getRoutingPads () { return _routingPads; } - inline Hook* NetBuilder::north ( size_t i ) const { return (i<_norths.size()) ? _norths[i] : NULL; } - inline Hook* NetBuilder::south ( size_t i ) const { return (i<_souths.size()) ? _souths[i] : NULL; } - inline Hook* NetBuilder::east ( size_t i ) const { return (i<_easts .size()) ? _easts [i] : NULL; } - inline Hook* NetBuilder::west ( size_t i ) const { return (i<_wests .size()) ? _wests [i] : NULL; } - inline void NetBuilder::setBothCornerContacts ( AutoContact* ac ) { _southWestContact = _northEastContact = ac; } + inline NetBuilder::UConnexity NetBuilder::getConnexity () const { return _connexity; } + inline ForkStack& NetBuilder::getForks () { return _forks; } + inline unsigned int NetBuilder::getStateG () const { return _connexity.fields.globals; } + inline GCell* NetBuilder::getGCell () const { return _gcell; } + inline Net* NetBuilder::getNet () const { return _net; } + inline unsigned int NetBuilder::getTopology () const { return _topology; } + inline vector& NetBuilder::getRoutingPads () { return _routingPads; } + inline map& NetBuilder::getRpLookup () { return _routingPadAutoSegments; } + inline Hook* NetBuilder::north ( size_t i ) const { return (i<_norths.size()) ? _norths[i] : NULL; } + inline Hook* NetBuilder::south ( size_t i ) const { return (i<_souths.size()) ? _souths[i] : NULL; } + inline Hook* NetBuilder::east ( size_t i ) const { return (i<_easts .size()) ? _easts [i] : NULL; } + inline Hook* NetBuilder::west ( size_t i ) const { return (i<_wests .size()) ? _wests [i] : NULL; } + inline void NetBuilder::setDegree ( unsigned int degree ) { _degree = degree; } + inline void NetBuilder::setBothCornerContacts ( AutoContact* ac ) { _southWestContact = _northEastContact = ac; } template< typename BuilderT > void NetBuilder::load ( AnabaticEngine* engine, Net* net ) { BuilderT()._load(engine,net); }