~kicad/+git/ngspice-mirror-sourceforge:fix-CKTunsetup-2

Last commit made on 2017-03-05
Get this branch:
git clone -b fix-CKTunsetup-2 https://git.launchpad.net/~kicad/+git/ngspice-mirror-sourceforge
Members of KiCad can upload to this branch. Log in for directions.

Branch merges

Branch information

Name:
fix-CKTunsetup-2
Repository:
lp:~kicad/+git/ngspice-mirror-sourceforge

Recent commits

97c174d... by rlar <rlar>

ngspiceMODULEsetup.c.xml, adms, implement DEVunsetup()

to release the allocated circuit nodes in
  the corresponding adms generated DEVsetup() routine
which is required when invoking CKTsetup() more than once
  without an intervening "reset"

9c9d89e... by rlar <rlar>

fix previous commit

0538511... by rlar <rlar>

xspice/icm/analog/file_source/cfunc.mod, use CALLBACK to free and fclose

ee0f1be... by rlar <rlar>

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.

0ae876d... by Marcel Hendrix

Fixed file_source. See the example.cir,

It exercises most parameters and supports ALTER.
Fixme, the data file is opened, but never closed!

3e04e09... by rlar <rlar>

mifsetup.c, MIFunsetup(), #3/3 now invoke CKTdltNNum()

bcdafe8... by rlar <rlar>

mifsetup.c, MIFunsetup(), #2/3 copy paste from MIFsetup()

836f201... by rlar <rlar>

mifsetup.c, MIFunsetup(), #1/3 delete broken code

fad6d1f... by rlar <rlar>

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.

5516d33... by rlar <rlar>

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.