Seabreeze : update on calculating RC; adding explication (brief) of fonctions

This commit is contained in:
HoangAnhP 2022-07-12 12:39:37 +02:00
parent 157532af48
commit d1c0e4882a
4 changed files with 63 additions and 11 deletions

27
Seabreeze/README.txt Normal file
View File

@ -0,0 +1,27 @@
Fonctions dans Seabreeze.cpp :
---------------------------------------------------------------------
contFromNet ( Net* net )
{
ajouter les contacts dans net au set<Contact*> _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
}

View File

@ -65,4 +65,19 @@ namespace Seabreeze {
{ {
return _Csm; return _Csm;
} }
/*
Record* Configuration::_getRecord () const
{
}
string Configuration::_getString () const
{
}
*/
string Configuration::_getTypeName () const
{
return "Configuration";
}
} }

View File

@ -64,7 +64,7 @@ namespace Seabreeze {
return; return;
} }
cerr << "Root contact : " << ct << endl; cerr << "Root contact : " << ct->getId() << endl;
cerr << "Start building tree..." << endl; cerr << "Start building tree..." << endl;
Node* s = new Node(nullptr, ct); Node* s = new Node(nullptr, ct);
@ -73,7 +73,10 @@ namespace Seabreeze {
double C = 0; double C = 0;
Set_RC(&R, &C, ct, nullptr); Set_RC(&R, &C, ct, nullptr);
s->R = R; s->R = R;
s->C = 1/C; if ( C == 0 )
s->C = 0;
else
s->C = 1/C;
//--------------------------------------------------------- //---------------------------------------------------------
Segment* seg = nullptr; Segment* seg = nullptr;
int c = 0; int c = 0;
@ -103,14 +106,14 @@ namespace Seabreeze {
cdebug_log(199,0) << endl cdebug_log(199,0) << endl
<< endl << endl
<< "Build from contact : " << s->_contact << endl << "Build from contact : " << s->_contact->getId() << endl
<< "With segment : " << seg << endl; << "With segment : " << seg << endl;
Contact* ccont = dynamic_cast<Contact*>(seg->getOppositeAnchor(s->_contact)); Contact* ccont = dynamic_cast<Contact*>(seg->getOppositeAnchor(s->_contact));
if ( not ccont || (s->Np && ccont == (s->Np)->_contact) ) if ( not ccont || (s->Np && ccont == (s->Np)->_contact) )
return; return;
cdebug_log(199,0) << "Target contact : " << ccont << endl; cdebug_log(199,0) << "Target contact : " << ccont->getId() << endl;
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
double Rb = 0; double Rb = 0;
double Cb = 0; double Cb = 0;
@ -127,7 +130,12 @@ namespace Seabreeze {
Node* node = new Node(s, ccont); Node* node = new Node(s, ccont);
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
node->R = Rb; 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; int count = 0;
for ( Component* comp : ccont->getSlaveComponents() ) { for ( Component* comp : ccont->getSlaveComponents() ) {
@ -145,7 +153,7 @@ namespace Seabreeze {
if ( not segmt ) if ( not segmt )
continue; continue;
cdebug_log(199,1) << "Segment : " << segmt << endl; cdebug_log(199,1) << "Segment : " << segmt->getId() << endl;
cdebug_tabw(199,-1); cdebug_tabw(199,-1);
Contact* target = dynamic_cast<Contact*>(segmt->getOppositeAnchor(ccont)); Contact* target = dynamic_cast<Contact*>(segmt->getOppositeAnchor(ccont));
@ -215,6 +223,7 @@ namespace Seabreeze {
else else
tmp = cct; tmp = cct;
Set_RC(R, C, tmp, sm); Set_RC(R, C, tmp, sm);
cdebug_log(199,0) << "tmp = " << tmp << "; sm = " << sm << "; R = " << R << "; C = " << C << endl;
} }
} while ( count == 2 ); } while ( count == 2 );
@ -226,8 +235,6 @@ namespace Seabreeze {
void Elmore::Set_RC ( double* R, double* C, Contact* ct, Segment* sm ) { void Elmore::Set_RC ( double* R, double* C, Contact* ct, Segment* sm ) {
double Rct = getConfig()->getRct(); double Rct = getConfig()->getRct();
double Rsm = getConfig()->getRsm();
double Csm = getConfig()->getCsm();
//double h_ct = DbU::toPhysical(ct->getHeight(), DbU::UnitPower::Nano); //double h_ct = DbU::toPhysical(ct->getHeight(), DbU::UnitPower::Nano);
double w_ct = DbU::toPhysical(ct->getWidth(), DbU::UnitPower::Nano); double w_ct = DbU::toPhysical(ct->getWidth(), DbU::UnitPower::Nano);
@ -235,15 +242,18 @@ namespace Seabreeze {
(*R) += Rct*S_ct; (*R) += Rct*S_ct;
if ( sm == nullptr ) { if ( sm == nullptr ) {
cerr << "Segment NULL !" << endl; C = 0;
} }
else { else {
double Rsm = getConfig()->getRsm();
double Csm = getConfig()->getCsm();
double l_sm = DbU::toPhysical(sm->getLength(), DbU::UnitPower::Nano); double l_sm = DbU::toPhysical(sm->getLength(), DbU::UnitPower::Nano);
double w_sm = DbU::toPhysical(sm->getWidth(), DbU::UnitPower::Nano); double w_sm = DbU::toPhysical(sm->getWidth(), DbU::UnitPower::Nano);
double S_sm = l_sm*w_sm; double S_sm = l_sm*w_sm;
(*R) += Rsm*S_sm; (*R) += Rsm*S_sm;
(*C) += 1/(Csm*S_sm); (*C) += 1/(Csm*S_sm);
} }
cdebug_log(199,0) << "ct = " << ct << "; sm = " << sm << "; R = " << R, "; C = " << C << endl;
} }
void Elmore::clearTree () void Elmore::clearTree ()

View File

@ -45,8 +45,8 @@ namespace Seabreeze {
double getRct (); double getRct ();
double getRsm (); double getRsm ();
double getCsm (); double getCsm ();
virtual Record* _getRecord () const; //virtual Record* _getRecord () const;
virtual string _getString () const; //virtual string _getString () const;
virtual string _getTypeName () const; virtual string _getTypeName () const;
protected : protected :
// Attributes // Attributes