Commit Graph

4498 Commits

Author SHA1 Message Date
rlar 9085084ccb device.c, #9/19, drop variable 'rhs' 2017-07-06 17:56:21 +02:00
rlar 1ff0500117 device.c, #8/19, use parent wordlist to restore beginning of the list 2017-07-06 17:56:21 +02:00
rlar 01039f81a2 device.c, #7/19, use a local wordlist *wn 2017-07-06 17:56:21 +02:00
rlar 50dd15093e device.c, #6/19, this 'wl2' wont be used anywhere 2017-07-06 17:56:21 +02:00
rlar 26f7a0e04e device.c, #5/19, drop 'eqfound', equivalent to 'wl != NULL' 2017-07-06 17:56:21 +02:00
rlar 3f09ab6634 device.c, #4/19, loop wont be executed, and 'step' wont be used any more 2017-07-06 17:56:21 +02:00
rlar 3baaa57d18 device.c, #3/19, move some code up 2017-07-06 17:56:21 +02:00
rlar 670d87a589 device.c, #2/19, 'wl' will not be used any more 2017-07-06 17:56:21 +02:00
rlar 1eca384a94 device.c, #1/19, can 'break' here, because 'wl' is NULL 2017-07-06 17:56:04 +02:00
h_vogt 761f3915f5 device.c, 'alter', don't insert empty "" token
when entering ' =' or '= ' in interactive mode
2017-07-06 17:55:06 +02:00
h_vogt d06f39f67d device.c, bug #342, prevent crash when using 'alter'
#342 SegFault alter command
https://sourceforge.net/p/ngspice/bugs/342/
2017-07-06 17:55:02 +02:00
rlar 9ddd1d7d40 fix commit: inp2q.c, #18/23, rewrite, combine two 'for' loop's
which replaced a INPgetNetTok() by INPgetTok()
causing a bug when handling special node names
for example this case
  q1 /c /c 0 npnmodel
2017-07-05 21:09:30 +02:00
rlar 2b17f3292d inpcom.c, inp_add_control_section(), upside down for readability 2017-06-25 14:37:13 +02:00
rlar 76bbaf4ac3 inpcom.c, inp_sort_params(), use insert_deck() 2017-06-25 14:37:13 +02:00
rlar a26ec804cb inpcom.c, inp_reorder_params_subckt(), introduce insert_deck() 2017-06-25 14:37:13 +02:00
rlar c285602105 inpcom.c, inp_reorder_params_subckt(), reorder 2017-06-25 14:37:13 +02:00
rlar bc62407226 inpcom.c, drop unused artefact xx_new_line() 2017-06-25 13:40:01 +02:00
rlar 1afa04b2d1 inpcom.c, insert_new_line(), inline xx_new_line() 2017-06-25 13:39:56 +02:00
rlar 5c7c278c3d inpcom.c, inp_fix_subckt(), #4/4, drop redundant initialisations 2017-06-25 13:39:48 +02:00
rlar c3e2c920ef inpcom.c, inp_fix_subckt(), #3/4, drop 'last_param_card' 2017-06-25 13:39:41 +02:00
rlar 2aafc50608 inpcom.c, inp_fix_subckt(), #2/4, use insert_new_line() 2017-06-25 13:39:34 +02:00
rlar dda35ef2a5 inpcom.c, inp_fix_subckt(), #1/4, rewrite 'append' 2017-06-25 13:39:27 +02:00
rlar e75f48d91f inpcom.c, insert_new_line(), allow NULL head 2017-06-25 13:00:39 +02:00
rlar 5ff5839296 inpcom.c, inp_stitch_continuation_lines(), rewrite for the following commit 2017-06-25 12:58:50 +02:00
rlar 420c023f56 inpcom.c, introduce insert_new_line()
use it to replace this pattern
  foo = bar->li_next = xx_new_line(bar->li_next, ...);
with
  foo = insert_newline(bar, ...);
2017-06-25 12:57:18 +02:00
rlar 38183b6167 inpcom.c, expand_section_ref(), #7/7, cleanup 2017-06-25 12:10:01 +02:00
rlar dd155dd83e inpcom.c, expand_section_ref(), #6/7, drop 'rest' 2017-06-25 12:09:21 +02:00
rlar 0f8fb4cf51 inpcom.c, expand_section_ref(), #5/7, drop 'newl' 2017-06-25 12:04:16 +02:00
rlar a77db80a85 inpcom.c, expand_section_ref(), #4/7, drop 'cend', use 'c' instead 2017-06-25 12:03:39 +02:00
rlar 0c94a651ee inpcom.c, expand_section_ref(), #3/7, simplify 2017-06-25 12:02:26 +02:00
rlar 26d878748d inpcom.c, expand_section_ref(), #2/7, t == section_def ==> cend == c 2017-06-25 12:01:34 +02:00
rlar 7f2cf192b6 inpcom.c, expand_section_ref(), #1/7, cend != NULL === t != section_def 2017-06-25 12:00:07 +02:00
rlar a51c1aba2c inpcom.c, inp_read(), #2/2, rewrite xx_new_line() insertion
using the fact
  end->li_next === NULL
