gendef.h, get rid of awkward counted GENnode macros
This commit is contained in:
parent
018a2d0e2f
commit
e311096429
|
|
@ -25,15 +25,6 @@ struct GENinstance {
|
|||
/* carefull, thats overlayed into the actual device structs */
|
||||
};
|
||||
|
||||
/* argh, terminals are counted from 1 */
|
||||
#define GENnode1 GENnode[0]
|
||||
#define GENnode2 GENnode[1]
|
||||
#define GENnode3 GENnode[2]
|
||||
#define GENnode4 GENnode[3]
|
||||
#define GENnode5 GENnode[4]
|
||||
#define GENnode6 GENnode[5]
|
||||
#define GENnode7 GENnode[6]
|
||||
|
||||
|
||||
/* per model data */
|
||||
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ TFanal(CKTcircuit *ckt, int restart)
|
|||
}
|
||||
|
||||
if (job->TFinIsI) {
|
||||
ckt->CKTrhs[ptr->GENnode1] -= 1;
|
||||
ckt->CKTrhs[ptr->GENnode2] += 1;
|
||||
ckt->CKTrhs[ptr->GENnode[0]] -= 1;
|
||||
ckt->CKTrhs[ptr->GENnode[1]] += 1;
|
||||
} else {
|
||||
insrc = CKTfndBranch(ckt, job->TFinSrc);
|
||||
ckt->CKTrhs[insrc] += 1;
|
||||
|
|
@ -119,8 +119,8 @@ TFanal(CKTcircuit *ckt, int restart)
|
|||
|
||||
/* now for input resistance */
|
||||
if (job->TFinIsI) {
|
||||
outputs[1] = ckt->CKTrhs[ptr->GENnode2] -
|
||||
ckt->CKTrhs[ptr->GENnode1];
|
||||
outputs[1] = ckt->CKTrhs[ptr->GENnode[1]] -
|
||||
ckt->CKTrhs[ptr->GENnode[0]];
|
||||
} else {
|
||||
if(fabs(ckt->CKTrhs[insrc])<1e-20) {
|
||||
outputs[1]=1e20;
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ URCunsetup(GENmodel *inModel, CKTcircuit *ckt)
|
|||
return E_NOMOD;
|
||||
|
||||
for (in = modfast->GENinstances; in; in = in->GENnextInstance)
|
||||
CKTdltNNum(ckt, in->GENnode1);
|
||||
CKTdltNNum(ckt, in->GENnode[0]);
|
||||
|
||||
CKTdltMod(ckt, modfast); /* Does the elements too */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue