inp_evaluate_temper(), add struct circ argument

This commit is contained in:
rlar 2017-03-25 21:35:54 +01:00
parent fa13e422cd
commit f2f2b3b09a
4 changed files with 13 additions and 10 deletions

View File

@ -748,7 +748,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
/* Now the circuit is defined, so generate the parse trees */
inp_parse_temper_trees();
/* Get the actual data for model and device instance parameters */
inp_evaluate_temper();
inp_evaluate_temper(ft_curckt);
}
/* linked list dbs is used to store the "save" or .save data (defined in breakp2.c),
@ -1583,7 +1583,7 @@ inp_parse_temper_trees(void)
void
inp_evaluate_temper(void)
inp_evaluate_temper(struct circ *circ)
{
struct pt_temper *d;
double result;
@ -1598,10 +1598,10 @@ inp_evaluate_temper(void)
for(d = modtlist; d; d = d->next) {
char *name = d->wl->wl_word;
INPretrieve(&name, ft_curckt->ci_symtab);
INPretrieve(&name, circ->ci_symtab);
/* only evaluate models which have been entered into the
hash table ckt->MODnameHash */
if (ft_sim->findModel (ft_curckt->ci_ckt, name) == NULL)
if (ft_sim->findModel (circ->ci_ckt, name) == NULL)
continue;
IFeval((IFparseTree *) d->pt, 1e-12, &result, NULL, NULL);
if (d->wlend->wl_word)

View File

@ -449,6 +449,7 @@ extern int NIpred(CKTcircuit *ckt);
extern IFfrontEnd *SPfrontEnd;
extern bool expr_w_temper;
extern void inp_evaluate_temper(void);
struct circ;
extern void inp_evaluate_temper(struct circ *ckt);
#endif

View File

@ -9,6 +9,7 @@ Modified: 2000 AlansFixes
#include "ngspice/sperror.h"
#include "ngspice/trandefs.h"
#include "ngspice/cpextern.h"
#include "ngspice/fteext.h"
#include "analysis.h"
@ -116,7 +117,7 @@ CKTdoJob(CKTcircuit *ckt, int reset, TSKtask *task)
/* call altermod and alter on device and model parameters assembled in
devtlist and modtlist (if using temper) because we have a new temperature */
if (expr_w_temper)
inp_evaluate_temper();
inp_evaluate_temper(ft_curckt);
error = 0;

View File

@ -13,6 +13,7 @@ Modified: 1999 Paolo Nenzi
#include "ngspice/cktdefs.h"
#include "ngspice/const.h"
#include "ngspice/sperror.h"
#include "ngspice/fteext.h"
#ifdef XSPICE
#include "ngspice/evt.h"
@ -144,7 +145,7 @@ DCtrCurv(CKTcircuit *ckt, int restart)
job->TRCVvType[i] = TEMP_CODE; /* Set the sweep type code */
ckt->CKTtemp = job->TRCVvStart[i] + CONSTCtoK; /* Set the new circuit temp */
if (expr_w_temper)
inp_evaluate_temper();
inp_evaluate_temper(ft_curckt);
CKTtemp(ckt);
goto found;
}
@ -277,7 +278,7 @@ DCtrCurv(CKTcircuit *ckt, int restart)
} else if (job->TRCVvType[i] == TEMP_CODE) {
ckt->CKTtemp = job->TRCVvStart[i] + CONSTCtoK;
if (expr_w_temper)
inp_evaluate_temper();
inp_evaluate_temper(ft_curckt);
CKTtemp(ckt);
} else if (job->TRCVvType[i] == rcode) {
((RESinstance *)(job->TRCVvElt[i]))->RESresist =
@ -471,7 +472,7 @@ DCtrCurv(CKTcircuit *ckt, int restart)
} else if (job->TRCVvType[i] == TEMP_CODE) { /* temperature */
ckt->CKTtemp += job->TRCVvStep[i];
if (expr_w_temper)
inp_evaluate_temper();
inp_evaluate_temper(ft_curckt);
CKTtemp(ckt);
}
@ -509,7 +510,7 @@ DCtrCurv(CKTcircuit *ckt, int restart)
} else if (job->TRCVvType[i] == TEMP_CODE) {
ckt->CKTtemp = job->TRCVvSave[i];
if (expr_w_temper)
inp_evaluate_temper();
inp_evaluate_temper(ft_curckt);
CKTtemp(ckt);
}