Fix IND model to work with 'alter' command in CUSPICE

This commit is contained in:
Francesco Lannutti 2018-05-06 20:45:40 +02:00
parent ac1e2b660a
commit 4ea0e8b86d
2 changed files with 20 additions and 0 deletions

View File

@ -11,6 +11,9 @@ Author: 1985 Thomas L. Quarles
#include "ngspice/sperror.h"
#include "ngspice/suffix.h"
#ifdef USE_CUSPICE
#include "ngspice/CUSPICE/CUSPICE.h"
#endif
/* ARGSUSED */
int
@ -65,5 +68,20 @@ INDparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
default:
return(E_BADPARM);
}
#ifdef USE_CUSPICE
int status ;
INDmodel *model ;
model = INDmodPtr(here) ;
if (model->gen.GENinitCUDA) {
model->INDparamCPU.INDinductArray[here->gen.GENcudaIndex] = here->INDinduct;
model->INDparamCPU.INDinitCondArray[here->gen.GENcudaIndex] = here->INDinitCond;
status = cuINDtemp ((GENmodel *)model);
if (status != 0)
return E_NOMEM;
}
#endif
return(OK);
}

View File

@ -196,6 +196,8 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
status = cuINDsetup ((GENmodel *)model) ;
if (status != 0)
return (E_NOMEM) ;
model->gen.GENinitCUDA = 1 ;
}
#endif