Brian Taylor
5c4352d02f
Add __MINGW64__ defines for builds on mingw with msys.
2023-10-28 10:58:15 +02:00
Brian Taylor
3bb6e86015
Add Windows Visual Studio support for the Isotel d_process xspice digital model. The Isotel mixedsim-master/examples/embedded/motorforce C code needs to have minor changes for _MSC_VER defines, and are not included with this commit. The changes relate to using #pragma pack(push, 1)...#pragma pack(pop) around some structs, and setting stdin/stdout in binary mode. It is doubtful that the cfunc.mod will compile on mingw or cygwin since I don't know if they support pipe/fork/exec/spawn calls. The code builds and runs on Windows, Linux, and MacOS. In the future, Giles Atkinson is looking at allowing Xspice models to load shared libraries (.dll, .so) which will avoid creating and communicating with an external program.
2023-10-28 10:58:06 +02:00
Holger Vogt
efdf332061
Prevent a crash if hash model table was not generated,
...
e.g. due to missing valid models.
2023-10-27 23:13:41 +02:00
Holger Vogt
10d7297798
Add cm_cecit(). If the input file could not be opened, stop ngspice.
2023-10-21 15:52:10 +02:00
Holger Vogt
19ebfb1887
Add a code model function cm_exit(const int exitcode).
...
This function calls controlled_exit(exitcode) to shut
down gracefully.
2023-10-18 22:46:27 +02:00
Holger Vogt
f26dda8616
Formatting
2023-10-18 17:44:56 +02:00
Holger Vogt
39443fafdd
Removing unused models takes much more time than keeping them
...
for large circuits.
Probably a hash table may help here (t.b.d.).
2023-10-18 14:36:08 +02:00
Holger Vogt
8ef0aece58
During setup of the models thre have been search scans in the
...
linked model list modtab. The time used here grows approx.
quadratically with the number of models. If the numbers get large,
e.g. with the IHP Open PDK, setup time make simulation impractical.
Therefore the linked list modtab has been enhanced by a hash table
modtabhash, which allows linear search time and makes simulation
of a 200k transistor circuit with IHP PDK possible. Already
the setup time for 15k transistor circuits has been reduced.
2023-10-18 14:34:16 +02:00
Holger Vogt
9702557f81
Evaluate function gauss() in B sources. This is required when
...
in .model files the tokens 'temper' and gauss() coexist, because
then the B Source function parser is applied.
2023-10-16 17:53:58 +02:00
Holger Vogt
eb36084700
re-formatting (indentation, tabs removed)
2023-10-11 00:08:55 +02:00
Holger Vogt
9edf34495e
Don't say 'issue in line no. 0', as this 'info' does not tell
...
where the line with position 0 really is in the input deck.
2023-10-09 23:19:30 +02:00
Holger Vogt
7c3cb8169c
This is a re-write of the PWM generator.
...
It is modelled according to the new d_OSC by Giles Atkinson.
Here frequency is fixed and duty cycle is controlled by an
analog input.
2023-10-07 17:13:55 +02:00
Holger Vogt
ecb416b800
This patch fixes a bug when shared library uses XSPICE:
...
Don't subtract delta twice, when breakpoint is active
and step is rejected.
https://sourceforge.net/p/ngspice/patches/106/
Thanks to Vyacheslav Shevchuk
2023-10-07 17:10:31 +02:00
Holger Vogt
9944a4869f
typo
2023-10-07 13:36:56 +02:00
Holger Vogt
53315ed764
Prevent crash when no input file given.
2023-10-05 00:19:51 +02:00
Holger Vogt
4f79105b06
Add comment
2023-10-02 10:07:52 +02:00
Holger Vogt
233f9daba4
Remove unused instance parameter ic (initial condition of controlling source).
2023-10-01 10:51:31 +02:00
Holger Vogt
28b495318d
Update to command 'wrnodev':
...
Prevent crash if tran is not (yet) run.
Open output file only when data are available.
Enhanced comment and warning message.
2023-09-28 10:05:31 +02:00
Holger Vogt
e449c894ce
Prepend title line by '*' if printed by 'listing r'.
...
This allows skipping all pre-processing.
2023-09-27 15:51:16 +02:00
Holger Vogt
76f837b0b7
skip all pre-processing for expanded input files created by 'listing r'
2023-09-27 15:49:37 +02:00
Giles Atkinson
2790fd68bb
Make the special "noglob" variable work. To preserve previous behaviour
...
change the default value from true to undefined (meaning false).
Also fix a misleading comment in glob.c.
2023-09-25 10:54:13 +02:00
Giles Atkinson
a70e708114
Make special interpreter variable "noglob" behave as documented:
...
globbing is off by default. An incompatible change, but previous
behaviour can be restored by "unset noglob" in .spiceinit.
2023-09-23 17:03:34 +02:00
Giles Atkinson
41c61604c5
Handle SIGTTIN and SIGTTOU on Unix-like OSs with X11 graphics.
...
That makes it possible to push ngspice into the background while
plot windows are open: the windows remain responsive.
Discussion on ngspice-users, starting 2023-09-01,
title: "`quit` in Interactive Mode."
Also restore terminal state when forcing exit with SIGINT (control-C).
2023-09-23 17:03:24 +02:00
Giles Atkinson
588116af48
Fix a bug in the "help" command. Some commands have no action function,
...
so the function pointer should not be used to detect the end of the table.
Use the command name instead.
2023-09-23 17:03:19 +02:00
Giles Atkinson
423f9a9db2
Fix a build bug for XSPICE: files generated for code models are
...
not removed when doing 'make clean' from release/src/xspice or above.
2023-09-23 17:03:09 +02:00
Holger Vogt
f3eb46e76d
Fix bug in fprintf
2023-09-23 16:45:35 +02:00
Holger Vogt
b034332e84
Improve warning message during evaluating .probe
2023-09-19 14:57:22 +02:00
Giles Atkinson
62471ecede
Fix two bugs in cmpp: an unmatched right bracket in cfunc.mod
...
causes an infinite parsing loop (mod_yacc.y) and XSPICE macros
are replaced in string literals (mod_lex.l).
2023-09-16 00:19:36 +02:00
Holger Vogt
dbc5042263
Prevent a crash if port cntrl is set to NULL
2023-09-15 23:42:08 +02:00
Holger Vogt
01bdd44ef9
Modify the previous commit a616a0abe:
...
no spaces in the first column
2023-09-15 23:41:12 +02:00
Vogt
a616a0abe3
Add variable wr_onspace to allow printing the vetor name with
...
one space delimiter
2023-09-14 15:22:14 +02:00
Holger Vogt
daa58f4125
Fix previous commit [acb7f2]
...
Allow frequency 0 Hz (make check will do agian).
2023-09-11 22:48:50 +02:00
Holger Vogt
acb7f2cd97
Make .ac error messages more verbose, prevent some crash,
...
enable default values.
2023-09-11 17:42:38 +02:00
dwarning
4368790c5d
remove compiler warning wrt. prototypes
2023-09-11 14:50:27 +02:00
Holger Vogt
b7993bb530
Formatting cktpzstr.c
2023-09-11 14:28:49 +02:00
Holger Vogt
dfeb0bdb4e
Improve error message on obsolete dot command
2023-09-11 14:28:20 +02:00
Holger Vogt
64c29e667e
Improve error message on unimplemented dot command
2023-09-11 12:02:59 +02:00
Holger Vogt
a6d5ce8ea6
Some KLU warnings are useless for the normal user, as she or he
...
does not have any means to further analyze or repair the issue:
Warning: KLU ReFactor failed. Factoring again...
Warning (ReFactor Complex): KLU Matrix is SINGULAR
Numerical Rank: %d\n
Singular Node: %d\n
So print these messages only in debug mode.
2023-09-10 14:41:16 +02:00
Holger Vogt
64307ba907
Add a title line to 'listing r', so the resulting output may be
...
re-loaded by the 'source' command.
2023-09-10 13:44:18 +02:00
Holger Vogt
9d84138216
Remove memory leak by not mallocing unused node_ids.
...
Remove some compiler warnings.
2023-09-09 23:35:54 +02:00
Holger Vogt
3b89410b8f
Slight cosmetics in comment.
2023-09-09 23:34:49 +02:00
Brian Taylor
492bb64d92
By default, use the shortest typical delay estimate. This makes the digi_74LS90_74LS42.cir testcase for bug641 behave almost the same as MicroCap 12. In ngspice and MicroCap, the only signal with a glitch is not_y8. The other not_* signals look the same. Setting ps_use_mntymx in .spiceinit will change the delay estimates. See the function set_u_devices_info in src/frontend/udevices.c for the various settings of ps_use_mntymx.
2023-09-09 23:22:06 +02:00
Holger Vogt
7a646c0a12
If 'strict_errorhandling' is set, bail out if operating point is not found
2023-09-09 18:38:09 +02:00
Holger Vogt
ad23146544
Don't check continuously for autostop, only when option flag is set
...
This speeds up simulations with simple device evaluation, but many
time stepps.
2023-09-09 18:37:13 +02:00
Holger Vogt
0f14c690d5
Stat. functions: safeguard against divide by zero, return nominal value
2023-08-26 10:15:08 +02:00
Holger Vogt
8837132f29
Fix d0fc344bf
...
("Shorten the ngspice message when performing operating point evaluation.
The average user often complained about useless 'info'.
The old output is now available when 'set ngdebug' in .spiceinit.",
2023-08-19)
Return with 0 if optran has been successful.
2023-08-20 00:11:39 +02:00
Holger Vogt
d5ceced24d
We are developing towards ngspice-42
2023-08-19 23:54:36 +02:00
Holger Vogt
d0fc344bf9
Shorten the ngspice message when performing operating point evaluation.
...
The average user often complained about useless 'info'. The old output
is now available when 'set ngdebug' in .spiceinit.
2023-08-19 23:42:34 +02:00
Holger Vogt
c0d73dcd6f
Fix bug 642 by replacing strstr() by search_plain_identifier()
2023-08-19 23:14:26 +02:00
Holger Vogt
750d92c493
Fix a bug, not finding any instance parameters for PSP or R2_CMC
...
If already aligned, return input value, not 0.
2023-08-16 11:14:26 +02:00