1 /******************************************************************************
2 * cv_vpi_user.h
3 *
4 * Simulator specific vpi_user (vpi_ routine) include file
5 *
6 * This file contains the constant definitions, structure definitions
7 * used by the Cver simulator specific vpi mechanism that follows
8 * the IEEE P1364 standard
9 *
10 * It must be included after vpi_user.h
11 *
12 * This file also contains the vpi_ routines that are enhancements not in
13 * the IEEE standard
14 *
15 * Copyright 1995-2003. Pragmatic C Software. All rights reserved.
16 ******************************************************************************/
17 #ifndef CV_VPI_USER_H
18 #define CV_VPI_USER_H
19 
20 #include <stdarg.h>
21 
22 #ifdef  __cplusplus
23 extern "C" {
24 #endif
25 
26 /*********** OBJECT TYPES **********/
27 /* numbers not yet assigned - using 500s (unassigned) until P1364 assigns */
28 #define vpiNetDriver    500        /* vpi_ added net driver */
29 #define vpiNetBitDriver 501        /* vpi_ added net bit driver */
30 #define vpiSchedBitEvent 502       /* vpi_ added wire driver per bit event */
31 #define vpiParamArray   503        /* new parameter array object */
32 #define vpiParamArrayWord 504      /* word of param array (same as memory) */
33 
34 /*********** METHODS **********/
35 /*********** methods used to traverse 1 to 1 relationships **********/
36 /* currently no access to pound parameter expressions - will move */
37 #define vpiPoundParam 505
38 
39 /* iterator to get one instance (vpiModule object) of each type */
40 /* 2nd argument to vpi_iterate must be NULL */
41 #define vpiOneOfEachMod  506       /* one instance of each type (Cver ext.) */
42 
43 /* Cver start range (to not conflict with standard or other simulators */
44 #define CV_START_ONUMS 500
45 
46 /*********** PROPERTIES ***********/
47 /*********** Cver added properties types ***********/
48 
49 /*---------------------------------------------------------------------------*/
50 /*------------------------------- definitions -------------------------------*/
51 /*---------------------------------------------------------------------------*/
52 /* extra vpi_put_value 4th argument flag value to add driver terminal */
53 #define vpiAddDriver 16
54 
55 /*********************** STRUCTURE DEFINITIONS ****************************/
56 /* cbLanguageLine call back per line record */
57 typedef struct t_vpi_languageline
58 {
59     char *linep;
60     char *file;
61     int lineno;
62 } s_vpi_languageline, *p_vpi_languageline;
63 
64 /* Cver specific call back record - starting at 500 to avoid conflicts */
65 #define cbLanguageLine 500
66 
67 /* customer specific simulation control operations */
68 #define cbCustomer1 501
69 
70 /* Cver extended vpi_control operations */
71 #define vpiInsertSource 500
72 #define vpiCustomer1 501
73 #define vpiFlushLog 502
74 #define vpiDumpVars 503
75 #define vpiEnableCb 504
76 #define vpiDisableCb 505
77 
78 /*---------------------------------------------------------------------------*/
79 /*--------------- Cver non standard routine definitions ---------------------*/
80 /*---------------------------------------------------------------------------*/
81 #if defined(__STDC__) || defined(__cplusplus)
82 
83 #ifndef PROTO_PARAMS
84 #define PROTO_PARAMS(params) params
85 #define DEFINED_PROTO_PARAMS
86 #endif
87 #ifndef EXTERN
88 #define EXTERN
89 #define DEFINED_EXTERN
90 #endif
91 
92 #else
93 
94 #ifndef PROTO_PARAMS
95 #define PROTO_PARAMS(params) (/* nothing */)
96 #define DEFINED_PROTO_PARAMS
97 #endif
98 #ifndef EXTERN
99 #define EXTERN extern
100 #define DEFINED_EXTERN
101 #endif
102 
103 #endif /* __STDC__ */
104 
105 /* SJM 11/13/03 - for backward compatibility - old name of vpi control */
106 #define vpi_sim_control vpi_control
107 
108 /* added routine for copying - submitted to committee for inclusion */
109 EXTERN vpiHandle    vpi_copy_object     PROTO_PARAMS((vpiHandle obj));
110 /* added routine for dumping internal vpi handle contents */
111 EXTERN PLI_INT32    __vpi_show_object PROTO_PARAMS((vpiHandle obj));
112 
113 #ifdef DEFINED_PROTO_PARAMS
114 #undef DEFINED_PROTO_PARAMS
115 #undef  PROTO_PARAMS
116 #endif
117 
118 #ifdef DEFINED_EXTERN
119 #undef DEFINED_EXTERN
120 #undef EXTERN
121 #endif
122 
123 #ifdef  __cplusplus
124 }
125 #endif
126 
127 #endif /* CV_VPI_USER_H */
128