Commit Graph

5751 Commits

Author SHA1 Message Date
Holger Vogt e3441044dd formatting 2020-04-27 10:12:19 +02:00
Holger Vogt 3ad93a50e8 Add EXITPOINTs, if reading inputs etc. fails 2020-04-27 10:09:30 +02:00
Holger Vogt d761ed9c79 comment on parse tree evaluation 2020-04-25 10:30:21 +02:00
Holger Vogt c520a9a4b9 if lt(a) comp mode is set, replace 'noiseless' by 'noisy=0' in resistors 2020-04-25 10:30:05 +02:00
Holger Vogt 74dbb1e843 Commit [88653f] Fixed assorted compiler warnings, memory leaks, etc.
branch beta_jdm by Jim Monte
2020-04-25 10:29:16 +02:00
Holger Vogt ca05aa318b Commit [88653f] Fixed assorted compiler warnings, memory leaks, etc.
branch beta_jdm by Jim Monte
2020-04-25 10:29:00 +02:00
Holger Vogt 779bd0e6e2 Commit [88653f] Fixed assorted compiler warnings, memory leaks, etc.
branch beta_jdm by Jim Monte
2020-04-25 10:28:49 +02:00
Holger Vogt a084f4f2b5 avoid type conversion warning size_t -> int 2020-04-25 10:28:34 +02:00
Holger Vogt d3866a6315 Spice_Notice is never NULL 2020-04-25 10:28:07 +02:00
Holger Vogt 0cd33d3fbb correct zeroing of allplots array 2020-04-25 10:27:49 +02:00
Holger Vogt fdbcdb5b7d apply const qualifier appropriately 2020-04-25 10:27:28 +02:00
Holger Vogt 814cadf36c remove const declaration to make ASRCsetup compatible with .DEVsetup 2020-04-25 10:25:42 +02:00
Holger Vogt 050cea146e correct zeroing of allnodes array 2020-04-25 10:24:25 +02:00
Holger Vogt 833751ab3f fix typo 2020-04-25 10:24:02 +02:00
Holger Vogt b3fdff7bc0 Spice_Build_Date is never NULL 2020-04-23 13:30:55 +02:00
Holger Vogt 1f8b179ef9 typo 2020-04-21 20:02:31 +02:00
Holger Vogt 572daed2ec Remove '.backanno' if LT campatibility mode is set 2020-04-21 20:02:18 +02:00
Holger Vogt b701a6347d cktislinear(): coupling of inductors is also linear 2020-04-21 20:02:05 +02:00
Holger Vogt bad2a4e467 Guard XSPICE plot switching against circuit being removed already 2020-04-21 20:01:49 +02:00
Holger Vogt ae2d207344 don't forget to free jobs->statistics[i] 2020-04-21 20:01:06 +02:00
Holger Vogt 3b5c272096 free mor data in jobs struct. Avoid memory leak upon 'quit' command. 2020-04-21 20:00:49 +02:00
Holger Vogt bc0cef9371 remove all data enlisted in the jobs structure 2020-04-21 20:00:35 +02:00
Holger Vogt bbb0007466 add function EVTswitch_plot() to switch the event data
according tothe (analog) plot. Called from plot_setcur()
in vetors.c, when command 'setplot xxx' is given.
2020-04-21 20:00:17 +02:00
Holger Vogt d72b4c415f get the plot name into the event job 2020-04-21 19:59:58 +02:00
Holger Vogt b356b00014 Fixes bugs 476, 486: Reset code model init flag,
required when any run is called a second time.
2020-04-21 19:59:43 +02:00
Holger Vogt c7e9c3884e pow(a,b) function derivative: special case also for a=const
with enhnaced efficiency
introduce TRACE and TRACE1 for debugging
2020-04-21 19:59:29 +02:00
Holger Vogt f5ebea5e9f use internally predefined pow() function 2020-04-21 19:59:11 +02:00
Holger Vogt a1a37d84a7 define is no longer needed with recent VS 2019 2020-04-21 19:58:55 +02:00
Holger Vogt d8085ed594 guard against ft_curckt->ci_ckt == NULL 2020-04-21 19:58:36 +02:00
Holger Vogt 11b22c8f46 showmod will no longer crash ngspice if run after some error 2020-04-21 19:58:07 +02:00
Holger Vogt 6ab1f8b2d6 add mfg to the .model tokens to be ignored during altermod 2020-04-21 19:57:47 +02:00
Holger Vogt 93a76d8e21 add a limit exp(arg) to the exp function. If arg is larger
than 14 (arbitrarily selected), continue with linear response.
2020-04-21 19:57:19 +02:00
Holger Vogt 87101cd26d no double parens 2020-04-21 19:56:55 +02:00
Holger Vogt 55f3776fc1 add a warning if file with modified parameters has not been found.
Then ignore the altermod command.
2020-04-21 19:56:27 +02:00
Holger Vogt 4c80a1ab7d fix a bug, use ciprefix instaed of cieq, cieq led to
always FALSE if statement
2020-04-21 19:55:42 +02:00
Holger Vogt a7e664a5c2 fix bug no. 484, correct TREALLOC usage 2020-04-21 19:55:04 +02:00
Holger Vogt 1c2dd967da During setup, ASRC (aka B source) uses ckt->CKTrhsOld[node->number]
for initial evaluation. .nodeset or .ic have never set CKTrhsOld,
so initalization for B source failed.
We still have to check why .nodeset and .ic are set two times,
first in CKTic(), then in CKTload()!
2020-04-21 19:54:41 +02:00
dwarning d735c60183 no size_t cast for GlobalMemoryStatusEx result 2020-04-21 19:52:05 +02:00
Holger Vogt 7889b5d540 re-add the icon to the top header of the ngspice GUI 2020-04-05 10:22:13 +02:00
Holger Vogt c4e23989f3 Don't us atexit(), but delete memory during 'quit' 2020-04-04 14:22:04 +02:00
Holger Vogt c2513af3e8 remove code that leads to crash if tran simulation is
interrupted and reset is sent (KiCAD)
2020-04-04 14:21:49 +02:00
Holger Vogt 1a9c1b8c24 remove unused code snippet 2020-04-04 14:21:33 +02:00
Holger Vogt e28cae42f1 enable both new gmin and dyngmin 2020-04-04 14:21:15 +02:00
Holger Vogt 673a14afdb more conservative op calculation:
start with new gmin, if this fails, fall back to dynamic gmin,
then source stepping
2020-04-04 14:20:45 +02:00
Holger Vogt 2f31bd5c2a avoid compiler warning 2020-04-04 14:20:16 +02:00
Holger Vogt 9edc436ef7 remove SIGINT handling which was not functional
add SIGSEGV handler which may be excluded by
set nosighandling
2020-04-04 14:19:55 +02:00
dwarning 8ca33bc8f5 VDMOS correct thermal diode contribution in reverse operation 2020-04-04 14:19:38 +02:00
dwarning b75791c87d VDMOS include body diode into power calculation 2020-04-04 14:19:21 +02:00
dwarning 897165d026 VDMOS change default value for Rthca 2020-04-04 14:19:03 +02:00
dwarning f19da3bd79 case correction for library name 2020-04-04 14:18:38 +02:00
Holger Vogt c076c932b4 enable MINGW linking to -lShlwapi,
which failed during making 32 bit shared lib
2020-04-04 14:17:54 +02:00
dwarning 3999dcc700 w and l must be exact altermod parameter for MOS binning 2020-04-04 14:16:47 +02:00
dwarning d3da0d5ebf VDMOS consider body diode thermal contribution for self-heatine effect 2020-04-04 14:16:19 +02:00
Holger Vogt c86cd740d6 fix a bug: re-enable reading vecs with length 1
Bug reported by LM
2020-04-04 14:15:55 +02:00
Holger Vogt ded0092ad6 If ngSpice_Command(NULL) is sent to shared ngspice,
the internal control structure memory is freed.
2020-04-04 14:15:38 +02:00
Holger Vogt d3fcf2f43f restrict removal of arg only to comma operator,
otherwise functions with a single variable may fail
2020-04-04 14:13:35 +02:00
Holger Vogt 4a3b193154 remove memory leak in function parser (bug. no 478),
second case
2020-04-04 14:13:01 +02:00
Holger Vogt 96976ee49d prevent non-English characters (e.g. Umlaute),
which gtkwave does not understand
2020-04-04 14:12:05 +02:00
Holger Vogt 3a6a445241 rcheck -> rcheckn in cmath1.c
delete alloced memory in case of check failure
2020-04-04 14:11:32 +02:00
Holger Vogt ba81e21197 rcheckn: rcheck plus freeing allocated memory 2020-04-04 14:11:07 +02:00
Holger Vogt 84ff135e5b syntax check for vdmos instances with 'thermal' flag 2020-04-04 14:10:07 +02:00
Holger Vogt 9e8e50cb57 Fix a bug raised by Sambeet in
[Ngspice-users] Problems with xspice limiter block:
Don't treat .model limit_comp limit(gain... as a function
if PSPICE compatibility is set.
2020-04-04 14:09:25 +02:00
dwarning edc5b5a4d4 VDMOS prevent fault if thermal switch is given but thermal nodes are not 2020-04-04 14:08:48 +02:00
dwarning 8c2bdd2f7a VDMOS include thermal components into convtest 2020-03-15 11:03:56 +01:00
dwarning 7b77a13d3d VDMOS return if NIintegrate fails 2020-03-15 11:03:36 +01:00
dwarning a850b2a070 VDMOS diode current op information 2020-03-15 11:00:34 +01:00
dwarning 793c82d384 VDMOS rise minimal diode resistance for better convergence 2020-03-15 11:00:23 +01:00
dwarning 5c5f43d122 VDMOS safe Temp init 2020-03-15 11:00:15 +01:00
dwarning 034f415621 VDMOS separate dc and thermal parts 2020-03-15 11:00:07 +01:00
dwarning 659ade6cf2 VDMOS few variable name changes 2020-03-15 10:59:59 +01:00
dwarning ce66266965 VDMOS remove drain resistance temperature derivation 2020-03-15 10:59:54 +01:00
dwarning ee7599b33f VDMOS few variable name changes 2020-03-15 10:59:49 +01:00
Holger Vogt 020c5578a1 remove unused code snippet 2020-03-15 10:59:27 +01:00
Holger Vogt 0490bc090b Allow 3-terminal MOS devices (e.g. VDMOS),
prevent crash upon user error
2020-03-15 10:59:05 +01:00
Holger Vogt 11cf6e709b third trial: get the token i(vss) as a whole in the lexer,
this prevents the parser from generating the spurious vector vss.
No need to do an extra translation i(vss) -> vss#branch.
2020-03-15 10:58:56 +01:00
Holger Vogt fbd17bc25a Imrove an error message: End-of-line delimiter $ is
not allowed when PSPICE compatibility is set. $ is
a standard character in PSPICE.
2020-03-15 10:58:30 +01:00
Holger Vogt 02cf88c119 correct the return values 2020-03-15 08:51:18 +01:00
dwarning ff07a21608 omit wanted fallthrough warnings with gcc 2020-03-15 08:51:18 +01:00
Holger Vogt d967e18632 compatibility to old vsnprintf() in MINGW is no longer needed.
Compiling with -D__USE_MINGW_ANSI_STDIO=1 enables C99 compatibility.
2020-03-15 08:51:18 +01:00
Holger Vogt 258c01d9bb Replace swprintf by MultiByteToWideChar to correctly
translate from utf-8 to wchar_t
2020-03-15 08:51:18 +01:00
Holger Vogt b81953fafd enable true gmin stepping
The old behavior, stepping diagmin, is re-obtained by adding flag
set 'dyngmin'
to .spiceinit or spinit
This flag may also be set within a .control section (e.g. to
compare results)
2020-03-15 08:51:18 +01:00
Holger Vogt 4bcb38abb5 clean up winmain.c 2020-03-15 08:51:18 +01:00
Holger Vogt 8d9d40d621 enable compiling wide char with MINGW 2020-03-15 08:51:18 +01:00
Holger Vogt 7a7f717574 make flag 'nolegend' localfor each plot 2020-03-15 08:51:17 +01:00
Holger Vogt 1398ee7aa0 set the proper preprocessor flag __MINGW32__ 2020-03-15 08:51:17 +01:00
Holger Vogt 249304a06f Instantiations of string and dstring functions as inline
This will remove the redundant-decls warning
2020-03-15 08:51:17 +01:00
Holger Vogt 0e4b736a5d remove outdated function GlobalMemoryStatus(&ms) 2020-03-15 08:51:17 +01:00
Holger Vogt 08a2f04e8d make code compile with MINGW (preliminary) 2020-03-15 08:51:17 +01:00
Holger Vogt bcfdc806a5 work around a bug in MINGW
Reported in
https://github.com/msys2/MINGW-packages/issues/6254
2020-03-15 08:51:17 +01:00
Holger Vogt 09d3fbe3ad remove false bracket in EXT_ASC 2020-03-15 08:51:17 +01:00
Holger Vogt 027b342a9c prevent crash if premature exit (without ckt) 2020-03-15 08:51:17 +01:00
Holger Vogt ded6bbbe34 make declaration inline 2020-03-15 08:51:16 +01:00
Holger Vogt cab9cbdddf re-enable making old apps with --enable-oldapps 2020-03-15 08:51:16 +01:00
Holger Vogt 2ff0e3b1b7 ngsconvert.c: add const to cp_enqvar 2020-03-15 08:51:16 +01:00
Holger Vogt 10c312856e re-enable making nutmeg 2020-03-15 08:51:16 +01:00
Holger Vogt 06239e567f plug a memory leak (in case of failing op for tran calculation) 2020-03-15 08:51:16 +01:00
Holger Vogt 2f23c58585 plug a memory leak (pll-xspice.cir) 2020-03-15 08:51:16 +01:00
Holger Vogt 14c0828a65 plug a memory leak (IXTH80N20L-IXTH48P20P-quasisat.sp) 2020-03-15 08:51:16 +01:00
dwarning 15b8e0ba7f add aliases for temp coeffs 2020-03-15 08:51:15 +01:00
dwarning 5e4c7a255e update .gitignore and make clean 2020-03-15 08:51:15 +01:00
dwarning e9abecc8c7 change vdmos flag to thermal, not to confuse with b4soi 2020-03-15 08:51:15 +01:00
dwarning 3686dbfb78 filter only mos instances with thermal switch 2020-03-15 08:51:15 +01:00
Holger Vogt f24ed96cbd plug some memory leaks 2020-03-15 08:51:15 +01:00
dwarning 791f18053f change vdmos flag to thermal, not to confuse with b4soi 2020-03-15 08:51:15 +01:00
Jim Monte b9d45349d5 Added featurest to com_let to allow default low and high indices and to allow the last dimension to default to its full range 2020-03-15 08:51:15 +01:00
dwarning 59bb80f3d3 free errMsg only if available 2020-03-15 08:51:14 +01:00
dwarning f632f79056 use errMsg under ngdebug condition and prevent memory leak 2020-03-15 08:51:14 +01:00
Holger Vogt eab10ee065 prevent double closing of file (Linux does not NULL fp during fclose) 2020-03-15 08:51:14 +01:00
Holger Vogt e53632c368 When plotting arrays of curves, plot lines only in the direction
of (in absolute terms) growing x values.
Example: MOS output characteristics.
In the rare case of plotting versus varying x directions
(e.g. example memristor.sp), one has to add the flag
'retraceplot' to the plot command.
2020-03-15 08:51:14 +01:00
Holger Vogt 14b154f5f3 Copy the scale vector as well and attach it to the data vector.
Remove it again when the graph is destroyed.
2020-03-15 08:51:14 +01:00
Holger Vogt f518766c66 add a slight offset between y axis labels and grid 2020-03-15 08:51:14 +01:00
Holger Vogt 1919cf5c94 replace variable 'gridwidth' by 'xgridwidth' 2020-03-15 08:51:13 +01:00
Holger Vogt c2cf4d7eda required for reliable re-plotting, however still has the
return line bug no #472
2020-03-15 08:51:13 +01:00
Holger Vogt 57e647c704 enable "null allowed" for reset input 2020-03-15 08:51:13 +01:00
Holger Vogt acbec3ae81 Preliminary 'fix' to a plotting bug (visible return line in an array of curves):
Partially undo code added in commit 10415875f4/
This will need further discussion or updates
2020-03-15 08:51:13 +01:00
Holger Vogt 71ad2903ff plug a memory leak in inpcom.c vdmos code 2020-03-15 08:51:13 +01:00
Holger Vogt 4ddcff55e7 add const declaration to newfopen 2020-03-15 08:51:13 +01:00
Holger Vogt c4045d371d single space indent in analysis window 2020-03-15 08:51:13 +01:00
Holger Vogt 8ff4c7cd3b just another remains of quote 2020-03-15 08:51:12 +01:00
Holger Vogt 7f085144a9 remove all the remains of quote() and strip() that had been
used to modify the eigths bit of a character or string.
The functions had been switched off some time ago.
We now need all bits of a char for extended ascii or utf8
2020-03-15 08:51:12 +01:00
Holger Vogt 8d986e50cc remove the remains of the old xgraph program
that has not been supported for many years
2020-03-15 08:51:12 +01:00
Holger Vogt 32722ecc57 some missing brackets, typos 2020-03-15 08:51:12 +01:00
Holger Vogt 93a408598a switch to colorarray in graph to string all color data,
one set per each graph.
If we are zooming or selecting a cutout, copy the
source graph's colors to the new graph. Transfer the
old graphs id to the new graph via graph->graphid.
2020-03-15 08:51:12 +01:00
Vogt 728ddae41e Set the color tables and linewidths personal for each graph,
added to strucht graph
Use only these data for plotting.
If zooming a plot windows, set as an extra parameter the graph id
of the 'mother graph'. Copy its color and line data to the new graph.
This is done by an extra parameter sgraphid to the internal plot
command that is issued in fcn PlotWindowProc().
Thus zooming will keep the background, text/line and graph colors.
Function setcolor() will always look into the colorarray of the
current graph.
2020-03-15 08:51:12 +01:00
Holger Vogt a7aaac854f enable color and font selection for X11:
Add graphics context gridgc for plotting the grids.
Enable rgbd:, input of color by RGB 0 ... 255
If no color1 (text/grid) is given,
    select black or white according to backgrund color.
