Commit Graph

7476 Commits

Author SHA1 Message Date
Holger Vogt 8a87d0f620 Fix a bug with the alter statement
lower case for device name, when sent from shared ngspice
or from interactive mode.
2021-08-07 16:39:46 +02:00
Holger Vogt d171c2dbea notice to enforce compiling and installing the code models 2021-08-02 17:09:33 +02:00
Vyacheslav Shevchuk c4470db441 XSPICE: fix double delta subtraction in dll mode
The problem is in XSPICE breakpoints handling and dll mode.
When ngspice is built as dll, it delegates CKTtime - CKTdelta
operation to the dll client using sharedsync call. Delta that
needs to be subtracted is passed as an olddelta argument, and
the client must subtract it if there are convergence issues.
If the client does not add a callback for this operation, default
implementation begins to work and substracts olddelta from CKTtime.
The problem is in breakpoints. When an analog breakpoint is between
the last accepted timepoint and CKTTime, then ngspice substracts
CKTdelta from CKTtime and passes 0 as olddelta to sharedsync.
It is ok. The problem is in XSPICE breakpoints. If XSPICE breakpoint is
set between the last accepted timepoint and CKTtime, then ngspice
substracts CKTdelta but pass non-zero olddelta to sharedsync.
As a result, olddelta is subtracted twice, and CKTtime becomes
less than the last accepted timepoint, which is incorrect.

The solution is to inform sharedsync call that olddelta has already
been subtracted from CKTtime during XSPICE breakpoint processing.
olddelta can't be set to 0 during XSPICE breakpoint handling because
it also takes part in the "timestep too small" check.

That is why a new flag has been introduced. It should be reset during
each iteration and set to 1 only when there are no convergence issues
and there are breakpoints between the last accepted timepoint and
CKTtime. If it is set, then DCtran knows that olddelta need to be set
to zero.

This issue has been fixed for SHARED_MODULE option only. Looks like
CLUSTER feature also uses incorrect olddelta, and it has to take into
account the XSPICE breakpoints flag. This problem has not been fixed
because we can't properly test this case.

WARNING: sharedsync is still broken if the library client decides
to use a callback for step delta managing and discard a valid
delta after the successful integration step. EVTBackup may drop
valid points in this case. The rule of thumb: do not set
GetSyncData callback in ngSpice_Init_Sync.
2021-08-01 12:02:15 +02:00
Holger Vogt 39b4f2733f When transferring boolean data over the ABI, keep them as boolean types, not integer
Replace the type of all boolean variables around the ABI by NG_BOOL.
NG_BOOL is typedefed to _Bool, when compiling shared ngspice. When
sharedspice.h is use externally NG_BOOL is typdefed to bool
2021-07-31 12:53:55 +02:00
Holger Vogt d4b495d6ab Add a small chapter on ngspice as shared library. 2021-07-30 14:10:47 +02:00
Carsten Schoenert 2ad3aa9276 configure.ac: Adding version string for LIB_NGSPICE_API
This isn't currently used but can be used in various places to
automatically provide the internal API version that is used.
Normally developers doesn't want to break the API by introducing a
version bump as this means the new library isn't backward compatible
any more.

E.g. the API version can be used to enhance the name of the library,
quite often libraries with an API version 0 don't add this version to
library name (like ngspice is doing this too right now).
2021-07-28 15:51:09 +02:00
Carsten Schoenert 915bca93a0 src/Makefile.am: Adopt used variables for lib versioning
A small adjustment so the configured ABI version from configure.ac will
get used for creating the libngspice library.
2021-07-28 15:51:09 +02:00
Carsten Schoenert a357108736 libtool: Adding helping content for API versioning
Doing the libtool versioning right can be a bit tedious. Especially the
correct handling of the various versions for the libtool .so naming is
difficult to understand if this part isn't done often.

To improve the API versioning adding some helping text what the various
version number are intended for and how to handle these within the
life cycle and development of the Ngspice project.

