Commit Graph

101 Commits

Author SHA1 Message Date
Brian Taylor 57dd3342ef Enable CIDER with KLU for DC, OP, and TRAN analyses. Small signal AC analysis is not yet supported for CIDER complex valued device KLU matrices. The examples/cider testcases produce printed simulation result values which have slight differences between Sparse and KLU. Differences are probably expected and in a few cases are ~1-2%, sometimes a little more. This should be good enough for most CIDER analyses. Francesco did a good piece of work. Runtimes are significantly shorter with KLU. 2025-09-08 23:33:41 +02:00
Holger Vogt c05a6398b7 Reserve enough memory 2024-12-15 10:27:04 +01:00
Holger Vogt 3f26d455c3 Re-formatting for readability 2024-12-15 10:26:51 +01:00
Holger Vogt 33638fc46e Improve error messages 2024-12-15 10:26:42 +01:00
Holger Vogt deb3cd9809 Replace all BOOLEAN, BOOL, _Bool by bool
Remove all #undef bool (set in conjunction with #iclude <Windows.h>)
2024-12-15 10:25:28 +01:00
Brian Taylor 5079b42f26 Fix bug 483 again. Faulty merges of KLU changes for cider were
introduced in ngspice 42. These broke the fix.
2024-11-02 22:45:11 +01:00
Vogt 501a64470f Error and warning messages to stderr 2024-11-02 22:31:47 +01:00
Holger Vogt c11613d1f7 Fix some memory leaks (Patch provided by Brian Taylor) 2023-08-16 11:14:25 +02:00
Francesco Lannutti 02e7c1c5b0 KLU branch rebased upon master @ 3 Feb 2022
Some merge conflicts have not been solved yet
Please look for >>>> HEAD if you want to solve them
2023-08-16 11:14:22 +02:00
Holger Vogt 3bb643c8f5 re-enable CIDER with option sparse by setting CKTkluMODE
in new matrix to CKTkluMODE from current circuit.
2023-08-16 11:14:20 +02:00
Francesco Lannutti 0b7dc09fc1 Fixed the accounting statistics for SPICE and CIDER about number of elements in KLU 2023-08-16 11:14:19 +02:00
Francesco Lannutti 88074a23c9 Fixed 2 files due to rebasing KLU branch on the master branch - 8/7/2020 2023-08-16 11:14:19 +02:00
Francesco Lannutti fe89da2b2c Getting rid of SPARSE for Initial Circuit Matrix creation. Now KLU is totally independent from SPARSE. This opens up the interface for other solvers as well
SPARSE can still used through '.options sparse', but it isn't possible to switch from KLU to SPARSE and viceversa at run-time
2023-08-16 11:14:18 +02:00
Francesco Lannutti 8a8adfe451 First KLU support of CIDER TWOD simulations 2023-08-16 11:14:17 +02:00
Francesco Lannutti 11fb209ee6 First KLU support of CIDER ONED simulations 2023-08-16 11:14:16 +02:00
Holger Vogt e1e2d8a88a Replace | by ||,
bug detected by code analysis
2023-08-13 11:04:19 +02:00
Brian Taylor 251f1e1984 The channel data needs to be freed for some 2D Cider devices. This shows up with some of the examples/cider/parallel circuits. 2023-07-15 11:33:52 +02:00
Holger Vogt d74e43f0f0 Move extern declaration to the top, out of any function.
Thus remove VC2022 compiler warnings.
2023-07-15 11:33:11 +02:00
Brian Taylor 51b361bbf0 When Cider models are present, a normal batch mode sp_shutdown (for example, ngspice -b cmosinv.cir) will call com_quit(NULL). This cleans up so that valgrind will find no leaks in Cider devices after sp_shutdown. To disable this feature, set the environment variable CIDER_COM_QUIT="OFF". Even though it really does not matter that Cider memory is cleared just before exit, it makes it cleaner for valgrind checks. 2023-07-15 11:32:37 +02:00
Brian Taylor 25c1c971e5 Fix the Cider memory leaks from setupContacts. TWOdestroy needed to free the contact nodes. 2023-07-15 11:31:48 +02:00
Brian Taylor db8ac72199 The CONTACT statement does not apply to 1D devices. 2023-07-15 11:31:24 +02:00
Brian Taylor 844ea11a63 Fix some more memory leaks in the CIDER 1D and 2D destroy functions. 2023-07-15 11:31:14 +02:00
Brian Taylor 80e44a32d6 Add missing FREE to reduce some of the Cider memory leaks. 2023-07-15 11:30:02 +02:00
Holger Vogt fc169fe23f CIDER: Plug some memory leak 2023-07-15 11:16:22 +02:00
Holger Vogt 67b2ddbad5 CIDER: Plug some memory leaks by adding to TWOdestroy() 2023-07-15 11:16:13 +02:00
Holger Vogt ffc09208bf send error message to stderr, not to stdout 2022-10-08 16:51:02 +02:00
Brian Taylor 36313d59f3 Use the current point number as the single digit index for Cider 2D ascii save files. This conforms to the normal usage with other types of ascii rawfile. The numd parser table entry for ic.file now has the correct IF_STRING type. 2021-09-29 20:28:59 +02:00
Brian Taylor 663a79dea8 Fix NAN error in numd2 area report and crashes when a doping file is missing. Update examples/cider so that the test circuits all run; add case sensitivity tests for rootfile and ic.file parameter strings enclosed in a single pair of double quotes. 2021-09-29 20:22:56 +02:00
Holger Vogt 85b07e35bf Fixes bug 483
prevent crash when surface mobility (surfmob) has been
selected in 2D simulation.
The patch is provided by Brian Taylor (see
https://sourceforge.net/p/ngspice/mailman/ngspice-devel/thread/e6e921a3-677c-f513-7410-df8568c4bdad%40comcast.net/#msg37318450
)
2021-07-16 10:53:07 +02:00
Holger Vogt 8eeb924460 CIDER: Enable printing either binary or ascii data output to file.
Patch provided by Brian Taylor, see
(https://sourceforge.net/p/ngspice/mailman/message/37309841/)
2021-07-05 14:31:21 +02:00
Holger Vogt 3ad93a50e8 Add EXITPOINTs, if reading inputs etc. fails 2020-04-27 10:09:30 +02:00
Holger Vogt b7012065ae remove compiler warning by setting variables to 0 2020-03-15 08:50:58 +01:00
rlar 84761c125f fix erfc() usage in cider
cider relied on our broken ngspice variant of erfc() which behaved as
  erfc_ngspice(x) = erfc(fabs(x))

Note:
  apart from cider, erfc is used in
    devices/ltra/ltramisc.c
      always with positive argument
  and
    src/frontend/spec.c
      again always with positive argument
Thus, the difference in implementation
 never mathered anywhere except in cider
2017-10-28 12:38:36 +02:00
h_vogt d84387d449 CIDER, use controlled_exit(1) instead of exit(1) 2017-03-25 18:44:00 +01:00
rlar 9dcf62e1cd drop home grown mathematical constants 2016-10-15 15:06:17 +02:00
rlar 141ed61ec8 use memcpy() instead of deprecated bcopy() 2016-07-30 20:58:19 +02:00
rlar 726d0be34c use char variants of the <ctype.h> toxxxx() family 2016-03-09 20:24:36 +01:00
rlar 9546b178fb drop macro `NEW', use TMALLOC instead 2015-12-19 19:38:55 +01:00
rlar 053a56e267 src/ciderlib/oned/onesetup.c, bug fix, access beyond array bounds 2015-12-17 18:51:21 +01:00
rlar c5e0bcde04 cleanup using `hypot()' 2014-12-06 20:41:11 +01:00
rlar 4049e8ec1f rewrite, using IFerrorf() 2014-04-04 21:58:08 +02:00
rlar ea7372efe7 rewrite, useing IFerrorf()
OUTerror() and IFerror() are no more used,
  but kept for compatibility
2014-04-04 21:22:48 +02:00
rlar 7381081226 ciderlib, proper types for newCard(), setCardParm(), askCardQuest() 2013-12-31 16:12:39 +01:00
rlar ccb600f3c1 drop `NIL' macro 2013-12-31 16:12:37 +01:00
rlar 4184aa8c10 cleanup, use array operator
checked for object file invariance on linux with
   ./configure --enable-debug=no --enable-maintainer-mode --with-readline=yes --enable-cider --enable-ndev --enable-pss --enable-xspice
2013-12-31 12:54:43 +01:00
rlar c377b7a6b3 avoid leading underscore in preprocessor macros 2013-12-31 12:54:27 +01:00
Francesco Lannutti 08ec219417 remove all .cvsignore files 2012-10-26 18:30:14 +02:00
rlar cb0a48801d introduce AM_CFLAGS = $(STATIC) 2012-07-07 14:51:39 +02:00
rlar a056ea3065 #3/4 switch realpart() and imagpart() args from ngcomplex* to ngcomplex 2012-02-07 19:53:12 +00:00
rlar afa1371746 #3/6 config.h --> ngspice/config.h, AM_CPPFLAGS 2011-12-27 12:05:51 +00:00