
/*
 * Structures for model: cpline
 *
 * Automatically generated by cmpp preprocessor
 *
 * !!! DO NOT EDIT !!!
 *
 */


#include "ngspice/ngspice.h"
#include <stdio.h>
#include "ngspice/devdefs.h"
#include "ngspice/ifsim.h"
#include "ngspice/mifdefs.h"
#include "ngspice/mifproto.h"
#include "ngspice/mifparse.h"


static IFparm MIFmPTable[] = {
    IOP("l", 0, IF_REAL, "length"),
    IOP("ze", 1, IF_REAL, "characteristic impedance of even mode"),
    IOP("zo", 2, IF_REAL, "characteristic impedance of odd mode"),
    IOP("ae", 3, IF_REAL, "attenuation per length (dB) even mode"),
    IOP("ao", 4, IF_REAL, "attenuation per length (dB) odd mode"),
    IOP("ere", 5, IF_REAL, "dielectric constant even mode"),
    IOP("ero", 6, IF_REAL, "dielectric constant odd mode"),
};


static IFparm MIFpTable[] = {
    OP("sim_points_data", 7, IF_STRING, "local static data"),
};


static Mif_Port_Type_t MIFportEnum0[] = {
    MIF_DIFF_RESISTANCE,
};


static char *MIFportStr0[] = {
    "hd",
};


static Mif_Port_Type_t MIFportEnum1[] = {
    MIF_DIFF_RESISTANCE,
};


static char *MIFportStr1[] = {
    "hd",
};


static Mif_Port_Type_t MIFportEnum2[] = {
    MIF_DIFF_RESISTANCE,
};


static char *MIFportStr2[] = {
    "hd",
};


static Mif_Port_Type_t MIFportEnum3[] = {
    MIF_DIFF_RESISTANCE,
};


static char *MIFportStr3[] = {
    "hd",
};


static Mif_Port_Type_t MIFportEnum4[] = {
    MIF_DIFF_VOLTAGE,
};


static char *MIFportStr4[] = {
    "vd",
};


static Mif_Port_Type_t MIFportEnum5[] = {
    MIF_DIFF_VOLTAGE,
};


static char *MIFportStr5[] = {
    "vd",
};


static Mif_Port_Type_t MIFportEnum6[] = {
    MIF_DIFF_VOLTAGE,
};


static char *MIFportStr6[] = {
    "vd",
};


static Mif_Port_Type_t MIFportEnum7[] = {
    MIF_DIFF_VOLTAGE,
};


static char *MIFportStr7[] = {
    "vd",
};