2017-06-24 22:03:03 +02:00
rlar 5c3dac41d9 inpcom.c, inp_read(), #1/2, rewrite 'append' to 'end' 2017-06-24 22:01:03 +02:00
rlar ed39305da0 inpcom.c, inp_add_series_resistor(), simplify xx_new_line() insertion 2017-06-24 20:30:04 +02:00
rlar 9eddd1d80f inpcom.c, inp_add_control_section(), #2/2, rewrite xx_new_line() insertion 2017-06-24 20:15:02 +02:00
rlar 4ad53f0de8 inpcom.c, inp_add_control_section(), #1/2, emphasise two assertions 2017-06-24 20:12:55 +02:00
rlar 4ff9c0c166 inpcom.c, inp_chk_for_multi_in_vcvs(), #6/6, drop 'model_card' 2017-06-24 19:44:35 +02:00
rlar d773b73f76 inpcom.c, inp_chk_for_multi_in_vcvs(), #5/6, drop 'next_card', deploy its value temporarily in the new line's li_next slot 2017-06-24 19:44:11 +02:00
rlar 3b55d2af40 inpcom.c, inp_chk_for_multi_in_vcvs(), #4/6, drop 'a_card', reuse the unused 'c' instead 2017-06-24 19:43:34 +02:00
rlar 634b012492 inpcom.c, inp_chk_for_multi_in_vcvs(), #3/6, xx_new_line() shall fill the li_next slot 2017-06-24 19:40:48 +02:00
rlar e9e9e5d55e inpcom.c, inp_chk_for_multi_in_vcvs(), #2/6, move code downwards 2017-06-24 19:40:38 +02:00
rlar c83b0544de inpcom.c, inp_chk_for_multi_in_vcvs(), #1/6, skip lines 2017-06-24 19:40:27 +02:00
rlar e81560de1a inpcom.c, drop the local 'new_line' variable 2017-06-24 19:11:22 +02:00
rlar b21b4170b2 inpcom.c, simplify the insertion of new lines/decks quite a bit 2017-06-24 19:11:21 +02:00
rlar 2972953336 inpcom.c, reorder initialisation
initialise param_beg and param_end before they will be used,
  instead of "afterwards" in preparation for the next following usage.
and move the "comment out" up some lines, think that way:
  comment out original line, append new line, ...
2017-06-24 18:16:48 +02:00
h_vogt 5d82d1b04a misccoms.c, com_quit(), don't free memory, unless shared ngspice
Traversing all linked memory structures to free their memory
  can be a somewhat lengthy business, especially in xspice,
  which is not worth the effort when we simply want to exit()
Long delays have been reported in certain cases.

For developers and for the usage of such tools as valgrind,
  we still free all the memory if 'set ngdebug' is given.
2017-06-24 17:55:26 +02:00
rlar b2621174d3 inpgmod.c, plug a memory hole
Reported and fixed by Marek Bielik in message:
  Subject: [Ngspice-devel] Memory leaks fix
  Date: Tue, 18 Apr 2017 16:16:21 +0000
2017-06-24 17:49:07 +02:00
h_vogt 7489a37973 inpgval.c, inpdpar.c, beautify the code 2017-06-06 17:05:22 +02:00
h_vogt fa6e21dd3a inpgval.c, INPgetValue(), use INPgetNetTok() instead of INPgetTok()
To fix a bug reported by Clyde Shappee in
  Subject: Problem with pole zero analysis and net names
  https://sourceforge.net/p/ngspice/discussion/127605/thread/14338e7e/

When using node names with a leading slash '/'
  on the "pz" analysis command line.
2017-06-06 16:51:32 +02:00
rlar a6a3d884ee fix commit "mifsetup.c, MIFunsetup(), #1/3 delete broken code"
which silently dropped the
  here->initialized = MIF_FALSE
aspect of the MIFunsetup() function

which caused segfault in testcase
  examples/memristor/memristor_x.sp
