Browse Source

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()
pre-master-46
rlar 8 years ago
parent
commit
6c71fef6f6
  1. 4
      src/spicelib/devices/cpl/cpl.c
  2. 4
      src/spicelib/parser/inpgmod.c

4
src/spicelib/devices/cpl/cpl.c

@ -23,7 +23,11 @@ IFparm CPLmPTable[] = { /* model parameters */
IOP( "c", CPL_C, IF_REALVEC,"capacitance per length"),
IOP( "g", CPL_G, IF_REALVEC,"conductance per length"),
IOP( "length", CPL_length, IF_REAL,"length"),
/* txl devices can be transformed to cpl devices in inpdomod.c
* Then we need to be able to swallow the 'txl' flag on a 'cpl' .model line
*/
IP( "cpl", CPL_MOD_R, IF_FLAG,"Device is a cpl model"),
IPR( "txl", CPL_MOD_R, IF_FLAG,"Device is a cpl model"),
};
char *CPLnames[] = {

4
src/spicelib/parser/inpgmod.c

@ -88,10 +88,6 @@ create_model(CKTcircuit *ckt, INPmodel *modtmp, INPtables *tab)
for (j = 0; j < *(ft_sim->devices[modtmp->INPmodType]->numModelParms); j++) {
if (strcmp(parm, "txl") == 0)
if (strcmp("cpl", ft_sim->devices[modtmp->INPmodType]->modelParms[j].keyword) == 0)
strcpy(parm, "cpl");
if (strcmp(parm, ft_sim->devices[modtmp->INPmodType]->modelParms[j].keyword) == 0) {
val = INPgetValue(ckt, &line, ft_sim->devices[modtmp->INPmodType]->modelParms[j].dataType, tab);

Loading…
Cancel
Save