From a6bfbdf8259dc74a448a89a63de7d25452b6a4f0 Mon Sep 17 00:00:00 2001 From: HoangAnhP Date: Wed, 20 Jul 2022 17:49:43 +0200 Subject: [PATCH] Seabreeze : some changes --- Seabreeze/src/Elmore.cpp | 6 ++--- Seabreeze/src/SeabreezeEngine.cpp | 14 ++++++++++-- Seabreeze/src/Tree.cpp | 22 +++++++++--------- Seabreeze/src/seabreeze/Configuration.h | 2 +- Seabreeze/src/seabreeze/Elmore.h | 2 +- Seabreeze/src/seabreeze/Tree.h | 30 ++++++++++++------------- 6 files changed, 43 insertions(+), 33 deletions(-) diff --git a/Seabreeze/src/Elmore.cpp b/Seabreeze/src/Elmore.cpp index 7dd85659..13a42852 100644 --- a/Seabreeze/src/Elmore.cpp +++ b/Seabreeze/src/Elmore.cpp @@ -132,7 +132,7 @@ namespace Seabreeze { cerr << Error( "Elmore::buildFromNode(): rootNode has no contact, aborting." ) << endl; return; } - _tree->add_node( rootNode ); + _tree->addNode( rootNode ); cdebug_log(199,1) << "Elmore::buildFromNode()" << endl; cdebug_log(199,0) << "rootNode->_contact=" << rootNode->contact() << endl; @@ -167,7 +167,7 @@ namespace Seabreeze { cdebug_log(199,0) << "Node's contact has : " << count << " segments" << endl; if (count == 1) { - _tree->add_node( node ); + _tree->addNode( node ); } else if (count > 2) { for ( Component* component : opposite->getSlaveComponents() ) { Segment* segment = dynamic_cast( component ); @@ -288,7 +288,7 @@ namespace Seabreeze { double Elmore::delayElmore ( RoutingPad* rp ) - { return _tree->Delay_Elmore( rp ); } + { return _tree->computeElmoreDelay( rp ); } void Elmore::toTree ( ostream& os ) const diff --git a/Seabreeze/src/SeabreezeEngine.cpp b/Seabreeze/src/SeabreezeEngine.cpp index b45abe34..037e9a2c 100644 --- a/Seabreeze/src/SeabreezeEngine.cpp +++ b/Seabreeze/src/SeabreezeEngine.cpp @@ -143,9 +143,19 @@ namespace Seabreeze { if (plug->getMasterNet()->getDirection() & Net::Direction::DirOut) { continue; } - cdebug_log(199,0) << "| Elmore's delay: " << elmore->delayElmore(rp) << " " << rp << endl; + cdebug_log(199,0) << "| Elmore's delay: " << elmore->delayElmore(rp) << " " << rp << endl; +/* + Contact* ct = nullptr; + for ( Component* comp : rp->getSlaveComponents() ) { + Contact* cont = dynamic_cast(comp); + if (cont) { + ct = cont; + break; + } + } + cerr << "| Elmore's delay: " << elmore->delayElmore(rp) << " " << ct << endl; } - +*/ cdebug_tabw(199,-1); DebugSession::close(); } diff --git a/Seabreeze/src/Tree.cpp b/Seabreeze/src/Tree.cpp index 36679b00..f72d3d24 100644 --- a/Seabreeze/src/Tree.cpp +++ b/Seabreeze/src/Tree.cpp @@ -43,7 +43,7 @@ namespace Seabreeze { } - Node* Tree::get_node ( Contact* contact ) + Node* Tree::getNode ( Contact* contact ) { for ( Node* n : _nodes ) { if (n->contact() == contact) return n; @@ -52,11 +52,11 @@ namespace Seabreeze { } - void Tree::new_node () + void Tree::newNode () { _nodes.push_back( new Node() ); } - void Tree::add_node ( Node* node ) + void Tree::addNode ( Node* node ) { node->setLabel( _nodes.size() ); if (find(_nodes.begin(), _nodes.end(), node) == _nodes.end()) @@ -64,20 +64,20 @@ namespace Seabreeze { } - void Tree::After_i ( Node *ni ) + void Tree::markNodeAfter ( Node *ni ) { if (not ni) return; ni->setAp( 1 ); for ( Node* child : ni->childs() ) { - After_i( child ); + markNodeAfter( child ); } } - set Tree::Branch_i ( Contact* contact ) + set Tree::getParents ( Contact* contact ) { set parents; - Node *ni = get_node( contact ); + Node *ni = getNode( contact ); while ( ni->parent() ) { parents.insert( ni->parent() ); ni = ni->parent(); @@ -86,7 +86,7 @@ namespace Seabreeze { } - double Tree::Delay_Elmore ( RoutingPad* rp ) + double Tree::computeElmoreDelay ( RoutingPad* rp ) { if (not rp) { cerr << Error( "Tree::computeDelay(): Sink RoutingPad argument is NULL." ) << endl; @@ -113,9 +113,9 @@ namespace Seabreeze { cdebug_log(199,0) << " rp=" << rp << endl; cdebug_log(199,0) << " sink=" << sink << endl; - set br = Branch_i( sink ); - Node* ni = get_node( sink ); - After_i( ni ); + set br = getParents( sink ); + Node* ni = getNode( sink ); + markNodeAfter( ni ); ni->setAp( 0 ); // Compute Rt of all nodes diff --git a/Seabreeze/src/seabreeze/Configuration.h b/Seabreeze/src/seabreeze/Configuration.h index 1fdc894e..ab7788b5 100644 --- a/Seabreeze/src/seabreeze/Configuration.h +++ b/Seabreeze/src/seabreeze/Configuration.h @@ -36,7 +36,7 @@ namespace Seabreeze { public : Configuration (); Configuration ( const Configuration& ); - ~Configuration (); + virtual ~Configuration (); virtual Configuration* clone () const; inline double getRct () const; inline double getRsm () const; diff --git a/Seabreeze/src/seabreeze/Elmore.h b/Seabreeze/src/seabreeze/Elmore.h index cd7b0121..4e3c677e 100644 --- a/Seabreeze/src/seabreeze/Elmore.h +++ b/Seabreeze/src/seabreeze/Elmore.h @@ -82,7 +82,7 @@ namespace Seabreeze { class ElmoreProperty : public Hurricane::PrivateProperty { friend class ElmoreExtension; - public: + private: static Name _name; public: static ElmoreProperty* create ( Net* net ); diff --git a/Seabreeze/src/seabreeze/Tree.h b/Seabreeze/src/seabreeze/Tree.h index 64306828..94e7c62f 100644 --- a/Seabreeze/src/seabreeze/Tree.h +++ b/Seabreeze/src/seabreeze/Tree.h @@ -36,26 +36,26 @@ namespace Seabreeze { class Tree { public: - Tree (); - ~Tree (); - inline size_t get_N (); - Node* get_node ( Contact* ); - inline const std::vector& get_node_list () const; - void new_node (); - void add_node ( Node* ); - void After_i ( Node* ); - std::set Branch_i ( Contact* ); - double Delay_Elmore ( RoutingPad* ); - void printNode ( std::ostream& , Node* , size_t depth ); - void print ( std::ostream& ); - void clear (); + Tree (); + ~Tree (); + inline size_t getN (); + Node* getNode ( Contact* ); + inline const std::vector& getNodeList () const; + void newNode (); + void addNode ( Node* ); + void markNodeAfter ( Node* ); + std::set getParents ( Contact* ); + double computeElmoreDelay ( RoutingPad* ); + void printNode ( std::ostream& , Node* , size_t depth ); + void print ( std::ostream& ); + void clear (); private: std::vector _nodes; }; - inline size_t Tree::get_N () { return _nodes.size(); } - inline const std::vector& Tree::get_node_list () const { return _nodes; } + inline size_t Tree::getN () { return _nodes.size(); } + inline const std::vector& Tree::getNodeList () const { return _nodes; } } // Seabreeze namespace.