From 6c71fef6f6a2bf826eed5a66abd749b0576ea6e3 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 3 Feb 2018 13:26:54 +0100 Subject: [PATCH] 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() --- src/spicelib/devices/cpl/cpl.c | 4 ++++ src/spicelib/parser/inpgmod.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spicelib/devices/cpl/cpl.c b/src/spicelib/devices/cpl/cpl.c index 58838ac65..73216203e 100644 --- a/src/spicelib/devices/cpl/cpl.c +++ b/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[] = { diff --git a/src/spicelib/parser/inpgmod.c b/src/spicelib/parser/inpgmod.c index 8485006a1..56739c278 100644 --- a/src/spicelib/parser/inpgmod.c +++ b/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);