Seabreeze : optimise with new attribute of Node + fix wrong formula of Elmore's delay

This commit is contained in:
HoangAnhP 2022-07-21 11:44:44 +02:00
parent a6bfbdf825
commit b65821282c
4 changed files with 17 additions and 17 deletions

View File

@ -27,7 +27,7 @@ namespace Seabreeze {
, _parent (nullptr) , _parent (nullptr)
, _childs () , _childs ()
, _contact(nullptr) , _contact(nullptr)
, _label (-1) , _label (0)
, _ap (0) , _ap (0)
{ } { }
@ -39,7 +39,7 @@ namespace Seabreeze {
, _parent (parent) , _parent (parent)
, _childs () , _childs ()
, _contact(contact) , _contact(contact)
, _label (-1) , _label (0)
, _ap (0) , _ap (0)
{ {
if (parent) parent->addChild( this ); if (parent) parent->addChild( this );

View File

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

View File

@ -58,7 +58,6 @@ namespace Seabreeze {
void Tree::addNode ( Node* node ) void Tree::addNode ( Node* node )
{ {
node->setLabel( _nodes.size() );
if (find(_nodes.begin(), _nodes.end(), node) == _nodes.end()) if (find(_nodes.begin(), _nodes.end(), node) == _nodes.end())
_nodes.push_back( node ); _nodes.push_back( node );
} }
@ -74,15 +73,18 @@ namespace Seabreeze {
} }
set<Node*> Tree::getParents ( Contact* contact ) void Tree::getBranch ( Contact* contact )
{ {
set<Node*> parents; for ( Node* n : _nodes ) {
n->setLabel(0);
}
Node *ni = getNode( contact ); Node *ni = getNode( contact );
ni->setLabel(1);
while ( ni->parent() ) { while ( ni->parent() ) {
parents.insert( ni->parent() ); ni->parent()->setLabel(1);
ni = ni->parent(); ni = ni->parent();
} }
return parents;
} }
@ -113,18 +115,17 @@ 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 = getParents( sink ); getBranch( sink );
Node* ni = getNode( sink ); Node* ni = getNode( sink );
markNodeAfter( ni ); markNodeAfter( ni );
ni->setAp( 0 ); ni->setAp( 0 );
// Compute Rt of all nodes // Compute Rt of all nodes
for ( size_t k = 0; k < _nodes.size(); k++ ) { for ( size_t k = 0; k < _nodes.size(); k++ ) {
if (k == 0) if (k == 0)
_nodes[k]->setRt( _nodes[k]->R() ); _nodes[k]->setRt( _nodes[k]->R() );
else { else {
if (_nodes[k]->ap() == 0) { if (_nodes[k]->ap() == 0) {
if (br.count(_nodes[k]) > 0) { if (_nodes[k]->label() == 1) {
_nodes[k]->setRt( _nodes[k]->parent()->Rt() + _nodes[k]->R() ); _nodes[k]->setRt( _nodes[k]->parent()->Rt() + _nodes[k]->R() );
} else { } else {
_nodes[k]->setRt( _nodes[k]->parent()->Rt() ); _nodes[k]->setRt( _nodes[k]->parent()->Rt() );
@ -134,7 +135,6 @@ namespace Seabreeze {
} }
} }
} }
// Compute Elmore delay time // Compute Elmore delay time
double delay = 0.0; double delay = 0.0;
for ( size_t k = 0; k < _nodes.size(); k++ ) { for ( size_t k = 0; k < _nodes.size(); k++ ) {

View File

@ -31,7 +31,7 @@ namespace Seabreeze {
using Hurricane::Component; using Hurricane::Component;
//---------------------------------------------------------- //---------------------------------------------------------
// Class : Seabreeze::Tree. // Class : Seabreeze::Tree.
class Tree { class Tree {
@ -44,7 +44,7 @@ namespace Seabreeze {
void newNode (); void newNode ();
void addNode ( Node* ); void addNode ( Node* );
void markNodeAfter ( Node* ); void markNodeAfter ( Node* );
std::set<Node*> getParents ( Contact* ); void getBranch ( Contact* );
double computeElmoreDelay ( 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& );