|
|
@ -126,14 +126,14 @@ char *MIFgetMod( |
|
|
--------------------------*/ |
|
|
--------------------------*/ |
|
|
|
|
|
|
|
|
/* loop through modtable looking for this model (*name) */ |
|
|
/* loop through modtable looking for this model (*name) */ |
|
|
for (modtmp = modtab; modtmp != NULL; modtmp = ((modtmp)->INPnextModel) ) { |
|
|
|
|
|
|
|
|
for (modtmp = modtab; modtmp != NULL; modtmp = modtmp->INPnextModel) { |
|
|
|
|
|
|
|
|
#ifdef TRACE |
|
|
#ifdef TRACE |
|
|
/* SDB debug statement */ |
|
|
/* SDB debug statement */ |
|
|
printf("In MIFgetMod, checking model against stored model = %s . . .\n", (modtmp)->INPmodName ); |
|
|
|
|
|
|
|
|
printf("In MIFgetMod, checking model against stored model = %s . . .\n", modtmp->INPmodName); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
if (strcmp((modtmp)->INPmodName,name) == 0) { |
|
|
|
|
|
|
|
|
if (strcmp(modtmp->INPmodName, name) == 0) { |
|
|
|
|
|
|
|
|
#ifdef TRACE |
|
|
#ifdef TRACE |
|
|
/* SDB debug statement */ |
|
|
/* SDB debug statement */ |
|
|
@ -144,7 +144,7 @@ char *MIFgetMod( |
|
|
/* ============== and return an appropriate pointer to it ===================== */ |
|
|
/* ============== and return an appropriate pointer to it ===================== */ |
|
|
|
|
|
|
|
|
/* make sure the type is valid before proceeding */ |
|
|
/* make sure the type is valid before proceeding */ |
|
|
if( (modtmp)->INPmodType < 0) { |
|
|
|
|
|
|
|
|
if(modtmp->INPmodType < 0) { |
|
|
/* illegal device type, so can't handle */ |
|
|
/* illegal device type, so can't handle */ |
|
|
*model = NULL; |
|
|
*model = NULL; |
|
|
|
|
|
|
|
|
@ -158,11 +158,11 @@ char *MIFgetMod( |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* check to see if this model's parameters have been processed */ |
|
|
/* check to see if this model's parameters have been processed */ |
|
|
if(! ((modtmp)->INPmodUsed )) { |
|
|
|
|
|
|
|
|
if(! modtmp->INPmodUsed) { |
|
|
|
|
|
|
|
|
/* not already processed, so create data struct */ |
|
|
/* not already processed, so create data struct */ |
|
|
error = ft_sim->newModel ( ckt, modtmp->INPmodType, |
|
|
error = ft_sim->newModel ( ckt, modtmp->INPmodType, |
|
|
&((modtmp)->INPmodfast), (modtmp)->INPmodName); |
|
|
|
|
|
|
|
|
&(modtmp->INPmodfast), modtmp->INPmodName); |
|
|
if(error) |
|
|
if(error) |
|
|
return(INPerror(error)); |
|
|
return(INPerror(error)); |
|
|
|
|
|
|
|
|
@ -179,7 +179,7 @@ char *MIFgetMod( |
|
|
/* remaining initializations will be done by MIFmParam() and MIFsetup() */ |
|
|
/* remaining initializations will be done by MIFmParam() and MIFsetup() */ |
|
|
|
|
|
|
|
|
/* parameter isolation, identification, binding */ |
|
|
/* parameter isolation, identification, binding */ |
|
|
line = ((modtmp)->INPmodLine)->line; |
|
|
|
|
|
|
|
|
line = modtmp->INPmodLine->line; |
|
|
INPgetTok(&line,&parm,1); /* throw away '.model' */ |
|
|
INPgetTok(&line,&parm,1); /* throw away '.model' */ |
|
|
INPgetTok(&line,&parm,1); /* throw away 'modname' */ |
|
|
INPgetTok(&line,&parm,1); /* throw away 'modname' */ |
|
|
|
|
|
|
|
|
@ -189,12 +189,12 @@ char *MIFgetMod( |
|
|
|
|
|
|
|
|
while(*line != 0) { |
|
|
while(*line != 0) { |
|
|
INPgetTok(&line,&parm,1); |
|
|
INPgetTok(&line,&parm,1); |
|
|
for(j=0 ; j < *(ft_sim->devices[(modtmp)->INPmodType]->numModelParms); j++) { |
|
|
|
|
|
if (strcmp(parm, ft_sim->devices[(modtmp)->INPmodType]->modelParms[j].keyword) == 0) { |
|
|
|
|
|
|
|
|
for(j=0 ; j < *(ft_sim->devices[modtmp->INPmodType]->numModelParms); j++) { |
|
|
|
|
|
if (strcmp(parm, ft_sim->devices[modtmp->INPmodType]->modelParms[j].keyword) == 0) { |
|
|
/* gtri modification: call MIFgetValue instead of INPgetValue */ |
|
|
/* gtri modification: call MIFgetValue instead of INPgetValue */ |
|
|
err1 = NULL; |
|
|
err1 = NULL; |
|
|
val = MIFgetValue(ckt,&line, |
|
|
val = MIFgetValue(ckt,&line, |
|
|
ft_sim->devices[(modtmp)->INPmodType]->modelParms[j].dataType, |
|
|
|
|
|
|
|
|
ft_sim->devices[modtmp->INPmodType]->modelParms[j].dataType, |
|
|
tab, &err1); |
|
|
tab, &err1); |
|
|
if(err1) { |
|
|
if(err1) { |
|
|
err2 = TMALLOC(char, 25 + strlen(name) + strlen(err1)); |
|
|
err2 = TMALLOC(char, 25 + strlen(name) + strlen(err1)); |
|
|
@ -202,8 +202,8 @@ char *MIFgetMod( |
|
|
return(err2); |
|
|
return(err2); |
|
|
} |
|
|
} |
|
|
error = ft_sim->setModelParm (ckt, |
|
|
error = ft_sim->setModelParm (ckt, |
|
|
(modtmp)->INPmodfast, |
|
|
|
|
|
ft_sim->devices[(modtmp)->INPmodType]-> |
|
|
|
|
|
|
|
|
modtmp->INPmodfast, |
|
|
|
|
|
ft_sim->devices[modtmp->INPmodType]-> |
|
|
modelParms[j].id, val, NULL); |
|
|
modelParms[j].id, val, NULL); |
|
|
if(error) |
|
|
if(error) |
|
|
return(INPerror(error)); |
|
|
return(INPerror(error)); |
|
|
@ -211,7 +211,7 @@ char *MIFgetMod( |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
/* gtri modification: processing of special parameter "level" removed */ |
|
|
/* gtri modification: processing of special parameter "level" removed */ |
|
|
if(j >= *(ft_sim->devices[(modtmp)->INPmodType]->numModelParms)) |
|
|
|
|
|
|
|
|
if(j >= *(ft_sim->devices[modtmp->INPmodType]->numModelParms)) |
|
|
{ |
|
|
{ |
|
|
//err has not been allocated, but free() in INPerrCat() |
|
|
//err has not been allocated, but free() in INPerrCat() |
|
|
|
|
|
|
|
|
@ -232,8 +232,8 @@ char *MIFgetMod( |
|
|
|
|
|
|
|
|
} /* end while end of line not reached */ |
|
|
} /* end while end of line not reached */ |
|
|
|
|
|
|
|
|
(modtmp)->INPmodUsed=1; |
|
|
|
|
|
(modtmp)->INPmodLine->error = err; |
|
|
|
|
|
|
|
|
modtmp->INPmodUsed = 1; |
|
|
|
|
|
modtmp->INPmodLine->error = err; |
|
|
|
|
|
|
|
|
} /* end if model parameters not processed yet */ |
|
|
} /* end if model parameters not processed yet */ |
|
|
|
|
|
|
|
|
|