Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 605 lines (516 sloc) 19.422 kb
a240be7 vpi_user header file is a root header.
steve authored
1 #ifndef __vpi_user_H
2 #define __vpi_user_H
3 /*
0644781 @caryr Add support for tracing procedural statements.
caryr authored
4 * Copyright (c) 1999-2011 Stephen Williams (steve@icarus.com)
a240be7 vpi_user header file is a root header.
steve authored
5 *
6 * This source code is free software; you can redistribute it
7 * and/or modify it in source code form under the terms of the GNU
8 * General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 */
21
22
de8c725 Mingw32 support (Venkat Iyer)
steve authored
23 #if defined(__MINGW32__) || defined (__CYGWIN32__)
a240be7 vpi_user header file is a root header.
steve authored
24 # define DLLEXPORT __declspec(dllexport)
25 #else
26 # define DLLEXPORT
27 #endif
28
29 #ifdef __cplusplus
aec5841 Implement vpi_put_value for signals.
steve authored
30 # define EXTERN_C_START extern "C" {
31 # define EXTERN_C_END }
32 #else
33 # define EXTERN_C_START
34 # define EXTERN_C_END
a240be7 vpi_user header file is a root header.
steve authored
35 #endif
36
6ede18d support GCC __attributes__ for printf formats.
steve authored
37 #ifndef __GNUC__
38 # undef __attribute__
39 # define __attribute__(x)
40 #endif
41
aec5841 Implement vpi_put_value for signals.
steve authored
42 EXTERN_C_START
43
ff90a57 Export the vpi_vprintf function.
steve authored
44 # include <stdarg.h>
e3e4e64 Add vpi_fopen and vpi_get_file.
steve authored
45 # include <stdio.h>
d3de1d9 Add at least minimal implementations for several
steve authored
46 # include "_pli_types.h"
ff90a57 Export the vpi_vprintf function.
steve authored
47
5d977ca @ldoolitt Brainless start to const-correct changes
ldoolitt authored
48 #define ICARUS_VPI_CONST
a240be7 vpi_user header file is a root header.
steve authored
49 typedef struct __vpiHandle *vpiHandle;
50
51 /*
52 * This structure is created by the VPI application to provide hooks
53 * into the application that the compiler/simulator can access.
54 */
55 typedef struct t_vpi_systf_data {
c37153b Verilog 2001 standart types.
steve authored
56 PLI_INT32 type;
65f0933 Add sysfunctype to calltf structure.
steve authored
57 PLI_INT32 sysfunctype;
1bd1d28 tfname can be constant.
steve authored
58 const char *tfname;
5d977ca @ldoolitt Brainless start to const-correct changes
ldoolitt authored
59 PLI_INT32 (*calltf) (ICARUS_VPI_CONST PLI_BYTE8*);
60 PLI_INT32 (*compiletf)(ICARUS_VPI_CONST PLI_BYTE8*);
72ec3a2 VPI tasks take PLI_BYTE* by the standard.
steve authored
61 PLI_INT32 (*sizetf) (PLI_BYTE8*);
5d977ca @ldoolitt Brainless start to const-correct changes
ldoolitt authored
62 ICARUS_VPI_CONST PLI_BYTE8 *user_data;
a240be7 vpi_user header file is a root header.
steve authored
63 } s_vpi_systf_data, *p_vpi_systf_data;
64
65 /* The type in the above structure can have one of the following
66 values: */
67 #define vpiSysTask 1
68 #define vpiSysFunc 2
69
70 typedef struct t_vpi_vlog_info
71 {
c37153b Verilog 2001 standart types.
steve authored
72 PLI_INT32 argc;
73 char **argv;
74 char *product;
75 char *version;
a240be7 vpi_user header file is a root header.
steve authored
76 } s_vpi_vlog_info, *p_vpi_vlog_info;
77
78
79 typedef struct t_vpi_time {
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
80
9d39b3a Access to modpaths via VPI
yang yun ju authored
81 /*
82 Type can be :
83
84 vpiScaledRealTime == 1
85 vpiSimTime == 2
86 vpiSuppressTime == 3
87 */
88
c37153b Verilog 2001 standart types.
steve authored
89 PLI_INT32 type;
90 PLI_UINT32 high;
91 PLI_UINT32 low;
a240be7 vpi_user header file is a root header.
steve authored
92 double real;
93 } s_vpi_time, *p_vpi_time;
94
95 #define vpiScaledRealTime 1
96 #define vpiSimTime 2
97 #define vpiSuppressTime 3
98
99 typedef struct t_vpi_vecval {
c37153b Verilog 2001 standart types.
steve authored
100 PLI_INT32 aval, bval; /* ab encoding: 00=0, 10=1, 11=X, 01=Z */
a240be7 vpi_user header file is a root header.
steve authored
101 } s_vpi_vecval, *p_vpi_vecval;
102
91d65d0 Add the vpi_user strength definitions.
steve authored
103 typedef struct t_vpi_strengthval {
c37153b Verilog 2001 standart types.
steve authored
104 PLI_INT32 logic;
105 PLI_INT32 s0, s1;
91d65d0 Add the vpi_user strength definitions.
steve authored
106 } s_vpi_strengthval, *p_vpi_strengthval;
107
a240be7 vpi_user header file is a root header.
steve authored
108 /*
109 * This structure holds values that are passed back and forth between
110 * the simulator and the application.
111 */
112 typedef struct t_vpi_value {
c37153b Verilog 2001 standart types.
steve authored
113 PLI_INT32 format;
a240be7 vpi_user header file is a root header.
steve authored
114 union {
c37153b Verilog 2001 standart types.
steve authored
115 char *str;
116 PLI_INT32 scalar;
117 PLI_INT32 integer;
a240be7 vpi_user header file is a root header.
steve authored
118 double real;
119 struct t_vpi_time *time;
120 struct t_vpi_vecval *vector;
121 struct t_vpi_strengthval *strength;
c37153b Verilog 2001 standart types.
steve authored
122 char *misc;
a240be7 vpi_user header file is a root header.
steve authored
123 } value;
124 } s_vpi_value, *p_vpi_value;
125
9d39b3a Access to modpaths via VPI
yang yun ju authored
126
127 /*
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
128
129 Conform the IEEE 1364, We add the
130 Standard vpi_delay structure to
9d39b3a Access to modpaths via VPI
yang yun ju authored
131 enable the modpath delay values
132
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
133
9d39b3a Access to modpaths via VPI
yang yun ju authored
134 Conform IEEE 1364, Pg 670 :
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
135
9d39b3a Access to modpaths via VPI
yang yun ju authored
136 The "da" field of the s_vpi_delay
137 structure shall be a user allocated
77061fa @caryr Add vpiFile and vpiLineNo for system functions.
caryr authored
138 array of "s_vpi_time" structure
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
139
77061fa @caryr Add vpiFile and vpiLineNo for system functions.
caryr authored
140 The array shall store delay values returned
9d39b3a Access to modpaths via VPI
yang yun ju authored
141 by vpi_get_delay(). The number of elements in
142 the array shall be determined by
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
143
77061fa @caryr Add vpiFile and vpiLineNo for system functions.
caryr authored
144 (1) The number of delays to be retrieved
9d39b3a Access to modpaths via VPI
yang yun ju authored
145 ( normally this is used in vpi_get_delays (..) )
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
146 {
d90ce68 @ldoolitt Spelling fixes
ldoolitt authored
147 (1.1) Set by "no_of_delays" field
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
148
9d39b3a Access to modpaths via VPI
yang yun ju authored
149 (1.2) For the primitive_object, the no_of_delays
150 shall be 2 or 3
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
151
9d39b3a Access to modpaths via VPI
yang yun ju authored
152 (1.3) For path_delay object the no_of_delays shall
153 be 1,2,3,6, 12
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
154
9d39b3a Access to modpaths via VPI
yang yun ju authored
155 (1.4) For timing_check_object, the no_of_delays shall
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
156 be match the number of limits existing in the
9d39b3a Access to modpaths via VPI
yang yun ju authored
157 Time Check
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
158
9d39b3a Access to modpaths via VPI
yang yun ju authored
159 (1.5) For intermodule_path object, the no_of_delays shall
160 be 2 or 3
161 }
162
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
163
164
165
9d39b3a Access to modpaths via VPI
yang yun ju authored
166 (2) The "mtm_flag" && "pulsere_flag"
167
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
168
9d39b3a Access to modpaths via VPI
yang yun ju authored
169 Normally, if you set mtm = X, pulsere = Y
170 then, you will need allocate (num * no_of_delay)
171 s_vpi_time elements for 'da' array before calling
172 the vpi_get/put_delays (..)
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
173
9d39b3a Access to modpaths via VPI
yang yun ju authored
174 ---------------------------------------------------------------------------
175 | | | |
176 | mtm_flag | No of s_vpi_time array | order in which delay |
177 | pulsere_flag | element required by the | elements shall be filed |
178 | | s_vpi_delay->da | |
179 | | | |
180 |----------------|-------------------------|------------------------------|
181 | | | 1o delay da[0]--> 1o delay |
182 | mtm = false | no_of_delay | 2o delay da[1]--> 2o delay |
183 | pulere = false | | |
184 | | | |
185 |----------------|-------------------------|------------------------------|
186 | | | 1o delay da[0]--> min delay |
187 | mtm = true | | da[1]--> typ delay |
188 | pulere = false | 3*no_of_delay | da[2]--> max delay |
189 | | | 2o delay da[3]--> min delay |
190 | | | da[4]--> typ delay |
191 | | | .... |
192 |----------------|-------------------------|------------------------------|
193 | | | 1o delay da[0]--> delay |
194 | mtm = false | | da[1]--> rej limit |
195 | pulere = true | 3*no_of_delay | da[2]--> err limit |
196 | | | 2o delay da[3]--> delay |
197 | | | da[4]--> rej limit |
198 | | | .... |
199 |----------------|-------------------------|------------------------------|
200 | | | 1o delay da[0]--> min delay |
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
201 | mtm = true | | da[1]--> typ delay |
9d39b3a Access to modpaths via VPI
yang yun ju authored
202 | pulere = true | 9*no_of_delay | da[2]--> max delay |
203 | | | da[3]--> min delay |
204 | | | da[4]--> typ delay |
205 | | | da[5]--> max delay |
206 | | | da[6]--> min delay |
207 | | | da[7]--> typ delay |
208 | | | da[8]--> max delay |
209 | | | 2o delay da[9]--> min delay |
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
210 | | | .... |
9d39b3a Access to modpaths via VPI
yang yun ju authored
211 -------------------------------------------------------------------------
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
212
9d39b3a Access to modpaths via VPI
yang yun ju authored
213 IMPORTANT :
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
214
215 The delay Structure has to be allocated before passing a pointer to
216 "vpi_get_delays ( )".
217
9d39b3a Access to modpaths via VPI
yang yun ju authored
218 */
219
220
221 typedef struct t_vpi_delay {
39dd22a @ldoolitt Adjust unusual spacing
ldoolitt authored
222 struct t_vpi_time *da; /* Array of delay data */
223 PLI_INT32 no_of_delays ;
224 PLI_INT32 time_type; /* vpiScaledRealTime, vpiSimTime */
225 PLI_INT32 mtm_flag;
226 PLI_INT32 append_flag;
227 PLI_INT32 plusere_flag;
9d39b3a Access to modpaths via VPI
yang yun ju authored
228 } s_vpi_delay, *p_vpi_delay;
229
230
231
232
233
a240be7 vpi_user header file is a root header.
steve authored
234 /* These are valid codes for the format of the t_vpi_value structure. */
235 #define vpiBinStrVal 1
236 #define vpiOctStrVal 2
237 #define vpiDecStrVal 3
238 #define vpiHexStrVal 4
239 #define vpiScalarVal 5
240 #define vpiIntVal 6
241 #define vpiRealVal 7
242 #define vpiStringVal 8
243 #define vpiVectorVal 9
244 #define vpiStrengthVal 10
245 #define vpiTimeVal 11
246 #define vpiObjTypeVal 12
247 #define vpiSuppressVal 13
248
249
250 /* SCALAR VALUES */
251 #define vpi0 0
252 #define vpi1 1
253 #define vpiZ 2
254 #define vpiX 3
255 #define vpiH 4
256 #define vpiL 5
257 #define vpiDontCare 6
258
91d65d0 Add the vpi_user strength definitions.
steve authored
259 /* STRENGTH VALUES */
260 #define vpiSupplyDrive 0x80
261 #define vpiStrongDrive 0x40
262 #define vpiPullDrive 0x20
263 #define vpiLargeCharge 0x10
264 #define vpiWeakDrive 0x08
265 #define vpiMediumCharge 0x04
266 #define vpiSmallCharge 0x02
267 #define vpiHiZ 0x01
a240be7 vpi_user header file is a root header.
steve authored
268
269 /* OBJECT CODES */
270 #define vpiConstant 7
271 #define vpiFunction 20
5eca5d9 Carry integerness throughout the compilation.
steve authored
272 #define vpiIntegerVar 25
a240be7 vpi_user header file is a root header.
steve authored
273 #define vpiIterator 27
274 #define vpiMemory 29
275 #define vpiMemoryWord 30
9d39b3a Access to modpaths via VPI
yang yun ju authored
276 #define vpiModPath 31
a240be7 vpi_user header file is a root header.
steve authored
277 #define vpiModule 32
278 #define vpiNamedBegin 33
b1c0f73 Add vpi support for named events.
steve authored
279 #define vpiNamedEvent 34
a240be7 vpi_user header file is a root header.
steve authored
280 #define vpiNamedFork 35
281 #define vpiNet 36
1222153 Keep parameter constants for the ivl_target API.
steve authored
282 #define vpiParameter 41
2fab315 @caryr Add smart part select for system functions &PV<>.
caryr authored
283 #define vpiPartSelect 42
68cf5ba @steveicarus Out path term for modpaths
steveicarus authored
284 #define vpiPathTerm 43
46253ed Rework expression parsing and elaboration to
steve authored
285 #define vpiRealVar 47
a240be7 vpi_user header file is a root header.
steve authored
286 #define vpiReg 48
287 #define vpiSysFuncCall 56
288 #define vpiSysTaskCall 57
289 #define vpiTask 59
290 #define vpiTimeVar 63
aa1cd16 @caryr Add preliminary support for vpiUserSystf, vpi_get_systf_info(), etc.
caryr authored
291 #define vpiUserSystf 67
82805b9 @caryr Add compiletf routines for the scanf functions.
caryr authored
292 #define vpiNetArray 114
a156d8b Add vpiIndex update.
steve authored
293 #define vpiIndex 78
4e286ea Add the vpiLeft.. and vpiRightRange constants
steve authored
294 #define vpiLeftRange 79
1782175 @caryr Add vpiArray, vpiParent, vpiIndex to VPI
caryr authored
295 #define vpiParent 81
4e286ea Add the vpiLeft.. and vpiRightRange constants
steve authored
296 #define vpiRightRange 83
a240be7 vpi_user header file is a root header.
steve authored
297 #define vpiScope 84
298 #define vpiSysTfCall 85
299 #define vpiArgument 89
300 #define vpiInternalScope 92
9d39b3a Access to modpaths via VPI
yang yun ju authored
301 #define vpiModPathIn 95
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
302 #define vpiModPathOut 96
e4ae832 Clean up spurious trailing white space.
steve authored
303 #define vpiVariables 100
2fab315 @caryr Add smart part select for system functions &PV<>.
caryr authored
304 #define vpiExpr 102
a240be7 vpi_user header file is a root header.
steve authored
305
306 #define vpiCallback 1000
307
308 /* PROPERTIES */
636758f @caryr Add support for `celldefine, vpiCellInstance
caryr authored
309 #define vpiUndefined (-1)
310 #define vpiType 1
311 #define vpiName 2
312 #define vpiFullName 3
313 #define vpiSize 4
314 #define vpiFile 5
315 #define vpiLineNo 6
316 #define vpiTopModule 7
317 #define vpiCellInstance 8
318 #define vpiDefName 9
a240be7 vpi_user header file is a root header.
steve authored
319 #define vpiTimeUnit 11
320 #define vpiTimePrecision 12
636758f @caryr Add support for `celldefine, vpiCellInstance
caryr authored
321 #define vpiDefFile 15
322 #define vpiDefLineNo 16
323 #define vpiNetType 22
324 # define vpiWire 1
7e3a7b8 @caryr Add basic support for events and cleanup VCD dumper.
caryr authored
325 # define vpiWand 2
326 # define vpiWor 3
327 # define vpiTri 4
328 # define vpiTri0 5
329 # define vpiTri1 6
330 # define vpiTriReg 7
331 # define vpiTriAnd 8
332 # define vpiTriOr 9
333 # define vpiSupply1 10
334 # define vpiSupply0 11
636758f @caryr Add support for `celldefine, vpiCellInstance
caryr authored
335 #define vpiArray 28
336 #define vpiEdge 36
337 # define vpiNoEdge 0x00 /* No edge */
338 # define vpiEdge01 0x01 /* 0 --> 1 */
339 # define vpiEdge10 0x02 /* 1 --> 0 */
340 # define vpiEdge0x 0x04 /* 0 --> x */
341 # define vpiEdgex1 0x08 /* x --> 1 */
342 # define vpiEdge1x 0x10 /* 1 --> x */
343 # define vpiEdgex0 0x20 /* x --> 0 */
344 # define vpiPosedge (vpiEdgex1|vpiEdge01|vpiEdge0x)
345 # define vpiNegedge (vpiEdgex0|vpiEdge10|vpiEdge1x)
346 # define vpiAnyEdge (vpiPosedge|vpiNegedge)
1970e41 Get value for vpoiConstType correct.
steve authored
347 #define vpiConstType 40
a240be7 vpi_user header file is a root header.
steve authored
348 # define vpiDecConst 1
349 # define vpiRealConst 2
350 # define vpiBinaryConst 3
351 # define vpiOctConst 4
352 # define vpiHexConst 5
353 # define vpiStringConst 6
fec6a10 Make $time and $realtime available to $display uniquely.
steve authored
354 #define vpiFuncType 44
355 # define vpiIntFunc 1
356 # define vpiRealFunc 2
357 # define vpiTimeFunc 3
20b7a23 Define function types.
steve authored
358 # define vpiSizedFunc 4
359 # define vpiSizedSignedFunc 5
360 #define vpiSysFuncType vpiFuncType
361 # define vpiSysFuncInt vpiIntFunc
362 # define vpiSysFuncReal vpiRealFunc
363 # define vpiSysFuncTime vpiTimeFunc
364 # define vpiSysFuncSized vpiSizedFunc
aa1cd16 @caryr Add preliminary support for vpiUserSystf, vpi_get_systf_info(), etc.
caryr authored
365 #define vpiUserDefn 49
18edf2f Rework of automatic task/function support.
Martin Whitaker authored
366 #define vpiAutomatic 50
2fab315 @caryr Add smart part select for system functions &PV<>.
caryr authored
367 #define vpiConstantSelect 53
368 #define vpiSigned 65
c8cb024 @caryr Move the vvp private properties to vvp/vpi_priv.h
caryr authored
369 /* IVL private properties, also see vvp/vpi_priv.h for other properties */
07bedc4 @caryr Add support for passing the delay selection to the VPI interface.
caryr authored
370 #define _vpiNexusId 0x1000000
371 /* used in vvp/vpi_priv.h 0x1000001 */
372 #define _vpiDelaySelection 0x1000002
373 # define _vpiDelaySelMinimum 1
374 # define _vpiDelaySelTypical 2
375 # define _vpiDelaySelMaximum 3
0644781 @caryr Add support for tracing procedural statements.
caryr authored
376 /* used in vvp/vpi_priv.h 0x1000003 */
377 /* used in vvp/vpi_priv.h 0x1000004 */
a240be7 vpi_user header file is a root header.
steve authored
378
379 /* DELAY MODES */
380 #define vpiNoDelay 1
381 #define vpiInertialDelay 2
382 #define vpiTransportDelay 3
383 #define vpiPureTransportDelay 4
384
385 #define vpiForceFlag 5
386 #define vpiReleaseFlag 6
e0fbc15 @steveicarus Support vpiForceFlag and vpiReleaseFlag for nets.
steveicarus authored
387 #define vpiReturnEvent 0x1000
a240be7 vpi_user header file is a root header.
steve authored
388
389 /* VPI FUNCTIONS */
aa1cd16 @caryr Add preliminary support for vpiUserSystf, vpi_get_systf_info(), etc.
caryr authored
390 extern vpiHandle vpi_register_systf(const struct t_vpi_systf_data*ss);
391 extern void vpi_get_systf_info(vpiHandle obj, p_vpi_systf_data data);
a240be7 vpi_user header file is a root header.
steve authored
392
2e3ce49 Arrange for mcd id=00_00_00_01 to go to stdout
steve authored
393 /* I/O routines */
394 extern PLI_UINT32 vpi_mcd_open(char *name);
395 extern PLI_UINT32 vpi_mcd_close(PLI_UINT32 mcd);
c37153b Verilog 2001 standart types.
steve authored
396 extern char *vpi_mcd_name(PLI_UINT32 mcd);
2e3ce49 Arrange for mcd id=00_00_00_01 to go to stdout
steve authored
397 extern PLI_INT32 vpi_mcd_printf(PLI_UINT32 mcd, const char*fmt, ...)
6ede18d support GCC __attributes__ for printf formats.
steve authored
398 __attribute__((format (printf,2,3)));
2e3ce49 Arrange for mcd id=00_00_00_01 to go to stdout
steve authored
399
400 extern PLI_INT32 vpi_printf(const char*fmt, ...)
401 __attribute__((format (printf,1,2)));
402
403 extern PLI_INT32 vpi_vprintf(const char*fmt, va_list ap);
404 extern PLI_INT32 vpi_mcd_vprintf(PLI_UINT32 mcd, const char*fmt, va_list ap);
405
406 extern PLI_INT32 vpi_flush(void);
407 extern PLI_INT32 vpi_mcd_flush(PLI_UINT32 mcd);
408
e3e4e64 Add vpi_fopen and vpi_get_file.
steve authored
409 /* proposed extensions */
e88c3a2 Details on the vpi_get_file function.
steve authored
410 /*
411 * These functions are proposed extensions to Verilog, and
412 * are described by the Verilog PLI task force as issue#347.
413 *
414 * The vpi_fopen() function is exactly the same as the $fopen system
415 * function. That is, it takes a path string and a mode string, and
416 * opens the file. The result is a 32bit value with bit 31 set, the
417 * remaining bits made up a small integer to represent the file.
418 *
419 * The vpi_get_file(fd) function takes as input a descriptor as
420 * returned by vpi_fopen or $fopen. Bit 31 must be set. The result
421 * is the C FILE* that represents the file.
422 */
e3e4e64 Add vpi_fopen and vpi_get_file.
steve authored
423 extern PLI_INT32 vpi_fopen(const char*name, const char*mode);
424 extern FILE *vpi_get_file(PLI_INT32 fd);
a240be7 vpi_user header file is a root header.
steve authored
425
426 /*
427 * support for VPI callback functions.
428 */
429 typedef struct t_cb_data {
c37153b Verilog 2001 standart types.
steve authored
430 PLI_INT32 reason;
431 PLI_INT32 (*cb_rtn)(struct t_cb_data*cb);
a240be7 vpi_user header file is a root header.
steve authored
432 vpiHandle obj;
433 p_vpi_time time;
434 p_vpi_value value;
c37153b Verilog 2001 standart types.
steve authored
435 PLI_INT32 index;
436 char *user_data;
a240be7 vpi_user header file is a root header.
steve authored
437 } s_cb_data, *p_cb_data;
438
439 #define cbValueChange 1
440 #define cbStmt 2
441 #define cbForce 3
442 #define cbRelease 4
443 #define cbAtStartOfSimTime 5
444 #define cbReadWriteSynch 6
445 #define cbReadOnlySynch 7
446 #define cbNextSimTime 8
447 #define cbAfterDelay 9
448 #define cbEndOfCompile 10
449 #define cbStartOfSimulation 11
450 #define cbEndOfSimulation 12
451 #define cbError 13
452 #define cbTchkViolation 14
453 #define cbStartOfSave 15
454 #define cbEndOfSave 16
455 #define cbStartOfRestart 17
456 #define cbEndOfRestart 18
457 #define cbStartOfReset 19
458 #define cbEndOfReset 20
459 #define cbEnterInteractive 21
460 #define cbExitInteractive 22
461 #define cbInteractiveScopeChange 23
462 #define cbUnresolvedSystf 24
463
464 extern vpiHandle vpi_register_cb(p_cb_data data);
c37153b Verilog 2001 standart types.
steve authored
465 extern PLI_INT32 vpi_remove_cb(vpiHandle ref);
a240be7 vpi_user header file is a root header.
steve authored
466
467 /*
468 * This function allows a vpi application to control the simulation
469 * engine. The operation parameter specifies the function to
470 * perform. The remaining parameters (if any) are interpreted by the
e546a9d @caryr Update the files to use vpi_control vs vpi_sim_control.
caryr authored
471 * operation. The vpi_sim_control definition (now named vpi_control)
472 * was added to P1364-2000 14 July 1999. See PLI Task Force ID: PTF-161
a240be7 vpi_user header file is a root header.
steve authored
473 *
474 * vpiFinish - perform the $finish operation, as soon as the user
475 * function returns. This operation takes a single
476 * parameter, a diagnostic exit code.
477 *
478 * vpiStop -
479 * vpiReset -
480 * vpiSetInteractiveScope -
481 */
c37153b Verilog 2001 standart types.
steve authored
482 extern void vpi_control(PLI_INT32 operation, ...);
7113655 @steveicarus Fix vpi_control operation codes to be standard
steveicarus authored
483 /************* vpi_control() constants (added with 1364-2000) *************/
484 #define vpiStop 66 /* execute simulator's $stop */
485 #define vpiFinish 67 /* execute simulator's $finish */
486 #define vpiReset 68 /* execute simulator's $reset */
487 #define vpiSetInteractiveScope 69 /* set simulator's interactive scope */
488 #define __ivl_legacy_vpiStop 1
489 #define __ivl_legacy_vpiFinish 2
a240be7 vpi_user header file is a root header.
steve authored
490
57aee7c Add vpi_chk_error and vpi_control functions.
steve authored
491 /* vpi_sim_control is the incorrect name for vpi_control. */
c37153b Verilog 2001 standart types.
steve authored
492 extern void vpi_sim_control(PLI_INT32 operation, ...);
57aee7c Add vpi_chk_error and vpi_control functions.
steve authored
493
c37153b Verilog 2001 standart types.
steve authored
494 extern vpiHandle vpi_handle(PLI_INT32 type, vpiHandle ref);
495 extern vpiHandle vpi_iterate(PLI_INT32 type, vpiHandle ref);
a240be7 vpi_user header file is a root header.
steve authored
496 extern vpiHandle vpi_scan(vpiHandle iter);
128f3d2 @caryr Fix new shadow issues and add -Wshadow to gcc compile.
caryr authored
497 extern vpiHandle vpi_handle_by_index(vpiHandle ref, PLI_INT32 idx);
c2ce8bb Add VPI_TRACE tracing of VPI calls.
steve authored
498 extern vpiHandle vpi_handle_by_name(const char*name, vpiHandle scope);
a240be7 vpi_user header file is a root header.
steve authored
499
500 extern void vpi_get_time(vpiHandle obj, s_vpi_time*t);
c37153b Verilog 2001 standart types.
steve authored
501 extern PLI_INT32 vpi_get(int property, vpiHandle ref);
502 extern char *vpi_get_str(PLI_INT32 property, vpiHandle ref);
a240be7 vpi_user header file is a root header.
steve authored
503 extern void vpi_get_value(vpiHandle expr, p_vpi_value value);
aec5841 Implement vpi_put_value for signals.
steve authored
504
505 /*
506 * This function puts a value into the object referenced by the
507 * handle. This assumes that the value supports having its value
508 * written to. The time parameter specifies when the assignment is to
509 * take place. This allows you to schedule an assignment to happen in
510 * the future.
511 *
512 * The flags value specifies the delay model to use in assigning the
513 * value. This specifies how the time value is to be used.
514 *
515 * vpiNoDelay -- Set the value immediately. The p_vpi_time parameter
516 * may be NULL, in this case. This is like a blocking assignment
517 * in behavioral code.
518 *
519 * vpiInertialDelay -- Set the value using the transport delay. The
520 * p_vpi_time parameter is required and specifies when the
521 * assignment is to take place. This is like a non-blocking
522 * assignment in behavioral code.
523 */
a240be7 vpi_user header file is a root header.
steve authored
524 extern vpiHandle vpi_put_value(vpiHandle obj, p_vpi_value value,
c37153b Verilog 2001 standart types.
steve authored
525 p_vpi_time when, PLI_INT32 flags);
a240be7 vpi_user header file is a root header.
steve authored
526
c37153b Verilog 2001 standart types.
steve authored
527 extern PLI_INT32 vpi_free_object(vpiHandle ref);
528 extern PLI_INT32 vpi_get_vlog_info(p_vpi_vlog_info vlog_info_p);
a240be7 vpi_user header file is a root header.
steve authored
529
6694912 @ldoolitt Non-controversial whitespace cleanup
ldoolitt authored
530 /*
9d39b3a Access to modpaths via VPI
yang yun ju authored
531 These Routines will enable the modpath vpiHandle
532 to read/write delay values
533 */
534 extern void vpi_get_delays(vpiHandle expr, p_vpi_delay delays);
535
536 extern void vpi_put_delays(vpiHandle expr, p_vpi_delay delays);
537
538
aa1cd16 @caryr Add preliminary support for vpiUserSystf, vpi_get_systf_info(), etc.
caryr authored
539 /*
540 * Check to see if two handles point to the same object.
541 */
542 extern PLI_INT32 vpi_compare_objects(vpiHandle obj1, vpiHandle obj2);
9d39b3a Access to modpaths via VPI
yang yun ju authored
543
544
6416f8b Add vpi_put_userdata
steve authored
545 /*
546 * These functions support attaching user data to an instance of a
547 * system task or function. These functions only apply to
548 * vpiSysTaskCall or vpiSysFuncCall handles.
549 */
c37153b Verilog 2001 standart types.
steve authored
550 extern PLI_INT32 vpi_put_userdata(vpiHandle obj, void*data);
6416f8b Add vpi_put_userdata
steve authored
551 extern void*vpi_get_userdata(vpiHandle obj);
a240be7 vpi_user header file is a root header.
steve authored
552
57aee7c Add vpi_chk_error and vpi_control functions.
steve authored
553 /*
554 * Support for handling errors.
555 */
556 typedef struct t_vpi_error_info {
c37153b Verilog 2001 standart types.
steve authored
557 PLI_INT32 state;
558 PLI_INT32 level;
559 char *message;
560 char *product;
561 char *code;
562 char *file;
563 PLI_INT32 line;
57aee7c Add vpi_chk_error and vpi_control functions.
steve authored
564 } s_vpi_error_info, *p_vpi_error_info;
565
566 /* error_info states */
567 # define vpiCompile 1
568 # define vpiPLI 2
569 # define vpiRun 3
570
571 /* error_info levels */
572 # define vpiNotice 1
573 # define vpiWarning 2
574 # define vpiError 3
575 # define vpiSystem 4
576 # define vpiInternal 5
577
c37153b Verilog 2001 standart types.
steve authored
578 extern PLI_INT32 vpi_chk_error(p_vpi_error_info info);
57aee7c Add vpi_chk_error and vpi_control functions.
steve authored
579
580
a240be7 vpi_user header file is a root header.
steve authored
581 /* This is the table of startup routines included in each module. */
186779c @ldoolitt fix boring C lint in header
ldoolitt authored
582 extern DLLEXPORT void (*vlog_startup_routines[])(void);
a240be7 vpi_user header file is a root header.
steve authored
583
299f6f8 acc_fetch_value support for %v format.
steve authored
584
585 /*
586 * ICARUS VERILOG EXTENSIONS
587 *
588 * The vpip_* functions are Icarus Verilog extensions. They are not
589 * standard VPI functions, so use these at your own risk.
590 *
591 * The vpip_format_* functions format values in string format in the
592 * manner of the $display system task.
593 */
594
cadf4cf Spelling fixes.
steve authored
595 /* Format a scalar a la %v. The str points to a 4byte character
299f6f8 acc_fetch_value support for %v format.
steve authored
596 buffer. The value must be a vpiStrengthVal. */
ef3aacf @caryr Make %v print all the bits of a vector.
caryr authored
597 extern void vpip_format_strength(char*str, s_vpi_value*value, unsigned bit);
608c257 @caryr Add $finish_and_return.
caryr authored
598 extern void vpip_set_return_value(int value);
5e512e6 @caryr Finish $clog2 function.
caryr authored
599 extern s_vpi_vecval vpip_calc_clog2(vpiHandle arg);
f2d5aca @caryr Add support for vpiUserSystf iteration, etc.
caryr authored
600 extern void vpip_make_systf_system_defined(vpiHandle ref);
299f6f8 acc_fetch_value support for %v format.
steve authored
601
aec5841 Implement vpi_put_value for signals.
steve authored
602 EXTERN_C_END
a240be7 vpi_user header file is a root header.
steve authored
603
604 #endif
Something went wrong with that request. Please try again.