From d5936833949436ead7ab7bfa4c572311ae0c30df Mon Sep 17 00:00:00 2001 From: HoangAnhP Date: Mon, 13 Jun 2022 14:53:36 +0200 Subject: [PATCH] Seabreeze : problem solved, tree created with all the contacts. To improve to a better form of tree. --- Seabreeze/src/Seabreeze.cpp | 70 +++++++++++++++++++------------ Seabreeze/src/SeabreezeEngine.cpp | 5 +++ 2 files changed, 49 insertions(+), 26 deletions(-) diff --git a/Seabreeze/src/Seabreeze.cpp b/Seabreeze/src/Seabreeze.cpp index e61f21bd..ce6e7a16 100644 --- a/Seabreeze/src/Seabreeze.cpp +++ b/Seabreeze/src/Seabreeze.cpp @@ -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(comp); + if ( not seg ) continue; + + for( Component* c : seg->getAnchors() ){ + Contact* ct = dynamic_cast(c); + if( not ct ) continue; + + _conts.insert(ct); + } + Contact* ct = dynamic_cast(seg->getOppositeAnchor(s->_contact));*/ - Contact* ct = dynamic_cast(c); - + Contact* ct = dynamic_cast(comp); if ( not ct ) continue; _conts.insert(ct); @@ -52,7 +61,7 @@ namespace Seabreeze { for ( Component* c : rp->getSlaveComponents() ) { Contact* cont = dynamic_cast(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(comp); + + if ( not seg ) continue; + //----------------------------------------- cerr << "Segment : " << seg << endl; //----------------------------------------- - if ( not seg ) continue; - + Contact* ccont = dynamic_cast(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); } - } + } + } } } diff --git a/Seabreeze/src/SeabreezeEngine.cpp b/Seabreeze/src/SeabreezeEngine.cpp index e06a7b97..499cf509 100644 --- a/Seabreeze/src/SeabreezeEngine.cpp +++ b/Seabreeze/src/SeabreezeEngine.cpp @@ -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;