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

View File

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