don't CKTtrunc when we approach the projected switch point by more
than 100 * DBL_EPSILON * CKTtime
to make sure VSRC / ISRC has still room to produce values.
FIXME,
dctran.c might suffer from a similiar, non sw/csw related issue.
it might be necessairy to generally replace CKTdelmin by
MAX(CKTdelmin, HEADROOM * DBL_EPSILON * CKTtime)
shrink the timesteps down to CKTdelmin when aproaching a switchpoint,
but not any further.
fixme, thats not entirely save, consider lastChange==0 too !
Thanks to Alan Gillespie for pointing to this place.
instead of CKTstate1[..CSWswitchstate]
which was introduced in commit:
> commit 0dae4607a0
> Date: Wed Apr 25 18:28:20 2001 +0000
>
> Added a patch to csw and sw from Jon Engelbert dealing with negative hister
reorder enum values for "state" to simplify boolean expressions,
and to make the miss-use of a "double" as "enum" less disturbing.
This commit will cause ngspice to exit()
in certain not thought of cases.
See
> commit 0dae4607a0
> Date: Wed Apr 25 18:28:20 2001 +0000
>
> Added a patch to csw and sw from Jon Engelbert dealing with negative histeresys
which changed "state" to range over {0,1,2,3}
spicelib/devices/{sw,csw}, #8/, cleanup, enums
> commit 0dae4607a0
> Date: Wed Apr 25 18:28:20 2001 +0000
>
> Added a patch to csw and sw from Jon Engelbert dealing with negative histeresys
This commit changed "state" from ranging over {0,1} to ranging over {0,1,2,3}
trying to express the idea of a state transition from REALLY_ON/OFF into
the hysteresis region, but got the HYST_ON/OFF wrong
> commit 0dae4607a0
> Date: Wed Apr 25 18:28:20 2001 +0000
>
> Added a patch to csw and sw from Jon Engelbert dealing with negative histeresys
This commit changed "state" from ranging over {0,1} to ranging over {0,1,2,3}
but did not fix queries to "state" accordingly.
Rewrite special behaviour for negative hysteresis.
This is a functional invariant cleanup of commit:
> commit 0dae4607a0
> Date: Wed Apr 25 18:28:20 2001 +0000
>
> Added a patch to csw and sw from Jon Engelbert dealing with negative histeresys
Rewrite expression for better emphasis of using fabs(hysteresis)
This is a functional invariant cleanup of commit:
> commit 0dae4607a0
> Date: Wed Apr 25 18:28:20 2001 +0000
>
> Added a patch to csw and sw from Jon Engelbert dealing with negative histeresys
fix an aspect of commit:
> commit 0dae4607a0
> Date: Wed Apr 25 18:28:20 2001 +0000
>
> Added a patch to csw and sw from Jon Engelbert dealing with negative histeresys
which allowed negative hysteresis, but didn't fix the usage of hysteresis
in the trunc.c files accordingly.
do it the same way as the other devices do
access CKTstates[][slot] via device specific descriptive macros
access CKTstates[] via CKTstate0 CKTstate1 macros
this patch has been checked for object file in-variance with gcc
inpcom.c is supposed to convert everything to lower case.
Thus we can work case sensitive in numparam,
which is easier compared to a whole set of local case conversions.
the functionality is a bit different though,
because the previous code searched for the *last* occurence of the identifier
yet the new code searches for the first occurence.