
/*
 * Structures for model: mlin
 *
 * 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("w", 1, IF_REAL, "width"),
    IOP("model", 2, IF_INTEGER, "Model type"),
    IOP("disp", 3, IF_INTEGER, "Dispersion type"),
    IOP("er", 4, IF_REAL, "Substrate dielectric permittivity"),
    IOP("h", 5, IF_REAL, "Substrate thickness"),
    IOP("t", 6, IF_REAL, "Metal strip thickness"),
    IOP("tand", 7, IF_REAL, "Substrate dielectric loss"),
    IOP("rho", 8, IF_REAL, "Metal resistance"),
    IOP("d", 9, IF_REAL, "RMS Substrate roughness"),
    IOP("tranmodel", 10, IF_INTEGER, "TRAN model DC/FULL"),
};


static IFparm MIFpTable[] = {
    OP("sim_points_data", 11, 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_VOLTAGE,
};


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


static Mif_Port_Type_t MIFportEnum3[] = {
    MIF_DIFF_VOLTAGE,
};


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


static Mif_Conn_Info_t MIFconnTable[] = {
  {
    "port1",
    "Microstrip terminals",
    MIF_INOUT,
    MIF_DIFF_RESISTANCE,
    "hd",
    1,
    MIFportEnum0,
    MIFportStr0,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
  {
    "port2",
    "Microstrip terminals",
    MIF_INOUT,
    MIF_DIFF_RESISTANCE,
    "hd",
    1,
    MIFportEnum1,
    MIFportStr1,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
  {
    "V1sens",
    "Sensing terminals",
    MIF_IN,
    MIF_DIFF_VOLTAGE,
    "vd",
    1,
    MIFportEnum2,
    MIFportStr2,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
  {
    "V2sens",
    "Sensisng terminals",
    MIF_IN,
    MIF_DIFF_VOLTAGE,
    "vd",
    1,
    MIFportEnum3,
    MIFportStr3,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
};

static union Mif_Parse_Value l_default[] = {
    { .rvalue=1.000000e-02 },
};

static union Mif_Parse_Value w_default[] = {
    { .rvalue=1.000000e-03 },
};

static union Mif_Parse_Value model_default[] = {
    { .ivalue=0 },
};

static union Mif_Parse_Value disp_default[] = {
    { .ivalue=0 },
};

static union Mif_Parse_Value er_default[] = {
    { .rvalue=9.800000e+00 },
};

static union Mif_Parse_Value h_default[] = {
    { .rvalue=1.000000e-03 },
};

static union Mif_Parse_Value t_default[] = {
    { .rvalue=3.500000e-05 },
};

static union Mif_Parse_Value tand_default[] = {
    { .rvalue=2.000000e-04 },
};

static union Mif_Parse_Value rho_default[] = {
    { .rvalue=2.200000e-08 },
};

static union Mif_Parse_Value d_default[] = {
    { .rvalue=1.500000e-07 },
};

static union Mif_Parse_Value tranmodel_default[] = {
    { .ivalue=0 },
};


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,
  },
  {
    "w",
    "width",
    MIF_REAL,
    1,
    w_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "model",
    "Model type",
    MIF_INTEGER,
    1,
    model_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "disp",
    "Dispersion type",
    MIF_INTEGER,
    1,
    disp_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "er",
    "Substrate dielectric permittivity",
    MIF_REAL,
    1,
    er_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "h",
    "Substrate thickness",
    MIF_REAL,
    1,
    h_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "t",
    "Metal strip thickness",
    MIF_REAL,
    1,
    t_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "tand",
    "Substrate dielectric loss",
    MIF_REAL,
    1,
    tand_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "rho",
    "Metal resistance",
    MIF_REAL,
    1,
    rho_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "d",
    "RMS Substrate roughness",
    MIF_REAL,
    1,
    d_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "tranmodel",
    "TRAN model DC/FULL",
    MIF_INTEGER,
    1,
    tranmodel_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_mlin(Mif_Private_t *);

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

SPICEdev cm_mlin_info = {
    .DEVpublic = {
        .name = "mlin",
        .description = "Microstrip line",
        .terms = &val_terms,
        .numNames = &val_numNames,
        .termNames = NULL,
        .numInstanceParms = &val_numInstanceParms,
        .instanceParms = MIFpTable,
        .numModelParms = &val_numModelParms,
        .modelParms = MIFmPTable,
        .flags = 0,

        .cm_func = cm_mlin,
        .num_conn = 4,
        .conn = MIFconnTable,
        .num_param = 11,
        .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
};