2017-06-06 16:42:32 +02:00
Tim Edwards fd79197fc0 xspice/icm/digital, introduce d_genlut
a digital n-input x m-output look-up table gate
2017-05-01 22:11:24 +02:00
Tim Edwards 8ae3b84c7c xspice/icm/digital, introduce d_lut
a digital n-input look-up table gate
2017-05-01 22:11:04 +02:00
h_vogt 37fe5308d3 xspice/icm/table, introduce table2d/table3d
which allows to model devices based upon linear interpolation
2017-04-30 17:00:15 +02:00
rlar a7cc37b2e2 ifparm, fix numdev too 2017-04-19 19:18:13 +02:00
h_vogt cc8fb86411 diotemp.c, set lower limit of saturation current 'is' to epsmin 2017-04-19 18:57:20 +02:00
h_vogt c82ee9d949 introduce option "epsmin"
To define a minimum argument for some log() function invocations.
(most notably for the diode saturation current 'is')
2017-04-19 18:56:00 +02:00
dwarning 78cc48575b prevent warnings for double declared variables 2017-04-17 20:53:30 +02:00
rlar 2f329bd8b4 N_MXVLNTH, drop noise variable name limitation 2017-04-15 17:21:24 +02:00
h_vogt 306ada7dd0 inpcom.c, get_model_type(), use gettok_noparens() to extract model type
Takes care of model descriptions in parentheses like
  d(...)
2017-04-12 22:00:07 +02:00
h_vogt 1ffb957e6c inpcom.c, inp_fix_subckt_multiplier(), cleanup, using strchr() 2017-04-12 21:48:13 +02:00
rlar 2f1219811e src/spicelib/devices/*/*set.c, XXXunsetup(), reset local node variables unconditionally
and use a more robust test for local node numbers.

That is, transform this pattern :
  if (here->Node && ...) {
     CKTdltNNum(ckt, here->Node);
     here->Node = 0;
  }
into this :
  if (here->Node > 0 && ...)
     CKTdltNNum(ckt, here->Node);
  here->Node = 0;

The change of "!= 0" ==> "> 0" accounts for rare cases where "Node"
   might have been set to -1, (meaning "unconnected")
The unconditional execution of the zero assignment is for those cases
  where "Node" might have been assigned to some external or other local Node.
If so, the variable would not be set to zero, confusing the "guarding" if's
  in the corresponding XXXsetup() routine.

The Pattern to follow is:
  1) unset and delete *all* local Nodes in XXXunsetup()
  2) allocate all of them again in a re-invocation of XXXsetup(),
       exactly the same way as in the very first invocation.
2017-04-12 21:34:05 +02:00
rlar 00c743c37d src/spicelib/devices/*/*def*.h, declare external node variables const
for almost all other external nodes (notable exception "txl")
src/spicelib/devices/*/*def*.h, declare external node variables const

1) The compiler shall emit an error message if we still mess around
     with external node numbers.
2) To mark which elements of the instance struct are meant to be set
     externally when parsing the netlist

These "external" node variables are exclusively set via the
  overlay struct GENinstance, member GENnode[]

We shall not mess around with these "external" node variables
  because it would get rather difficult to avoid bugs considering
  re-invocation of the XXXsetup() routine.
This gets interesting for devices with optional ports,
  which get copied around depending on the amount of connected ports.
2017-04-12 21:34:02 +02:00
rlar 0e9576cb34 src/spicelib/devices/*/*set.c, missing CKTdltNNum() invocations, complex cases
All locally created nodes (CKTmk..() invocations in XXXsetup())
  must be deleted in XXXunsetup()

Otherwise CKTmk..() invocations during a following CKTsetup()
  will re-emit still used node numbers,
  thus accidentally shorting nodes.

This patch fixes the complex cases,
  which are external node variables (ports of the instance),
  which might be moved over to other external node variables
  to cope with optional port connections.
This is fixed by copying the node numbers to local shadow variables
  to avoid messing with the external nodes.
Otherwise a following CKTsetup() might again meddle with the external
  node variables, at least causing considerable confusion, probably causing
  hard to find bugs.
2017-04-12 21:34:00 +02:00
rlar c0921250b7 src/spicelib/devices/*/*set.c, missing CKTdltNNum() invocations, medium cases
All locally created nodes (CKTmk..() invocations in XXXsetup())
  must be deleted in XXXunsetup()

Otherwise CKTmk..() invocations during a following CKTsetup()
  will re-emit still used node numbers,
  thus accidentally shorting nodes.

This patch fixes a little bit more complex cases,
  which are local node variables which will start with value 0
  and eventually be set with the result of a CKTmk..() invocations,
  but might as well receive a node number from another node variable.
Here CKTdltNNum() must not be invoked if the node number is merely
  a copy from another node variable.
2017-04-12 21:33:59 +02:00
rlar 1fd14fa2ee src/spicelib/devices/*/*set.c, missing CKTdltNNum() invocations, simple cases
All locally created nodes (CKTmk..() invocations in XXXsetup())
  must be deleted in XXXunsetup()

Otherwise CKTmk..() invocations during a following CKTsetup()
  will re-emit still used node numbers,
  thus accidentally shorting nodes.

