Seabreeze : some changes

This commit is contained in:
HoangAnhP 2022-07-20 17:49:43 +02:00
parent 336b0ad015
commit a6bfbdf825
6 changed files with 43 additions and 33 deletions

View File

@ -132,7 +132,7 @@ namespace Seabreeze {
cerr << Error( "Elmore::buildFromNode(): rootNode has no contact, aborting." ) << endl; cerr << Error( "Elmore::buildFromNode(): rootNode has no contact, aborting." ) << endl;
return; return;
} }
_tree->add_node( rootNode ); _tree->addNode( rootNode );
cdebug_log(199,1) << "Elmore::buildFromNode()" << endl; cdebug_log(199,1) << "Elmore::buildFromNode()" << endl;
cdebug_log(199,0) << "rootNode->_contact=" << rootNode->contact() << 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; cdebug_log(199,0) << "Node's contact has : " << count << " segments" << endl;
if (count == 1) { if (count == 1) {
_tree->add_node( node ); _tree->addNode( node );
} else if (count > 2) { } else if (count > 2) {
for ( Component* component : opposite->getSlaveComponents() ) { for ( Component* component : opposite->getSlaveComponents() ) {
Segment* segment = dynamic_cast<Segment*>( component ); Segment* segment = dynamic_cast<Segment*>( component );
@ -288,7 +288,7 @@ namespace Seabreeze {
double Elmore::delayElmore ( RoutingPad* rp ) double Elmore::delayElmore ( RoutingPad* rp )
{ return _tree->Delay_Elmore( rp ); } { return _tree->computeElmoreDelay( rp ); }
void Elmore::toTree ( ostream& os ) const void Elmore::toTree ( ostream& os ) const

View File

@ -144,8 +144,18 @@ namespace Seabreeze {
continue; 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<Contact*>(comp);
if (cont) {
ct = cont;
break;
}
}
cerr << "| Elmore's delay: " << elmore->delayElmore(rp) << " " << ct << endl;
} }
*/
cdebug_tabw(199,-1); cdebug_tabw(199,-1);
DebugSession::close(); DebugSession::close();
} }

View File

@ -43,7 +43,7 @@ namespace Seabreeze {
} }
Node* Tree::get_node ( Contact* contact ) Node* Tree::getNode ( Contact* contact )
{ {
for ( Node* n : _nodes ) { for ( Node* n : _nodes ) {
if (n->contact() == contact) return n; if (n->contact() == contact) return n;
@ -52,11 +52,11 @@ namespace Seabreeze {
} }
void Tree::new_node () void Tree::newNode ()
{ _nodes.push_back( new Node() ); } { _nodes.push_back( new Node() ); }
void Tree::add_node ( Node* node ) void Tree::addNode ( Node* node )
{ {
node->setLabel( _nodes.size() ); node->setLabel( _nodes.size() );
if (find(_nodes.begin(), _nodes.end(), node) == _nodes.end()) 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; if (not ni) return;
ni->setAp( 1 ); ni->setAp( 1 );
for ( Node* child : ni->childs() ) { for ( Node* child : ni->childs() ) {
After_i( child ); markNodeAfter( child );
} }
} }
set<Node*> Tree::Branch_i ( Contact* contact ) set<Node*> Tree::getParents ( Contact* contact )
{ {
set<Node*> parents; set<Node*> parents;
Node *ni = get_node( contact ); Node *ni = getNode( contact );
while ( ni->parent() ) { while ( ni->parent() ) {
parents.insert( ni->parent() ); parents.insert( ni->parent() );
ni = 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) { if (not rp) {
cerr << Error( "Tree::computeDelay(): Sink RoutingPad argument is NULL." ) << endl; 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) << " rp=" << rp << endl;
cdebug_log(199,0) << " sink=" << sink << endl; cdebug_log(199,0) << " sink=" << sink << endl;
set<Node*> br = Branch_i( sink ); set<Node*> br = getParents( sink );
Node* ni = get_node( sink ); Node* ni = getNode( sink );
After_i( ni ); markNodeAfter( ni );
ni->setAp( 0 ); ni->setAp( 0 );
// Compute Rt of all nodes // Compute Rt of all nodes

View File

@ -36,7 +36,7 @@ namespace Seabreeze {
public : public :
Configuration (); Configuration ();
Configuration ( const Configuration& ); Configuration ( const Configuration& );
~Configuration (); virtual ~Configuration ();
virtual Configuration* clone () const; virtual Configuration* clone () const;
inline double getRct () const; inline double getRct () const;
inline double getRsm () const; inline double getRsm () const;

View File

@ -82,7 +82,7 @@ namespace Seabreeze {
class ElmoreProperty : public Hurricane::PrivateProperty { class ElmoreProperty : public Hurricane::PrivateProperty {
friend class ElmoreExtension; friend class ElmoreExtension;
public: private:
static Name _name; static Name _name;
public: public:
static ElmoreProperty* create ( Net* net ); static ElmoreProperty* create ( Net* net );

View File

@ -36,26 +36,26 @@ namespace Seabreeze {
class Tree { class Tree {
public: public:
Tree (); Tree ();
~Tree (); ~Tree ();
inline size_t get_N (); inline size_t getN ();
Node* get_node ( Contact* ); Node* getNode ( Contact* );
inline const std::vector<Node*>& get_node_list () const; inline const std::vector<Node*>& getNodeList () const;
void new_node (); void newNode ();
void add_node ( Node* ); void addNode ( Node* );
void After_i ( Node* ); void markNodeAfter ( Node* );
std::set<Node*> Branch_i ( Contact* ); std::set<Node*> getParents ( Contact* );
double Delay_Elmore ( RoutingPad* ); double computeElmoreDelay ( RoutingPad* );
void printNode ( std::ostream& , Node* , size_t depth ); void printNode ( std::ostream& , Node* , size_t depth );
void print ( std::ostream& ); void print ( std::ostream& );
void clear (); void clear ();
private: private:
std::vector<Node*> _nodes; std::vector<Node*> _nodes;
}; };
inline size_t Tree::get_N () { return _nodes.size(); } inline size_t Tree::getN () { return _nodes.size(); }
inline const std::vector<Node*>& Tree::get_node_list () const { return _nodes; } inline const std::vector<Node*>& Tree::getNodeList () const { return _nodes; }
} // Seabreeze namespace. } // Seabreeze namespace.