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:
rlar 2015-08-09 17:20:50 +02:00
parent 5940bf9294
commit 61724121aa
2 changed files with 15 additions and 14 deletions

View File

@ -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;

View File

@ -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) {