This patch fixes the simple cases,
  which are local node variables which will start with value 0
  and eventually be set with the result of a CKTmk..() invocation.
More complex cases evolve, if such a local variable might receive
  a node number which origins from another node, or the netlist itself.
2017-04-12 21:33:58 +02:00
rlar 0c86adf9af src/spicelib/devices/*/*set.c, XXXunsetup(), sort CKTdltNNum() invocations
Invoke CKTdltNNum() in reverse order of local node creation in XXXsetup()

This fixes a bug at least in mesa and hfet1,
  where already destroyed node variables have still been accessed
  in the guarding 'if' of a later CKTdltNNum() stanza.
Invoking them in revers order easily prevents such bugs,
  and improves readability.
2017-04-12 21:33:50 +02:00
rlar 7afb798a6f check for illegal DEVsetup() DEVunsetup() patterns.
Consider the following silent contracts:
1)
 CKTsetup() invocations must be separated by a CKTunsetup() invocation
 But CKTsetup() has an internal flag,
   which will prevent re-invocation of DEVsetup()
 But DEVsetup() will be called during sensitivity analysis,
   bypassing this precaution. It is fatal if this will
   cause another node allocation (CKTmk..()).
   This commit tries to detect such cases.
   (Note: many DEVsetup routines (all ?) have their CKTmk..() invocations
      guarded to avoid reallocation of local nodes,
      see commit f7f454c0a1
        bug fix, fix the guard for device generated internal nodes (via CKTmkVolt())
   )
   FIXME:
     DEVsetup() is seriously obfuscated by these guards.
     If would be far better, if the sensitivity analysis
       wouldn't sidestep into DEVsetup()
     consider a device local variant of the CKTisSetup flag
2)
 DEVunsetup() must delete all, each and every,
   local allocated node in DEVsetup()
 Otherwise CKTmk..() invocations in a following CKTsetup() will
   return duplicate node numbers, effectively shorting device nodes.
 This commit tries to detect incomplete CKTdltNNum() invocations.
3)
  DEVunsetup() must not delete a netlist node.
  This can easily happen in those devices which have optional ports,
    which have code in DEVsetup() which copies node numbers to
    local node variables.
  This commit tries to detect such errors.
2017-04-12 21:32:51 +02:00
h_vogt 69b235531e sharedspice.c, introduce csh variable "sharedmode"
to reflect whether running as shared library
2017-04-12 21:22:22 +02:00
h_vogt 0bf381e01d cpitf.c, for Windows, introduce csh variable "win_console"
to reflect whether this .exe is a "console" build
2017-04-12 21:11:13 +02:00
h_vogt 670880086f cpitf.c, MS Visual Studio, introduce csh variable "pg_config"
reflecting .exe compilation for
  32/64 bit
  with/without NGDEBUG
2017-04-12 21:01:57 +02:00
h_vogt d7a1899210 runcoms.c, rawfile.c, include filename in the 'ASCII/binary raw file' printout 2017-04-12 20:45:51 +02:00
rlar 926ba4baaf xspice/icm/analog/file_source/cfunc.mod, use CALLBACK
to free() locally allocated memory and fclose() a local filestream
2017-04-12 20:14:47 +02:00
rlar 58874cc65e xspice, implement "CALLBACK"
Allow to register a callback function in the cfunc.mod files,
  which will be invoked in MIFdestroy.
Usefull to "free" memory which has been allocated locally in a cfunc.mod file.
2017-04-12 20:02:35 +02:00
mhx 5f0f54761a xspice, analog/file_source, bug fix
The source code did not consider the possibility
  of more than one "tran" analysis invocations.

see "Bewildering problem with filesource block while sweeping"
https://sourceforge.net/p/ngspice/discussion/133842/thread/52949e23/
2017-04-12 20:01:14 +02:00
rlar 4872580221 mifsetup.c, MIFunsetup(), #3/3 now invoke CKTdltNNum() 2017-04-12 18:41:07 +02:00
rlar 9154f83c37 mifsetup.c, MIFunsetup(), #2/3 copy paste from MIFsetup() 2017-04-12 18:38:26 +02:00
rlar c68a0313bd mifsetup.c, MIFunsetup(), #1/3 delete broken code 2017-04-12 18:38:25 +02:00
dwarning 48262e5c0a extend safe operation area check (SOA) to polarity check for mosfets by additional parameters 2017-04-11 21:31:54 +02:00
rlar 46ab21dca9 inpcom.c, is_a_modelname(), don't accept "1E2" 2017-04-09 20:19:35 +02:00
h_vogt 847a09fd37 inpcom.c, get_number_terminals(), ignore "save" and "print" when CIDER 2017-04-09 18:33:12 +02:00
h_vogt e5d70d0821 gnuplot.c, bug fix, allow gnuplot with MINGW 2017-04-09 17:53:40 +02:00
rlar ccfcc056ad inpcom.c, bug fix, allow leading '_' in parameter identifiers 2017-04-09 15:38:15 +02:00
rlar c6896cf338 accept .para shortcut for .param 2017-04-09 15:37:46 +02:00
rlar 900bed550d string.c, #6/6, use skip_ws() and skip_back_ws() 2017-04-09 15:35:44 +02:00
rlar 0da47c644b string.c, #5/6, cleanup 2017-04-09 15:35:41 +02:00
rlar 5b23b54769 string.c, #4/6, cleanup token fetching 2017-04-09 15:35:38 +02:00
rlar c6a3438408 string.c, #3/6, cleanup 'return' 2017-04-09 15:35:35 +02:00
rlar ed13e8a15a string.c, #2/7, drop 'register' 2017-04-09 15:35:32 +02:00
rlar d48bec757c string.c, #1/6, whitespace 2017-04-09 15:35:29 +02:00
rlar fb1c6fc123 ifparm, #16/16, isrc.c, non grouped alias entry, change "c" from IP to IOPPR 2017-04-09 15:29:44 +02:00
rlar 762314b893 ifparm, #15/16, ind.c, missing IF_AC|IF_PRINCIPAL in alias entry, use IOPAPR 2017-04-09 15:29:43 +02:00
rlar d32a32bdc8 ifparm, #14/16, res.c, missing IF_ORQUERY|IF_REDUNDANT, introduce IOPQOR 2017-04-09 15:29:42 +02:00
rlar cefb65507f ifparm, #13/16, res.c, missing IF_SETQUERY in an alias entry, introduce IOPQR 2017-04-09 15:29:41 +02:00
rlar 8d3acddc7b ifparm, #12/16, res.c, missing IF_PRINCIPAL in an alias entry, introduce IOPPR 2017-04-09 15:29:40 +02:00
rlar 614eebe944 ifparm, #11/16, res.c, missing IF_CHKQUERY for some alias entries, introduce IOPZR 2017-04-09 15:29:40 +02:00
rlar ff00855397 ifparm, #10/16, jfet2.c, missing IF_REDUNDANT for some aliases, introduce PARAMR 2017-04-09 15:29:39 +02:00
rlar cee466b35e ifparm, #9/16, mes.c, "m" is an alias of "area", use IOPUR 2017-04-09 15:29:38 +02:00
rlar f0e2b43940 ifparm, #8/16, excess IF_REDUNDANT for some aliases, use IOP 2017-04-09 15:29:37 +02:00
rlar 102a6b7c77 ifparm, #7/16, missing IF_UNINTERESTING for some aliases, introduce IOPUR 2017-04-09 15:29:36 +02:00
rlar 4fc33eb656 ifparm, #6/16, missing IF_NONSENSE for some aliases, introduce IOPXR 2017-04-09 15:29:35 +02:00
rlar b56c2a2504 ifparm, #5/16, missing IF_AC for some aliases, introduce IOPAR 2017-04-09 15:29:34 +02:00
rlar eac26d741c ifparm, #4/16, missing IF_REDUNDANT for some aliases, introduce IOPAPR 2017-04-09 15:29:33 +02:00
rlar 445860f79a ifparm, #3/16, missing IF_REDUNDANT for some aliases, use IOPR 2017-04-09 15:29:32 +02:00
dwarning 115b52a899 ifparm, #2/16, missing IF_REDUNDANT, duplicates and descriptions 2017-04-09 15:29:30 +02:00
dwarning e0fcdc7457 ifparm, #1/16, missing IF_REDUNDANT for vth0/vtho in bsim models 2017-04-09 15:23:15 +02:00
rlar 1e6b809af8 introduce command "check_ifparm" to check consistency of the device IFparm sets
For developing purpose only, and bound to HAVE_TSEARCH, HAVE_TDESTROY

IFparm descriptors must obey certain contracts,
  1) aliases must be grouped together with their associated main descriptor,
       and all must have flag IF_REDUNDANT set
  2) there shall be no duplicated .id fields except for aliases.
  3) aliased entries shall have consistent .dataType fields

check_ifparm will traverse all IFparm sets and report violations
2017-04-09 14:40:51 +02:00
h_vogt cf9dbff890 inpcom.c, cleanup, use strchr() 2017-04-09 14:14:45 +02:00
rlar 2df8f433f8 inp.c, inp_parse_temper(), rewrite, using search_idenifier and find_assignment
try to make it more robust with regard to
  '!=' '<=' '=='         don't misinterpret as '='
  "atemperaticvariable"  don't misinterpret as 'temper'
  multiple temper in one expression
2017-04-09 14:14:36 +02:00
rlar 511389ad10 inpcom.c, introduce find_back_assignment() 2017-04-09 14:14:06 +02:00
rlar 5238f0b1cb inpcom.c, find_assignment(), const'ify and declare extern 2017-04-09 14:12:22 +02:00
rlar 4c44027cd2 inp.c, inp_parse_temper(), cleanup 2017-04-09 14:12:13 +02:00
rlar 2809ccaa13 shrink scope of expr_w_temper 2017-04-09 14:06:27 +02:00
rlar 872ceeedc7 inp_temper_compat(), return expr_w_temper 2017-04-09 14:06:15 +02:00
rlar 2c35eebb0b invoke in_parse_temper_trees() and inp_evaluate_temper() unconditionally 2017-04-09 14:06:02 +02:00
rlar e35429a222 inpcom.c, introduce rem_tlist() 2017-04-09 14:03:11 +02:00
rlar c600312d01 deploy devtlist/modtlist in struct circ 2017-04-09 13:59:53 +02:00
rlar 2a50316304 inp_parse_temper(), add modtlist_p/devtlist_p arguments 2017-04-09 13:59:46 +02:00
rlar f78d8e21f0 inp_parse_temper_trees(), add struct circ argument 2017-04-09 13:59:38 +02:00
rlar f2f2b3b09a inp_evaluate_temper(), add struct circ argument 2017-04-09 13:49:43 +02:00
rlar fa13e422cd inpcom.c, bug fix, always reset expr_w_temper 2017-04-09 13:49:32 +02:00
rlar 5513d8bdf3 inpcom.c, bug fix, expr_w_temper missing reset 2017-04-09 13:49:22 +02:00
rlar c920946c73 inp.c, bug fix, need to reset modtlist/devtlist unconditionally 2017-04-09 13:49:13 +02:00
rlar 12de713ff5 inp.c, bug fix, commit "allow 'temper' keyword in .param, .model and device instance lines ..."
don't overwrite struct pt_temper.expression,
  to allow free'ing this string.
2017-04-09 13:49:05 +02:00
h_vogt 648de2a001 cktdojob.c, add missing evaluation of TEMPER after new temperature is set
This is relevant for model and device parameters containing TEMPER.
2017-04-09 13:48:55 +02:00
h_vogt 67e06bb4ac winmain.c, bug fix, #315 ngspice under windows 10 shows exception on quit
https://sourceforge.net/p/ngspice/bugs/315/

longjmp() creates segfault under Windows 10 (VS and MINGW)
somewhere when MainWindowProc() is processing the WM_CLOSE message.

Instead of raising SIGINT, directly call cp_doquit().
return 0 if "askquit" is set and the user declines to "quit".
This continues the simulation, if still active.
2017-04-09 12:46:38 +02:00
dwarning 33c7740884 bsim4 model update according berkeley release - disclaimer change 2017-03-31 15:01:30 +02:00
dwarning 3f0096fd46 bsim4 model update according berkeley release - code change 2017-03-31 14:48:14 +02:00
rlar ab409ad62e protect vec_free() and free_pnode() macro for use in non braced blocks
if ()
  vec_free()
2017-03-25 19:54:40 +01:00
rlar c7811a76df ngspice/fteext.h, whitespace and spelling 2017-03-25 19:41:32 +01:00
rlar cc15853b4f ngspice/ftedefs.h, whitespace and spelling 2017-03-25 19:11:33 +01:00
h_vogt d84387d449 CIDER, use controlled_exit(1) instead of exit(1) 2017-03-25 18:44:00 +01:00
rlar 2142cfdcce subckt.c, cleanup 2017-03-25 18:17:08 +01:00
rlar 9b01dbae95 subckt.c, numnodes(), #4/4, drop 'buf' 2017-03-25 18:17:07 +01:00
rlar 66b8b3de54 subckt.c, numnodes(), #3/4, rename argument 'name' --> 'line' 2017-03-25 18:17:04 +01:00
rlar 7b6070e6b9 subckt.c, numnodes(), #2/4, cleanup 2017-03-25 18:00:43 +01:00
rlar b18c06c441 subckt.c, numnodes(), #1/4, cleanup 2017-03-25 18:00:41 +01:00
rlar 33788f7052 remove excessive inp_evaluate_temper() prototypes 2017-03-22 21:47:43 +01:00
rlar 0fb21eaf4a subckt.c, translate(), #8/8 whitespace and comments 2017-03-22 21:25:46 +01:00
rlar f19a6c6390 subckt.c, translate(), #7/8 cleanup 2017-03-22 21:25:46 +01:00
rlar 49947e0279 subckt.c, translate(), #6/8 cleanup 2017-03-22 21:25:46 +01:00
rlar 2a4c34c401 subckt.c, translate(), #5/8 trailing 's' is never used 2017-03-22 21:25:46 +01:00
rlar 7169ad4bfa subckt.c, translate(), #4/8 don't append trailing whitespace 2017-03-22 21:25:46 +01:00
rlar 1f31f73295 subckt.c, translate(), #3/8 simplify 2017-03-22 21:25:45 +01:00
rlar e40485b8a3 subckt.c, translate(), #2/8 cleanup 2017-03-22 21:25:45 +01:00
rlar 476c41f436 subckt.c, translate(), #1/8 cleanup 2017-03-22 21:25:45 +01:00
rlar 405c6f6f02 subckt.c, introduce translate_mod_name() 2017-03-22 21:25:45 +01:00
rlar db213fd8d2 subckt.c, devmodtranslate(), dupplicate code from above
and drop a redundant piece
2017-03-22 21:25:45 +01:00
rlar c653161666 subckt.c, introduce translate_inst_name()
to abstract the instance name translation during netlist flattening
2017-03-22 21:25:45 +01:00
rlar a54a535dd5 subckt.c, introduce translate_node_name() 2017-03-22 21:25:45 +01:00
rlar bab59844ff subckt.c, emphasize instance_name translation
When translating an instance_name in a subcircuit instance 'xfoo'
undconditionally express the exception for 'x' instances, which is:
  x42 --> xsub.x42
but for all others the first char (the devtype) is prepended
  r42 --> r.xsub.r42
2017-03-22 21:25:45 +01:00
rlar e3b3cc502a subckt.c, translate(), emphasize instance_name translation 2017-03-22 21:25:45 +01:00
rlar a03a57c9f9 subckt.c, emphasize token separator insertion 2017-03-22 21:25:44 +01:00
rlar 6b78ed4367 subckt.c, devmodtranslate(), rewrite using bxx_ facility 2017-03-22 21:25:44 +01:00
rlar 4d69002144 subckt.c, translate(), rewrite using bxx facility 2017-03-22 21:25:39 +01:00
rlar 13b6daae2f subckt.c, translate(), cleanup while() loop 2017-03-22 20:53:22 +01:00
rlar a5dd826d19 subckt.c, finishLine(), #9/9, unconditionally transform instance name in i() expressions 2017-03-22 20:53:14 +01:00
rlar dc092c4ebc subckt.c, finishLine(), #8/9, fuse two if's with the same conditional expr 2017-03-22 20:52:10 +01:00
rlar 99d788cd12 subckt.c, finishLine(), #7/9, drop condition which is always true 2017-03-22 20:50:59 +01:00
rlar 253cf5b75a subckt.c, finishLine(), #6/9, drop condition which is always false 2017-03-22 20:50:38 +01:00
rlar ff4805c023 subckt.c, finishLine(), #5/9, move/duplicate code behind if/else into the if/else 2017-03-22 20:49:53 +01:00
rlar 735e7700ce subckt.c, finishline(), #4/9, reorder 2017-03-21 20:27:20 +01:00
rlar 8ab28df4ec subckt.c, finishline(), #3/9, here *src === '(' 2017-03-21 20:27:19 +01:00
rlar 5d3896c388 subckt.c, finishline(), #2/9, rewrite 2017-03-21 20:27:18 +01:00
rlar 0502e83fba subckt.c, finishline(), #1/9, trivial cleanup 2017-03-21 20:27:17 +01:00
rlar f12ff5464e inpptree.c, PTdifferentiate(), cleanup, use a #define
to express the expressions arguments more readable
2017-03-19 21:06:49 +01:00
rlar d696aa8781 niconv.c, NIconvTest(), NaN in CKTrhs denotes non-convergence
emit a warning message, but only if ft_ngdebug is set
2017-03-19 20:38:41 +01:00
rlar dc6e1cb064 use strchr() instead of strstr() 2017-03-19 20:24:49 +01:00
rlar bd50814677 drop 'depreciated_skip..()' 2017-03-19 20:13:11 +01:00
rlar 7a42510cc0 const'ify some 'skip'ing functions 2017-03-19 20:12:25 +01:00
rlar 45ad60b738 rename gettok_nc() --> nexttok(), and functionalize it 2017-03-19 20:11:01 +01:00
rlar f338dfe27e subckt.c, undo a bogous hunk from commit "beautify code", Dec 16 2011 2017-03-19 20:07:34 +01:00
rlar f9019a5576 devices/*/*ld.c, bug fix, missing assignment to 'model' 2017-03-19 19:47:25 +01:00
mhx efb8214945 fix spelling, "too much" versus "too many" 2017-03-18 20:49:28 +01:00
rlar 889aaebfd7 inp2m.c, #7/7, whitepace cleanup 2017-03-18 20:44:21 +01:00
rlar 576e522d38 inp2m.c, #6/7, reorder code 2017-03-18 20:44:13 +01:00
rlar 73e76fd88a inp2m.c, #5/7, drop nname[] 2017-03-18 20:44:04 +01:00
rlar 74145c53a6 inp2m.c, #4/7, move code up into the for loop 2017-03-18 20:43:55 +01:00
rlar 5a95487ad7 inp2m.c, #3/7, simpify, move code down into the for loop 2017-03-18 20:43:46 +01:00
rlar 788c8f7067 inp2m.c, #2/7, simplify, move code down into for loop 2017-03-18 20:43:38 +01:00
rlar bef3fd1dd5 inp2m.c, #1/7, insist on a valid model, don't default to something
Emit an error message when unable to identify a valid modelname token.

