Move the INP2R changes to the more generic place 'CKTmodCrt' and 'CKTcrtElt'
This commit is contained in:
parent
d8611aede8
commit
0b23419e0f
|
|
@ -31,6 +31,11 @@ CKTmodCrt(CKTcircuit *ckt, int type, GENmodel **modfast, IFuid name)
|
|||
if (!model)
|
||||
return E_NOMEM;
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
model->GENnInstances = 0 ;
|
||||
model->GENinitCUDA = 0 ;
|
||||
#endif
|
||||
|
||||
model->GENmodType = type;
|
||||
model->GENmodName = name;
|
||||
model->GENnextModel = ckt->CKThead[type];
|
||||
|
|
|
|||
|
|
@ -56,6 +56,11 @@ CKTcrtElt(CKTcircuit *ckt, GENmodel *modPtr, GENinstance **inInstPtr, IFuid name
|
|||
DEVices[type]->DEVpublic.name, ckt->CKTstat->STATdevNum[type].instNum);
|
||||
#endif
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
instPtr->GENcudaIndex = modPtr->GENnInstances ;
|
||||
modPtr->GENnInstances++ ;
|
||||
#endif
|
||||
|
||||
instPtr->GENname = name;
|
||||
|
||||
instPtr->GENmodPtr = modPtr;
|
||||
|
|
|
|||
|
|
@ -176,20 +176,8 @@ void INP2R(CKTcircuit *ckt, INPtables * tab, struct card *current)
|
|||
/* create default R model */
|
||||
IFnewUid(ckt, &uid, NULL, "R", UID_MODEL, NULL);
|
||||
IFC(newModel, (ckt, type, &(tab->defRmod), uid));
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
tab->defRmod->GENnInstances = 0 ;
|
||||
tab->defRmod->GENinitCUDA = 0 ;
|
||||
#endif
|
||||
|
||||
}
|
||||
IFC(newInstance, (ckt, tab->defRmod, &fast, name));
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
fast->GENcudaIndex = tab->defRmod->GENnInstances ;
|
||||
tab->defRmod->GENnInstances++ ;
|
||||
#endif
|
||||
|
||||
if (error1 == 1) { /* was a r=val construction */
|
||||
val = INPevaluate(&line, &error1, 1); /* [<val>] */
|
||||
#ifdef TRACE
|
||||
|
|
|
|||
Loading…
Reference in New Issue