Go to file
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
examples move examples file to prpoer xspice folder 2021-07-27 11:39:11 +02:00
m4 avoid bison dependency `version >= 2.7' 2016-07-09 20:58:17 +02:00
man cmpp is no longer distributed 2021-02-20 18:44:34 +01:00
src XSPICE: fix double delta subtraction in dll mode 2021-08-01 12:02:15 +02:00
tests removed more tests 2021-01-20 16:45:24 +01:00
visualc Prepare ngspice-35 2021-07-20 21:44:31 +02:00
.gitattributes .gitattributes, do not modify crlf line endings of visual studio proj files 2015-10-16 20:35:07 +02:00
.gitignore ignore adms intermediate files 2021-01-02 19:04:34 +01:00
ANALYSES ngspice-26: update documentation 2014-01-11 16:24:37 +01:00
AUTHORS author added 2020-05-03 11:44:48 +02:00
BUGS whitespace 2014-01-11 16:24:34 +01:00
COPYING Update for ngspice-34 2021-01-03 08:47:47 +01:00
ChangeLog correct typos found by linthian 2019-09-28 12:24:09 +02:00
DEVICES Prepare ngspice-35 2021-07-20 16:35:13 +02:00
FAQ Prepare ngspice-35 2021-07-20 21:44:31 +02:00
INSTALL Add a small chapter on ngspice as shared library. 2021-07-30 14:10:47 +02:00
Makefile.am remove contrib from EXTRA_DIST 2021-01-02 19:12:35 +01:00
NEWS Prepare ngspice-35 2021-07-20 21:44:31 +02:00
README prepare for ngspice-27 2017-08-24 18:01:05 +02:00
README-old.adms Update on the ADMS README 2018-05-27 12:40:54 +02:00
README.adms Prepare ngspice-30 2018-12-23 13:43:08 +01:00
README.shared-xspice update to ngGet_Vec_Info() 2018-05-19 16:52:50 +02:00
README.tcl prepare ngspice-27 2017-08-23 23:48:28 +02:00
README.utf8 added features of utf-8 descrption 2020-03-15 08:51:14 +01:00
README.vdmos update to actual status, parameter list added 2018-05-04 20:35:13 +02:00
Stuarts_Poly_Notes ngspice-26: update documentation 2014-01-11 16:24:37 +01:00
autogen.sh Bug 548: Add support for mawk in autogen.sh 2021-04-27 14:44:49 +02:00
build-for-mac-os.sh 'make clean' added 2020-05-05 20:55:22 +02:00
compile_linux.sh update compile scripts for Linux and macOS 2020-05-03 00:18:23 +02:00
compile_linux_shared.sh compile script for shared ngspice library 2021-07-24 12:27:34 +02:00
compile_macos.sh Standard clang compiler does not support OpenMP 2021-06-28 10:22:41 +02:00
compile_min.sh Move compiling the ICON from compile_mingw.sh to makefile.am 2020-10-10 13:55:11 +02:00
compile_min_shared.sh only 64 bit release and debug 2020-05-04 17:18:32 +02:00
configure.ac configure.ac: Adding version string for LIB_NGSPICE_API 2021-07-28 15:51:09 +02:00
cross-compile-shared.sh cross-compile-shared.sh, fix commit, chmod a+x 2015-12-15 21:51:15 +01:00
cross-compile.sh cross-compile*.sh, mention required debian packages 2015-12-15 20:42:57 +01:00
ngspice.pc.in Add pkg-config file 2018-05-19 20:54:27 +02:00

README

README for NGSPICE
==================

Ngspice is a mixed-level/mixed-signal circuit simulator. Its code
is based on three open source software packages: Spice3f5, Cider1b1
and Xspice.

Spice3 does not need any introduction, is the most popular circuit
simulator. In over 30 years of its life Spice3 has become a de-facto
standard for simulating circuits.

Cider couples Spice3f5 circuit level simulator to DSIM device simulator
to provide greater simulation accuracy of critical devices. DSIM
devices are described in terms of their structures and materials.

Xspice is an extension to Spice3C1 that provides code modelling support
and simulation of digital components through an embedded event driven
algorithm.

Ngspice is, anyway, much more than the simple sum of the packages
above, as many people contributed to the project with their experience,
their bug fixes and their improvements. If you are interested, browse
the site and discover what ngspice offers and what needs. If you think
you can help, join the development team.

Ngspice is an ongoing project, growing everyday from users contributions,
suggestions and reports. What we will be able to do depends mostly on
user interests, contributions and feedback.



USER DISCUSSION FORUMS:
-----------------------

 For discussions on ngspice, there are five discussion forums, to be
 found at https://sourceforge.net/p/ngspice/discussion/. These
 typically provide quick answers to any question concerning ngspice.
 A new section on 'tips and examples' assembles useful tips provided
 by maintainers and users.



MAILING LISTS:
-------------

 There are two mailing lists dedicated to the use and development of ngspice.

 * ngspice-users@lists.sourceforge.net:
   This list is the list for the users of the ngspice simulator.

 * ngspice-devel@lists.sourceforge.net:
   ngspice development issues. Developers and "want to be" developers should
   subscribe here.

 To subscribe the list(s), send a message to:
   <ngspice-users-subscribe@lists.sourceforge.net>
   <ngspice-devel-subscribe@lists.sourceforge.net>



WEB SITEs:
--------

This project is hosted on Sourceforge.net.
The home page is http://ngspice.sourceforge.net
The page offering source code and user interaction is
 http://sourceforge.net/projects/ngspice