
/*
 * Structures for model: d_srlatch
 *
 * 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("sr_delay", 0, IF_REAL, "delay from s or r input change"),
    IOP("enable_delay", 1, IF_REAL, "delay from clk"),
    IOP("set_delay", 2, IF_REAL, "delay from set"),
    IOP("reset_delay", 3, IF_REAL, "delay from reset"),
    IOP("ic", 4, IF_INTEGER, "output initial state"),
    IOP("rise_delay", 5, IF_REAL, "rise delay"),
    IOP("fall_delay", 6, IF_REAL, "fall delay"),
    IOP("sr_load", 7, IF_REAL, "s & r load values (F)"),
    IOP("enable_load", 8, IF_REAL, "clk load value (F)"),
    IOP("set_load", 9, IF_REAL, "set load value (F)"),
    IOP("reset_load", 10, IF_REAL, "reset load value (F)"),
};


static Mif_Port_Type_t MIFportEnum0[] = {
    MIF_DIGITAL,
};


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


static Mif_Port_Type_t MIFportEnum1[] = {
    MIF_DIGITAL,
};


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


static Mif_Port_Type_t MIFportEnum2[] = {
    MIF_DIGITAL,
};


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


static Mif_Port_Type_t MIFportEnum3[] = {
    MIF_DIGITAL,
};


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


static Mif_Port_Type_t MIFportEnum4[] = {
    MIF_DIGITAL,
};


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


static Mif_Port_Type_t MIFportEnum5[] = {
    MIF_DIGITAL,
};


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


static Mif_Port_Type_t MIFportEnum6[] = {
    MIF_DIGITAL,
};


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


static Mif_Conn_Info_t MIFconnTable[] = {
  {
    "s",
    "s input",
    MIF_IN,
    MIF_DIGITAL,
    "d",
    1,
    MIFportEnum0,
    MIFportStr0,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
  {
    "r",
    "r input",
    MIF_IN,
    MIF_DIGITAL,
    "d",
    1,
    MIFportEnum1,
    MIFportStr1,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
  {
    "enable",
    "enable",
    MIF_IN,
    MIF_DIGITAL,
    "d",
    1,
    MIFportEnum2,
    MIFportStr2,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
  },
  {
    "set",
    "asynch. set",
    MIF_IN,
    MIF_DIGITAL,
    "d",
    1,
    MIFportEnum3,
    MIFportStr3,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "reset",
    "asynch. reset",
    MIF_IN,
    MIF_DIGITAL,
    "d",
    1,
    MIFportEnum4,
    MIFportStr4,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "out",
    "data output",
    MIF_OUT,
    MIF_DIGITAL,
    "d",
    1,
    MIFportEnum5,
    MIFportStr5,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "Nout",
    "inverted data output",
    MIF_OUT,
    MIF_DIGITAL,
    "d",
    1,
    MIFportEnum6,
    MIFportStr6,
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
};

static union Mif_Parse_Value sr_delay_default[] = {
    { .rvalue=1.000000e-09 },
};

static union Mif_Parse_Value enable_delay_default[] = {
    { .rvalue=1.000000e-09 },
};

static union Mif_Parse_Value set_delay_default[] = {
    { .rvalue=1.000000e-09 },
};

static union Mif_Parse_Value reset_delay_default[] = {
    { .rvalue=1.000000e-09 },
};

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

static union Mif_Parse_Value rise_delay_default[] = {
    { .rvalue=1.000000e-09 },
};

static union Mif_Parse_Value fall_delay_default[] = {
    { .rvalue=1.000000e-09 },
};

static union Mif_Parse_Value sr_load_default[] = {
    { .rvalue=1.000000e-12 },
};

static union Mif_Parse_Value enable_load_default[] = {
    { .rvalue=1.000000e-12 },
};

static union Mif_Parse_Value set_load_default[] = {
    { .rvalue=1.000000e-12 },
};

static union Mif_Parse_Value reset_load_default[] = {
    { .rvalue=1.000000e-12 },
};


static Mif_Param_Info_t MIFparamTable[] = {
  {
    "sr_delay",
    "delay from s or r input change",
    MIF_REAL,
    1,
    sr_delay_default,
    MIF_TRUE,
    { .rvalue=1.000000e-12 },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "enable_delay",
    "delay from clk",
    MIF_REAL,
    1,
    enable_delay_default,
    MIF_TRUE,
    { .rvalue=1.000000e-12 },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "set_delay",
    "delay from set",
    MIF_REAL,
    1,
    set_delay_default,
    MIF_TRUE,
    { .rvalue=1.000000e-12 },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "reset_delay",
    "delay from reset",
    MIF_REAL,
    1,
    reset_delay_default,
    MIF_TRUE,
    { .rvalue=1.000000e-12 },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "ic",
    "output initial state",
    MIF_INTEGER,
    1,
    ic_default,
    MIF_TRUE,
    { .ivalue=0 },
    MIF_TRUE,
    { .ivalue=2 },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "rise_delay",
    "rise delay",
    MIF_REAL,
    1,
    rise_delay_default,
    MIF_TRUE,
    { .rvalue=1.000000e-12 },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "fall_delay",
    "fall delay",
    MIF_REAL,
    1,
    fall_delay_default,
    MIF_TRUE,
    { .rvalue=1.000000e-12 },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "sr_load",
    "s & r load values (F)",
    MIF_REAL,
    1,
    sr_load_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "enable_load",
    "clk load value (F)",
    MIF_REAL,
    1,
    enable_load_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "set_load",
    "set load value (F)",
    MIF_REAL,
    1,
    set_load_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
  {
    "reset_load",
    "reset load value (F)",
    MIF_REAL,
    1,
    reset_load_default,
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    { .bvalue=MIF_FALSE },
    MIF_FALSE,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_FALSE,
    0,
    MIF_TRUE,
  },
};


extern void cm_d_srlatch(Mif_Private_t *);

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

SPICEdev cm_d_srlatch_info = {
    .DEVpublic = {
        .name = "d_srlatch",
        .description = "digital sr-type latch",
        .terms = &val_terms,
        .numNames = &val_numNames,
        .termNames = NULL,
        .numInstanceParms = &val_numInstanceParms,
        .instanceParms = NULL,
        .numModelParms = &val_numModelParms,
        .modelParms = MIFmPTable,
        .flags = 0,

        .cm_func = cm_d_srlatch,
        .num_conn = 7,
        .conn = MIFconnTable,
        .num_param = 11,
        .param = MIFparamTable,
        .num_inst_var = 0,
        .inst_var = NULL,
    },

    .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
};

