📄 vpi_user.h
字号:
#define vpiTri 4 /* three-state net */#define vpiTri0 5 /* pull-down net */#define vpiTri1 6 /* pull-up net */#define vpiTriReg 7 /* tri state reg net */#define vpiTriAnd 8 /* three-state wire-and net */#define vpiTriOr 9 /* three-state wire-or net */#define vpiSupply1 10 /* supply 1 net */#define vpiSupply0 11 /* supply zero net */#define vpiNone 12 /* no default net type (1364-2001) */#define vpiUwire 13 /* unresolved wire net (1364-2005) */#define vpiExplicitScalared 23 /* explicitly scalared (boolean) */#define vpiExplicitVectored 24 /* explicitly vectored (boolean) */#define vpiExpanded 25 /* expanded vector net (boolean) */#define vpiImplicitDecl 26 /* implicitly declared net (boolean) */#define vpiChargeStrength 27 /* charge decay strength of net *//* Defined as part of strengths section.#define vpiLargeCharge 0x10#define vpiMediumCharge 0x04#define vpiSmallCharge 0x02*/#define vpiArray 28 /* variable array (boolean) */#define vpiPortIndex 29 /* Port index *//************************ gate and terminal properties ************************/#define vpiTermIndex 30 /* Index of a primitive terminal */#define vpiStrength0 31 /* 0-strength of net or gate */#define vpiStrength1 32 /* 1-strength of net or gate */#define vpiPrimType 33 /* prmitive subtypes: */#define vpiAndPrim 1 /* and gate */#define vpiNandPrim 2 /* nand gate */#define vpiNorPrim 3 /* nor gate */#define vpiOrPrim 4 /* or gate */#define vpiXorPrim 5 /* xor gate */#define vpiXnorPrim 6 /* xnor gate */#define vpiBufPrim 7 /* buffer */#define vpiNotPrim 8 /* not gate */#define vpiBufif0Prim 9 /* zero-enabled buffer */#define vpiBufif1Prim 10 /* one-enabled buffer */#define vpiNotif0Prim 11 /* zero-enabled not gate */#define vpiNotif1Prim 12 /* one-enabled not gate */#define vpiNmosPrim 13 /* nmos switch */#define vpiPmosPrim 14 /* pmos switch */#define vpiCmosPrim 15 /* cmos switch */#define vpiRnmosPrim 16 /* resistive nmos switch */#define vpiRpmosPrim 17 /* resistive pmos switch */#define vpiRcmosPrim 18 /* resistive cmos switch */#define vpiRtranPrim 19 /* resistive bidirectional */#define vpiRtranif0Prim 20 /* zero-enable resistive bidirectional */#define vpiRtranif1Prim 21 /* one-enable resistive bidirectional */#define vpiTranPrim 22 /* bidirectional */#define vpiTranif0Prim 23 /* zero-enabled bidirectional */#define vpiTranif1Prim 24 /* one-enabled bidirectional */#define vpiPullupPrim 25 /* pullup */#define vpiPulldownPrim 26 /* pulldown */#define vpiSeqPrim 27 /* sequential UDP */#define vpiCombPrim 28 /* combinational UDP *//**************** path, path terminal, timing check properties ****************/#define vpiPolarity 34 /* polarity of module path... */#define vpiDataPolarity 35 /* ...or data path: */#define vpiPositive 1 /* positive */#define vpiNegative 2 /* negative */#define vpiUnknown 3 /* unknown (unspecified) */#define vpiEdge 36 /* edge type of module path: */#define vpiNoEdge 0x00 /* no edge */#define vpiEdge01 0x01 /* 0 -> 1 */#define vpiEdge10 0x02 /* 1 -> 0 */#define vpiEdge0x 0x04 /* 0 -> x */#define vpiEdgex1 0x08 /* x -> 1 */#define vpiEdge1x 0x10 /* 1 -> x */#define vpiEdgex0 0x20 /* x -> 0 */#define vpiPosedge (vpiEdgex1 | vpiEdge01 | vpiEdge0x)#define vpiNegedge (vpiEdgex0 | vpiEdge10 | vpiEdge1x)#define vpiAnyEdge (vpiPosedge | vpiNegedge)#define vpiPathType 37 /* path delay connection subtypes: */#define vpiPathFull 1 /* ( a *> b ) */#define vpiPathParallel 2 /* ( a => b ) */#define vpiTchkType 38 /* timing check subtypes: */#define vpiSetup 1 /* $setup */#define vpiHold 2 /* $hold */#define vpiPeriod 3 /* $period */#define vpiWidth 4 /* $width */#define vpiSkew 5 /* $skew */#define vpiRecovery 6 /* $recovery */#define vpiNoChange 7 /* $nochange */#define vpiSetupHold 8 /* $setuphold */#define vpiFullskew 9 /* $fullskew -- added for 1364-2001 */#define vpiRecrem 10 /* $recrem -- added for 1364-2001 */#define vpiRemoval 11 /* $removal -- added for 1364-2001 */#define vpiTimeskew 12 /* $timeskew -- added for 1364-2001 *//**************************** expression properties ***************************/#define vpiOpType 39 /* operation subtypes: */#define vpiMinusOp 1 /* unary minus */#define vpiPlusOp 2 /* unary plus */#define vpiNotOp 3 /* unary not */#define vpiBitNegOp 4 /* bitwise negation */#define vpiUnaryAndOp 5 /* bitwise reduction and */#define vpiUnaryNandOp 6 /* bitwise reduction nand */#define vpiUnaryOrOp 7 /* bitwise reduction or */#define vpiUnaryNorOp 8 /* bitwise reduction nor */#define vpiUnaryXorOp 9 /* bitwise reduction xor */#define vpiUnaryXNorOp 10 /* bitwise reduction xnor */#define vpiSubOp 11 /* binary subtraction */#define vpiDivOp 12 /* binary division */#define vpiModOp 13 /* binary modulus */#define vpiEqOp 14 /* binary equality */#define vpiNeqOp 15 /* binary inequality */#define vpiCaseEqOp 16 /* case (x and z) equality */#define vpiCaseNeqOp 17 /* case inequality */#define vpiGtOp 18 /* binary greater than */#define vpiGeOp 19 /* binary greater than or equal */#define vpiLtOp 20 /* binary less than */#define vpiLeOp 21 /* binary less than or equal */#define vpiLShiftOp 22 /* binary left shift */#define vpiRShiftOp 23 /* binary right shift */#define vpiAddOp 24 /* binary addition */#define vpiMultOp 25 /* binary multiplication */#define vpiLogAndOp 26 /* binary logical and */#define vpiLogOrOp 27 /* binary logical or */#define vpiBitAndOp 28 /* binary bitwise and */#define vpiBitOrOp 29 /* binary bitwise or */#define vpiBitXorOp 30 /* binary bitwise xor */#define vpiBitXNorOp 31 /* binary bitwise xnor */#define vpiBitXnorOp vpiBitXNorOp /* added with 1364-2001 */#define vpiConditionOp 32 /* ternary conditional */#define vpiConcatOp 33 /* n-ary concatenation */#define vpiMultiConcatOp 34 /* repeated concatenation */#define vpiEventOrOp 35 /* event or */#define vpiNullOp 36 /* null operation */#define vpiListOp 37 /* list of expressions */#define vpiMinTypMaxOp 38 /* min:typ:max: delay expression */#define vpiPosedgeOp 39 /* posedge */#define vpiNegedgeOp 40 /* negedge */#define vpiArithLShiftOp 41 /* arithmetic left shift (1364-2001) */#define vpiArithRShiftOp 42 /* arithmetic right shift (1364-2001) */#define vpiPowerOp 43 /* arithmetic power op (1364-2001) */#define vpiConstType 40 /* constant subtypes: */#define vpiDecConst 1 /* decimal integer */#define vpiRealConst 2 /* real */#define vpiBinaryConst 3 /* binary integer */#define vpiOctConst 4 /* octal integer */#define vpiHexConst 5 /* hexadecimal integer */#define vpiStringConst 6 /* string literal */#define vpiIntConst 7 /* HDL integer constant (1364-2001) */#define vpiBlocking 41 /* blocking assignment (boolean) */#define vpiCaseType 42 /* case statement subtypes: */#define vpiCaseExact 1 /* exact match */#define vpiCaseX 2 /* ignore X's */#define vpiCaseZ 3 /* ignore Z's */#define vpiNetDeclAssign 43 /* assign part of decl (boolean) *//************************** task/function properties **************************/#define vpiFuncType 44 /* HDL function & system function type */#define vpiIntFunc 1 /* returns integer */#define vpiRealFunc 2 /* returns real */#define vpiTimeFunc 3 /* returns time */#define vpiSizedFunc 4 /* returns an arbitrary size */#define vpiSizedSignedFunc 5 /* returns sized signed value *//** alias 1364-1995 system function subtypes to 1364-2001 function subtypes ***/#define vpiSysFuncType vpiFuncType#define vpiSysFuncInt vpiIntFunc#define vpiSysFuncReal vpiRealFunc#define vpiSysFuncTime vpiTimeFunc#define vpiSysFuncSized vpiSizedFunc#define vpiUserDefn 45 /*user defined system task/func(boolean)*/#define vpiScheduled 46 /* object still scheduled (boolean) *//*********************** properties added with 1364-2001 **********************/#define vpiActive 49 /* reentrant task/func frame is active */#define vpiAutomatic 50 /* task/func obj is automatic */#define vpiCell 51 /* configuration cell */#define vpiConfig 52 /* configuration config file */#define vpiConstantSelect 53 /* (boolean) bit-select or part-select indices are constant expressions */#define vpiDecompile 54 /* decompile the object */#define vpiDefAttribute 55 /* Attribute defined for the obj */#define vpiDelayType 56 /* delay subtype */#define vpiModPathDelay 1 /* module path delay */#define vpiInterModPathDelay 2 /* intermodule path delay */#define vpiMIPDelay 3 /* module input port delay */#define vpiIteratorType 57 /* object type of an iterator */#define vpiLibrary 58 /* configuration library */#define vpiMultiArray 59 /* Object is a multidimensional array */#define vpiOffset 60 /* offset from LSB */#define vpiResolvedNetType 61 /* net subtype after resolution, returns same subtypes as vpiNetType */#define vpiSaveRestartID 62 /* unique ID for save/restart data */#define vpiSaveRestartLocation 63 /* name of save/restart data file */#define vpiValid 64 /* reentrant task/func frame is valid */#define vpiSigned 65 /* TRUE for vpiIODecl and any object in the expression class if the object has the signed attribute */#define vpiLocalParam 70 /* TRUE when a param is declared as a localparam */#define vpiModPathHasIfNone 71 /* Mod path has an ifnone statement *//*********************** properties added with 1364-2005 **********************/#define vpiIndexedPartSelectType 72 /* Indexed part-select type */#define vpiPosIndexed 1 /* +: */#define vpiNegIndexed 2 /* -: */#define vpiIsMemory 73 /* TRUE for a one-dimensional reg array *//*************** vpi_control() constants (added with 1364-2001) ***************/#define vpiStop 66 /* execute simulator's $stop */#define vpiFinish 67 /* execute simulator's $finish */#define vpiReset 68 /* execute simulator's $reset */#define vpiSetInteractiveScope 69 /* set simulator's interactive scope *//**************************** I/O related defines *****************************/#define VPI_MCD_STDOUT 0x00000001/*************************** STRUCTURE DEFINITIONS ****************************//******************************* time structure *******************************/typedef struct t_vpi_time{ PLI_INT32 type; /* [vpiScaledRealTime, vpiSimTime, vpiSuppressTime] */ PLI_UINT32 high, low; /* for vpiSimTime */ double real; /* for vpiScaledRealTime */} s_vpi_time, *p_vpi_time;/* time types */#define vpiScaledRealTime 1#define vpiSimTime 2#define vpiSuppressTime 3/****************************** delay structures ******************************/typedef struct t_vpi_delay{ struct t_vpi_time *da; /* pointer to user allocated array of delay values */ PLI_INT32 no_of_delays; /* number of delays */ PLI_INT32 time_type; /* [vpiScaledRealTime, vpiSimTime, vpiSuppressTime] */ PLI_INT32 mtm_flag; /* true for mtm values */ PLI_INT32 append_flag; /* true for append */ PLI_INT32 pulsere_flag; /* true for pulsere values */} s_vpi_delay, *p_vpi_delay;/***************************** value structures *******************************//* vector value */#ifndef VPI_VECVAL /* added in 1364-2005 */#define VPI_VECVALtypedef struct t_vpi_vecval{ /* following fields are repeated enough times to contain vector */ PLI_INT32 aval, bval; /* bit encoding: ab: 00=0, 10=1, 11=X, 01=Z */} s_vpi_vecval, *p_vpi_vecval;#endif/* strength (scalar) value */typedef struct t_vpi_strengthval{ PLI_INT32 logic; /* vpi[0,1,X,Z] */ PLI_INT32 s0, s1; /* refer to strength coding below */} s_vpi_strengthval, *p_vpi_strengthval;/* strength values */#define vpiSupplyDrive 0x80#define vpiStrongDrive 0x40#define vpiPullDrive 0x20#define vpiWeakDrive 0x08#define vpiLargeCharge 0x10#define vpiMediumCharge 0x04#define vpiSmallCharge 0x02#define vpiHiZ 0x01/* generic value */typedef struct t_vpi_value{ PLI_INT32 format; /* vpi[[Bin,Oct,Dec,Hex]Str,Scalar,Int,Real,String, Vector,Strength,Suppress,Time,ObjType]Val */ union { PLI_BYTE8 *str; /* string value */ PLI_INT32 scalar; /* vpi[0,1,X,Z] */ PLI_INT32 integer; /* integer value */ double real; /* real value */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -