diff --git a/src/spicelib/devices/isrc/isrcacct.c b/src/spicelib/devices/isrc/isrcacct.c index fb3252147..495f38396 100644 --- a/src/spicelib/devices/isrc/isrcacct.c +++ b/src/spicelib/devices/isrc/isrcacct.c @@ -228,6 +228,9 @@ ISRCaccept(CKTcircuit *ckt, GENmodel *inModel) double RTSEMT = state->RTSEMT; if (ckt->CKTtime == 0) { + /* initialzing here again needed for repeated calls to tran command */ + state->RTScapTime = RTScapTime = exprand(RTSCAPT); + state->RTSemTime = RTSemTime = RTScapTime + exprand(RTSEMT); if (ckt->CKTbreak) { error = CKTsetBreak(ckt, RTScapTime); if(error) diff --git a/src/spicelib/devices/isrc/isrcload.c b/src/spicelib/devices/isrc/isrcload.c index 34804a14f..04017585c 100644 --- a/src/spicelib/devices/isrc/isrcload.c +++ b/src/spicelib/devices/isrc/isrcload.c @@ -327,6 +327,10 @@ INoi1 1 0 DC 0 TRNOISE(0n 0.5n 1 10n) : generate 1/f noise double TS = state -> TS; double RTSAM = state->RTSAM; + /* reset top (hack for repeated tran commands) */ + if (time == 0) + state->top = 0; + /* no noise */ if(TS == 0.0) { value = 0.0; diff --git a/src/spicelib/devices/vsrc/vsrcacct.c b/src/spicelib/devices/vsrc/vsrcacct.c index 25765ca9c..7ce21fda4 100644 --- a/src/spicelib/devices/vsrc/vsrcacct.c +++ b/src/spicelib/devices/vsrc/vsrcacct.c @@ -228,6 +228,10 @@ VSRCaccept(CKTcircuit *ckt, GENmodel *inModel) double RTSEMT = state->RTSEMT; if (ckt->CKTtime == 0) { + /* initialzing here again needed for repeated calls to tran command */ + state->RTScapTime = RTScapTime = exprand(RTSCAPT); + state->RTSemTime = RTSemTime = RTScapTime + exprand(RTSEMT); + if (ckt->CKTbreak) { error = CKTsetBreak(ckt, RTScapTime); if(error) diff --git a/src/spicelib/devices/vsrc/vsrcload.c b/src/spicelib/devices/vsrc/vsrcload.c index 3f5726449..28734b156 100644 --- a/src/spicelib/devices/vsrc/vsrcload.c +++ b/src/spicelib/devices/vsrc/vsrcload.c @@ -345,10 +345,15 @@ VNoi3 3 0 DC 0 TRNOISE(0 0 0 0 15m 22u 50u) : generate RTS noise double TS = state -> TS; double RTSAM = state->RTSAM; + /* reset top (hack for repeated tran commands) */ + if (time == 0) + state->top = 0; + /* no noise */ if(TS == 0.0) { value = 0.0; } else { + /* 1/f and white noise */ size_t n1 = (size_t) floor(time / TS);