Basically libtool uses 'current', 'revision' and 'age' to version a
library.
Here a short outline how to do the libtool versioning:

 Only bug fixing did happen, no new symbols were added, the new library
 provide the exact amount and behaviour of the existing symbols.

 --> Increase the 'revision' by 1 (c:r+1:a)

 New symbols were added, the behaviour of the existing symbols doesn't
 have changed.

 --> Increase the 'age' by 1, set 'revision' to 0 (c:r=0,a+1)

 Existing symbols behave now different or existing symbols were removed.

 --> Increase 'current' by 1, set 'revison' to 0, set 'age' to 0 (c+1,r=0,a=0)
 !!!Note!!!
 The ABI version is also affected by this (needs a bump too, the library
 isn't backward compatible any more.
2021-07-28 15:51:09 +02:00
Holger Vogt 1720745a85 XSPICE delay: add some more safeguards 2021-07-27 11:45:38 +02:00
Holger Vogt ee2c71563d move examples file to prpoer xspice folder 2021-07-27 11:39:11 +02:00
Holger Vogt 544bf76d3b Write some output to file with raw file or table format. 2021-07-24 13:58:54 +02:00
Holger Vogt 7585405ca1 Circuit (ring oscillator) with various current and voltage measurements
inside and outside of subcircuits
2021-07-24 13:58:44 +02:00
Holger Vogt a17cd1c38a compile script for shared ngspice library 2021-07-24 12:27:34 +02:00
Holger Vogt 3d0cc0e7a7 Add library versioning according to
https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html#Libtool-versioning
Add package versioning with m4 macros
2021-07-24 10:29:06 +02:00
Holger Vogt 71fa627d55 Prepare ngspice-35 2021-07-20 21:44:31 +02:00
Holger Vogt 6260e2f5d7 Prepare ngspice-35 2021-07-20 16:35:13 +02:00
Holger Vogt ac733a4d33 Preliminary fix for the 'interpolate' function.
Interpolation of 1D vectors is o.k. now,
multi-dimensional vectors are not (yet) supported.
2021-07-20 16:21:15 +02:00
Holger Vogt 9a42a95bcc new file name (transfer characteristics inside) 2021-07-20 14:20:52 +02:00
Holger Vogt a6ca0414e9 Update to psp model files and examples
NMOS, PMOS, inverter, ring oscillator
2021-07-20 14:20:36 +02:00
Holger Vogt 0b16bda413 Don't write past '\0', fixes a bug in commit
1c5e0d11d ("If there is a XSPICE code model .model line with
file input, keep quotes and case for the file path.", 2021-07-15)
2021-07-20 14:20:17 +02:00
Holger Vogt 3c21b1e464 Check for double '{', replace the inner '{', '}' by '(', ')'
in .subckt or .model (which both may stem from external sources)
2021-07-16 20:13:52 +02:00
Holger Vogt 154632911e 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:26:11 +02:00
Holger Vogt 72b221d9dc If there is a XSPICE code model .model line
with file input, keep quotes and case for the file path.
2021-07-15 16:31:48 +02:00
Holger Vogt e494571757 Enable the m parameter in E, G, B, R behavioral source/devices 2021-07-14 20:47:08 +02:00
Holger Vogt a51d599a90 Revert "v(/out) --> v("/out") when node name starts with math or number char"
This reverts commit 0de8fb8783.
2021-07-10 19:26:02 +02:00
Holger Vogt 8adc6c0124 re-enable making the old help system for Linux/Cygwin
by --enable-help --enable-oldapps
2021-07-10 14:43:26 +02:00
Holger Vogt f6cdf4b95b Prevent crash when CIDER diode models are used.
There is no third node in NUMD or NUMD2, so don't set
GENnode(fast)[i]. This patch fixes a bug introduced in
4895a4b5a ("Diode model with selfheating option", 2021-04-11)
2021-07-10 14:11:56 +02:00
Holger Vogt 0de8fb8783 v(/out) --> v("/out") when node name starts with math or number char
for 'plot', 'write', 'print'
2021-07-10 11:16:27 +02:00
Holger Vogt 6cc5ed3dbf Get immediate response into text window,
when requesting information on coordinates.
2021-07-07 10:41:04 +02:00
Holger Vogt d4e29cd49c WinGUI: Push any remaining error message into text window
before emitting interactive error message window and exit.
2021-07-05 23:15:22 +02:00
Holger Vogt c1c11c84f9 Remove a false read when curr_line has
already been invalidated.
2021-07-05 20:40:38 +02:00
Holger Vogt 817c576ed3 Remove a memory leak
Make inp_rem_levels non-static
and use it to remove 'root' after it has been used.
2021-07-05 20:40:23 +02:00
Holger Vogt d84aa5d956 Nodedamping: Make difference independent of the sign
of the difference
2021-07-05 08:06:11 +02:00
Holger Vogt af7360b8f2 JFET2: Add a link to literature 2021-07-05 08:05:02 +02:00
Holger Vogt 94338a9c0d Enhancement for E source with table, convert to B source with pwl:
Add G source
Allow 'table' also being part of a parameter name like 'table_something'
2021-06-30 14:14:52 +02:00
dwarning e234a7c776 Add channel type determination belong nmos/pmos model parameter 2021-06-29 12:34:50 +02:00
Holger Vogt 19d86d35e6 Standard clang compiler does not support OpenMP
Homebrew clang needs to investigted further
2021-06-28 10:22:41 +02:00
Holger Vogt efbd185b76 Don't show message for every iteration 2021-06-27 14:12:58 +02:00
Holger Vogt cc9c751d04 Fix a bug in the 'dc' progress report 2021-06-25 18:34:14 +02:00
Holger Vogt 400d72551d 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-06-25 18:34:06 +02:00
Holger Vogt 1eb5527e34 Add a 'qsort' dummy according to current compiler standards.
Detected during the very rare condition of not finding a 'qsort'
during the ./configure step.
2021-06-25 15:26:17 +02:00
Holger Vogt 49e5ac14a0 Enable including 'readline' from a non standard location.
--with-readline=<location> may be given instead of --with-readline=yes
This is required when on macOS readline is installed from Homebrew.
Standard Xcode readline in macOS is not compatible with ngspice.
If --with-readline=yes is given, there is no change of behaviour
compared with previous releases.
2021-06-23 20:23:30 +02:00
Holger Vogt ba6a833355 Make error message more verbode 2021-06-22 11:59:27 +02:00
Holger Vogt c90b813c06 Prevent crash if there is bad syntax in h, g, e, or f line 2021-06-22 00:19:43 +02:00
Holger Vogt 1f59e25fb0 Crash when trying to delete root and netlist:
Revert the order of deletion: Firstly the root, then the netlist.
2021-06-21 18:26:23 +02:00
Holger Vogt 44a4652915 Make syntax check for nesting of .subckt ... .ends more verbose:
Try to find out where .subckt/.ends may be doubled, or missing.
2021-06-21 15:35:51 +02:00
Holger Vogt 585bb8cada Add '\f' to characters to be replace by '+'
during the syntax check of an netlist input file.
2021-06-21 13:49:53 +02:00
Holger Vogt e552bc61cf Add evaluating and using temp and dtemp
as ASRC instance parameters.
2021-06-20 16:34:01 +02:00
Holger Vogt 45c0e4fd9f add a comment: we should use TNOM, but not a fixed 300.15.
TNOM still has to be added to the ASRC parameters.
2021-06-20 16:33:04 +02:00
Holger Vogt 55e404f0f7 Don't put brackets around dtemp and temp, when they denote
instance parameters and thus are on the left hand side of '='
2021-06-20 16:31:46 +02:00