Verilog 2001 standart types.

This commit is contained in:
steve 2003-03-13 18:26:12 +00:00
parent fd95cffad4
commit c37153b604
1 changed files with 57 additions and 54 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: vpi_user.h,v 1.22 2003/03/13 04:34:35 steve Exp $" #ident "$Id: vpi_user.h,v 1.23 2003/03/13 18:26:12 steve Exp $"
#endif #endif
@ -54,12 +54,12 @@ typedef struct __vpiHandle *vpiHandle;
* into the application that the compiler/simulator can access. * into the application that the compiler/simulator can access.
*/ */
typedef struct t_vpi_systf_data { typedef struct t_vpi_systf_data {
int type; PLI_INT32 type;
int subtype; PLI_INT32 subtype;
char *tfname; char *tfname;
int (*calltf)(char*); PLI_INT32 (*calltf)(char*);
int (*compiletf)(char*); PLI_INT32 (*compiletf)(char*);
int (*sizetf)(); PLI_INT32 (*sizetf)();
char *user_data; char *user_data;
} s_vpi_systf_data, *p_vpi_systf_data; } s_vpi_systf_data, *p_vpi_systf_data;
@ -70,7 +70,7 @@ typedef struct t_vpi_systf_data {
typedef struct t_vpi_vlog_info typedef struct t_vpi_vlog_info
{ {
int argc; PLI_INT32 argc;
char **argv; char **argv;
char *product; char *product;
char *version; char *version;
@ -78,9 +78,9 @@ typedef struct t_vpi_vlog_info
typedef struct t_vpi_time { typedef struct t_vpi_time {
int type; PLI_INT32 type;
unsigned int high; PLI_UINT32 high;
unsigned int low; PLI_UINT32 low;
double real; double real;
} s_vpi_time, *p_vpi_time; } s_vpi_time, *p_vpi_time;
@ -89,12 +89,12 @@ typedef struct t_vpi_time {
#define vpiSuppressTime 3 #define vpiSuppressTime 3
typedef struct t_vpi_vecval { typedef struct t_vpi_vecval {
int aval, bval; /* ab encoding: 00=0, 10=1, 11=X, 01=Z */ PLI_INT32 aval, bval; /* ab encoding: 00=0, 10=1, 11=X, 01=Z */
} s_vpi_vecval, *p_vpi_vecval; } s_vpi_vecval, *p_vpi_vecval;
typedef struct t_vpi_strengthval { typedef struct t_vpi_strengthval {
int logic; PLI_INT32 logic;
int s0, s1; PLI_INT32 s0, s1;
} s_vpi_strengthval, *p_vpi_strengthval; } s_vpi_strengthval, *p_vpi_strengthval;
/* /*
@ -102,16 +102,16 @@ typedef struct t_vpi_strengthval {
* the simulator and the application. * the simulator and the application.
*/ */
typedef struct t_vpi_value { typedef struct t_vpi_value {
int format; PLI_INT32 format;
union { union {
char*str; char *str;
int scalar; PLI_INT32 scalar;
int integer; PLI_INT32 integer;
double real; double real;
struct t_vpi_time *time; struct t_vpi_time *time;
struct t_vpi_vecval *vector; struct t_vpi_vecval *vector;
struct t_vpi_strengthval *strength; struct t_vpi_strengthval *strength;
char*misc; char *misc;
} value; } value;
} s_vpi_value, *p_vpi_value; } s_vpi_value, *p_vpi_value;
@ -221,26 +221,26 @@ extern void vpi_printf(const char*fmt, ...)
/* vpi_vprintf is non-standard. */ /* vpi_vprintf is non-standard. */
extern void vpi_vprintf(const char*fmt, va_list ap); extern void vpi_vprintf(const char*fmt, va_list ap);
extern unsigned int vpi_mcd_close(unsigned int mcd); extern PLI_UINT32 vpi_mcd_close(unsigned int mcd);
extern char *vpi_mcd_name(unsigned int mcd); extern char *vpi_mcd_name(PLI_UINT32 mcd);
extern unsigned int vpi_mcd_open(char *name); extern PLI_UINT32 vpi_mcd_open(char *name);
extern unsigned int vpi_mcd_open_x(char *name, char *mode); extern PLI_UINT32 vpi_mcd_open_x(char *name, char *mode);
extern int vpi_mcd_printf(unsigned int mcd, const char*fmt, ...) extern PLI_INT32 vpi_mcd_printf(unsigned int mcd, const char*fmt, ...)
__attribute__((format (printf,2,3))); __attribute__((format (printf,2,3)));
extern int vpi_mcd_fputc(unsigned int mcd, unsigned char x); extern PLI_INT32 vpi_mcd_fputc(unsigned int mcd, unsigned char x);
extern int vpi_mcd_fgetc(unsigned int mcd); extern PLI_INT32 vpi_mcd_fgetc(unsigned int mcd);
/* /*
* support for VPI callback functions. * support for VPI callback functions.
*/ */
typedef struct t_cb_data { typedef struct t_cb_data {
int reason; PLI_INT32 reason;
int (*cb_rtn)(struct t_cb_data*cb); PLI_INT32 (*cb_rtn)(struct t_cb_data*cb);
vpiHandle obj; vpiHandle obj;
p_vpi_time time; p_vpi_time time;
p_vpi_value value; p_vpi_value value;
int index; PLI_INT32 index;
char*user_data; char *user_data;
} s_cb_data, *p_cb_data; } s_cb_data, *p_cb_data;
#define cbValueChange 1 #define cbValueChange 1
@ -269,7 +269,7 @@ typedef struct t_cb_data {
#define cbUnresolvedSystf 24 #define cbUnresolvedSystf 24
extern vpiHandle vpi_register_cb(p_cb_data data); extern vpiHandle vpi_register_cb(p_cb_data data);
extern int vpi_remove_cb(vpiHandle ref); extern PLI_INT32 vpi_remove_cb(vpiHandle ref);
/* /*
* This function allows a vpi application to control the simulation * This function allows a vpi application to control the simulation
@ -286,24 +286,24 @@ extern int vpi_remove_cb(vpiHandle ref);
* vpiReset - * vpiReset -
* vpiSetInteractiveScope - * vpiSetInteractiveScope -
*/ */
extern void vpi_control(int operation, ...); extern void vpi_control(PLI_INT32 operation, ...);
#define vpiStop 1 #define vpiStop 1
#define vpiFinish 2 #define vpiFinish 2
#define vpiReset 3 #define vpiReset 3
#define vpiSetInteractiveScope 4 #define vpiSetInteractiveScope 4
/* vpi_sim_control is the incorrect name for vpi_control. */ /* vpi_sim_control is the incorrect name for vpi_control. */
extern void vpi_sim_control(int operation, ...); extern void vpi_sim_control(PLI_INT32 operation, ...);
extern vpiHandle vpi_handle(int type, vpiHandle ref); extern vpiHandle vpi_handle(PLI_INT32 type, vpiHandle ref);
extern vpiHandle vpi_iterate(int type, vpiHandle ref); extern vpiHandle vpi_iterate(PLI_INT32 type, vpiHandle ref);
extern vpiHandle vpi_scan(vpiHandle iter); extern vpiHandle vpi_scan(vpiHandle iter);
extern vpiHandle vpi_handle_by_index(vpiHandle ref, int index); extern vpiHandle vpi_handle_by_index(vpiHandle ref, PLI_INT32 index);
extern vpiHandle vpi_handle_by_name(const char*name, vpiHandle scope); extern vpiHandle vpi_handle_by_name(const char*name, vpiHandle scope);
extern void vpi_get_time(vpiHandle obj, s_vpi_time*t); extern void vpi_get_time(vpiHandle obj, s_vpi_time*t);
extern int vpi_get(int property, vpiHandle ref); extern PLI_INT32 vpi_get(int property, vpiHandle ref);
extern char* vpi_get_str(int property, vpiHandle ref); extern char *vpi_get_str(PLI_INT32 property, vpiHandle ref);
extern void vpi_get_value(vpiHandle expr, p_vpi_value value); extern void vpi_get_value(vpiHandle expr, p_vpi_value value);
/* /*
@ -326,30 +326,30 @@ extern void vpi_get_value(vpiHandle expr, p_vpi_value value);
* assignment in behavioral code. * assignment in behavioral code.
*/ */
extern vpiHandle vpi_put_value(vpiHandle obj, p_vpi_value value, extern vpiHandle vpi_put_value(vpiHandle obj, p_vpi_value value,
p_vpi_time when, int flags); p_vpi_time when, PLI_INT32 flags);
extern int vpi_free_object(vpiHandle ref); extern PLI_INT32 vpi_free_object(vpiHandle ref);
extern int vpi_get_vlog_info(p_vpi_vlog_info vlog_info_p); extern PLI_INT32 vpi_get_vlog_info(p_vpi_vlog_info vlog_info_p);
/* /*
* These functions support attaching user data to an instance of a * These functions support attaching user data to an instance of a
* system task or function. These functions only apply to * system task or function. These functions only apply to
* vpiSysTaskCall or vpiSysFuncCall handles. * vpiSysTaskCall or vpiSysFuncCall handles.
*/ */
extern int vpi_put_userdata(vpiHandle obj, void*data); extern PLI_INT32 vpi_put_userdata(vpiHandle obj, void*data);
extern void*vpi_get_userdata(vpiHandle obj); extern void*vpi_get_userdata(vpiHandle obj);
/* /*
* Support for handling errors. * Support for handling errors.
*/ */
typedef struct t_vpi_error_info { typedef struct t_vpi_error_info {
int state; PLI_INT32 state;
int level; PLI_INT32 level;
char*message; char *message;
char*product; char *product;
char*code; char *code;
char*file; char *file;
int line; PLI_INT32 line;
} s_vpi_error_info, *p_vpi_error_info; } s_vpi_error_info, *p_vpi_error_info;
/* error_info states */ /* error_info states */
@ -364,7 +364,7 @@ typedef struct t_vpi_error_info {
# define vpiSystem 4 # define vpiSystem 4
# define vpiInternal 5 # define vpiInternal 5
extern int vpi_chk_error(p_vpi_error_info info); extern PLI_INT32 vpi_chk_error(p_vpi_error_info info);
/* This is the table of startup routines included in each module. */ /* This is the table of startup routines included in each module. */
@ -374,6 +374,9 @@ EXTERN_C_END
/* /*
* $Log: vpi_user.h,v $ * $Log: vpi_user.h,v $
* Revision 1.23 2003/03/13 18:26:12 steve
* Verilog 2001 standart types.
*
* Revision 1.22 2003/03/13 04:34:35 steve * Revision 1.22 2003/03/13 04:34:35 steve
* Add VPI_TRACE tracing of VPI calls. * Add VPI_TRACE tracing of VPI calls.
* vpi_handle_by_name takes a const char*. * vpi_handle_by_name takes a const char*.