Error message, but no crash if font cannot be selected.
Enable separate linewidth selection for grid and graph.
2020-03-15 08:51:11 +01:00
Holger Vogt 800cd05f3d new variable nolegend: with 'set nolegend' plotting of
the legend is suppressed.
2020-03-15 08:51:11 +01:00
Holger Vogt fed7ef378f add variable ticchar, allow an arbitrary character as ticmark 2020-03-15 08:51:11 +01:00
Holger Vogt 8639144093 cp_getvar: force a limit to a string entered
Issue a warning, truncate the string
2020-03-15 08:51:11 +01:00
Holger Vogt 1fda03382e color input for text/grids (color1), background (color0)
and graphs (color2-22) on Windows via
set color2=red
set color2=rgb:ff/0/0
set color2=rgbd:255,0,0
several examples given in the example files
2020-03-15 08:51:11 +01:00
Holger Vogt 86917e3d36 enclose in WinGUI #ifdef 2020-03-15 08:51:11 +01:00
Holger Vogt 6094769fda Restore original 'green', slight update on
auto color selection vs. background
2020-03-15 08:51:11 +01:00
Holger Vogt cb38e7a367 enable using setting colors by colornn with 0<=nn<=22
The name list of colors is given by
https://www.codeproject.com/Articles/1276/Naming-Common-Colors
2020-03-15 08:51:10 +01:00
Holger Vogt 54778527c4 list of colors used 2020-03-15 08:51:10 +01:00
Holger Vogt 167bd9b433 enable color selection, if compiled with MINGW 2020-03-15 08:51:10 +01:00
Holger Vogt 3701ca0364 add color selection to WinGui plots 2020-03-15 08:51:10 +01:00
Holger Vogt ef95ff7edc generate variable oscompiled
test for variable
2020-03-15 08:51:10 +01:00
Holger Vogt 38bb89663d replace old_x11 by HAVE_LIBXFT defined in configure 2020-03-15 08:51:09 +01:00
Holger Vogt 921058cb39 fix remaining bugs when EXT_ASC is defined 2020-03-15 08:51:09 +01:00
Holger Vogt 6e0b631492 Regain static behaviour, keep removing compiler warning 2020-03-15 08:51:09 +01:00
Holger Vogt 3a8e3d130c update and unify font handling 2020-03-15 08:51:08 +01:00
Holger Vogt bef9c70e71 Prepare font selection and rotation only once per graph
in func X11_DefineXft().
Only 0 and 90 degree are supported.
2020-03-15 08:51:08 +01:00
Holger Vogt 8312a8ade2 Select suitable default text color 2020-03-15 08:51:08 +01:00
Holger Vogt 3eb04b2fdc improve on memory leaks
(not yet completely satisfying)
2020-03-15 08:51:08 +01:00
Holger Vogt 8f42eae6ab add empty line after error message 2020-03-15 08:51:08 +01:00
Holger Vogt a23748cf8c Don't call DestroyGraph if graf id is 0 2020-03-15 08:51:08 +01:00
Holger Vogt 673069f442 add to the source window after 'source' command 2020-03-15 08:51:08 +01:00
Holger Vogt fd96983099 Reset DevSwitch before returning 2020-03-15 08:51:08 +01:00
Holger Vogt e7022f7fae utf-8 string length determined by strlen 2020-03-15 08:51:08 +01:00
Holger Vogt ac1c8c4a96 return NULL upon NULL input 2020-03-15 08:51:07 +01:00
Holger Vogt 93be5bab0c increase buffer size, send text to string window,
retrieve the correct number of byte after utf-8 conversion.

Answering to a promt (e.g. after command 'hardcopy') does not
yet do.
2020-03-15 08:51:07 +01:00