From d1c0e4882aff2a942ab3ae5e55ed463e10765bd7 Mon Sep 17 00:00:00 2001 From: HoangAnhP Date: Tue, 12 Jul 2022 12:39:37 +0200 Subject: [PATCH] Seabreeze : update on calculating RC; adding explication (brief) of fonctions --- Seabreeze/README.txt | 27 ++++++++++++++++++++++++ Seabreeze/src/Configuration.cpp | 15 +++++++++++++ Seabreeze/src/Seabreeze.cpp | 28 +++++++++++++++++-------- Seabreeze/src/Seabreeze/Configuration.h | 4 ++-- 4 files changed, 63 insertions(+), 11 deletions(-) create mode 100644 Seabreeze/README.txt diff --git a/Seabreeze/README.txt b/Seabreeze/README.txt new file mode 100644 index 00000000..57b022eb --- /dev/null +++ b/Seabreeze/README.txt @@ -0,0 +1,27 @@ +Fonctions dans Seabreeze.cpp : + +--------------------------------------------------------------------- +contFromNet ( Net* net ) +{ + ajouter les contacts dans net au set _conts; +} + +buildTree ( RoutingPad* rp ) +{ + Construire l'arbre de rp, ça veux dire le contact trouvé dans rp sera la racine de l'arbre +} + +build_from_Node ( Node* source, Segment* seg ) +{ + Après avoir crée le premier node / la racine dans buildTree, on va l'utiliser pour construire l'arbre. +} + +build_branch ( double* R, double* C, Contact* contact ) +{ + Parcourir la branche et trouver le Node suivant de l'arbre +} + +Set_RC ( double* R, double* C, Contact* ct, Segment* sm ) +{ + Calculer le RC de la branche ct-sm et ajouter la valeur dans R et C +} diff --git a/Seabreeze/src/Configuration.cpp b/Seabreeze/src/Configuration.cpp index 9cd4492e..39f6ac57 100644 --- a/Seabreeze/src/Configuration.cpp +++ b/Seabreeze/src/Configuration.cpp @@ -65,4 +65,19 @@ namespace Seabreeze { { return _Csm; } +/* + Record* Configuration::_getRecord () const + { + + } + + string Configuration::_getString () const + { + + } +*/ + string Configuration::_getTypeName () const + { + return "Configuration"; + } } diff --git a/Seabreeze/src/Seabreeze.cpp b/Seabreeze/src/Seabreeze.cpp index c4f8e2db..a89e78fd 100644 --- a/Seabreeze/src/Seabreeze.cpp +++ b/Seabreeze/src/Seabreeze.cpp @@ -64,7 +64,7 @@ namespace Seabreeze { return; } - cerr << "Root contact : " << ct << endl; + cerr << "Root contact : " << ct->getId() << endl; cerr << "Start building tree..." << endl; Node* s = new Node(nullptr, ct); @@ -73,7 +73,10 @@ namespace Seabreeze { double C = 0; Set_RC(&R, &C, ct, nullptr); s->R = R; - s->C = 1/C; + if ( C == 0 ) + s->C = 0; + else + s->C = 1/C; //--------------------------------------------------------- Segment* seg = nullptr; int c = 0; @@ -103,14 +106,14 @@ namespace Seabreeze { cdebug_log(199,0) << endl << endl - << "Build from contact : " << s->_contact << endl + << "Build from contact : " << s->_contact->getId() << endl << "With segment : " << seg << endl; Contact* ccont = dynamic_cast(seg->getOppositeAnchor(s->_contact)); if ( not ccont || (s->Np && ccont == (s->Np)->_contact) ) return; - cdebug_log(199,0) << "Target contact : " << ccont << endl; + cdebug_log(199,0) << "Target contact : " << ccont->getId() << endl; //----------------------------------------------------------------------- double Rb = 0; double Cb = 0; @@ -127,7 +130,12 @@ namespace Seabreeze { Node* node = new Node(s, ccont); //----------------------------------------------------------------------- node->R = Rb; - node->C = 1/Cb; + if ( Cb == 0 ) + node->C = 0; + else + node->C = 1/Cb; + + cdebug_log(199,0) << "R = " << Rb << "; C = " << Cb << endl; //----------------------------------------------------------------------- int count = 0; for ( Component* comp : ccont->getSlaveComponents() ) { @@ -145,7 +153,7 @@ namespace Seabreeze { if ( not segmt ) continue; - cdebug_log(199,1) << "Segment : " << segmt << endl; + cdebug_log(199,1) << "Segment : " << segmt->getId() << endl; cdebug_tabw(199,-1); Contact* target = dynamic_cast(segmt->getOppositeAnchor(ccont)); @@ -215,6 +223,7 @@ namespace Seabreeze { else tmp = cct; Set_RC(R, C, tmp, sm); + cdebug_log(199,0) << "tmp = " << tmp << "; sm = " << sm << "; R = " << R << "; C = " << C << endl; } } while ( count == 2 ); @@ -226,8 +235,6 @@ namespace Seabreeze { void Elmore::Set_RC ( double* R, double* C, Contact* ct, Segment* sm ) { double Rct = getConfig()->getRct(); - double Rsm = getConfig()->getRsm(); - double Csm = getConfig()->getCsm(); //double h_ct = DbU::toPhysical(ct->getHeight(), DbU::UnitPower::Nano); double w_ct = DbU::toPhysical(ct->getWidth(), DbU::UnitPower::Nano); @@ -235,15 +242,18 @@ namespace Seabreeze { (*R) += Rct*S_ct; if ( sm == nullptr ) { - cerr << "Segment NULL !" << endl; + C = 0; } else { + double Rsm = getConfig()->getRsm(); + double Csm = getConfig()->getCsm(); double l_sm = DbU::toPhysical(sm->getLength(), DbU::UnitPower::Nano); double w_sm = DbU::toPhysical(sm->getWidth(), DbU::UnitPower::Nano); double S_sm = l_sm*w_sm; (*R) += Rsm*S_sm; (*C) += 1/(Csm*S_sm); } + cdebug_log(199,0) << "ct = " << ct << "; sm = " << sm << "; R = " << R, "; C = " << C << endl; } void Elmore::clearTree () diff --git a/Seabreeze/src/Seabreeze/Configuration.h b/Seabreeze/src/Seabreeze/Configuration.h index 4a89dcf0..aef8f553 100644 --- a/Seabreeze/src/Seabreeze/Configuration.h +++ b/Seabreeze/src/Seabreeze/Configuration.h @@ -45,8 +45,8 @@ namespace Seabreeze { double getRct (); double getRsm (); double getCsm (); - virtual Record* _getRecord () const; - virtual string _getString () const; + //virtual Record* _getRecord () const; + //virtual string _getString () const; virtual string _getTypeName () const; protected : // Attributes