Commit Graph

5733 Commits

Author SHA1 Message Date
rlar bc12b32542 spicelib/devices/{sw,csw}, fix CKTtime += CKTdelmin issue
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)
2018-03-30 21:35:56 +02:00
rlar f159708362 failing testcase, tran freezes 2018-03-30 21:30:01 +02:00
rlar 3a635fcbff davis testcircuit from bug #240, show achieved precision 2018-03-28 23:12:45 +02:00
rlar ae8657f631 testcases 2018-03-28 17:35:53 +02:00
rlar 21c4003dda spicelib/devices/{sw,csw}, #13/, improve SW/CSWtrunc()
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.
2018-03-28 17:29:00 +02:00
rlar 624c523ad3 spicelib/devices/{sw,csw}, #12/, minor, increase similiarity CSW vs SW
to ease diff'ing of those two models

(compile "for i in swacld.c swask.c sw.c swdefs.h swdel.c swdest.c swext.h swinit.c swinit.h switf.h swload.c swmask.c swmdel.c swmpar.c swnoise.c swparam.c swpzld.c swsetup.c swtrunc.c ; do diff -U2 -b -w src/spicelib/devices/sw/$i src/spicelib/devices/csw/c$i ; done" 'diff-mode)
2018-03-28 17:20:48 +02:00
rlar d515a10bde spicelib/devices/{sw,csw}, #10/, bug fix, update CKTstate0[..CSWctrlvalue]
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
2018-03-28 17:18:18 +02:00
rlar 13bb4cac77 spicelib/devices/{sw,csw}, #9/, cleanup, rename missleading zero_stateGiven 2018-03-10 14:19:28 +01:00
rlar 1d998d0c42 spicelib/devices/{sw,csw}, #8/, cleanup, enums
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
2018-03-10 14:12:48 +01:00
rlar 91d4f74b2e spicelib/devices/{sw,csw}, #7/, cleanup, HYST_ON/OFF
clean up the state transition from REALLY_ON/OFF to HYST_ON/OFF
2018-03-10 14:12:20 +01:00
rlar 50ad54e534 spicelib/devices/{sw,csw}, #6/, bug fix, HYST_ON/OFF
> 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
2018-03-10 13:46:02 +01:00
rlar d0599517de spicelib/devices/{sw,csw}, #5/, bug fix, semantics of "state"
> 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.
2018-03-10 11:44:13 +01:00
rlar 56d1d3901d spicelib/devices/{sw,csw}, #4/, clean up negative hysteresis
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
2018-03-10 11:44:05 +01:00
rlar b4db438731 spicelib/devices/{sw,csw}, #3/, clean up negative hysteresis
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
2018-03-10 11:42:43 +01:00
rlar 5bb08ea5c8 spicelib/devices/{sw,csw}, #2/, bug fix, negative hysteresis
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.
2018-03-10 11:42:34 +01:00
rlar bc21f25fe7 spicelib/devices/{sw,csw}, #1/, drop unused assignment 2018-03-10 11:42:33 +01:00
rlar ead6dc4816 spicelib/devices/{sw,csw}, unify CKTstates[] access
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
2018-03-08 19:40:53 +01:00
rlar bcecc19e8b spicelib/devices/{sw,csw}, cleanup for readability
This change is functional invariant, and has been checked
 with gcc for object file in-variance.
For the details see the "rewrite-sw" branch
2018-03-08 18:24:49 +01:00
h_vogt 3dd2115291 frontend/subckt.c, do not put model names into numparam hash table
nobody seems to make use of these entries.
see nupa_type which shrinks to four enum's
2018-03-01 18:13:01 +01:00
rlar b803b294b4 frontend/parser/lexical.c, cp_lexer(), allow # and * comment
Both, whether interactive or not.
Especially for command scripts.
2018-02-26 19:41:04 +01:00
rlar 6903584e99 asrc/asrcacld.c, bug fix, reciproc tc coefficient 2018-02-25 21:59:15 +01:00
Holger Vogt b1aa6cfc87 xspice/enh/enhtrans.c, two2three_translate(), plug a memory leak 2018-02-25 20:05:15 +01:00
rlar 878c9645c7 frontend/outitf.c, drop /* ARGSUSED */ comments 2018-02-22 21:56:05 +01:00
Holger Vogt edc690e26f frontend/outitf.c, plug a memory leak when `.option interp' 2018-02-22 21:55:23 +01:00
Holger Vogt de6654ff72 COPYING, clarify the licenses
add a table of files licensed differently to 'New BSD'

We will try to contact USB officials to obtain a re-licensing of CIDER.
2018-02-22 21:50:52 +01:00
rlar cd1bbf2003 rewrite, use designated initializer for SPICEdev initialisation 2018-02-21 20:02:00 +01:00
rlar 95ef5e79d9 numparam/*, use `pscopy()' 2018-02-20 21:34:06 +01:00
rlar 9ad63cc2c0 numparam/*, plug memory leaks 2018-02-20 21:33:55 +01:00
rlar ea1b83698f numparam/*, drop case conversions
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.
2018-02-20 21:33:32 +01:00
rlar 0200d5c7e9 numparam/*, drop "old style" '&' syntax
Probably an artefact of the external preprocessor implementation
  of numparam.
This syntax seems to have been a non spice macro expansion facility.
2018-02-20 21:30:52 +01:00
rlar 8022aa09a6 spicenum.c, cleanup dicoS usage 2018-02-20 21:30:41 +01:00
rlar aa0dbd20ad spicenum.c, drop putlogfile() 2018-02-20 21:30:15 +01:00
rlar 15c00a9d42 spicenum.c, drop dologfileS, logfileS and nblogS
which are never set
2018-02-20 21:29:50 +01:00
rlar 112f35cc96 nupa_copy(), use skip_back_ws() 2018-02-20 21:29:29 +01:00
rlar 9218b76583 nupa_copy(), cleanup 2018-02-20 21:28:56 +01:00
rlar ec24c1ded7 nupa_copy(), fix lvalue 2018-02-20 21:28:03 +01:00
rlar 06708f1ed1 nupa_copy(), ls ==> s_end - (const) s 2018-02-20 21:27:38 +01:00
rlar 751d377d3e pscopy(), pscopy_up(), use `char *stop' argument
instead of `int length' argument
2018-02-20 21:13:16 +01:00
rlar e21d48a267 pscopy(), pscopy_up(), use _spice_dstring_setlength() return value
instead of invoking spice_dstring_value()
2018-02-20 21:13:05 +01:00
rlar 2ce91b0821 pscopy(), pscopy_up(), expand spice_dstring_reinit() macro
and inline the resulting spice_dstring_setlength() invocation
2018-02-20 21:12:56 +01:00
rlar 2cb579cd9f pscopy(), pscopy_up(), drop `start' argument
which is always zero
2018-02-20 21:12:44 +01:00
rlar 3bd9c1c858 scopyd(), return void 2018-02-20 20:51:30 +01:00
rlar 5164c16a1b numparam/mystring.c, drop unused nadd(), cins(), sins() and spos_() 2018-02-17 19:15:55 +01:00
rlar 468f7580ad nupa_subcktcall(), cleanup using skip_ws() 2018-02-17 19:15:55 +01:00
rlar a38b19bc0e nupa_subcktcall(), reintroduce search for last occurence of the subckt name 2018-02-17 19:15:55 +01:00
rlar c2f519c191 nupa_subcktcall(), drop `p_subname' 2018-02-17 19:15:55 +01:00
rlar 3f5ea23c71 nupa_subcktcall(), drop `ls_ptr'
valid because
neither `jp' nor `gp' will ever be incremented beyond end of string
2018-02-17 19:15:55 +01:00
rlar 437f92385a nupa_subcktcall(), avoid `jp' pointing beyond end of string
The skip whitespace loop in the following line shall
  safely swallow the delimiting space instead
2018-02-17 19:15:55 +01:00
rlar bb9689139b nupa_subcktcall(), drop `parsebuf' and `buf' 2018-02-17 19:15:55 +01:00
rlar 8b1e4fc32c nupa_subcktcall(), introduce search_isolated_identifier()
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.
2018-02-17 19:15:55 +01:00