static Mif_Conn_Info_t MIFconnTable[] = {
  {
    "p1",
    "Terminals Line1",
    MIF_INOUT,
    MIF_DIFF_RESISTANCE,
    "hd",
    1,
    MIFportEnum0,
    MIFportStr0,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
  {
    "p2",
    "Terminals Line1",
    MIF_INOUT,
    MIF_DIFF_RESISTANCE,
    "hd",
    1,
    MIFportEnum1,
    MIFportStr1,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
  {
    "p3",
    "Terminals Line2",
    MIF_INOUT,
    MIF_DIFF_RESISTANCE,
    "hd",
    1,
    MIFportEnum2,
    MIFportStr2,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
  {
    "p4",
    "Terminals Line2",
    MIF_INOUT,
    MIF_DIFF_RESISTANCE,
    "hd",
    1,
    MIFportEnum3,
    MIFportStr3,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
  {
    "p1s",
    "Sensing terminals line 1",
    MIF_IN,
    MIF_DIFF_VOLTAGE,
    "vd",
    1,
    MIFportEnum4,
    MIFportStr4,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
  {
    "p2s",
    "Sensing terminals line 1",
    MIF_IN,
    MIF_DIFF_VOLTAGE,
    "vd",
    1,
    MIFportEnum5,
    MIFportStr5,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
  {
    "p3s",
    "Sensing terminals line 1",
    MIF_IN,
    MIF_DIFF_VOLTAGE,
    "vd",
    1,
    MIFportEnum6,
    MIFportStr6,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
  {
    "p4s",
    "Sensing terminals line 1",
    MIF_IN,
    MIF_DIFF_VOLTAGE,
    "vd",
    1,
    MIFportEnum7,
    MIFportStr7,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
};

static union Mif_Parse_Value l_default[] = {
    { .rvalue=1.000000e+00 },
};

static union Mif_Parse_Value ze_default[] = {
    { .rvalue=5.000000e+01 },
};

static union Mif_Parse_Value zo_default[] = {
    { .rvalue=5.000000e+01 },
};

static union Mif_Parse_Value ae_default[] = {
    { .rvalue=0.000000e+00 },
};

static union Mif_Parse_Value ao_default[] = {
    { .rvalue=0.000000e+00 },
};

static union Mif_Parse_Value ere_default[] = {
    { .rvalue=1.000000e+00 },
};

static union Mif_Parse_Value ero_default[] = {
    { .rvalue=1.000000e+00 },
};


static Mif_Param_Info_t MIFparamTable[] = {
  {
    "l",
    "length",
    MIF_REAL,
    1,
    l_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "ze",
    "characteristic impedance of even mode",
    MIF_REAL,
    1,
    ze_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "zo",
    "characteristic impedance of odd mode",
    MIF_REAL,
    1,
    zo_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "ae",
    "attenuation per length (dB) even mode",
    MIF_REAL,
    1,
    ae_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "ao",
    "attenuation per length (dB) odd mode",
    MIF_REAL,
    1,
    ao_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "ere",
    "dielectric constant even mode",
    MIF_REAL,
    1,
    ere_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "ero",
    "dielectric constant odd mode",
    MIF_REAL,
    1,
    ero_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
};


static Mif_Inst_Var_Info_t MIFinst_varTable[] = {
  {
    "sim_points_data",
    "local static data",
    MIF_STRING,
    MIF_FALSE,
  },
};


extern void cm_cpline(Mif_Private_t *);

static int val_terms             = 0;
static int val_numNames          = 0;
static int val_numInstanceParms  = 1;
static int val_numModelParms     = 7;
static int val_sizeofMIFinstance = sizeof(MIFinstance);
static int val_sizeofMIFmodel    = sizeof(MIFmodel);

SPICEdev cm_cpline_info = {
    .DEVpublic = {
        .name = "cpline",
        .description = "Generic transmission line",
        .terms = &val_terms,
        .numNames = &val_numNames,
        .termNames = NULL,
        .numInstanceParms = &val_numInstanceParms,
        .instanceParms = MIFpTable,
        .numModelParms = &val_numModelParms,
        .modelParms = MIFmPTable,
        .flags = 0,

        .cm_func = cm_cpline,
        .num_conn = 8,
        .conn = MIFconnTable,
        .num_param = 7,
        .param = MIFparamTable,
        .num_inst_var = 1,
        .inst_var = MIFinst_varTable,
    },

    .DEVparam = NULL,
    .DEVmodParam = MIFmParam,
    .DEVload = MIFload,
    .DEVsetup = MIFsetup,
    .DEVunsetup = MIFunsetup,
    .DEVpzSetup = NULL,
    .DEVtemperature = NULL,
    .DEVtrunc = MIFtrunc,
    .DEVfindBranch = NULL,
    .DEVacLoad = MIFload,
    .DEVaccept = NULL,
    .DEVdestroy = NULL,
    .DEVmodDelete = MIFmDelete,
    .DEVdelete = MIFdelete,
    .DEVsetic = NULL,
    .DEVask = MIFask,
    .DEVmodAsk = MIFmAsk,
    .DEVpzLoad = NULL,
    .DEVconvTest = MIFconvTest,
    .DEVsenSetup = NULL,
    .DEVsenLoad = NULL,
    .DEVsenUpdate = NULL,
    .DEVsenAcLoad = NULL,
    .DEVsenPrint = NULL,
    .DEVsenTrunc = NULL,
    .DEVdisto = NULL,
    .DEVnoise = NULL,
    .DEVsoaCheck = NULL,
    .DEVinstSize = &val_sizeofMIFinstance,
    .DEVmodSize = &val_sizeofMIFmodel,

#ifdef CIDER
    .DEVdump = NULL,
    .DEVacct = NULL,
#endif

#ifdef KLU
    .DEVbindCSC = MIFbindCSC,
    .DEVbindCSCComplex = MIFbindCSCComplex,
    .DEVbindCSCComplexToReal = MIFbindCSCComplexToReal,
#endif
};