If a default model is needed, then create one explicitly:
  m1 1 2 3 4 mosdefault
  .model mosdefault mos1()
2017-03-18 20:43:19 +01:00
rlar 80ef8b308d inp2m.c, do not restrict binning to four nodes
until now, for unknown reasons,
  the search for binned modelnames was restricted to
  instances with less than five nodes.
2017-03-18 20:18:11 +01:00
rlar 50c0424225 inp2q.c, inp2m.c, plug a memory leak 2017-03-18 20:15:39 +01:00
Francesco Lannutti 43f24d6f22 rewrite cktsens.c in terms of the 'SMP' matrix interface 2017-03-17 18:22:36 +01:00
rlar fb4f462388 SMPnewMatrix(), add 'size' to the function arguments 2017-03-17 18:12:48 +01:00
rlar 07d89b5fcd devices/**, unify structure member variables, ptr -> Ptr 2017-03-17 17:42:58 +01:00
rlar a6cb9d0d88 cplsetup.c, polish VECTOR_ALLOC and MATRIX_ALLOC
explicitly express the object type to be allocated
2017-03-17 17:37:24 +01:00
rlar 8c09761e6b adms, polish autogen.sh and configure.ac
Allow to override the admsXml executable when invoking
  autogen.sh and configure.ac

ADMSXML=/foo/bar/baz/admsXml ./autogen.sh --adms
ADMSXML=/foo/bar/baz/admsXml ./configure --enable-adms
alternatively (and more advertised)
./configure ADMSXML=/foo/bar/baz/admsXml --enable-adms

The generated Makefiles remember the given path.
A relative path doesn't make sense of course.
2017-03-12 19:34:37 +01:00
rlar 3ea412e7cd bug fix for commit "inp2q.c, #17/23, rewrite, using a 'for' loop" 2017-03-12 17:57:27 +01:00
rlar c3a92e2bb3 xspice, cleanup, move typedef over to the other ones 2017-03-12 12:18:09 +01:00
rlar 987952e57e adms/admst/ngspiceMODULEsetup.c.xml, adms, implement DEVunsetup()
Which is needed to release the allocated circuit nodes in
  the corresponding adms generated DEVsetup() routine.
This is required when invoking CKTsetup() more than once
  without an intervening "reset".
2017-03-12 10:43:32 +01:00
rlar 6ccccbe7c4 adms/admst/ngspiceMODULE.c.xml, fix the port name table
which will be exported from the model code to "spice" via
  struct IFdevice.terms
  struct IFdevice.numNames
  struct IFdevice.termNames
2017-03-12 10:41:52 +01:00
rlar ba6955a1aa inp2q.c, sanitise optional ports processing
Tie ports 4 and up to ground, iff not connected.

Actually, I think the model's DEVsetup routine should do this business,
  we should pass -1 to denote the fact of being unconnected
2017-03-11 21:11:32 +01:00
rlar 3ce3424a9c inp2q.c, #23/23, whitespace 2017-03-11 20:27:48 +01:00
rlar 9ad1a3033b inp2q.c, #22/23, drop #ifdef, model_numnodes() does care about this 2017-03-11 20:27:48 +01:00
rlar ac77e5b020 inp2q.c, #21/23, drop nname[] and model, use local 'token' instead 2017-03-11 20:27:47 +01:00
rlar 25fa9a4454 inp2q.c, #20/23, insist on a valid model, don't default to something
If a default model is needed, then create one explicitly:
 q1 1 2 3 npndefault
 .model npndefault npn()

Note:
  This code was buggy anyway because the last token,
    which turned out not to be a valid model name,
    was silently swallowed.
  Thus PARSECALL() didn't parse the whole thing.
2017-03-11 20:27:47 +01:00
rlar b85a07c62c inp2q.c, #19/23, rewrite, move code into the 'for' loop 2017-03-11 20:27:47 +01:00
rlar b1ccdd2184 inp2q.c, #18/23, rewrite, combine two 'for' loop's 2017-03-11 20:27:47 +01:00
rlar 807115c145 inp2q.c, #17/23, rewrite, using a 'for' loop 2017-03-11 20:27:47 +01:00