Commit Graph

5244 Commits

Author SHA1 Message Date
rlar d4a47c1f7b inpcom.c, inp_reorder_params_subckt(), introduce insert_deck() 2017-04-23 19:33:50 +02:00
rlar 53e83cdee3 inpcom.c, inp_reorder_params_subckt(), reorder 2017-04-23 19:33:50 +02:00
rlar f1380ab114 inpcom.c, drop unused artefact xx_new_line() 2017-04-23 19:33:50 +02:00
rlar 6d87c4c2eb inpcom.c, complete insert_new_line() 2017-04-23 19:33:50 +02:00
rlar fd493ab59c inpcom.c, inp_fix_subckt(), drop redundant initialisations 2017-04-23 19:33:50 +02:00
rlar 56e3881142 inpcom.c, inp_fix_subckt(), drop 'last_param_card' 2017-04-23 19:33:50 +02:00
rlar 25d512aa3e inpcom.c, inp_fix_subckt(), use insert_new_line 2017-04-23 19:33:49 +02:00
rlar 95a28252f2 inpcom.c, inp_fix_subckt(), rewrite appending to the tail 2017-04-23 19:33:49 +02:00
rlar 5bf064b034 inpcom.c, extend insert_new_line() to allow NULL head 2017-04-23 19:33:49 +02:00
rlar 339539c0c9 inpcom.c, introduce insert_new_line() 2017-04-23 19:33:49 +02:00
rlar c213391bc3 inpcom.c, expand_section_ref(), cleanup 2017-04-23 19:33:49 +02:00
rlar 7af4421a50 inpcom.c, expand_section_ref(), drop 'rest' 2017-04-23 19:33:49 +02:00
rlar 8888be7eae inpcom.c, expand_section_ref(), drop 'newl' 2017-04-23 19:33:49 +02:00
rlar f9ad655bb6 inpcom.c, expand_section_ref(), drop 'cend', use 'c' instead 2017-04-23 19:33:49 +02:00
rlar 942640ba5c inpcom.c, expand_section_ref(), simplify 2017-04-23 19:33:49 +02:00
rlar ab76b8d12c inpcom.c, expand_section_ref(), cend != NULL => t != section_def 2017-04-23 19:33:48 +02:00
rlar c809e15dc1 inpcom.c, inp_read(), rewrite 2017-04-23 19:33:48 +02:00
rlar be5a4809ae inpcom.c, inp_read(), rewrite appending to the tail 2017-04-23 19:33:48 +02:00
rlar 8926cda427 inpcom.c, inp_stitch_continuation_lines(), prepare 2017-04-23 19:33:48 +02:00
rlar 17ffad7f2b inpcom.c, inp_add_series_resistor(), simplify and drop 'd' 2017-04-23 19:33:48 +02:00
rlar 372c4ba8a2 inpcom.c, inp_add_series_resistor(), reorder 2017-04-23 19:33:48 +02:00
rlar 2ce71c10ef inpcom.c, inp_add_series_resistor(), reorder
deploy value for 'd->li_next' in the li_next slot and fetch from there
2017-04-23 19:33:48 +02:00
rlar 0d17fffb00 inpcom.c, inp_add_series_resistor(), fill li_next slot yourself 2017-04-23 19:33:48 +02:00
rlar 84b66b6728 inpcom.c, inp_add_control_section(), transform 2017-04-23 19:33:47 +02:00
rlar ec3198b1a9 inpcom.c, inp_add_control_section(), emphasise two assertions 2017-04-23 19:33:47 +02:00
rlar 5cd88a3fc5 inpcom.c, inp_chk_for_multi_in_vcvs(), drop 'model_card', and finish off the other two too 2017-04-23 19:33:47 +02:00
rlar 8d2f63107d inpcom.c, inp_chk_for_multi_in_vcvs(), drop 'next_card', deploy its value temporarily in the new line li_next slot 2017-04-23 19:33:47 +02:00
rlar fb4722ffca inpcom.c, inp_chk_for_multi_in_vcvs(), drop 'a_card', reuse the unused 'c' instead 2017-04-23 19:33:47 +02:00
rlar e6c0ddf238 inpcom.c, inp_chk_for_multi_in_vcvs(), xx_new_line() shall fill the li_next slot 2017-04-23 19:33:47 +02:00
rlar 76d45af765 inpcom.c, inp_chk_for_multi_in_vcvs(), move code downwards 2017-04-23 19:33:47 +02:00
rlar d76cf964c5 inpcom.c, inp_chk_for_multi_in_vcvs(), skip lines 2017-04-23 19:33:47 +02:00
rlar 15c56a1bcc inpcom.c, drop 'new_line' 2017-04-23 19:33:46 +02:00
rlar 9e89d8c4bf inpcom.c, simplify the insertion of new lines quite a bit. 2017-04-23 19:33:46 +02:00
rlar b81dab07f9 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-04-23 19:33:46 +02:00
h_vogt c5df31975f misccoms.c, exit immediately, if not shared ngspice,
do exit only after cleaning all memory if 'set ngdebug' is given.
2017-04-23 19:33:37 +02:00
rlar 58dfc6cf91 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-04-23 19:33:30 +02:00
rlar 6f7b68945d tests/regression/sens, fix test cases
which have been invalidated by commit:
ifparm, #4/16, missing IF_REDUNDANT for some aliases, introduce IOPAPR

before this commit, sensitivity to "capacitance" was published twice,
  once with name "c1"  (reference name of a CAP device)
  and as "c1_c" (reference name of a CAP concatenated with param name "c")
after said commit, sensitivity is no longer published as "c1_c"
  (because "c" is only an "alias"/IF_REDUNDANT of the main parameter
   which is named "capacitance", and "capacitance" is a IF_PRINCIPAL
   and thus avoids "concatenation" of the parameter name)
2017-04-21 18:52:43 +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