From 527fbf78c8e128e478231799b2e74c6b253acd81 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 10 Jan 2018 16:55:54 +0100 Subject: [PATCH] parser/inpgmod.c, drop obfuscated 'txl' exceptional processing dependent on given R and L parameter values, txl models might be transformed to cpl models in inpdomod.c This would cause a "unknown parameter" warning in inpgmod.c, when searching for the "txl" flag in a "cpl" model, which is avoided with some awkward special handling in inpgmod.c This commit removes the special handling for this situation by addition of an "alias" parameter "txl" to the "cpl" module parameter description in cpl/cpl.c Note, the setModelParm() invocation is a noop for both "cpl" and "txl", see code in cplmpar.c function CPLmParam() and txlmpar.c function TXLmParam() --- src/spicelib/devices/cpl/cpl.c | 4 ++++ src/spicelib/parser/inpgmod.c | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/spicelib/devices/cpl/cpl.c b/src/spicelib/devices/cpl/cpl.c index 58838ac65..83f9208d3 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 can transformed to cpl 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 327bae850..929328917 100644 --- a/src/spicelib/parser/inpgmod.c +++ b/src/spicelib/parser/inpgmod.c @@ -85,11 +85,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) break; }