Seabreeze : problem solved, tree created with all the contacts. To improve to a better form of tree.

This commit is contained in:
HoangAnhP 2022-06-13 14:53:36 +02:00
parent 3bd38f4363
commit d593683394
2 changed files with 49 additions and 26 deletions

View File

@ -30,11 +30,20 @@ namespace Seabreeze {
void Elmore::contFromNet ( Net* net ) {
for ( RoutingPad* rp : net->getRoutingPads() ) {
for ( Component* c : rp->getSlaveComponents() ) {
for ( Component* comp : rp->getSlaveComponents() ) {
/* Segment* seg = dynamic_cast<Segment*>(comp);
if ( not seg ) continue;
for( Component* c : seg->getAnchors() ){
Contact* ct = dynamic_cast<Contact*>(c);
if( not ct ) continue;
_conts.insert(ct);
}
Contact* ct = dynamic_cast<Contact*>(seg->getOppositeAnchor(s->_contact));*/
Contact* ct = dynamic_cast<Contact*>(c);
Contact* ct = dynamic_cast<Contact*>(comp);
if ( not ct ) continue;
_conts.insert(ct);
@ -52,7 +61,7 @@ namespace Seabreeze {
for ( Component* c : rp->getSlaveComponents() ) {
Contact* cont = dynamic_cast<Contact*>(c);
if ( cont ) {
if ( cont ) {//&& find(_conts.begin(), _conts.end(), cont) != _conts.end() ) {
ct = cont;
break;
}
@ -62,18 +71,19 @@ namespace Seabreeze {
cerr << "No contact found" << endl;
return;
}
cerr << "Start building tree..." << endl;
cerr << "Root contact : " << ct << endl;
cerr << "Start building tree..." << endl << endl;;
Node* s = new Node(nullptr, ct);
build_from_node(s);
cerr << "Finished building tree !" << endl;
cerr << endl << "Finished building tree !" << endl;
_tree->print(cerr);
}
void Elmore::build_from_node ( Node* s )
{
//-----------------------------------------------------------------------
cerr << "Elmore::build_from_node" << endl;
cerr << "Elmore::build_from_node" << endl;
cerr << "From contact : " << s->_contact << endl;
//-----------------------------------------------------------------------
if ( s->_contact == nullptr ) {
cerr << "No contact found" << s->_contact << endl;
@ -88,33 +98,41 @@ namespace Seabreeze {
for ( Component* comp : (s->_contact)->getSlaveComponents() ) {
Segment* seg = dynamic_cast<Segment*>(comp);
if ( not seg ) continue;
//-----------------------------------------
cerr << "Segment : " << seg << endl;
//-----------------------------------------
if ( not seg ) continue;
Contact* ccont = dynamic_cast<Contact*>(seg->getOppositeAnchor(s->_contact));
//----------------------------------------------------------------
cerr << ccont << endl;
//----------------------------------------------------------------
if ( not ccont )
cerr << "Target contc : " << ccont << endl;
//----------------------------------------------------------------
if ( not ccont || (s->Np && ccont == (s->Np)->_contact) )
continue;
else{
if ( find( checker.begin(), checker.end(), ccont) != checker.end() ) {
cerr << "Net contains a circle. Cannot apply Elmore's delay here !" << endl;
return;
}
else {
else{
if ( find( checker.begin(), checker.end(), ccont) != checker.end() ) {
cerr << "Net contains a circle. Cannot apply Elmore's delay here !" << endl;
return;
}
else {
//-----------------------------------------------------------------------
cerr << "Contact found in the net" << endl;
cerr << "Contact found in the net" << endl;
//-----------------------------------------------------------------------
if ( not s->Np || ccont != (s->Np)->_contact ) {
Node* node = new Node( s, ccont );
build_from_node(node);
}
if ( not s->Np || ccont != (s->Np)->_contact ) {
Node* node = new Node( s, ccont );
//-----------------------------------------------------------------------
cerr << "Parent node : " << node->Np->_contact << endl;
cerr << endl;
cerr << endl;
//-----------------------------------------------------------------------
build_from_node(node);
}
}
}
}
}
}

View File

@ -108,7 +108,12 @@ namespace Seabreeze {
Elmore* elm = ElmoreProperty::create(net)->getElmore();
elm->contFromNet(net);
//-------------------------------------------------------------------------
cerr << endl;
cerr << "There are : " << (elm->get_conts()).size() << " contacts" << endl;
for ( Contact* ct : elm->get_conts() ) {
cerr << ct << endl;
}
cerr << endl;
//-------------------------------------------------------------------------
elm->buildTree(driver);
cerr << "Tree built succesfully !" << endl;