Seabreeze : problem solved, tree created with all the contacts. To improve to a better form of tree.
This commit is contained in:
parent
3bd38f4363
commit
d593683394
|
@ -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;
|
||||||
|
|
||||||
Contact* ct = dynamic_cast<Contact*>(c);
|
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*>(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,32 +98,40 @@ 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;
|
}
|
||||||
}
|
else {
|
||||||
else {
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
cerr << "Contact found in the net" << endl;
|
cerr << "Contact found in the net" << endl;
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
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 );
|
||||||
build_from_node(node);
|
//-----------------------------------------------------------------------
|
||||||
}
|
cerr << "Parent node : " << node->Np->_contact << endl;
|
||||||
|
cerr << endl;
|
||||||
|
cerr << endl;
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
build_from_node(node);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue