Commit Graph

5394 Commits

Author SHA1 Message Date
rlar e6431f042a spicelib/parser, support instance parameter defaults on .model lines 2018-02-15 22:38:56 +01:00
rlar 7a64d78749 introduce GENinstanceFree() and GENmodelFree()
To abstract away the business of releasing the memory
  of a struct GENmodel or struct GENinstance.
2018-02-15 22:38:55 +01:00
rlar b2242c6a1d 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-15 22:38:54 +01:00
rlar d62f1955d2 GENmodel, GENinstance, change layout, #3/4, coccinelle semantic patch 2018-02-15 22:38:53 +01:00
rlar aad7a8fd3b GENmodel, GENinstance, change layout, #3/4, klag-5.cocci for coccinelle 2018-02-15 22:38:52 +01:00
rlar 5b00667bfb GENmodel, GENinstance, change layout, #2/4, complete the change
fix the .xml files too
2018-02-15 22:38:51 +01:00
rlar a1ef5eba42 GENmodel, GENinstance, change layout, #1/4, coccinelle semantic patch 2018-02-15 22:38:50 +01:00
rlar e43446cc0c GENmodel, GENinstance, change layout, #1/4, klag-4.cocci for coccinelle 2018-02-15 22:38:49 +01:00
rlar d079bf7b87 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-15 22:38:48 +01:00
rlar 7762002b8c DEVdestroy(), change API, #1/2, coccinelle semantic patch 2018-02-15 22:38:47 +01:00
rlar 0ffefedd03 DEVdestroy(), change API, #1/2, klag-3.cocci for coccinelle 2018-02-15 22:38:46 +01:00
rlar 5f025050ab DEVdestroy(), move code over to DEVmodDelete() and DEVdelete()
This patch itself is not valid until all invokers of DEVdestroy()
  (currently this is CKTdestroy() exclusively)
  are rewritten to invoke DEVmodDelete() and DEVdelete()
2018-02-15 22:38:45 +01:00
rlar 98f6893aeb 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-15 22:38:44 +01:00
rlar bd2a4d4e42 DEVmodDelete(), change API, #1/2, coccinelle semantic patch 2018-02-15 22:36:31 +01:00
rlar 16600fe57b DEVmodDelete(), change API, #1/2, klag-2.cocci for coccinelle 2018-02-15 22:36:12 +01:00
rlar 5513bbbdb2 DEVmodDelete(), extend ASRCdelete() and use it in ASRCmDelete()
rip instance specific cleanup business from the ASRCmDelete() function.
move this to ASRCdelete()
2018-02-14 21:50:03 +01:00
rlar c2cc896cb4 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-14 21:49:55 +01:00
rlar 205e79f61b DEVdelete(), change API, #1/2, coccinelle semantic patch 2018-02-14 21:49:37 +01:00
rlar f37b8c3d9f DEVdelete(), change API, #1/2, klag-1.cocci for coccinelle 2018-02-14 21:49:19 +01:00
rlar a8e440eabe whitespace cleanup, comments cleanup, line wrap 2018-02-14 18:53:30 +01:00
rlar ec4b7ffecd adms/admst/ngspiceMODULE*.c.xml, drop "register" declaration 2018-02-12 17:56:00 +01:00
rlar 57f9804db6 devices/adms/admst/ngspiceMODULEdel.c.xml, bug fix, endless loop
A missing update of "prev" would cause endless looping
  when searching for a device instance.

