mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 05:47:42 +02:00
Move the INP2R changes to the more generic place 'CKTmodCrt' and 'CKTcrtElt'
This commit is contained in:
@@ -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];
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user