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

View File

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

View File

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

View File

@ -31,7 +31,7 @@ namespace Seabreeze {
using Hurricane::Component;
//----------------------------------------------------------
//---------------------------------------------------------
// Class : Seabreeze::Tree.
class Tree {
@ -44,7 +44,7 @@ namespace Seabreeze {
void newNode ();
void addNode ( Node* );
void markNodeAfter ( Node* );
std::set<Node*> getParents ( Contact* );
void getBranch ( Contact* );
double computeElmoreDelay ( RoutingPad* );
void printNode ( std::ostream& , Node* , size_t depth );
void print ( std::ostream& );
@ -54,7 +54,7 @@ namespace Seabreeze {
};
inline size_t Tree::getN () { return _nodes.size(); }
inline size_t Tree::getN () { return _nodes.size(); }
inline const std::vector<Node*>& Tree::getNodeList () const { return _nodes; }