From c674c83440a4e6e39c009ee9a2721e03512e6f71 Mon Sep 17 00:00:00 2001 From: Florian Ballenegger Date: Thu, 1 Oct 2020 18:20:57 +0200 Subject: [PATCH] add comment in the code --- src/xspice/mif/mifsetup.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/xspice/mif/mifsetup.c b/src/xspice/mif/mifsetup.c index 22be753d3..8d85e7786 100644 --- a/src/xspice/mif/mifsetup.c +++ b/src/xspice/mif/mifsetup.c @@ -17,6 +17,7 @@ AUTHORS MODIFICATIONS + 1 oct. 2020 Florian Ballenegger Added support for instance parameters SUMMARY @@ -84,6 +85,43 @@ entries in the SPICE matrix and the storage of pointers to locations of the matrix used by MIFload during a simulation. */ +/* +Support for instance parameters: how it works + +cmpp is modified to recognize the new 'parameter_scope' keyword +in ifspec.ifs files, which can be set to 'model', 'instance', or 'both'. + +All parameters are filled in the xspice parameter descriptor, as before. + +Instance parameters spice descriptors are added when ifspec.ifs +is translated (xspice/cmpp/writ_ifs.c). +Use the index in the xspice list of parameter descriptors as key id. +Instance parameters are put first, followed by instance static variables. +Parameters which have instance scope only are filtered out the model +parameter spice descriptors. + +A new field 'iparam' is added in the Mif_Private_t struct to point to the +table of instance parameters values, which is stored in the MIFinstance +and allocated in mif_inp2.c. + +Model object MIFmodel still hold entries for all parameters in 'param', +including instance parameters. The wasted memory is considered small as +there is usually less models than instances. + +In the codemodel code generated by cmpp from cfunc.mod, the access to +parameters that have instance scope is modified to point to the iparam +entry of Mif_Private_t (xspice/cmpp/mod_yacc.y). Relevant index to +iparam table is calculated by cmpp. + +A new MIFParam function is added to the core interface. +MIFask and MIFmParam are modified. + +Parsing for A devices is modified at several places +(mif_inp2.c, subckt.c, inpcom.c) + +Florian Ballenegger (Anamosic), October 2020. +*/ + int MIFsetup(