diff --git a/Makefile.in b/Makefile.in index b48647934..62a07277e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -16,7 +16,7 @@ # 59 Temple Place - Suite 330 # Boston, MA 02111-1307, USA # -#ident "$Id: Makefile.in,v 1.140 2002/12/10 05:45:44 steve Exp $" +#ident "$Id: Makefile.in,v 1.141 2003/01/10 03:06:32 steve Exp $" # # SHELL = /bin/sh @@ -67,7 +67,7 @@ ifeq ('@HAVE_IPAL@','yes') TARGETS += tgt-pal endif -all: ivl@EXEEXT@ libvpi.a +all: ivl@EXEEXT@ for dir in $(SUBDIRS) ; do (cd $$dir ; $(MAKE) all); done cd vpi ; $(MAKE) all cd ivlpp ; $(MAKE) all @@ -141,19 +141,6 @@ Makefile: Makefile.in config.h.in config.status ./config.status -libvpi.a: vpithunk.o - rm -f $@ - ar cvq $@ vpithunk.o - ranlib $@ - -# The vpithunk.c file (that makes up the libvpi.a library) needs to -# be make with PIC flags, because shared objects load it. -vpithunk.o: vpithunk.c - @[ -d dep ] || mkdir dep - $(CC) $(CPPFLAGS) $(CFLAGS) $(PICFLAGS) -MD -c $< -o $*.o - mv $*.d dep/$*.d - - ifeq (@WIN32@,yes) # Under Windows (mingw) I need to make the ivl.exe in two steps. # The first step makes an ivl.exe that dlltool can use to make an @@ -225,7 +212,7 @@ else WIN32_INSTALL = $(bindir)/iverilog-vpi endif -install: all installdirs $(libdir)/ivl/ivl@EXEEXT@ $(libdir)/ivl/iverilog.conf $(includedir)/ivl_target.h $(includedir)/vpi_user.h $(includedir)/acc_user.h $(includedir)/veriuser.h $(libdir)/libvpi.a $(WIN32_INSTALL) $(INSTALL_DOC) +install: all installdirs $(libdir)/ivl/ivl@EXEEXT@ $(libdir)/ivl/iverilog.conf $(includedir)/ivl_target.h $(includedir)/vpi_user.h $(includedir)/acc_user.h $(includedir)/veriuser.h $(WIN32_INSTALL) $(INSTALL_DOC) cd vpi ; $(MAKE) install cd ivlpp ; $(MAKE) install cd driver ; $(MAKE) install @@ -235,9 +222,6 @@ install: all installdirs $(libdir)/ivl/ivl@EXEEXT@ $(libdir)/ivl/iverilog.conf $ $(bindir)/iverilog-vpi: ./iverilog-vpi $(INSTALL_SCRIPT) ./iverilog-vpi $(bindir)/iverilog-vpi -$(libdir)/libvpi.a : ./libvpi.a - $(INSTALL_DATA) libvpi.a $(libdir)/libvpi.a - $(libdir)/ivl/ivl@EXEEXT@: ./ivl@EXEEXT@ $(INSTALL_PROGRAM) ./ivl@EXEEXT@ $(libdir)/ivl/ivl@EXEEXT@ $(STRIP) $(strip_dynamic) $(libdir)/ivl/ivl@EXEEXT@ @@ -294,7 +278,6 @@ uninstall: rm -f $(libdir)/ivl/iverilog.conf rm -f $(libdir)/ivl/ivl -rmdir $(libdir)/ivl - rm -f $(libdir)/libvpi.a rm -f $(bindir)/verilog rm -f $(bindir)/iverilog-vpi rm -f $(bindir)/gverilog@EXEEXT@ diff --git a/vpi/Makefile.in b/vpi/Makefile.in index 09d34eab0..25af0101a 100644 --- a/vpi/Makefile.in +++ b/vpi/Makefile.in @@ -18,7 +18,7 @@ # 59 Temple Place - Suite 330 # Boston, MA 02111-1307, USA # -#ident "$Id: Makefile.in,v 1.31 2002/04/07 04:37:53 steve Exp $" +#ident "$Id: Makefile.in,v 1.32 2003/01/10 03:06:32 steve Exp $" # # SHELL = /bin/sh @@ -60,12 +60,12 @@ sys_random.o sys_readmem.o sys_readmem_lex.o sys_time.o sys_vcd.o \ sys_lxt.o lxt_write.o \ mt19937int.o -SYSTEM_VPI_LDFLAGS = -L.. -lvpi +SYSTEM_VPI_LDFLAGS = -L../vvp -lvpi ifeq (@WIN32@,yes) SYSTEM_VPI_LDFLAGS += -liberty endif -system.vpi: $O ../libvpi.a +system.vpi: $O ../vvp/libvpi.a $(CC) @shared@ -o $@ $O $(SYSTEM_VPI_LDFLAGS) sys_readmem_lex.c: sys_readmem_lex.lex diff --git a/vpithunk.c b/vpithunk.c deleted file mode 100644 index 9e7eeeb2e..000000000 --- a/vpithunk.c +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2001-2002 Stephen Williams (steve@icarus.com) - * - * This source code is free software; you can redistribute it - * and/or modify it in source code form under the terms of the GNU - * General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ -#ifdef HAVE_CVS_IDENT -#ident "$Id: vpithunk.c,v 1.8 2003/01/09 04:10:17 steve Exp $" -#endif - -#include -#include -#include "vpi_user.h" -#include "vpithunk.h" - -/* - * This code is linked into the VPI module, not the simulator. The - * module uses the symbols defined in here to call implementations - * supplied by the simulator, which loaded this module with dlopen or - * the equivilent. - * - * The vpi_thunk_p pointer points to a table of function pointers that - * point to all the functions that a simulator is expected to provide. - * The vlog_register_sim is a function that the simulator is expected - * to call with a value for the vpi_thunk_p pointer. This is how the - * run time linkage to all the functions in the make program are made. - * - * In Icarus Verilog, the VPI module is also supposed to export a - * vlog_startup_routines table. This is something that the programmer - * does, so the libvpi library, and the vlog_register_sim function, - * are invisible to the user. - * - * The simulator is careful to call the vpi_register_sim function from - * a loaded module before executing the startup routines. - */ -static p_vpi_thunk vpi_thunk_p = 0; - -#define VPITV_CALL(fn,args) { \ - if (vpi_thunk_p == 0) { \ - no_sim(#fn); return; \ - } \ - if (vpi_thunk_p->fn == 0) { \ - no_func(#fn); return; \ - } \ - vpi_thunk_p->fn args; \ -} - -#define VPIT_CALL(fn,def,args) { \ - if (vpi_thunk_p == 0) { \ - no_sim(#fn); return def; \ - } \ - if (vpi_thunk_p->fn == 0) { \ - no_func(#fn); return def; \ - } \ - return vpi_thunk_p->fn args; \ -} - -static void no_sim(const char *fn) -{ - fprintf(stderr, "No Simulator registered, cannot handle vpi " - "call to %s\n", fn); -} - -static void no_func(const char *fn) -{ - fprintf(stderr, "Simulator doesn't have a %s function\n",fn); -} - -DLLEXPORT int vpi_register_sim(p_vpi_thunk tp) -{ - vpi_thunk_p = 0; - if (tp->magic != VPI_THUNK_MAGIC) { - fprintf(stderr, "Thunk Magic Number mismatch. Got %08X, expected %08x\n", - tp->magic, VPI_THUNK_MAGIC); - return 0; - } - vpi_thunk_p = tp; - return 1; -} - -void vpi_register_systf(const struct t_vpi_systf_data *ss) -{ - VPITV_CALL(vpi_register_systf,(ss)); -} - -void vpi_printf(const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - VPITV_CALL(vpi_vprintf,(fmt,ap)); - va_end(ap); -} - -unsigned int vpi_mcd_close(unsigned int mcd) -{ - VPIT_CALL(vpi_mcd_close,-1,(mcd)); -} - - -char *vpi_mcd_name(unsigned int mcd) -{ - VPIT_CALL(vpi_mcd_name,0,(mcd)); -} - -unsigned int vpi_mcd_open(char *name) -{ - VPIT_CALL(vpi_mcd_open,-1,(name)); -} - -unsigned int vpi_mcd_open_x(char *name, char *mode) -{ - VPIT_CALL(vpi_mcd_open_x,-1, (name, mode)); -} - -int vpi_mcd_printf(unsigned int mcd, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - VPIT_CALL(vpi_mcd_vprintf,0,(mcd,fmt,ap)); - va_end(ap); /* bad - never hit */ -} - -int vpi_mcd_fputc(unsigned int mcd, unsigned char x) -{ - VPIT_CALL(vpi_mcd_fputc, 0, (mcd, x)); -} - -int vpi_mcd_fgetc(unsigned int mcd) -{ - VPIT_CALL(vpi_mcd_fgetc, -1, (mcd)); -} - -extern vpiHandle vpi_register_cb(p_cb_data data) -{ - VPIT_CALL(vpi_register_cb,0,(data)); -} - -extern int vpi_remove_cb(vpiHandle ref) -{ - VPIT_CALL(vpi_remove_cb,0,(ref)); -} - -extern void vpi_sim_control(int operation, ...) -{ - va_list ap; - va_start(ap, operation); - VPITV_CALL(vpi_sim_vcontrol,(operation,ap)); - va_end(ap); /* bad - never hit */ -} - -extern void vpi_control(int operation, ...) -{ - va_list ap; - va_start(ap, operation); - VPITV_CALL(vpi_sim_vcontrol,(operation,ap)); - va_end(ap); /* bad - never hit */ -} - -extern vpiHandle vpi_handle(int type, vpiHandle ref) -{ - VPIT_CALL(vpi_handle, 0, (type, ref)); -} - -extern vpiHandle vpi_iterate(int type, vpiHandle ref) -{ - VPIT_CALL(vpi_iterate, 0, (type, ref)); -} - -extern vpiHandle vpi_scan(vpiHandle iter) -{ - VPIT_CALL(vpi_scan, 0, (iter)); -} - -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)); -} - -extern int vpi_get(int property, vpiHandle ref) -{ - VPIT_CALL(vpi_get, 0, (property, ref)); - -} - -extern char* vpi_get_str(int property, vpiHandle ref) -{ - VPIT_CALL(vpi_get_str, 0, (property,ref)); -} - -extern void vpi_get_value(vpiHandle expr, p_vpi_value value) -{ - VPITV_CALL(vpi_get_value, (expr, value)); -} - -extern vpiHandle vpi_put_value(vpiHandle obj, p_vpi_value value, - p_vpi_time when, int flags) -{ - VPIT_CALL(vpi_put_value, 0, (obj, value, when, flags)); -} - -extern int vpi_free_object(vpiHandle ref) -{ - VPIT_CALL(vpi_free_object, -1, (ref)); -} - -extern int vpi_get_vlog_info(p_vpi_vlog_info vlog_info_p) -{ - VPIT_CALL(vpi_get_vlog_info, 0, (vlog_info_p)); -} - -extern int vpi_chk_error(p_vpi_error_info info) -{ - VPIT_CALL(vpi_chk_error, 0, (info)); -} - -extern void* vpi_get_userdata(vpiHandle obj) -{ - VPIT_CALL(vpi_get_userdata, 0, (obj)); -} - -extern int vpi_put_userdata(vpiHandle obj, void*data) -{ - VPIT_CALL(vpi_put_userdata, 0, (obj, data)); -} - -/* - * $Log: vpithunk.c,v $ - * Revision 1.8 2003/01/09 04:10:17 steve - * Add vpi_put_userdata - * - * 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. - * - * Revision 1.5 2002/08/11 23:47:04 steve - * Add missing Log and Ident strings. - * - */ diff --git a/vpithunk.h b/vpithunk.h deleted file mode 100644 index bcb17fa0c..000000000 --- a/vpithunk.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef _VPI_THUNK_H_ -#define _VPI_THUNK_H_ 1 - -/* - * Copyright (c) 2001-2003 Stephen Williams (steve@icarus.com) - * - * This source code is free software; you can redistribute it - * and/or modify it in source code form under the terms of the GNU - * General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ -#ifdef HAVE_CVS_IDENT -#ident "$Id: vpithunk.h,v 1.6 2003/01/09 04:10:17 steve Exp $" -#endif - -/* These functions are actually defined in lieu of the vpi functions - by the simulator. These prototypes should'nt go into vpi_user.h, - because we don't want the users to be seeing this stuff. They - are non-standard. We have to put them here, so that - including vpi_user.h doesn't require including stdarg.h */ - -EXTERN_C_START - -# include -extern void vpi_vprintf(const char*fmt, va_list ap); -extern int vpi_mcd_vprintf(unsigned int mcd, const char*fmt, va_list ap); -extern void vpi_sim_vcontrol(int operation, va_list ap); - -EXTERN_C_END - -/* before v0.7: 0x87836BA4 */ -/* v0.7 thunk magic is 0x87836BA5 */ -#define VPI_THUNK_MAGIC (0x87836BA5) - -typedef struct { - int magic; - void (*vpi_register_systf)(const struct t_vpi_systf_data*ss); - void (*vpi_vprintf)(const char*fmt, va_list ap); - unsigned int (*vpi_mcd_close)(unsigned int mcd); - char *(*vpi_mcd_name)(unsigned int mcd); - unsigned int (*vpi_mcd_open)(char *name); - unsigned int (*vpi_mcd_open_x)(char *name, char *mode); - int (*vpi_mcd_vprintf)(unsigned int mcd, const char*fmt, va_list ap); - int (*vpi_mcd_fputc)(unsigned int mcd, unsigned char x); - int (*vpi_mcd_fgetc)(unsigned int mcd); - vpiHandle (*vpi_register_cb)(p_cb_data data); - int (*vpi_remove_cb)(vpiHandle ref); - void (*vpi_sim_vcontrol)(int operation, va_list ap); - vpiHandle (*vpi_handle)(int type, vpiHandle ref); - vpiHandle (*vpi_iterate)(int type, vpiHandle ref); - vpiHandle (*vpi_scan)(vpiHandle iter); - vpiHandle (*vpi_handle_by_index)(vpiHandle ref, int index); - void (*vpi_get_time)(vpiHandle obj, s_vpi_time*t); - int (*vpi_get)(int property, vpiHandle ref); - char* (*vpi_get_str)(int property, vpiHandle ref); - void (*vpi_get_value)(vpiHandle expr, p_vpi_value value); - vpiHandle (*vpi_put_value)(vpiHandle obj, p_vpi_value value, - p_vpi_time when, int flags); - 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); - - int (*vpi_put_userdata)(vpiHandle obj, void*data); - void* (*vpi_get_userdata)(vpiHandle obj); - - void*pad3; - void*pad2; - void*pad1; - void*pad0; - -} vpi_thunk, *p_vpi_thunk; - -DLLEXPORT int vpi_register_sim(p_vpi_thunk tp); - -#endif - -/* - * $Log: vpithunk.h,v $ - * Revision 1.6 2003/01/09 04:10:17 steve - * Add vpi_put_userdata - * - * 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. - * - * Revision 1.3 2002/08/11 23:47:04 steve - * Add missing Log and Ident strings. - * - */ diff --git a/vvp/Makefile.in b/vvp/Makefile.in index f7ef4ff25..b614ab361 100644 --- a/vvp/Makefile.in +++ b/vvp/Makefile.in @@ -16,7 +16,7 @@ # 59 Temple Place - Suite 330 # Boston, MA 02111-1307, USA # -#ident "$Id: Makefile.in,v 1.40 2002/08/12 00:27:10 steve Exp $" +#ident "$Id: Makefile.in,v 1.41 2003/01/10 03:06:32 steve Exp $" # # SHELL = /bin/sh @@ -50,10 +50,10 @@ LIBS = @LIBS@ @EXTRALIBS@ dllib=@DLLIB@ rdynamic=@rdynamic@ -all: vvp +all: vvp@EXEEXT@ libvpi.a clean: - rm -rf vvp *.o *~ parse.cc parse.cc.output parse.h lexor.cc dep + rm -rf vvp@EXEEXT@ *.o *~ parse.cc parse.cc.output parse.h lexor.cc dep distclean: clean rm -f config.h Makefile config.cache config.log config.status @@ -70,9 +70,25 @@ functor.o fvectors.o npmos.o resolv.o symbols.o ufunc.o codes.o vthread.o \ schedule.o statistics.o tables.o udp.o memory.o force.o event.o \ logic.o delay.o $V +ifeq (@WIN32@,yes) +# Under Windows (mingw) I need to make the ivl.exe in two steps. +# The first step makes an ivl.exe that dlltool can use to make an +# export and import library, and the last link makes a, ivl.exe +# that really exports the things that the import library imports. +vvp@EXEEXT@ libvpi.a: $O vvp.def + $(CXX) -o vvp@EXEEXT@ $O $(dllib) @EXTRALIBS@ + dlltool --dllname vvp@EXEEXT@ --def vvp.def \ + --output-lib libvpi.a --output-exp vvp.exp + $(CXX) -o vvp@EXEEXT@ vvp.exp $O $(dllib) @EXTRALIBS@ +else +libvpi.a: libvpi.c + $(CC) -c $(srcdir)/libvpi.c + rm -f libvpi.a + ar cqv libvpi.a libvpi.o + vvp: $O $(CXX) $(rdynamic) $(CXXFLAGS) $(LDFLAGS) -o vvp $O $(LIBS) $(dllib) - +endif %.o: %.cc @[ -d dep ] || mkdir dep @@ -113,10 +129,13 @@ Makefile: Makefile.in config.status ./config.status -install: all installdirs $(bindir)/vvp $(INSTALL_DOC) +install: all installdirs $(bindir)/vvp@EXEEXT@ $(libdir)/libvpi.a $(INSTALL_DOC) -$(bindir)/vvp: ./vvp - $(INSTALL_PROGRAM) ./vvp $(bindir)/vvp +$(bindir)/vvp@EXEEXT@: ./vvp@EXEEXT@ + $(INSTALL_PROGRAM) ./vvp@EXEEXT@ $(bindir)/vvp@EXEEXT@ + +$(libdir)/libvpi.a : ./libvpi.a + $(INSTALL_DATA) libvpi.a $(libdir)/libvpi.a $(mandir)/man1/vvp.1: $(srcdir)/vvp.man $(INSTALL_DATA) $(srcdir)/vvp.man $(mandir)/man1/vvp.1 @@ -129,7 +148,8 @@ installdirs: $(srcdir)/mkinstalldirs uninstall: - rm -f $(bindir)/vvp + rm -f $(bindir)/vvp@EXEEXT@ + rm -f $(libdir)/libvpi.a rm -f $(mandir)/man1/vvp.1 -include $(patsubst %.o, dep/%.d, $O) diff --git a/vvp/libvpi.c b/vvp/libvpi.c new file mode 100644 index 000000000..75dfb9897 --- /dev/null +++ b/vvp/libvpi.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2003 Stephen Williams (steve@icarus.com) + * + * This source code is free software; you can redistribute it + * and/or modify it in source code form under the terms of the GNU + * General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ +#ifdef HAVE_CVS_IDENT +#ident "$Id: libvpi.c,v 1.1 2003/01/10 03:06:32 steve Exp $" +#endif + +/* + * Things that should be statically linked by VPI modules go here. + */ + +/* + * $Log: libvpi.c,v $ + * Revision 1.1 2003/01/10 03:06:32 steve + * Remove vpithunk, and move libvpi to vvp directory. + * + */ diff --git a/vvp/vpi_modules.cc b/vvp/vpi_modules.cc index 38b7086e0..2ca8a17d1 100644 --- a/vvp/vpi_modules.cc +++ b/vvp/vpi_modules.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2003 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -17,20 +17,18 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: vpi_modules.cc,v 1.12 2002/08/12 01:35:09 steve Exp $" +#ident "$Id: vpi_modules.cc,v 1.13 2003/01/10 03:06:32 steve Exp $" #endif # include "config.h" # include "vpi_priv.h" # include "ivl_dlfcn.h" -# include "vpithunk.h" # include # include # include # include typedef void (*vlog_startup_routines_t)(void); -typedef int (*vpi_register_sim_t)(p_vpi_thunk tp); const char* vpip_module_path[64] = { @@ -107,22 +105,6 @@ void vpip_load_module(const char*name) } - void *regsub = ivl_dlsym(dll, LU "vpi_register_sim" TU); - vpi_register_sim_t simreg = (vpi_register_sim_t)regsub; - if (regsub == 0) { - fprintf(stderr, "%s: Unable to locate vpi_register_sim", name); - ivl_dlclose(dll); - return; - } - - extern vpi_thunk vvpt; - if (((simreg)(&vvpt)) == 0) { - fprintf(stderr, "%s: vpi_register_sim returned zero", name); - ivl_dlclose(dll); - return; - } - - void*table = ivl_dlsym(dll, LU "vlog_startup_routines" TU); if (table == 0) { fprintf(stderr, "%s: no vlog_startup_routines\n", name); @@ -139,6 +121,9 @@ void vpip_load_module(const char*name) /* * $Log: vpi_modules.cc,v $ + * Revision 1.13 2003/01/10 03:06:32 steve + * Remove vpithunk, and move libvpi to vvp directory. + * * Revision 1.12 2002/08/12 01:35:09 steve * conditional ident string using autoconfig. * @@ -162,23 +147,5 @@ void vpip_load_module(const char*name) * * Revision 1.6 2001/07/26 03:13:51 steve * Make the -M flag add module search paths. - * - * Revision 1.5 2001/06/12 03:53:11 steve - * Change the VPI call process so that loaded .vpi modules - * use a function table instead of implicit binding. - * - * Revision 1.4 2001/05/22 02:14:47 steve - * Update the mingw build to not require cygwin files. - * - * Revision 1.3 2001/03/23 02:40:22 steve - * Add the :module header statement. - * - * Revision 1.2 2001/03/22 05:39:34 steve - * Test print that interferes with output. - * - * Revision 1.1 2001/03/16 01:44:34 steve - * Add structures for VPI support, and all the %vpi_call - * instruction. Get linking of VPI modules to work. - * */ diff --git a/vvp/vpi_priv.cc b/vvp/vpi_priv.cc index 3ec6dd246..5ad951eae 100644 --- a/vvp/vpi_priv.cc +++ b/vvp/vpi_priv.cc @@ -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.26 2002/12/21 00:55:58 steve Exp $" +#ident "$Id: vpi_priv.cc,v 1.27 2003/01/10 03:06:32 steve Exp $" #endif # include "vpi_priv.h" @@ -354,6 +354,14 @@ extern "C" void vpi_vprintf(const char*fmt, va_list ap) vprintf(fmt, ap); } +extern "C" void vpi_printf(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vpi_vprintf(fmt, ap); + va_end(ap); +} + extern "C" void vpi_sim_vcontrol(int operation, va_list ap) { @@ -367,8 +375,19 @@ extern "C" void vpi_sim_vcontrol(int operation, va_list ap) } } +extern "C" void vpi_sim_control(int operation, ...) +{ + va_list ap; + va_start(ap, operation); + vpi_sim_vcontrol(operation, ap); + va_end(ap); +} + /* * $Log: vpi_priv.cc,v $ + * Revision 1.27 2003/01/10 03:06:32 steve + * Remove vpithunk, and move libvpi to vvp directory. + * * Revision 1.26 2002/12/21 00:55:58 steve * The $time system task returns the integer time * scaled to the local units. Change the internal @@ -391,56 +410,4 @@ extern "C" void vpi_sim_vcontrol(int operation, va_list ap) * * Revision 1.21 2002/07/19 01:12:50 steve * vpi_iterate returns 0 on error. - * - * Revision 1.20 2002/07/17 05:13:43 steve - * Implementation of vpi_handle_by_name, and - * add the vpiVariables iterator. - * - * Revision 1.19 2002/07/12 02:04:44 steve - * vpi_iterate return null if there is nothing to iterate. - * - * Revision 1.18 2002/07/05 17:14:15 steve - * Names of vpi objects allocated as vpip_strings. - * - * Revision 1.17 2002/06/21 04:58:55 steve - * Add support for special integer vectors. - * - * Revision 1.16 2002/06/02 19:05:50 steve - * Check for null pointers from users. - * - * Revision 1.15 2002/05/18 02:34:11 steve - * Add vpi support for named events. - * - * Add vpi_mode_flag to track the mode of the - * vpi engine. This is for error checking. - * - * Revision 1.14 2002/05/03 15:44:11 steve - * Add vpiModule iterator to vpiScope objects. - * - * Revision 1.13 2002/04/07 00:46:21 steve - * minor cleanup of formatting. - * - * Revision 1.12 2002/01/09 03:15:23 steve - * Add vpi_get_vlog_info support. - * - * Revision 1.11 2002/01/06 00:48:39 steve - * VPI access to root module scopes. - * - * Revision 1.10 2001/10/31 04:27:47 steve - * Rewrite the functor type to have fewer functor modes, - * and use objects to manage the different types. - * (Stephan Boettcher) - * - * Revision 1.9 2001/09/15 18:27:05 steve - * Make configure detect malloc.h - * - * Revision 1.8 2001/07/11 02:27:21 steve - * Add support for REadOnlySync and monitors. - * - * Revision 1.7 2001/06/30 23:03:17 steve - * support fast programming by only writing the bits - * that are listed in the input file. - * - * Revision 1.6 2001/06/21 22:54:12 steve - * Support cbValueChange callbacks. */ diff --git a/vvp/vvp.def b/vvp/vvp.def new file mode 100644 index 000000000..dced31962 --- /dev/null +++ b/vvp/vvp.def @@ -0,0 +1,28 @@ +EXPORTS + +vpi_chk_error +vpi_free_object +vpi_get +vpi_get_str +vpi_get_time +vpi_get_userdata +vpi_get_value +vpi_get_vlog_info +vpi_handle +vpi_handle_by_index +vpi_handle_by_name +vpi_iterate +vpi_mcd_close +vpi_mcd_fgetc +vpi_mcd_fputc +vpi_mcd_name +vpi_mcd_open +vpi_mcd_printf +vpi_printf +vpi_put_userdata +vpi_put_value +vpi_register_systf +vpi_scan +vpi_sim_control +vpi_sim_vcontrol +vpi_vprintf