introduced in commit:
> commit 38e68869a2
> Date:   Wed Mar 1 14:30:24 2006 +0000
>
>     Added mdel, del and dest functions to interface.
2018-02-12 17:55:59 +01:00
rlar cd95ad62f2 devices/ndev/ndevdel.c, remove a redundant `return' 2018-02-12 17:55:58 +01:00
rlar efbb7badbc extend commit: spicelib/devcies/*dest.c, rewrite DEVdestroy() functions
rewrite admst/ngspiceMODULEdest.c.xml too, see commit

> commit 4d79617cf1
> Date:   Fri Jul 29 22:22:16 2016 +0200
>
>     spicelib/devcies/*dest.c, rewrite DEVdestroy() functions
2018-02-12 17:55:57 +01:00
rlar 88c50afcd9 parser/inpdpar.c, #6/6, cleanup, introduce find_instance_parameter() 2018-02-03 17:54:15 +01:00
rlar cf0c9eac06 parser/inpdpar.c, #5/6, cleanup, use a local `IFparm *' 2018-02-03 17:54:06 +01:00
rlar f88cfa5d55 parser/inpdpar.c, #4/6, cleanup, use a local `IFdevice *' 2018-02-03 17:53:57 +01:00
rlar 36f3263727 parser/inpdpar.c, #3/6, cleanup, whitespace 2018-02-03 17:53:48 +01:00
rlar 4140af6d29 parser/inpdpar.c, #2/6, cleanup, use a 'switch' 2018-02-03 17:53:38 +01:00
rlar eb86a66146 parser/inpdpar.c, #1/6, cleanup, search, break then process 2018-02-03 17:53:28 +01:00
rlar bdf6091da7 parser/inpgmod.c, #6/6, cleanup, introduce find_model_parameter() 2018-02-03 17:29:33 +01:00
rlar 45e98db44c parser/inpgmod.c, #5/6, cleanup, loop with a `IFparm *' 2018-02-03 17:29:32 +01:00
rlar b75aba17a4 parser/inpgmod.c, #4/6, cleanup, use a local `IFdevice *' 2018-02-03 17:29:32 +01:00
rlar 63df147cdb parser/inpgmod.c, #3/6, cleanup, local variables 2018-02-03 17:29:32 +01:00
rlar ac34d19c94 parser/inpgmod.c, #2/6, cleanup, fuse the if's 2018-02-03 17:29:32 +01:00
rlar edceabbb54 parser/inpgmod.c, #1/6, cleanup, search, break then process 2018-02-03 17:29:30 +01:00
rlar 6c71fef6f6 parser/inpgmod.c, create_model(), drop obfuscated 'txl' processing
Dependent on given R and L parameter values,
  "txl" models might be transformed to "cpl" models in INPdomodel().
This would cause a "unrecognized parameter" warning in create_model()
  when searching for the "txl" flag in the "cpl" model,
  which is avoided with some awkward extra processing in inpgmod.c

This commit removes this special processing
  by addition of an "alias" parameter "txl" to the
  "cpl" module parameter description CPLmPTable[] in "cpl.c"

Note,
  setModelParm() is a no-op for "cpl" and "txl"
  see case CPL_MOD_R in
    function CPLmParam()
  and case TXL_MOD_R in
    function TXLmParam()
2018-02-03 15:55:22 +01:00
rlar aa27c8969c parser/inpgmod.c, fix an almost bug, (level=...)
When 'level' is a valid model parameter,
  then it was processed like any other parameter,
but additionally the
  `if (strcmp(parm, "level") == 0)'
invoked INPgetValue() a second time.

This special processing is meant to allow "level" for all models
  whether they make use of it or not.

The excess invocation of INPgetValue() didn't cause harm,
  merely because the next token after the "level=number"
almost necessarily is a string (the beginning "name=" of the next assignment)
thus not a parse-able number,
thus the second INPgetValue() didn't modify the 'line' pointer.

To sanitise the code invoke the "level" skipping only if "level"
  is not recognised as a valid model parameter.
2018-02-03 15:39:20 +01:00
rlar 668123ae44 analysis/cktpname.c, #4/4, cleanup 2018-02-03 13:17:17 +01:00
rlar 30550370fb analysis/cktpname.c, #3/4, cleanup obfuscated loop termination 2018-02-03 13:16:40 +01:00
rlar d85ceb85cb analysis/cktpname.c, #2/4, cleanup, use a local `IFparm *' 2018-02-03 13:16:12 +01:00
rlar 1d60387617 analysis/cktpname.c, #1/4, cleanup, use a local `IFdevice *' 2018-02-03 13:16:01 +01:00
rlar fbc1f37b36 mif/mifdelete.c, fix commit: xspice, implement "CALLBACK"
MIFdelete() might be called with third arg being NULL,
  searching for the instance to be deleted by name only.
Need to invoke the callback in this case too.
2018-02-03 12:20:23 +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
rlar 9f68d8cd68 devices/*, fix spelling of some struct members 2018-02-03 09:46:13 +01:00
rlar f53384da70 devices/*, USE_OMP, cleanup 'InstanceArray' usage
store 'InstanceArray' in the very first module only,
  NULL it in any other.

FREE() it in every module to treat them all the same in XXXdestroy()
2018-02-02 23:03:55 +01:00
rlar 93b62297d8 devices/mos6, add missing files mos6del.c and mos6mdel.c
this is a plain copy from mos3
2018-02-02 22:53:43 +01:00
rlar fb6b4adaa5 devices/bsimsoi/b4soidest.c, fix commit: "OpenMP for B4SOI version 4.3.1"
> commit 39c98ad798
> Date:   Fri Jul 2 09:35:05 2010 +0000
>
>     OpenMP for B4SOI version 4.3.1
2018-02-02 22:35:59 +01:00
rlar 3763f9914e devices/nbjt/nbjtdefs.h, fix commit: "mark end of struct GENmodel overlay"
> commit 3794c1eb20
> Date:   Sat Jun 22 18:40:48 2013 +0200
>
>     mark end of struct GENmodel overlay
2018-02-02 22:24:10 +01:00