Move the INP2R changes to the more generic place 'CKTmodCrt' and 'CKTcrtElt'

This commit is contained in:
Francesco Lannutti
2018-04-30 01:50:28 +02:00
parent d8611aede8
commit 0b23419e0f
3 changed files with 10 additions and 12 deletions
+5
View File
@@ -31,6 +31,11 @@ CKTmodCrt(CKTcircuit *ckt, int type, GENmodel **modfast, IFuid name)
if (!model) if (!model)
return E_NOMEM; return E_NOMEM;
#ifdef USE_CUSPICE
model->GENnInstances = 0 ;
model->GENinitCUDA = 0 ;
#endif
model->GENmodType = type; model->GENmodType = type;
model->GENmodName = name; model->GENmodName = name;
model->GENnextModel = ckt->CKThead[type]; model->GENnextModel = ckt->CKThead[type];
+5
View File
@@ -56,6 +56,11 @@ CKTcrtElt(CKTcircuit *ckt, GENmodel *modPtr, GENinstance **inInstPtr, IFuid name
DEVices[type]->DEVpublic.name, ckt->CKTstat->STATdevNum[type].instNum); DEVices[type]->DEVpublic.name, ckt->CKTstat->STATdevNum[type].instNum);
#endif #endif
#ifdef USE_CUSPICE
instPtr->GENcudaIndex = modPtr->GENnInstances ;
modPtr->GENnInstances++ ;
#endif
instPtr->GENname = name; instPtr->GENname = name;
instPtr->GENmodPtr = modPtr; instPtr->GENmodPtr = modPtr;
-12
View File
@@ -176,20 +176,8 @@ void INP2R(CKTcircuit *ckt, INPtables * tab, struct card *current)
/* create default R model */ /* create default R model */
IFnewUid(ckt, &uid, NULL, "R", UID_MODEL, NULL); IFnewUid(ckt, &uid, NULL, "R", UID_MODEL, NULL);
IFC(newModel, (ckt, type, &(tab->defRmod), uid)); 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)); 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 */ if (error1 == 1) { /* was a r=val construction */
val = INPevaluate(&line, &error1, 1); /* [<val>] */ val = INPevaluate(&line, &error1, 1); /* [<val>] */
#ifdef TRACE #ifdef TRACE