res/restemp.c, bug fix, need to update `RESresist' in `REStemp()'
instead of `RESsetup()' to be effective when altering a resistor model parameter or when sweeping a resistor model parameter in a dc analysis. see tests/regression/temper/temper-3.cir
This commit is contained in:
parent
5940bf9294
commit
61724121aa
|
|
@ -52,20 +52,6 @@ RESsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit*ckt, int *state)
|
|||
if(!here->RESscaleGiven) here->RESscale = 1.0;
|
||||
if(!here->RESmGiven) here->RESm = 1.0;
|
||||
if(!here->RESnoisyGiven) here->RESnoisy = 1;
|
||||
if(!here->RESresGiven) {
|
||||
if(here->RESlength * here->RESwidth * model->RESsheetRes > 0.0) {
|
||||
here->RESresist = model->RESsheetRes * (here->RESlength -
|
||||
model->RESshort) / (here->RESwidth - model->RESnarrow);
|
||||
} else {
|
||||
if(model->RESresGiven) {
|
||||
here->RESresist = model->RESres;
|
||||
} else {
|
||||
SPfrontEnd->IFerrorf (ERR_WARNING,
|
||||
"%s: resistance to low, set to 1 mOhm", here->RESname);
|
||||
here->RESresist = 1e-03;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!here->RESbv_maxGiven)
|
||||
here->RESbv_max = model->RESbv_max;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,21 @@ REStemp(GENmodel *inModel, CKTcircuit *ckt)
|
|||
for (here = model->RESinstances; here != NULL ;
|
||||
here=here->RESnextInstance) {
|
||||
|
||||
if (!here->RESresGiven) {
|
||||
if (here->RESlength * here->RESwidth * model->RESsheetRes > 0.0) {
|
||||
here->RESresist =
|
||||
(here->RESlength - model->RESshort) /
|
||||
(here->RESwidth - model->RESnarrow) *
|
||||
model->RESsheetRes;
|
||||
} else if (model->RESresGiven) {
|
||||
here->RESresist = model->RESres;
|
||||
} else {
|
||||
SPfrontEnd->IFerrorf (ERR_WARNING,
|
||||
"%s: resistance to low, set to 1 mOhm", here->RESname);
|
||||
here->RESresist = 1e-03;
|
||||
}
|
||||
}
|
||||
|
||||
/* Default Value Processing for Resistor Instance */
|
||||
|
||||
if(!here->REStempGiven) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue