Add vpi_handle_by_name to the VPI interface,

and bump the vpithunk magic number.
This commit is contained in:
steve 2002-12-11 23:55:22 +00:00
parent cca07fa42d
commit 8ab909a765
4 changed files with 36 additions and 5 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vpithunk.c,v 1.6 2002/08/12 01:35:01 steve Exp $"
#ident "$Id: vpithunk.c,v 1.7 2002/12/11 23:55:22 steve Exp $"
#endif
#include <stdio.h>
@ -188,6 +188,11 @@ extern vpiHandle vpi_handle_by_index(vpiHandle ref, int index)
VPIT_CALL(vpi_handle_by_index,0,(ref, index));
}
extern vpiHandle vpi_handle_by_name(char *name, vpiHandle scope)
{
VPIT_CALL(vpi_handle_by_name,0,(name, scope));
}
extern void vpi_get_time(vpiHandle obj, s_vpi_time*t)
{
VPITV_CALL(vpi_get_time, (obj,t));
@ -232,6 +237,10 @@ extern int vpi_chk_error(p_vpi_error_info info)
/*
* $Log: vpithunk.c,v $
* Revision 1.7 2002/12/11 23:55:22 steve
* Add vpi_handle_by_name to the VPI interface,
* and bump the vpithunk magic number.
*
* Revision 1.6 2002/08/12 01:35:01 steve
* conditional ident string using autoconfig.
*

View File

@ -20,7 +20,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vpithunk.h,v 1.4 2002/08/12 01:35:01 steve Exp $"
#ident "$Id: vpithunk.h,v 1.5 2002/12/11 23:55:22 steve Exp $"
#endif
/* These functions are actually defined in lieu of the vpi functions
@ -38,7 +38,9 @@ extern void vpi_sim_vcontrol(int operation, va_list ap);
EXTERN_C_END
#define VPI_THUNK_MAGIC (0x87836BA4)
/* before v0.7: 0x87836BA4 */
/* v0.7 thunk magic is 0x87836BA5 */
#define VPI_THUNK_MAGIC (0x87836BA5)
typedef struct {
int magic;
@ -67,6 +69,7 @@ typedef struct {
int (*vpi_free_object)(vpiHandle ref);
int (*vpi_get_vlog_info)(p_vpi_vlog_info vlog_info_p);
int (*vpi_chk_error)(p_vpi_error_info info);
vpiHandle (*vpi_handle_by_name)(char *name, vpiHandle scope);
} vpi_thunk, *p_vpi_thunk;
DLLEXPORT int vpi_register_sim(p_vpi_thunk tp);
@ -75,6 +78,10 @@ DLLEXPORT int vpi_register_sim(p_vpi_thunk tp);
/*
* $Log: vpithunk.h,v $
* Revision 1.5 2002/12/11 23:55:22 steve
* Add vpi_handle_by_name to the VPI interface,
* and bump the vpithunk magic number.
*
* Revision 1.4 2002/08/12 01:35:01 steve
* conditional ident string using autoconfig.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vpi_priv.cc,v 1.24 2002/08/24 05:02:58 steve Exp $"
#ident "$Id: vpi_priv.cc,v 1.25 2002/12/11 23:55:22 steve Exp $"
#endif
# include "vpi_priv.h"
@ -133,6 +133,12 @@ int vpi_get(int property, vpiHandle ref)
char* vpi_get_str(int property, vpiHandle ref)
{
if (ref == 0) {
fprintf(stderr, "vpi error: vpi_get_str(%d, ...) called "
"with null vpiHandle.\n", property);
return 0;
}
assert(ref);
if (ref->vpi_type->vpi_get_str_ == 0)
return 0;
@ -363,6 +369,10 @@ extern "C" void vpi_sim_vcontrol(int operation, va_list ap)
/*
* $Log: vpi_priv.cc,v $
* Revision 1.25 2002/12/11 23:55:22 steve
* Add vpi_handle_by_name to the VPI interface,
* and bump the vpithunk magic number.
*
* Revision 1.24 2002/08/24 05:02:58 steve
* Fix = vs == error.
*

View File

@ -1,5 +1,5 @@
#ifdef HAVE_CVS_IDENT
#ident "$Id: vvp_vpi.cc,v 1.5 2002/08/12 01:35:09 steve Exp $"
#ident "$Id: vvp_vpi.cc,v 1.6 2002/12/11 23:55:22 steve Exp $"
#endif
#include <stdarg.h>
@ -27,6 +27,7 @@ void vvp_vpi_init()
vvpt.vpi_iterate = vpi_iterate;
vvpt.vpi_scan = vpi_scan;
vvpt.vpi_handle_by_index = vpi_handle_by_index;
vvpt.vpi_handle_by_name = vpi_handle_by_name;
vvpt.vpi_get_time = vpi_get_time;
vvpt.vpi_get = vpi_get;
vvpt.vpi_get_str = vpi_get_str;
@ -39,6 +40,10 @@ void vvp_vpi_init()
/*
* $Log: vvp_vpi.cc,v $
* Revision 1.6 2002/12/11 23:55:22 steve
* Add vpi_handle_by_name to the VPI interface,
* and bump the vpithunk magic number.
*
* Revision 1.5 2002/08/12 01:35:09 steve
* conditional ident string using autoconfig.
*