From 413d0ff1035e89a25ec4f3055a91332d1afa37eb Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sun, 21 Nov 2010 00:11:43 +0000 Subject: [PATCH] PULSE: correct timing in case of phase != 0 --- ChangeLog | 5 ++--- src/spicelib/devices/vsrc/vsrcacct.c | 14 +++----------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4bfc6a75..b4621642d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,5 @@ -2010-11-20 - * vsracct.c: allow time < 0.0 if no XSPICE A device - FIXME has to be investigated further! +2010-11-20 Holger Vogt + * vsracct.c: correct timing in case of phase != 0 2010-11-19 Robert Larice * */** : diff --git a/src/spicelib/devices/vsrc/vsrcacct.c b/src/spicelib/devices/vsrc/vsrcacct.c index 7ec93c925..ef17b0a36 100644 --- a/src/spicelib/devices/vsrc/vsrcacct.c +++ b/src/spicelib/devices/vsrc/vsrcacct.c @@ -68,18 +68,11 @@ VSRCaccept(CKTcircuit *ckt, GENmodel *inModel) && here->VSRCcoeffs[6] != 0.0 ? here->VSRCcoeffs[6] : ckt->CKTfinalTime; #ifdef XSPICE - PHASE = here->VSRCfunctionOrder > 8 + PHASE = here->VSRCfunctionOrder > 7 ? here->VSRCcoeffs[7] : 0.0; #endif /* offset time by delay and limit to zero */ time = ckt->CKTtime - TD; -#ifdef XSPICE - /* FIXME Why is this here? - For now: Add it only if A devices are present. - h_vogt */ - if ((ckt->CKTadevFlag == 1) && (time < 0.0)) - time = 0.0; -#endif #ifdef XSPICE /* normalize phase to 0 - 2PI */ @@ -89,11 +82,10 @@ VSRCaccept(CKTcircuit *ckt, GENmodel *inModel) /* compute equivalent delta time and add to time */ deltat = (phase / (2 * M_PI)) * PER; - time += deltat; + time += deltat; + TD -= deltat; #endif /* gtri - end - wbk - add PHASE parameter */ - - if(time >= PER) { /* repeating signal - figure out where we are */