Commit Graph

601 Commits

Author SHA1 Message Date
Francesco Lannutti 9481013fe0 Implement klu_z_print() 2018-03-27 10:00:03 +02:00
Francesco Lannutti ea52cd7ba0 Implement spMatrix_CSC_dump() 2018-03-27 10:00:03 +02:00
Francesco Lannutti 8d53bf8791 Implemented spDeterminant_KLU 2018-03-27 10:00:03 +02:00
Francesco Lannutti ff9af114d4 klu_extract_Udiag, Fixed the PZ Analysis for KLU - Added a missing KLU node in VSRC which exists only in case of PZ Analysis - Other fixes 2018-03-27 10:00:02 +02:00
Francesco Lannutti 5dc9605e3f Fixed a bug in SMPpreOrder and let KLU digest an empty matrix 2018-03-27 10:00:02 +02:00
Francesco Lannutti 4677aa608c KLU Integration from scratch #4, changed files 2018-03-27 09:48:52 +02:00
Francesco Lannutti f37e049ce3 KLU Integration from scratch #1, new files 2018-03-26 23:28:09 +02:00
Francesco Lannutti ef76160343 move include files to src/include/ngspice/ 2018-03-26 23:28:09 +02:00
rlar b803b294b4 frontend/parser/lexical.c, cp_lexer(), allow # and * comment
Both, whether interactive or not.
Especially for command scripts.
2018-02-26 19:41:04 +01:00
rlar 4ec2717079 struct card, #5/6, rewrite from type "card" to "struct card" 2018-02-17 19:15:53 +01:00
rlar 10a353ebf4 struct card, #4/6, drop typedef card
For readability and to allow variables to have the name "card"
(avoid name collision with typedef "card")
2018-02-17 19:15:53 +01:00
rlar 511cdd7188 struct card, #3/6, rename members from struct line to struct card 2018-02-17 19:15:53 +01:00
rlar 981fed70ca struct card, #2/6, drop struct line
struct line is an overlay of struct card.
2018-02-17 19:15:53 +01:00
rlar 8d93511a96 struct card, #1/6, minor cleanup 2018-02-17 19:15:53 +01:00
rlar 41c0ee45a2 introduce GENinstanceFree() and GENmodelFree()
To abstract away the business of releasing the memory
  of a struct GENmodel or struct GENinstance.
2018-02-17 11:53:07 +01:00
rlar 8c7d7051ae GENmodel, GENinstance, change layout, #4/4, complete the change
currently each and every device specific instance and model structure
  duplicates the memory layout of a struct GENmodel / GENinstance

further the first structure elements behind a GENinstance header
  are reinterpreted as a sort of a generic "node" array.

This business is very error prone, and makes it difficult to
  extend struct GENmodel / struct GENinstance.

This patch makes this business much more bearable.
2018-02-17 11:53:06 +01:00
rlar 2c9bfecbad GENmodel, GENinstance, change layout, #3/4, coccinelle semantic patch 2018-02-17 11:53:05 +01:00
rlar 4748c92de9 DEVdestroy(), change API, #2/2, complete the change, inclusive CKTdestroy()
loop over DEVmodDelete() and DEVdelete() in CKTdestroy()
  instead of doing this business in the DEVdestroy() functions.

As a consequence, most DEVdestroy() functions
  collapse completely.
2018-02-17 11:52:59 +01:00
rlar 3cd81295a8 DEVmodDelete(), change API, #2/2, complete the change
Instead of searching and then deleting a given device-model,
  just delete the given model.

The search shall be done somewhere else.

Don't free the model struct itself,
  this shall be done by the invoker himself.

Don't free the device instrance list,
  this shall be done by the invoker himself.

As a consequence, most DEVmodDelete() functions
  collapse almost completely.

This change is of no consequence,
  because DEVmodDelete() is currently nowhere used.
2018-02-17 11:52:53 +01:00
rlar c3ed42f486 DEVdelete(), change API, #2/2, complete the change
Instead of searching and then deleting a given device-instance,
  just delete the given instance.

The search shall be done somewhere else.

Don't free the instance struct itself,
  this shall be done by the invoker.

As a consequence most DEVdelete() functions
  collapse almost completely.

This change is of no consequence,
  because DEVdelete() is currently nowhere used.
2018-02-17 11:52:46 +01:00
rlar e311096429 gendef.h, get rid of awkward counted GENnode macros 2018-02-03 11:46:24 +01:00
rlar 018a2d0e2f devices/*, unify, add missing instance struct member 'GENstate'
to the generic part of all instance structs, even when actually unused.
see GENstate in "gendefs.h"
2018-02-03 11:46:24 +01:00
Holger Vogt 560cb6e970 plotting/grid.c, bug fix, avoid string buffer overflow
Prevent a crash of example/FFT_test.cir.
Buffer 'buf' in function drawlingrid() has been too small.
Increase 'buf' size, and add some protection.

The example file examples/plot/test-small-plot.cir
shows the limits of plotting:
  difference in two numbers at digit 14 is plotted well.
                            at digit 15 is plotted with bugs.
                            at digit 16 is reduced to integer.

consider compiling with
  -O1 -D_FORTIFY_SOURCE=2
for gcc, and
  /GS
for visual studio.
2018-01-27 21:58:15 +01:00
rlar c900cc8824 drop ngspice internal implementation of erfc()
which these days is guaranteed to be provided by <math.h>

note,
  our own implementation was incorrect anyway.
  it evaluated to
    erfc_ngspice(x) = erfc(fabs(x))
2017-10-28 12:38:32 +02:00
dwarning a1d27b4257 dio, introduce qd as an alias for diode charge to get the right unit in plotting 2017-08-03 17:03:10 +02:00
rlar a7cc37b2e2 ifparm, fix numdev too 2017-04-19 19:18:13 +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
rlar 2f329bd8b4 N_MXVLNTH, drop noise variable name limitation 2017-04-15 17:21:24 +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
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
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 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 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 2809ccaa13 shrink scope of expr_w_temper 2017-04-09 14:06:27 +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 f2f2b3b09a inp_evaluate_temper(), add struct circ argument 2017-04-09 13:49:43 +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 33788f7052 remove excessive inp_evaluate_temper() prototypes 2017-03-22 21:47:43 +01:00
rlar bd50814677 drop 'depreciated_skip..()' 2017-03-19 20:13:11 +01:00