|
|
@ -25,7 +25,7 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) |
|
|
* sparse matrix previously provided |
|
|
* sparse matrix previously provided |
|
|
*/ |
|
|
*/ |
|
|
{ |
|
|
{ |
|
|
VSRCmodel *model = (VSRCmodel *)inModel; |
|
|
|
|
|
|
|
|
VSRCmodel *model = (VSRCmodel *) inModel; |
|
|
VSRCinstance *here; |
|
|
VSRCinstance *here; |
|
|
double time; |
|
|
double time; |
|
|
double value = 0.0; |
|
|
double value = 0.0; |
|
|
@ -37,7 +37,7 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) |
|
|
for (here = model->VSRCinstances; here != NULL ; |
|
|
for (here = model->VSRCinstances; here != NULL ; |
|
|
here=here->VSRCnextInstance) { |
|
|
here=here->VSRCnextInstance) { |
|
|
if (here->VSRCowner != ARCHme) continue; |
|
|
if (here->VSRCowner != ARCHme) continue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*(here->VSRCposIbrptr) += 1.0 ; |
|
|
*(here->VSRCposIbrptr) += 1.0 ; |
|
|
*(here->VSRCnegIbrptr) -= 1.0 ; |
|
|
*(here->VSRCnegIbrptr) -= 1.0 ; |
|
|
*(here->VSRCibrPosptr) += 1.0 ; |
|
|
*(here->VSRCibrPosptr) += 1.0 ; |
|
|
@ -59,10 +59,11 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) |
|
|
} |
|
|
} |
|
|
/* use the transient functions */ |
|
|
/* use the transient functions */ |
|
|
switch(here->VSRCfunctionType) { |
|
|
switch(here->VSRCfunctionType) { |
|
|
|
|
|
|
|
|
default: |
|
|
default: |
|
|
value = here->VSRCdcValue; |
|
|
value = here->VSRCdcValue; |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case PULSE: { |
|
|
case PULSE: { |
|
|
double V1, V2, TD, TR, TF, PW, PER; |
|
|
double V1, V2, TD, TR, TF, PW, PER; |
|
|
double basetime = 0; |
|
|
double basetime = 0; |
|
|
@ -88,11 +89,11 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) |
|
|
&& here->VSRCcoeffs[6] != 0.0 |
|
|
&& here->VSRCcoeffs[6] != 0.0 |
|
|
? here->VSRCcoeffs[6] : ckt->CKTfinalTime; |
|
|
? here->VSRCcoeffs[6] : ckt->CKTfinalTime; |
|
|
|
|
|
|
|
|
/* shift time by delay time TD */ |
|
|
|
|
|
|
|
|
/* shift time by delay time TD */ |
|
|
time -= TD; |
|
|
time -= TD; |
|
|
|
|
|
|
|
|
#ifdef XSPICE |
|
|
#ifdef XSPICE |
|
|
/* gtri - begin - wbk - add PHASE parameter */ |
|
|
|
|
|
|
|
|
/* gtri - begin - wbk - add PHASE parameter */ |
|
|
PHASE = here->VSRCfunctionOrder > 7 |
|
|
PHASE = here->VSRCfunctionOrder > 7 |
|
|
? here->VSRCcoeffs[7] : 0.0; |
|
|
? here->VSRCcoeffs[7] : 0.0; |
|
|
|
|
|
|
|
|
@ -100,12 +101,12 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) |
|
|
phase = PHASE / 360.0; |
|
|
phase = PHASE / 360.0; |
|
|
phase = fmod(phase, 1.0); |
|
|
phase = fmod(phase, 1.0); |
|
|
deltat = phase * PER; |
|
|
deltat = phase * PER; |
|
|
while (deltat > 0) |
|
|
|
|
|
|
|
|
while (deltat > 0) |
|
|
deltat -= PER; |
|
|
deltat -= PER; |
|
|
/* shift time by pase (neg. for pos. phase value) */ |
|
|
/* shift time by pase (neg. for pos. phase value) */ |
|
|
time += deltat; |
|
|
time += deltat; |
|
|
/* gtri - end - wbk - add PHASE parameter */ |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
/* gtri - end - wbk - add PHASE parameter */ |
|
|
|
|
|
#endif |
|
|
if(time > PER) { |
|
|
if(time > PER) { |
|
|
/* repeating signal - figure out where we are */ |
|
|
/* repeating signal - figure out where we are */ |
|
|
/* in period */ |
|
|
/* in period */ |
|
|
@ -121,75 +122,73 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) |
|
|
} else { /* time > TR + PW && < TR + PW + TF */ |
|
|
} else { /* time > TR + PW && < TR + PW + TF */ |
|
|
value = V2 + (V1 - V2) * (time - (TR + PW)) / TF; |
|
|
value = V2 + (V1 - V2) * (time - (TR + PW)) / TF; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
case SINE: { |
|
|
case SINE: { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double VO, VA, FREQ, TD, THETA; |
|
|
double VO, VA, FREQ, TD, THETA; |
|
|
/* gtri - begin - wbk - add PHASE parameter */ |
|
|
|
|
|
|
|
|
/* gtri - begin - wbk - add PHASE parameter */ |
|
|
#ifdef XSPICE |
|
|
#ifdef XSPICE |
|
|
double PHASE; |
|
|
double PHASE; |
|
|
double phase; |
|
|
double phase; |
|
|
|
|
|
|
|
|
PHASE = here->VSRCfunctionOrder > 5 |
|
|
PHASE = here->VSRCfunctionOrder > 5 |
|
|
? here->VSRCcoeffs[5] : 0.0; |
|
|
? here->VSRCcoeffs[5] : 0.0; |
|
|
|
|
|
|
|
|
/* compute phase in radians */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* compute phase in radians */ |
|
|
phase = PHASE * M_PI / 180.0; |
|
|
phase = PHASE * M_PI / 180.0; |
|
|
#endif |
|
|
#endif |
|
|
VO = here->VSRCcoeffs[0]; |
|
|
VO = here->VSRCcoeffs[0]; |
|
|
VA = here->VSRCcoeffs[1]; |
|
|
VA = here->VSRCcoeffs[1]; |
|
|
FREQ = here->VSRCfunctionOrder > 2 |
|
|
|
|
|
|
|
|
FREQ = here->VSRCfunctionOrder > 2 |
|
|
&& here->VSRCcoeffs[2] != 0.0 |
|
|
&& here->VSRCcoeffs[2] != 0.0 |
|
|
? here->VSRCcoeffs[2] : (1/ckt->CKTfinalTime); |
|
|
? here->VSRCcoeffs[2] : (1/ckt->CKTfinalTime); |
|
|
TD = here->VSRCfunctionOrder > 3 |
|
|
TD = here->VSRCfunctionOrder > 3 |
|
|
? here->VSRCcoeffs[3] : 0.0; |
|
|
? here->VSRCcoeffs[3] : 0.0; |
|
|
THETA = here->VSRCfunctionOrder > 4 |
|
|
THETA = here->VSRCfunctionOrder > 4 |
|
|
? here->VSRCcoeffs[4] : 0.0; |
|
|
? here->VSRCcoeffs[4] : 0.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
time -= TD; |
|
|
time -= TD; |
|
|
if (time <= 0) { |
|
|
if (time <= 0) { |
|
|
#ifdef XSPICE |
|
|
#ifdef XSPICE |
|
|
value = VO + VA * sin(phase); |
|
|
value = VO + VA * sin(phase); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
value = VO + VA * sin(FREQ*time * 2.0 * M_PI + phase) * |
|
|
|
|
|
exp(-time*THETA); |
|
|
|
|
|
#else |
|
|
|
|
|
|
|
|
value = VO + VA * sin(FREQ*time * 2.0 * M_PI + phase) * |
|
|
|
|
|
exp(-time*THETA); |
|
|
|
|
|
#else |
|
|
value = VO; |
|
|
value = VO; |
|
|
} else { |
|
|
|
|
|
value = VO + VA * sin(FREQ * time * 2.0 * M_PI) * |
|
|
|
|
|
exp(-time*THETA); |
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
value = VO + VA * sin(FREQ * time * 2.0 * M_PI) * |
|
|
|
|
|
exp(-time*THETA); |
|
|
#endif |
|
|
#endif |
|
|
/* gtri - end - wbk - add PHASE parameter */ |
|
|
|
|
|
|
|
|
/* gtri - end - wbk - add PHASE parameter */ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
case EXP: { |
|
|
case EXP: { |
|
|
double V1, V2, TD1, TD2, TAU1, TAU2; |
|
|
double V1, V2, TD1, TD2, TAU1, TAU2; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
V1 = here->VSRCcoeffs[0]; |
|
|
V1 = here->VSRCcoeffs[0]; |
|
|
V2 = here->VSRCcoeffs[1]; |
|
|
V2 = here->VSRCcoeffs[1]; |
|
|
TD1 = here->VSRCfunctionOrder > 2 |
|
|
|
|
|
|
|
|
TD1 = here->VSRCfunctionOrder > 2 |
|
|
&& here->VSRCcoeffs[2] != 0.0 |
|
|
&& here->VSRCcoeffs[2] != 0.0 |
|
|
? here->VSRCcoeffs[2] : ckt->CKTstep; |
|
|
? here->VSRCcoeffs[2] : ckt->CKTstep; |
|
|
TAU1 = here->VSRCfunctionOrder > 3 |
|
|
|
|
|
|
|
|
TAU1 = here->VSRCfunctionOrder > 3 |
|
|
&& here->VSRCcoeffs[3] != 0.0 |
|
|
&& here->VSRCcoeffs[3] != 0.0 |
|
|
? here->VSRCcoeffs[3] : ckt->CKTstep; |
|
|
? here->VSRCcoeffs[3] : ckt->CKTstep; |
|
|
TD2 = here->VSRCfunctionOrder > 4 |
|
|
|
|
|
|
|
|
TD2 = here->VSRCfunctionOrder > 4 |
|
|
&& here->VSRCcoeffs[4] != 0.0 |
|
|
&& here->VSRCcoeffs[4] != 0.0 |
|
|
? here->VSRCcoeffs[4] : TD1 + ckt->CKTstep; |
|
|
? here->VSRCcoeffs[4] : TD1 + ckt->CKTstep; |
|
|
TAU2 = here->VSRCfunctionOrder > 5 |
|
|
|
|
|
|
|
|
TAU2 = here->VSRCfunctionOrder > 5 |
|
|
&& here->VSRCcoeffs[5] |
|
|
&& here->VSRCcoeffs[5] |
|
|
? here->VSRCcoeffs[5] : ckt->CKTstep; |
|
|
? here->VSRCcoeffs[5] : ckt->CKTstep; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(time <= TD1) { |
|
|
if(time <= TD1) { |
|
|
value = V1; |
|
|
value = V1; |
|
|
} else if (time <= TD2) { |
|
|
} else if (time <= TD2) { |
|
|
value = V1 + (V2-V1)*(1-exp(-(time-TD1)/TAU1)); |
|
|
|
|
|
|
|
|
value = V1 + (V2-V1)*(1-exp(-(time-TD1)/TAU1)); |
|
|
} else { |
|
|
} else { |
|
|
value = V1 + (V2-V1)*(1-exp(-(time-TD1)/TAU1)) + |
|
|
value = V1 + (V2-V1)*(1-exp(-(time-TD1)/TAU1)) + |
|
|
(V1-V2)*(1-exp(-(time-TD2)/TAU2)) ; |
|
|
(V1-V2)*(1-exp(-(time-TD2)/TAU2)) ; |
|
|
@ -197,75 +196,78 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
case SFFM:{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case SFFM: { |
|
|
|
|
|
|
|
|
double VO, VA, FC, MDI, FS; |
|
|
double VO, VA, FC, MDI, FS; |
|
|
/* gtri - begin - wbk - add PHASE parameters */ |
|
|
/* gtri - begin - wbk - add PHASE parameters */ |
|
|
#ifdef XSPICE |
|
|
#ifdef XSPICE |
|
|
|
|
|
|
|
|
double PHASEC, PHASES; |
|
|
double PHASEC, PHASES; |
|
|
double phasec; |
|
|
double phasec; |
|
|
double phases; |
|
|
double phases; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHASEC = here->VSRCfunctionOrder > 5 |
|
|
PHASEC = here->VSRCfunctionOrder > 5 |
|
|
? here->VSRCcoeffs[5] : 0.0; |
|
|
|
|
|
|
|
|
? here->VSRCcoeffs[5] : 0.0; |
|
|
PHASES = here->VSRCfunctionOrder > 6 |
|
|
PHASES = here->VSRCfunctionOrder > 6 |
|
|
? here->VSRCcoeffs[6] : 0.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
? here->VSRCcoeffs[6] : 0.0; |
|
|
|
|
|
|
|
|
/* compute phases in radians */ |
|
|
/* compute phases in radians */ |
|
|
phasec = PHASEC * M_PI / 180.0; |
|
|
phasec = PHASEC * M_PI / 180.0; |
|
|
phases = PHASES * M_PI / 180.0; |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
phases = PHASES * M_PI / 180.0; |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
VO = here->VSRCcoeffs[0]; |
|
|
VO = here->VSRCcoeffs[0]; |
|
|
VA = here->VSRCcoeffs[1]; |
|
|
VA = here->VSRCcoeffs[1]; |
|
|
FC = here->VSRCfunctionOrder > 2 |
|
|
|
|
|
|
|
|
FC = here->VSRCfunctionOrder > 2 |
|
|
&& here->VSRCcoeffs[2] |
|
|
&& here->VSRCcoeffs[2] |
|
|
? here->VSRCcoeffs[2] : (1/ckt->CKTfinalTime); |
|
|
? here->VSRCcoeffs[2] : (1/ckt->CKTfinalTime); |
|
|
MDI = here->VSRCfunctionOrder > 3 |
|
|
MDI = here->VSRCfunctionOrder > 3 |
|
|
? here->VSRCcoeffs[3] : 0.0; |
|
|
? here->VSRCcoeffs[3] : 0.0; |
|
|
FS = here->VSRCfunctionOrder > 4 |
|
|
|
|
|
|
|
|
FS = here->VSRCfunctionOrder > 4 |
|
|
&& here->VSRCcoeffs[4] |
|
|
&& here->VSRCcoeffs[4] |
|
|
? here->VSRCcoeffs[4] : (1/ckt->CKTfinalTime); |
|
|
? here->VSRCcoeffs[4] : (1/ckt->CKTfinalTime); |
|
|
|
|
|
|
|
|
#ifdef XSPICE |
|
|
#ifdef XSPICE |
|
|
/* compute waveform value */ |
|
|
/* compute waveform value */ |
|
|
value = VO + VA * |
|
|
|
|
|
|
|
|
value = VO + VA * |
|
|
sin((2.0 * M_PI * FC * time + phasec) + |
|
|
sin((2.0 * M_PI * FC * time + phasec) + |
|
|
MDI * sin(2.0 * M_PI * FS * time + phases)); |
|
|
MDI * sin(2.0 * M_PI * FS * time + phases)); |
|
|
#else |
|
|
#else |
|
|
value = VO + VA * |
|
|
|
|
|
sin((2.0 * M_PI * FC * time) + |
|
|
|
|
|
MDI * sin(2.0 * M_PI * FS * time)); |
|
|
|
|
|
|
|
|
value = VO + VA * |
|
|
|
|
|
sin((2.0 * M_PI * FC * time) + |
|
|
|
|
|
MDI * sin(2.0 * M_PI * FS * time)); |
|
|
#endif |
|
|
#endif |
|
|
/* gtri - end - wbk - add PHASE parameters */ |
|
|
|
|
|
|
|
|
/* gtri - end - wbk - add PHASE parameters */ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case AM:{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case AM: { |
|
|
|
|
|
|
|
|
double VA, FC, MF, VO, TD; |
|
|
double VA, FC, MF, VO, TD; |
|
|
/* gtri - begin - wbk - add PHASE parameters */ |
|
|
|
|
|
|
|
|
/* gtri - begin - wbk - add PHASE parameters */ |
|
|
#ifdef XSPICE |
|
|
#ifdef XSPICE |
|
|
double PHASEC, PHASES; |
|
|
double PHASEC, PHASES; |
|
|
double phasec; |
|
|
double phasec; |
|
|
double phases; |
|
|
double phases; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PHASEC = here->VSRCfunctionOrder > 5 |
|
|
PHASEC = here->VSRCfunctionOrder > 5 |
|
|
? here->VSRCcoeffs[5] : 0.0; |
|
|
|
|
|
|
|
|
? here->VSRCcoeffs[5] : 0.0; |
|
|
PHASES = here->VSRCfunctionOrder > 6 |
|
|
PHASES = here->VSRCfunctionOrder > 6 |
|
|
? here->VSRCcoeffs[6] : 0.0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
? here->VSRCcoeffs[6] : 0.0; |
|
|
|
|
|
|
|
|
/* compute phases in radians */ |
|
|
/* compute phases in radians */ |
|
|
phasec = PHASEC * M_PI / 180.0; |
|
|
phasec = PHASEC * M_PI / 180.0; |
|
|
phases = PHASES * M_PI / 180.0; |
|
|
|
|
|
|
|
|
phases = PHASES * M_PI / 180.0; |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
VA = here->VSRCcoeffs[0]; |
|
|
VA = here->VSRCcoeffs[0]; |
|
|
VO = here->VSRCcoeffs[1]; |
|
|
VO = here->VSRCcoeffs[1]; |
|
|
MF = here->VSRCfunctionOrder > 2 |
|
|
|
|
|
|
|
|
MF = here->VSRCfunctionOrder > 2 |
|
|
&& here->VSRCcoeffs[2] |
|
|
&& here->VSRCcoeffs[2] |
|
|
? here->VSRCcoeffs[2] : (1/ckt->CKTfinalTime); |
|
|
? here->VSRCcoeffs[2] : (1/ckt->CKTfinalTime); |
|
|
FC = here->VSRCfunctionOrder > 3 |
|
|
FC = here->VSRCfunctionOrder > 3 |
|
|
? here->VSRCcoeffs[3] : 0.0; |
|
|
? here->VSRCcoeffs[3] : 0.0; |
|
|
TD = here->VSRCfunctionOrder > 4 |
|
|
|
|
|
|
|
|
TD = here->VSRCfunctionOrder > 4 |
|
|
&& here->VSRCcoeffs[4] |
|
|
&& here->VSRCcoeffs[4] |
|
|
? here->VSRCcoeffs[4] : 0.0; |
|
|
? here->VSRCcoeffs[4] : 0.0; |
|
|
|
|
|
|
|
|
@ -277,16 +279,17 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) |
|
|
/* compute waveform value */ |
|
|
/* compute waveform value */ |
|
|
value = VA * (VO + sin(2.0 * M_PI * MF * time + phases )) * |
|
|
value = VA * (VO + sin(2.0 * M_PI * MF * time + phases )) * |
|
|
sin(2.0 * M_PI * FC * time + phases); |
|
|
sin(2.0 * M_PI * FC * time + phases); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#else |
|
|
#else |
|
|
value = VA * (VO + sin(2.0 * M_PI * MF * time)) * |
|
|
value = VA * (VO + sin(2.0 * M_PI * MF * time)) * |
|
|
sin(2.0 * M_PI * FC * time); |
|
|
sin(2.0 * M_PI * FC * time); |
|
|
#endif |
|
|
|
|
|
|
|
|
#endif |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* gtri - end - wbk - add PHASE parameters */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* gtri - end - wbk - add PHASE parameters */ |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
case PWL: { |
|
|
case PWL: { |
|
|
int i = 0, num_repeat = 0, ii = 0; |
|
|
int i = 0, num_repeat = 0, ii = 0; |
|
|
double foo, repeat_time = 0, end_time, breakpt_time, itime; |
|
|
double foo, repeat_time = 0, end_time, breakpt_time, itime; |
|
|
@ -306,7 +309,7 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) |
|
|
foo = *(here->VSRCcoeffs+2*i+1); |
|
|
foo = *(here->VSRCcoeffs+2*i+1); |
|
|
value = foo; |
|
|
value = foo; |
|
|
goto loadDone; |
|
|
goto loadDone; |
|
|
} else if ( (*(here->VSRCcoeffs+2*i)+repeat_time < time) |
|
|
|
|
|
|
|
|
} else if ( (*(here->VSRCcoeffs+2*i)+repeat_time < time) |
|
|
&& (*(here->VSRCcoeffs+2*(i+1))+repeat_time > time) ) { |
|
|
&& (*(here->VSRCcoeffs+2*(i+1))+repeat_time > time) ) { |
|
|
foo = *(here->VSRCcoeffs+2*i+1) + (((time-(*(here->VSRCcoeffs+2*i)+repeat_time))/ |
|
|
foo = *(here->VSRCcoeffs+2*i+1) + (((time-(*(here->VSRCcoeffs+2*i)+repeat_time))/ |
|
|
(*(here->VSRCcoeffs+2*(i+1)) - *(here->VSRCcoeffs+2*i))) * |
|
|
(*(here->VSRCcoeffs+2*(i+1)) - *(here->VSRCcoeffs+2*i))) * |
|
|
@ -319,7 +322,7 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) |
|
|
value = foo; |
|
|
value = foo; |
|
|
|
|
|
|
|
|
if ( !here->VSRCrGiven ) goto loadDone; |
|
|
if ( !here->VSRCrGiven ) goto loadDone; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end_time = *(here->VSRCcoeffs + here->VSRCfunctionOrder-2); |
|
|
end_time = *(here->VSRCcoeffs + here->VSRCfunctionOrder-2); |
|
|
breakpt_time = *(here->VSRCcoeffs + here->VSRCrBreakpt); |
|
|
breakpt_time = *(here->VSRCcoeffs + here->VSRCrBreakpt); |
|
|
repeat_time = end_time + (end_time - breakpt_time)*num_repeat++ - breakpt_time; |
|
|
repeat_time = end_time + (end_time - breakpt_time)*num_repeat++ - breakpt_time; |
|
|
@ -328,7 +331,7 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/**** tansient noise routines: |
|
|
|
|
|
|
|
|
/**** tansient noise routines: |
|
|
VNoi2 2 0 DC 0 TRNOISE(10n 0.5n 0 0n) : generate gaussian distributed noise |
|
|
VNoi2 2 0 DC 0 TRNOISE(10n 0.5n 0 0n) : generate gaussian distributed noise |
|
|
rms value, time step, 0 0 |
|
|
rms value, time step, 0 0 |
|
|
VNoi1 1 0 DC 0 TRNOISE(0n 0.5n 1 10n) : generate 1/f noise |
|
|
VNoi1 1 0 DC 0 TRNOISE(0n 0.5n 1 10n) : generate 1/f noise |
|
|
@ -368,12 +371,12 @@ VNoi3 3 0 DC 0 TRNOISE(0 0 0 0 15m 22u 50u) : generate RTS noise |
|
|
if(here -> VSRCdcGiven) |
|
|
if(here -> VSRCdcGiven) |
|
|
value += here->VSRCdcValue; |
|
|
value += here->VSRCdcValue; |
|
|
} |
|
|
} |
|
|
break; |
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
case TRRANDOM: { |
|
|
case TRRANDOM: { |
|
|
struct trrandom_state *state = here -> VSRCtrrandom_state; |
|
|
struct trrandom_state *state = here -> VSRCtrrandom_state; |
|
|
value = state -> value; |
|
|
value = state -> value; |
|
|
/* DC value */ |
|
|
|
|
|
|
|
|
/* DC value */ |
|
|
if(here -> VSRCdcGiven) |
|
|
if(here -> VSRCdcGiven) |
|
|
value += here->VSRCdcValue; |
|
|
value += here->VSRCdcValue; |
|
|
} |
|
|
} |
|
|
@ -382,6 +385,7 @@ VNoi3 3 0 DC 0 TRNOISE(0 0 0 0 15m 22u 50u) : generate RTS noise |
|
|
} // switch |
|
|
} // switch |
|
|
} // else (line 48) |
|
|
} // else (line 48) |
|
|
loadDone: |
|
|
loadDone: |
|
|
|
|
|
|
|
|
/* gtri - begin - wbk - modify for supply ramping option */ |
|
|
/* gtri - begin - wbk - modify for supply ramping option */ |
|
|
#ifdef XSPICE_EXP |
|
|
#ifdef XSPICE_EXP |
|
|
value *= ckt->CKTsrcFact; |
|
|
value *= ckt->CKTsrcFact; |
|
|
@ -397,5 +401,6 @@ loadDone: |
|
|
|
|
|
|
|
|
} // for loop instances |
|
|
} // for loop instances |
|
|
} // for loop models |
|
|
} // for loop models |
|
|
|
|
|
|
|
|
return(OK); |
|
|
return(OK); |
|
|
} |
|
|
} |