/* The header file should be included by any application intending to use VHPI. This header file should be provided by tool vendors supporting the VHPI interface. The range of values from of 1000 to 2000 are RESERVED by the standard. Vendors are allowed to provide additional functionality (other than the one defined by the standard) and incorporate it in the header. This can be done by defining the following macros. Note: INT_AMS * macros are place holders for VHPI ams extensions. */ /* define internal macros for VHPI internal functionality */ #ifndef VHPI_INTERNAL_H #define INT_CLASSES #define INT_AMS_CLASSES #define INT_ONE_METHODS #define INT_AMS_ONE_METHODS #define INT_MANY_METHODS #define INT_AMS_MANY_METHODS #define INT_INT_PROPERTIES #define INT_AMS_INT_PROPERTIES #define INT_STR_PROPERTIES #define INT_AMS_STR_PROPERTIES #define INT_REAL_PROPERTIES #define INT_AMS_REAL_PROPERTIES #define INT_PHYS_PROPERTIES #define INT_AMS_PHYS_PROPERTIES #define INT_VAL_FORMATS #define INT_AMS_VAL_FORMATS #define INT_ATTR #define INT_AMS_ATTR #define INT_PROTOTYPES #endif /* * |---------------------------------------------------------------| * | | * | This is the VHPI header file | * | | * | | * | | * | FOR CONFORMANCE WITH THE VHPI STANDARD, A VHPI APPLICATION | * | OR PROGRAM MUST REFERENCE THIS HEADER FILE | * | Its contents can be modified to include vendor extensions. | * | | * |---------------------------------------------------------------| */ /*** File vhpi_user.h ***/ /*** This file describe the procedural interface to access VHDL compiled, instantiated and run-time data. It is derived from the UML model. ***/ #ifndef VHPI_USER_H #define VHPI_USER_H #ifdef __cplusplus extern "C" { #endif /*---------------------------------------------------------------------------*/ /*--------------------------- Portability Help ------------------------------*/ /*---------------------------------------------------------------------------*/ /* Sized variables */ #ifndef PLI_TYPES #define PLI_TYPES typedef int PLI_INT32; typedef unsigned int PLI_UINT32; typedef short PLI_INT16; typedef unsigned short PLI_UINT16; typedef char PLI_BYTE8; typedef unsigned char PLI_UBYTE8; #endif typedef void PLI_VOID; /* Use to export a symbol */ #if WIN32 #ifndef PLI_DLLISPEC #define PLI_DLLISPEC __declspec(dllimport) #define VHPI_USER_DEFINED_DLLISPEC 1 #endif #else #ifndef PLI_DLLISPEC #define PLI_DLLISPEC #endif #endif /* Use to import a symbol */ #if WIN32 #ifndef PLI_DLLESPEC #define PLI_DLLESPEC __declspec(dllexport) #define VHPI_USER_DEFINED_DLLESPEC 1 #endif #else #ifndef PLI_DLLESPEC #define PLI_DLLESPEC #endif #endif /* Use to mark a function as external */ #ifndef PLI_EXTERN #define PLI_EXTERN #endif /* Use to mark a variable as external */ #ifndef PLI_VEXTERN #define PLI_VEXTERN extern #endif #ifndef PLI_PROTOTYPES #define PLI_PROTOTYPES #define PROTO_PARAMS(params) params /* object is defined imported by the application */ #define XXTERN PLI_EXTERN PLI_DLLISPEC /* object is exported by the application */ #define EETERN PLI_EXTERN PLI_DLLESPEC #endif /* define internal macros for VHPI internal functionality */ #ifndef VHPI_INTERNAL_H #define INT_CLASSES #define INT_AMS_CLASSES #define INT_ONE_METHODS #define INT_AMS_ONE_METHODS #define INT_MANY_METHODS #define INT_AMS_MANY_METHODS #define INT_INT_PROPERTIES #define INT_AMS_INT_PROPERTIES #define INT_STR_PROPERTIES #define INT_AMS_STR_PROPERTIES #define INT_REAL_PROPERTIES #define INT_AMS_REAL_PROPERTIES #define INT_PHYS_PROPERTIES #define INT_AMS_PHYS_PROPERTIES #define INT_VAL_FORMATS #define INT_AMS_VAL_FORMATS #define INT_ATTR #define INT_AMS_ATTR #define INT_PROTOTYPES #endif /* basic typedefs */ #ifndef VHPI_TYPES #define VHPI_TYPES typedef PLI_UINT32 *vhpiHandleT; typedef PLI_UINT32 vhpiEnumT; typedef PLI_UINT32 vhpiIntT; typedef char vhpiCharT; typedef double vhpiRealT; typedef struct vhpiPhysS { PLI_INT32 high; PLI_UINT32 low; } vhpiPhysT; /********************** time structure ****************************/ typedef struct vhpiTimeS { PLI_UINT32 high; PLI_UINT32 low; } vhpiTimeT; /********************** value structure **************************/ /* value formats */ typedef enum { vhpiBinStrVal = 1, /* do not move */ vhpiOctStrVal = 2, /* do not move */ vhpiDecStrVal = 3, /* do not move */ vhpiHexStrVal = 4, /* do not move */ vhpiEnumVal = 5, vhpiIntVal = 6, vhpiLogicVal = 7, vhpiRealVal = 8, vhpiStrVal = 9, vhpiCharVal = 10, vhpiTimeVal = 11, vhpiPhysVal = 12 , vhpiObjTypeVal = 13, vhpiPtrVal = 14, vhpiEnumVecVal = 15, vhpiIntVecVal = 16, vhpiLogicVecVal = 17, vhpiRealVecVal = 18, vhpiTimeVecVal = 19, vhpiPhysVecVal = 20, vhpiPtrVecVal = 21, vhpiRawDataVal = 22 INT_VAL_FORMATS INT_AMS_VAL_FORMATS } vhpiFormatT; /* value structure */ typedef struct vhpiValueS { vhpiFormatT format; /* vhpi[Char,[Bin,Oct,Dec,Hex]Str, Enum, Logic,Int,Real,Phys,Time,Ptr, EnumVec,LogicVec,IntVect,RealVec,PhysVec,TimeVec, PtrVec,ObjType,RawData]Val */ PLI_UINT32 bufSize; /* the size in bytes of the value buffer; this is set by the user */ PLI_INT32 numElems; /* different meanings depending on the format: vhpiStrVal, vhpi{Bin...}StrVal: size of string array type values: number of array elements scalar type values: undefined */ vhpiPhysT unit; /* changed to vhpiPhysT in charles */ union { vhpiEnumT enumv, *enumvs; vhpiIntT intg, *intgs; vhpiRealT real, *reals; vhpiPhysT phys, *physs; vhpiTimeT time, *times; vhpiCharT ch, *str; void *ptr, **ptrs; } value; } vhpiValueT; #endif /* Following are the constant definitions. They are divided into three major areas: 1) object types 2) access methods 3) properties */ #define vhpiUndefined 1000 /*************** OBJECT KINDS *******************/ typedef enum { vhpiAccessTypeDeclK = 1001, vhpiAggregateK = 1002, vhpiAliasDeclK = 1003, vhpiAllK = 1004, vhpiAllocatorK = 1005, vhpiAnyCollectionK = 1006, vhpiArchBodyK = 1007, vhpiArgvK = 1008, vhpiArrayTypeDeclK = 1009, vhpiAssertStmtK = 1010, vhpiAssocElemK = 1011, vhpiAttrDeclK = 1012, vhpiAttrSpecK = 1013, vhpiBinaryExprK = 1014, vhpiBitStringLiteralK = 1015, vhpiBlockConfigK = 1016, vhpiBlockStmtK = 1017, vhpiBranchK = 1018, vhpiCallbackK = 1019, vhpiCaseStmtK = 1020, vhpiCharLiteralK = 1021, vhpiCompConfigK = 1022, vhpiCompDeclK = 1023, vhpiCompInstStmtK = 1024, vhpiCondSigAssignStmtK = 1025, vhpiCondWaveformK = 1026, vhpiConfigDeclK = 1027, vhpiConstDeclK = 1028, vhpiConstParamDeclK = 1029, vhpiConvFuncK = 1030, vhpiDeRefObjK = 1031, vhpiDisconnectSpecK = 1032, vhpiDriverK = 1033, vhpiDriverCollectionK = 1034, vhpiElemAssocK = 1035, vhpiElemDeclK = 1036, vhpiEntityClassEntryK = 1037, vhpiEntityDeclK = 1038, vhpiEnumLiteralK = 1039, vhpiEnumRangeK = 1040, /* new in ldv40 */ vhpiEnumTypeDeclK = 1041, vhpiExitStmtK = 1042, vhpiFileDeclK = 1043, vhpiFileParamDeclK = 1044, vhpiFileTypeDeclK = 1045, vhpiFloatRangeK = 1046, vhpiFloatTypeDeclK = 1047, vhpiForGenerateK = 1048, vhpiForLoopK = 1049, vhpiForeignfK = 1050, vhpiFuncCallK = 1051, vhpiFuncDeclK = 1052, vhpiGenericDeclK = 1053, vhpiGroupDeclK = 1054, vhpiGroupTempDeclK = 1055, vhpiIfGenerateK = 1056, vhpiIfStmtK = 1057, vhpiInPortK = 1058, vhpiIndexedNameK = 1059, vhpiIntLiteralK = 1060, vhpiIntRangeK = 1061, vhpiIntTypeDeclK = 1062, vhpiIteratorK = 1063, vhpiLibraryDeclK = 1064, vhpiLoopStmtK = 1065, vhpiNextStmtK = 1066, vhpiNullLiteralK = 1067, vhpiNullStmtK = 1068, vhpiOperatorK = 1069, vhpiOthersK = 1070, vhpiOutPortK = 1071, vhpiPackBodyK = 1072, vhpiPackDeclK = 1073, vhpiPackInstK = 1074, vhpiParamAttrNameK = 1075, vhpiPhysLiteralK = 1076, vhpiPhysRangeK = 1077, vhpiPhysTypeDeclK = 1078, vhpiPortDeclK = 1079, vhpiProcCallStmtK = 1080, vhpiProcDeclK = 1081, vhpiProcessStmtK = 1082, vhpiProtectedTypeK = 1083, vhpiProtectedTypeBodyK = 1084, vhpiProtectedTypeDeclK = 1085, vhpiRealLiteralK = 1086, vhpiRecordTypeDeclK = 1087, vhpiReportStmtK = 1088, vhpiReturnStmtK = 1089, vhpiRootInstK = 1090, vhpiSelectSigAssignStmtK = 1091, vhpiSelectWaveformK = 1092, vhpiSelectedNameK = 1093, vhpiSigDeclK = 1094, vhpiSigParamDeclK = 1095, vhpiSimpAttrNameK = 1096, vhpiSimpleSigAssignStmtK = 1097, vhpiSliceNameK = 1098, vhpiStringLiteralK = 1099, vhpiSubpBodyK = 1100, vhpiSubtypeDeclK = 1101, vhpiSubtypeIndicK = 1102, vhpiToolK = 1103, vhpiTransactionK = 1104, vhpiTypeConvK = 1105, vhpiUnaryExprK = 1106, vhpiUnitDeclK = 1107, vhpiUserAttrNameK = 1108, vhpiVarAssignStmtK = 1109, vhpiVarDeclK = 1110, vhpiVarParamDeclK = 1111, vhpiWaitStmtK = 1112, vhpiWaveformElemK = 1113, vhpiWhileLoopK = 1114 INT_CLASSES INT_AMS_CLASSES } vhpiClassKindT; /************** methods used to traverse 1 to 1 relationships *******************/ typedef enum { vhpiAbstractLiteral = 1301, vhpiActual = 1302, vhpiAll = 1303, vhpiAttrDecl = 1304, vhpiAttrSpec = 1305, vhpiBaseType = 1306, vhpiBaseUnit = 1307, vhpiBasicSignal = 1308, vhpiBlockConfig = 1309, vhpiCaseExpr = 1310, vhpiCondExpr = 1311, vhpiConfigDecl = 1312, vhpiConfigSpec = 1313, vhpiConstraint = 1314, vhpiContributor = 1315, vhpiCurCallback = 1316, vhpiCurEqProcess = 1317, vhpiCurStackFrame = 1318, vhpiDeRefObj = 1319, vhpiDecl = 1320, vhpiDesignUnit = 1321, vhpiDownStack = 1322, vhpiElemSubtype = 1323, vhpiEntityAspect = 1324, vhpiEntityDecl = 1325, vhpiEqProcessStmt = 1326, vhpiExpr = 1327, vhpiFormal = 1328, vhpiFuncDecl = 1329, vhpiGroupTempDecl = 1330, vhpiGuardExpr = 1331, vhpiGuardSig = 1332, vhpiImmRegion = 1333, vhpiInPort = 1334, vhpiInitExpr = 1335, vhpiIterScheme = 1336, vhpiLeftExpr = 1337, vhpiLexicalScope = 1338, vhpiLhsExpr = 1339, vhpiLocal = 1340, vhpiLogicalExpr = 1341, vhpiName = 1342, vhpiOperator = 1343, vhpiOthers = 1344, vhpiOutPort = 1345, vhpiParamDecl = 1346, vhpiParamExpr = 1347, vhpiParent = 1348, vhpiPhysLiteral = 1349, vhpiPrefix = 1350, vhpiPrimaryUnit = 1351, vhpiProtectedTypeBody = 1352, vhpiProtectedTypeDecl = 1353, vhpiRejectTime = 1354, vhpiReportExpr = 1355, vhpiResolFunc = 1356, vhpiReturnExpr = 1357, vhpiReturnTypeMark = 1358, vhpiRhsExpr = 1359, vhpiRightExpr = 1360, vhpiRootInst = 1361, vhpiSelectExpr = 1362, vhpiSeverityExpr = 1363, vhpiSimpleName = 1364, vhpiSubpBody = 1365, vhpiSubpDecl = 1366, vhpiSubtype = 1367, vhpiSuffix = 1368, vhpiTimeExpr = 1369, vhpiTimeOutExpr = 1370, vhpiTool = 1371, vhpiType = 1372 vhpiTypeMark = 1373, vhpiUnitDecl = 1374, vhpiUpStack = 1375, vhpiUpperRegion = 1376, vhpiUse = 1377, vhpiValExpr = 1378, vhpiValSubtype = 1379 INT_ONE_METHODS INT_AMS_ONE_METHODS } vhpiOneToOneT; /************** methods used to traverse 1 to many relationships *******************/ typedef enum { vhpiAliasDecls = 1501, vhpiArgvs = 1502, vhpiAttrDecls = 1503, vhpiAttrSpecs = 1504, vhpiBasicSignals = 1505, vhpiBlockStmts = 1506, vhpiBranchs = 1507, vhpiCallbacks = 1508, vhpiChoices = 1509, vhpiCompInstStmts = 1510, vhpiCondExprs = 1511, vhpiCondWaveforms = 1512, vhpiConfigItems = 1513, vhpiConfigSpecs = 1514, vhpiConstDecls = 1515, vhpiConstraints = 1516, vhpiContributors = 1517, vhpiCurRegions = 1518, vhpiDecls = 1519, vhpiDepUnits = 1520, vhpiDesignUnits = 1521, vhpiDrivenSigs = 1522, vhpiDrivers = 1523, vhpiElemAssocs = 1524, vhpiEntityClassEntrys = 1525, vhpiEntityDesignators = 1526, vhpiEnumLiterals = 1527, vhpiForeignfs = 1528, vhpiGenericAssocs = 1529, vhpiGenericDecls = 1530, vhpiIndexExprs = 1531, vhpiIndexedNames = 1532, vhpiInternalRegions = 1533, vhpiMembers = 1534, vhpiPackInsts = 1535, vhpiParamAssocs = 1536, vhpiParamDecls = 1537, vhpiPortAssocs = 1538, vhpiPortDecls = 1539, vhpiRecordElems = 1540, vhpiSelectWaveforms = 1541, vhpiSelectedNames = 1542, vhpiSensitivitys = 1543, vhpiSeqStmts = 1544, vhpiSigAttrs = 1545, vhpiSigDecls = 1546, vhpiSigNames = 1547, vhpiSignals = 1548, vhpiSpecNames = 1549, vhpiSpecs = 1550, vhpiStmts = 1551, /* vhpiTargets removed in 4.0 */ vhpiTransactions = 1552, vhpiTypeMarks = 1553, vhpiUnitDecls = 1554, vhpiUses = 1555, vhpiVarDecls = 1556, vhpiWaveformElems = 1557 INT_MANY_METHODS INT_AMS_MANY_METHODS } vhpiOneToManyT; /****************** PROPERTIES *******************/ /******* INTEGER or BOOLEAN PROPERTIES **********/ typedef enum { vhpiAccessP = 1001, vhpiArgcP = 1002, vhpiAttrKindP = 1003, vhpiBaseIndexP = 1004, vhpiBeginLineNoP = 1005, vhpiEndLineNoP = 1006, vhpiEntityClassP = 1007, vhpiForeignKindP = 1008, vhpiFrameLevelP = 1009, vhpiGenerateIndexP = 1010, vhpiIntValP = 1011, vhpiIsAnonymousP = 1012, vhpiIsBasicP = 1013, vhpiIsCompositeP = 1014, vhpiIsDefaultP = 1015, vhpiIsDeferredP = 1016, vhpiIsDiscreteP = 1017, vhpiIsForcedP = 1018, vhpiIsForeignP = 1019, vhpiIsGuardedP = 1020, vhpiIsImplicitDeclP = 1021, vhpiIsInvalidP = 1022, vhpiIsLocalP = 1023, vhpiIsNamedP = 1024, vhpiIsNullP = 1025, vhpiIsOpenP = 1026, vhpiIsPLIP = 1027, vhpiIsPassiveP = 1028, vhpiIsPostponedP = 1029, vhpiIsProtectedTypeP = 1030, vhpiIsPureP = 1031, vhpiIsResolvedP = 1032, vhpiIsScalarP = 1033, vhpiIsSeqStmtP = 1034, vhpiIsSharedP = 1035, vhpiIsTransportP = 1036, vhpiIsUnaffectedP = 1037, vhpiIsUnconstrainedP = 1038, vhpiIsUninstantiatedP = 1039, vhpiIsUpP = 1040, vhpiIsVitalP = 1041, vhpiIteratorTypeP = 1042, vhpiKindP = 1042, -- change all numbers vhpiLeftBoundP = 1043, vhpiLevelP = 1044, vhpiLineNoP = 1045, vhpiLineOffsetP = 1046, vhpiLoopIndexP = 1047, vhpiModeP = 1048, vhpiNumDimensionsP = 1049, vhpiNumFieldsP = 1050, vhpiNumGensP = 1051, vhpiNumLiteralsP = 1052, vhpiNumMembersP = 1053, vhpiNumParamsP = 1054, vhpiNumPortsP = 1055, vhpiOpenModeP = 1056, vhpiPhaseP = 1057, vhpiPositionP = 1058, vhpiPredefAttrP = 1059, vhpiProtectedLevelP = 1060, vhpiReasonP = 1061, vhpiRightBoundP = 1062, vhpiSigKindP = 1063, vhpiSizeP = 1064, vhpiStartLineNoP = 1065, vhpiStateP = 1066, vhpiStaticnessP = 1067, vhpiVHDLversionP = 1068, vhpiIdP = 1069, /* MIXED_LANG_PROPERTY */ vhpiLanguageP = 1200 INT_INT_PROPERTIES INT_AMS_INT_PROPERTIES } vhpiIntPropertyT; /******* STRING PROPERTIES **********/ typedef enum { vhpiCaseNameP = 1301, vhpiCompNameP = 1302, vhpiDefNameP = 1303, vhpiFileNameP = 1304, vhpiFullCaseNameP = 1305, vhpiFullNameP = 1306, vhpiKindStrP = 1307, vhpiLabelNameP = 1308, vhpiLibLogicalNameP = 1309, vhpiLibPhysicalNameP = 1310, vhpiLogicalNameP = 1311, vhpiLoopLabelNameP = 1312, vhpiNameP = 1313, vhpiOpNameP = 1314, vhpiStrValP = 1315, vhpiToolVersionP = 1316, vhpiUnitNameP = 1317, vhpiSaveRestartLocationP = 1318, /* MIXED LANG PROPERTIES */ vhpiFullVlogNameP = 1500, vhpiFullVHDLNameP = 1501, vhpiFullLSNameP = 1502, vhpiFullLSCaseNameP = 1503 INT_STR_PROPERTIES INT_AMS_STR_PROPERTIES } vhpiStrPropertyT; /******* REAL PROPERTIES **********/ typedef enum { vhpiFloatLeftBoundP = 1601, vhpiFloatRightBoundP = 1602, vhpiRealValP = 1603 INT_REAL_PROPERTIES INT_AMS_REAL_PROPERTIES } vhpiRealPropertyT; /******* PHYSICAL PROPERTIES **********/ typedef enum { vhpiPhysLeftBoundP = 1651, vhpiPhysPositionP = 1652, vhpiPhysRightBoundP = 1653, vhpiPhysValP = 1654, vhpiPrecisionP = 1655, vhpiSimTimeUnitP = 1656 INT_PHYS_PROPERTIES INT_AMS_PHYS_PROPERTIES } vhpiPhysPropertyT; /******************* PROPERTY VALUES ************************/ /* vhpiOpenModeP */ #define vhpiInOpen 1001 #define vhpiOutOpen 1002 #define vhpiReadOpen 1003 #define vhpiWriteOpen 1004 #define vhpiAppendOpen 1005 /* vhpiModeP */ #define vhpiInMode 1001 #define vhpiOutMode 1002 #define vhpiInoutMode 1003 #define vhpiBufferMode 1004 #define vhpiLinkageMode 1005 /* vhpiSigKindP */ #define vhpiRegister 1001 #define vhpiBus 1002 #define vhpiNormal 1003 /* vhpiStaticnessP */ #define vhpiLocallyStatic 1001 #define vhpiGloballyStatic 1002 #define vhpiDynamic 1003 /* vhpiPredefAttrP */ #define vhpiActivePA 1001 #define vhpiAscendingPA 1002 #define vhpiBasePA 1003 #define vhpiDelayedPA 1004 #define vhpiDrivingPA 1005 #define vhpiDriving_valuePA 1006 #define vhpiEventPA 1007 #define vhpiHighPA 1008 #define vhpiImagePA 1009 #define vhpiInstance_namePA 1010 #define vhpiLast_activePA 1011 #define vhpiLast_eventPA 1012 #define vhpiLast_valuePA 1013 #define vhpiLeftPA 1014 #define vhpiLeftofPA 1015 #define vhpiLengthPA 1016 #define vhpiLowPA 1017 #define vhpiPath_namePA 1018 #define vhpiPosPA 1019 #define vhpiPredPA 1020 #define vhpiQuietPA 1021 #define vhpiRangePA 1022 #define vhpiReverse_rangePA 1023 #define vhpiRightPA 1024 #define vhpiRightofPA 1025 #define vhpiSimple_namePA 1026 #define vhpiStablePA 1027 #define vhpiSuccPA 1028 #define vhpiTransactionPA 1029 #define vhpiValPA 1030 #define vhpiValuePA 1031 /* vhpiAttrKindP */ typedef enum { vhpiFunctionAK = 1, vhpiRangeAK = 2, vhpiSignalAK = 3, vhpiTypeAK = 4, vhpiValueAK = 5 INT_ATTR INT_AMS_ATTR } vhpiAttrKindT; /* vhpiEntityClassP */ #define vhpiEntityEC 1001 #define vhpiArchitectureEC 1002 #define vhpiConfigurationEC 1003 #define vhpiProcedureEC 1004 #define vhpiFunctionEC 1005 #define vhpiPackageEC 1006 #define vhpiTypeEC 1007 #define vhpiSubtypeEC 1008 #define vhpiConstantEC 1009 #define vhpiSignalEC 1010 #define vhpiVariableEC 1011 #define vhpiComponentEC 1012 #define vhpiLabelEC 1013 #define vhpiLiteralEC 1014 #define vhpiUnitsEC 1015 #define vhpiFileEC 1016 #define vhpiGroupEC 1017 /* vhpiAccessP */ #define vhpiRead 1 #define vhpiWrite 2 #define vhpiConnectivity 4 #define vhpiNoAccess 8 /* value for vhpiStateP property for callbacks */ typedef enum { vhpiEnable, vhpiDisable, vhpiMature /* callback has occured */ } vhpiStateT; /* MIXED LANGUAGE PROPERTY VALUES */ /* vhpiLanguageP */ #define vhpiVHDL 1001 #define vhpiVerilog 1002 /* the following enumeration types are used only for vhpiSimTimeUnitP and vhpiPrecisionP property and for setting the unit field of the value structure; they represent the physical position of a given VHDL time unit */ /* time unit physical position values {high, low} */ PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiFS; PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiPS; PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiNS; PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiUS; PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiMS; PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiS; PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiMN; PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiHR; /********************** delay structures **************************/ /* removed ; postponed to next version of the standard */ /* IEEE std_logic values */ #define vhpiU 0 /* uninitialized */ #define vhpiX 1 /* unknown */ #define vhpi0 2 /* forcing 0 */ #define vhpi1 3 /* forcing 1 */ #define vhpiZ 4 /* high impedance */ #define vhpiW 5 /* weak unknown */ #define vhpiL 6 /* weak 0 */ #define vhpiH 7 /* weak 1 */ #define vhpiDontCare 8 /* don't care */ /* IEEE std bit values */ #define vhpibit0 0 /* bit 0 */ #define vhpibit1 1 /* bit 1 */ /* IEEE std boolean values */ #define vhpiFalse 0 /* false */ #define vhpiTrue 1 /* true */ /************** vhpiPhaseP property values *************/ typedef enum { vhpiRegistrationPhase = 1, vhpiAnalysisPhase = 2, vhpiElaborationPhase = 3, vhpiInitializationPhase = 4, vhpiSimulationPhase = 5, vhpiTerminationPhase = 6, vhpiSavePhase = 7, vhpiRestartPhase = 8, vhpiResetPhase = 9 } vhpiPhaseT ; /**************** PLI error information structure ****************/ typedef enum { vhpiNote = 1, /* same as vpiNotice */ vhpiWarning = 2, /* same as vpiWarning */ vhpiError = 3, /* same as vpiError */ vhpiFailure = 6, /* keep it like that for interoperability with VPI */ vhpiSystem = 4, /* same as vpiSystem */ vhpiInternal = 5 /* same as vpiInternal */ } vhpiSeverityT; typedef struct vhpiErrorInfoS { vhpiSeverityT severity; PLI_BYTE8 *message; PLI_BYTE8 *str; PLI_BYTE8 *file; /* Name of the VHDL file where the VHPI error originated */ PLI_INT32 line; /* Line number in the VHDL file */ } vhpiErrorInfoT; /********************* callback structures ************************/ /* callback user data structure */ typedef struct vhpiCbDataS { PLI_INT32 reason; /* callback reason */ PLI_VOID (*cb_rtn) (const struct vhpiCbDataS *); /* call routine */ vhpiHandleT obj; /* trigger object */ vhpiTimeT *time; /* callback time */ vhpiValueT *value; /* trigger object value */ PLI_VOID *user_data; /* pointer to user data to be passed to the callback function */ } vhpiCbDataT; /**************************** CALLBACK REASONS ****************************/ /*************************** Simulation object related ***********************/ /* These are repetitive callbacks */ #define vhpiCbValueChange 1001 #define vhpiCbForce 1002 #define vhpiCbRelease 1003 #define vhpiCbTransaction 1004 /* optional callback reason */ /****************************** Statement related ****************************/ /* These are repetitive callbacks */ #define vhpiCbStmt 1005 #define vhpiCbResume 1006 /* ganges */ #define vhpiCbSuspend 1007 /* ganges */ /* issue: one time or repetitive callbacks */ #define vhpiCbStartOfSubpCall 1008 /* ganges */ #define vhpiCbEndOfSubpCall 1009 /* ganges */ /****************************** Time related ******************************/ /* the Rep callback reasons are the repeated versions of the callbacks */ #define vhpiCbAfterDelay 1010 #define vhpiCbRepAfterDelay 1011 /*************************** Simulation cycle phase related *****************/ #define vhpiCbNextTimeStep 1012 #define vhpiCbRepNextTimeStep 1013 #define vhpiCbStartOfNextCycle 1014 #define vhpiCbRepStartOfNextCycle 1015 #define vhpiCbStartOfProcesses 1016 /* new in charles */ #define vhpiCbRepStartOfProcesses 1017 /* new in ldv 3.3 */ #define vhpiCbEndOfProcesses 1018 /* ganges */ #define vhpiCbRepEndOfProcesses 1019 /* new ldv 3.3 */ #define vhpiCbLastKnownDeltaCycle 1020 /* new in ldv 3.3 */ #define vhpiCbRepLastKnownDeltaCycle 1021 /* new in ldv 3.3 */ #define vhpiCbStartOfPostponed 1022 /* ganges */ #define vhpiCbRepStartOfPostponed 1023 /* new in ldv 3.3 */ #define vhpiCbEndOfTimeStep 1024 /* ganges */ #define vhpiCbRepEndOfTimeStep 1025 /* new in ldv 3.3 */ /***************************** Action related *****************************/ /* these are one time callback unless otherwise noted */ #define vhpiCbStartOfTool 1026 /* new in charles */ #define vhpiCbEndOfTool 1027 /* new in charles */ #define vhpiCbStartOfAnalysis 1028 /* new in charles */ #define vhpiCbEndOfAnalysis 1029 /* new in charles */ #define vhpiCbStartOfElaboration 1030 /* new in charles */ #define vhpiCbEndOfElaboration 1031 /* name was cbkEndOfElaboration in tiber */ #define vhpiCbStartOfInitialization 1032 /* Name change in charles */ #define vhpiCbEndOfInitialization 1033 /* new in ldv 3.3 */ #define vhpiCbStartOfSimulation 1034 #define vhpiCbEndOfSimulation 1035 #define vhpiCbQuiescense 1036 /* repetitive */ #define vhpiCbPLIError 1037 /* repetitive */ #define vhpiCbStartOfSave 1038 #define vhpiCbkEndOfSave 1039 #define vhpiCbStartOfRestart 1040 #define vhpiCbEndOfRestart 1041 #define vhpiCbStartOfReset 1042 #define vhpiCbEndOfReset 1043 #define vhpiCbEnterInteractive 1044 /* repetitive */ #define vhpiCbExitInteractive 1045 /* repetitive */ #define vhpiCbSigInterrupt 1046 /* repetitive */ /* Foreign model callbacks */ #define vhpiCbTimeOut 1047 /* non repetitive */ #define vhpiCbRepTimeOut 1048 /* repetitive */ #define vhpiCbSensitivity 1049 /* repetitive */ /**************************** CALLBACK FLAGS ******************************/ #define vhpiReturnCb 0x00000001 #define vhpiDisableCb 0x00000010 /******************** FUNCTION DECLARATIONS *********************/ XXTERN PLI_INT32 vhpi_assert PROTO_PARAMS((vhpiSeverityT severity, PLI_BYTE8 *formatmsg,…)); /* callback related */ XXTERN vhpiHandleT vhpi_register_cb PROTO_PARAMS((vhpiCbDataT *cb_data_p, PLI_UINT32 flags)); XXTERN PLI_INT32 vhpi_remove_cb PROTO_PARAMS((vhpiHandleT cb_obj)); XXTERN PLI_INT32 vhpi_disable_cb PROTO_PARAMS((vhpiHandleT cb_obj)); XXTERN PLI_INT32 vhpi_enable_cb PROTO_PARAMS((vhpiHandleT cb_obj)); XXTERN PLI_INT32 vhpi_get_cb_info PROTO_PARAMS((vhpiHandleT object, vhpiCbDataT *cb_data_p)); /* for obtaining handles */ XXTERN vhpiHandleT vhpi_handle_by_name PROTO_PARAMS((const PLI_BYTE8 *name, vhpiHandleT scope)); XXTERN vhpiHandleT vhpi_handle_by_index PROTO_PARAMS((vhpiOneToManyT itRel, vhpiHandleT parent, PLI_INT32 indx)); /* for traversing relationships */ XXTERN vhpiHandleT vhpi_handle PROTO_PARAMS((vhpiOneToOneT type, vhpiHandleT referenceHandle)); XXTERN vhpiHandleT vhpi_iterator PROTO_PARAMS((vhpiOneToManyT type, vhpiHandleT referenceHandle)); XXTERN vhpiHandleT vhpi_scan PROTO_PARAMS((vhpiHandleT iterator)); /* for processsing properties */ XXTERN PLI_INT32 vhpi_get PROTO_PARAMS((vhpiIntPropertyT property, vhpiHandleT object)); XXTERN const PLI_BYTE8 * vhpi_get_str PROTO_PARAMS((vhpiStrPropertyT property, vhpiHandleT object)); XXTERN vhpiRealT vhpi_get_real PROTO_PARAMS((vhpiRealPropertyT property, vhpiHandleT object)); /* vhpi_get_phys new in charles */ XXTERN vhpiPhysT vhpi_get_phys PROTO_PARAMS((vhpiPhysPropertyT property, vhpiHandleT object)); /* for access to protected types: new in ganges */ typedef int (*vhpiUserFctT)(); XXTERN PLI_INT32 vhpi_protected_call PROTO_PARAMS((vhpiHandleT varHdl, vhpiUserFctT userFct, PLI_VOID *userData)); /* value processing */ XXTERN PLI_INT32 vhpi_get_value PROTO_PARAMS((vhpiHandleT expr, vhpiValueT *value_p)); XXTERN PLI_INT32 vhpi_put_value PROTO_PARAMS((vhpiHandleT object, vhpiValueT *value_p, PLI_UINT32 flags)); /* vhpi_put_value flags */ typedef enum { vhpiDeposit, vhpiDepositPropagate, vhpiForce, vhpiForcePropagate, vhpiRelease, vhpiSizeConstraint } vhpiPutValueFlagsT; XXTERN PLI_INT32 vhpi_schedule_transaction PROTO_PARAMS((vhpiHandleT drivHdl, vhpiValueT *value_p, PLI_INT32 numValues, vhpiTimeT *delayp,PLI_UINT32 delayMode, vhpiTimeT * pulseRejp)); typedef enum { vhpiInertial, vhpiTransport } vhpidelayModeT; XXTERN PLI_INT32 vhpi_format_value PROTO_PARAMS((const vhpiValueT *in_value_p, vhpiValueT *out_value_p)); /* time processing */ /* the current simulation time is retrieved */ XXTERN void vhpi_get_time PROTO_PARAMS((vhpiTimeT *time_p, long *cycles)); /* The next active time */ #define vhpiNoActivity -1 XXTERN PLI_INT32 vhpi_get_next_time PROTO_PARAMS((vhpiTimeT *time_p)); /* simulation control */ typedef enum { vhpiStop, vhpiFinish, vhpiReset } vhpiSimControlT; XXTERN PLI_INT32 vhpi_sim_control PROTO_PARAMS((vhpiSimControlT command, ...)); /* I/O routine */ XXTERN PLI_INT32 vhpi_printf PROTO_PARAMS((const PLI_BYTE8 *format,...)); /* utilities to print VHDL strings */ static PLI_INT32 vhpi_is_printable( PLI_BYTE8 ch ) { unsigned char uch = (unsigned char)ch; if (uch < 31) return 0; if (uch < 127) return 1; if (uch == 127) return 0; if (uch < 160) return 0; return 1; } static const PLI_UBYTE8* VHPICharCodes[256]={ "NUL", "SOH", "STX", "ETX", "EOT", "ENQ","ACK", "BEL" , "BS", "HT", "LF", "VT", "FF", "CR", "SO" , "SI", "DLE", "DC1", "DC2", "DC3", "DC4","NAK", "SYN" , "ETB", "CAN", "EM", "SUB", "ESC", "FSP", "GSP", "RSP" , "USP", " ","!","\"","#","$","%","&","", "(",")","*","+",",","-",".","/", "0","1","2","3","4","5","6","7", "8","9",":",";","<","=",">","?", "@","A","B","C","D","E","F","G", "H","I","J","K","L","M","N","O", "P","Q","R","S","T","U","V","W", "X","Y","Z","[","\\","]","^","_", "`","a","b","c","d","e","f","g", "h","i","j","k","l","m","n","o", "p","q","r","s","t","u","v","w", "x","y","z","{","|","}","~","DEL", "C128", "C129", "C130","C131","C132","C133","C134","C135", "C136", "C137", "C138","C139","C140","C141","C142","C143", "C144", "C145", "C146","C147","C148","C149","C150","C151", "C152", "C153", "C154","C155","C156","C157","C158","C159", " ","¡","¢","£","¤","¥","¦","§", "¨","©","ª","«","","­","®","¯", "°","±","²","³","´","µ","","•", "¸","¹","º","»","¼","½","¾","¿", "À","Á","Â","Ã","Ä","Å","Æ","Ç", "È","É","Ê","Ë","Ì","Í","Î","Ï", "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×", "Ø","Ù","Ú","Û","Ü","Ý","Þ","ß", "à","á","â","ã","ä","å","æ","ç", "è","é","ê","ë","ì","í","î","ï", "ð","ñ","ò","ó","ô","õ","ö","÷", "ø","ù","ú","û","ü","ý","þ","ÿ" }; #define VHPI_GET_PRINTABLE_STRINGCODE( ch ) VHPICharCodes[PLI_UBYTE8 ch] /* utility routines */ XXTERN PLI_INT32 vhpi_compare_handles PROTO_PARAMS((vhpiHandleT handle1, vhpiHandleT handle2)); XXTERN PLI_INT32 vhpi_check_error PROTO_PARAMS((vhpiErrorInfoT *error_info_p)); /* name change was vhpi_free_handle in charles */ XXTERN PLI_INT32 vhpi_release_handle PROTO_PARAMS((vhpiHandleT object)); /* creation functions */ XXTERN vhpiHandleT vhpi_create PROTO_PARAMS((vhpiClassKindT kind, vhpiHandleT handle1, vhpiHandleT handle2)); /* Foreign model data structures and functions */ typedef enum { vhpiArchF, vhpiFuncF, vhpiProcF, vhpiLibF, vhpiAppF } vhpiForeignT; typedef struct vhpiForeignDataS { vhpiForeignT kind; PLI_BYTE8 * libraryName; PLI_BYTE8 * modelName; PLI_VOID (*elabf)(const struct vhpiCbDataS *cb_data_p); PLI_VOID (*execf)(const struct vhpiCbDataS *cb_data_p); } vhpiForeignDataT; XXTERN vhpiHandleT vhpi_register_foreignf PROTO_PARAMS((vhpiForeignDataT *foreignDatap)); XXTERN int vhpi_get_foreign_info PROTO_PARAMS((vhpiHandleT hdl, vhpiForeignDataT *foreignDatap)); /* for saving and restoring foreign models data */ XXTERN PLI_INT32 vhpi_get_data PROTO_PARAMS((PLI_INT32 id, PLI_VOID * dataLoc, PLI_INT32 numBytes)); XXTERN PLI_INT32 vhpi_put_data PROTO_PARAMS((PLI_INT32 id, PLI_VOID * dataLoc, PLI_INT32 numBytes)); /* internal function prototypes from vhpi_internal.h */ INT_PROTOTYPES /**************************** GLOBAL VARIABLES ****************************/ typedef PLI_VOID (*vhpiBootstrapFctT)(); extern PLI_DLLESPEC vhpiBootstrapFctT *vhpiBootstrapArray[]; /* array of function pointers, */ /* last pointer should be null */ #undef PLI_EXTERN #undef PLI_VEXTERN #ifdef VHPI_USER_DEFINED_DLLISPEC #undef VHPI_USER_DEFINED_DLLISPEC #undef PLI_DLLISPEC #endif #ifdef VHPI_USER_DEFINED_DLLESPEC #undef VHPI_USER_DEFINED_DLLESPEC #undef PLI_DLLESPEC #endif #ifdef PLI_PROTOTYPES #undef PLI_PROTOTYPES #undef PROTO_PARAMS #undef XXTERN #undef EETERN #endif #ifdef __cplusplus } #endif #endif /* VHPI_USER_H */