diff --git a/autoconf.sh b/autoconf.sh index 04ab70eb1..7e3a204e9 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -9,7 +9,7 @@ echo "Autoconf in root..." autoconf -for dir in vpip vvp tgt-vvp tgt-fpga libveriuser cadpli +for dir in vpip vpi vvp tgt-vvp tgt-fpga libveriuser cadpli do echo "Autoconf in $dir..." ( cd ./$dir ; autoconf --include=.. ) diff --git a/configure.in b/configure.in index e333b6c07..c66acc06d 100644 --- a/configure.in +++ b/configure.in @@ -245,6 +245,6 @@ AC_SUBST(vpidir1) AC_SUBST(vpidir2) AC_MSG_RESULT(${vpidir1} ${vpidir2}) -AC_CONFIG_SUBDIRS(vvp tgt-vvp tgt-fpga libveriuser cadpli) +AC_CONFIG_SUBDIRS(vpi vvp tgt-vvp tgt-fpga libveriuser cadpli) -AC_OUTPUT(Makefile vpi/Makefile ivlpp/Makefile driver/Makefile driver-vpi/Makefile tgt-null/Makefile tgt-stub/Makefile tgt-verilog/Makefile tgt-pal/Makefile) +AC_OUTPUT(Makefile ivlpp/Makefile driver/Makefile driver-vpi/Makefile tgt-null/Makefile tgt-stub/Makefile tgt-verilog/Makefile tgt-pal/Makefile) diff --git a/vpi/.cvsignore b/vpi/.cvsignore index b19eb16dd..4748cf791 100644 --- a/vpi/.cvsignore +++ b/vpi/.cvsignore @@ -1,3 +1,8 @@ +configure +config.status +config.log +autom4te.cache +vpi_config.h Makefile sys_readmem_lex.c system.vpi diff --git a/vpi/configure.in b/vpi/configure.in new file mode 100644 index 000000000..eed2b70dd --- /dev/null +++ b/vpi/configure.in @@ -0,0 +1,207 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(vpi_config.h.in) +AC_CONFIG_HEADER(vpi_config.h) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CXX +AC_CHECK_TOOL(STRIP, strip, true) +AC_CHECK_PROGS(LEX,flex,none) +if test "$LEX" = "none" +then + echo "*** Error: No suitable flex found. ***" + echo " Please install the 'flex' package." + exit 1 +fi + +AC_CYGWIN +AC_EXEEXT +AC_MINGW32 + +WIN32=no +AC_MSG_CHECKING("Checking for windows") +if test "$CYGWIN" = "yes" -o "$MINGW32" = "yes" +then + WIN32=yes +fi + +AC_SUBST(MINGW32) +AC_SUBST(WIN32) +AC_MSG_RESULT($WIN32) +AC_SUBST(EXEEXT) + +AX_CPP_IDENT + +# vvp32 is by default disabled +#enable_vvp32=no +AC_SUBST(enable_vvp32) + + +AC_CHECK_HEADERS(malloc.h inttypes.h) + +AC_CHECK_LIB(z, gzwrite) +AC_CHECK_LIB(z, gzwrite, HAVE_LIBZ=yes, HAVE_LIBZ=no) +AC_SUBST(HAVE_LIBZ) +if test "$WIN32" = "yes"; then +AC_CHECK_LIB(bz2, main) +else +AC_CHECK_LIB(bz2, BZ2_bzdopen) +fi + +# -- +# Look for a dl library to use. First look for the standard dlopen +# functions, and failing that look for the HP specific shl_load function. + +AC_CHECK_HEADERS(dlfcn.h dl.h, break) + +DLLIB='' +AC_CHECK_LIB(dl,dlopen,[DLLIB=-ldl]) +if test -z "$DLLIB" ; then +AC_CHECK_LIB(dld,shl_load,[DLLIB=-ldld]) +fi +AC_SUBST(DLLIB) + +AC_PROG_INSTALL + +AC_LANG_C +AC_C_BIGENDIAN + +AC_CANONICAL_HOST +# Do some operating system specific setup. +case "${host}" in + *-*-darwin*) + CPPFLAGS="-no-cpp-precomp $CPPFLAGS" + CFLAGS="-no-cpp-precomp $CFLAGS" + ;; + + *-*-linux*) + AC_DEFINE(_LARGEFILE_SOURCE) + AC_DEFINE(_LARGEFILE64_SOURCE) + ;; +esac + +# $host + +# The -fPIC flag is used to tell the compiler to make position +# independent code. It is needed when making shared objects. + +AC_MSG_CHECKING("for flag to make position independent code") +PICFLAG=-fPIC +case "${host}" in + + *-*-cygwin*) + PICFLAG= + ;; + + *-*-hpux*) + PICFLAG=+z + ;; + +esac +AC_SUBST(PICFLAG) +AC_MSG_RESULT($PICFLAG) + + +# mingw needs to link with libiberty.a, cygwin can tolerate it + +AC_MSG_CHECKING("for extra libs needed") +EXTRALIBS= +case "${host}" in + *-*-cygwin*) + EXTRALIBS="-liberty" + ;; +esac +AC_SUBST(EXTRALIBS) +AC_MSG_RESULT($EXTRALIBS) + +# Darwin requires -no-cpp-precomp +case "${host}" in + *-*-darwin*) + CPPFLAGS="-no-cpp-precomp $CPPFLAGS" + CFLAGS="-no-cpp-precomp $CFLAGS" + ;; +esac + +# The -rdynamic flag is used by iverilog when compiling the target, +# to know how to export symbols of the main program to loadable modules +# that are brought in by -ldl +AC_MSG_CHECKING("for -rdynamic compiler flag") + +rdynamic=-rdynamic +case "${host}" in + + *-*-netbsd*) + rdynamic="-Wl,--export-dynamic" + ;; + + *-*-solaris*) + rdynamic="" + ;; + + *-*-cygwin*) + rdynamic="" + ;; + + *-*-hpux*) + rdynamic="-E" + ;; + + *-*-darwin*) + rdynamic="-Wl,-all_load" + strip_dynamic="-SX" + ;; + +esac +AC_SUBST(rdynamic) +AC_MSG_RESULT($rdynamic) +AC_SUBST(strip_dynamic) +AC_MSG_RESULT($strip_dynamic) + +AC_MSG_CHECKING("for shared library link flag") +shared=-shared +case "${host}" in + + *-*-cygwin*) + shared="-shared -Wl,--enable-auto-image-base" + ;; + + *-*-hpux*) + shared="-b" + ;; + + *-*-darwin1.[0123]) + shared="-bundle -undefined suppress" + ;; + + *-*-darwin*) + shared="-bundle -undefined suppress -flat_namespace" + ;; +esac + +AC_SUBST(shared) +AC_MSG_RESULT($shared) + +AX_CPP_IDENT + +# If not otherwise specified, set the libdir64 variable +# to the same as libdir. +AC_MSG_CHECKING(for libdir64 path) +if test x${libdir64} = x +then + libdir64="${libdir}" +fi +AC_SUBST(libdir64) +AC_MSG_RESULT(${libdir64}) + +# where to put vpi subdirectories +AC_MSG_CHECKING(for VPI subdirectories) +if test x${vpidir1} = x +then + vpidir1="." +fi + +AC_SUBST(vpidir1) +AC_SUBST(vpidir2) +AC_MSG_RESULT(${vpidir1} ${vpidir2}) + +AC_OUTPUT(Makefile) diff --git a/vpi/stringheap.c b/vpi/stringheap.c index 8ca744553..badd7c470 100644 --- a/vpi/stringheap.c +++ b/vpi/stringheap.c @@ -17,9 +17,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: stringheap.c,v 1.2 2003/04/28 01:03:11 steve Exp $" +#ident "$Id: stringheap.c,v 1.3 2004/01/21 01:22:53 steve Exp $" #endif +# include "sys_priv.h" # include "stringheap.h" # include # include @@ -64,6 +65,9 @@ const char*strdup_sh(struct stringheap_s*hp, const char*txt) /* * $Log: stringheap.c,v $ + * Revision 1.3 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.2 2003/04/28 01:03:11 steve * Fix stringheap list management failure. * diff --git a/vpi/sys_convert.c b/vpi/sys_convert.c index 096630e0d..23d745269 100644 --- a/vpi/sys_convert.c +++ b/vpi/sys_convert.c @@ -17,11 +17,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_convert.c,v 1.3 2003/03/17 21:59:54 steve Exp $" +#ident "$Id: sys_convert.c,v 1.4 2004/01/21 01:22:53 steve Exp $" #endif +# include "vpi_config.h" # include "vpi_user.h" -# include "config.h" # include # include # include @@ -281,6 +281,9 @@ void sys_convert_register() /* * $Log: sys_convert.c,v $ + * Revision 1.4 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.3 2003/03/17 21:59:54 steve * Implement $itor and $bitstoreal * diff --git a/vpi/sys_deposit.c b/vpi/sys_deposit.c index df2bea4c3..916251e4b 100644 --- a/vpi/sys_deposit.c +++ b/vpi/sys_deposit.c @@ -18,10 +18,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_deposit.c,v 1.3 2002/08/12 01:35:04 steve Exp $" +#ident "$Id: sys_deposit.c,v 1.4 2004/01/21 01:22:53 steve Exp $" #endif -# include "config.h" +# include "vpi_config.h" # include "vpi_user.h" # include @@ -79,6 +79,9 @@ void sys_deposit_register() /* * $Log: sys_deposit.c,v $ + * Revision 1.4 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.3 2002/08/12 01:35:04 steve * conditional ident string using autoconfig. * diff --git a/vpi/sys_display.c b/vpi/sys_display.c index 1c32d9923..6987dc95f 100644 --- a/vpi/sys_display.c +++ b/vpi/sys_display.c @@ -17,10 +17,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_display.c,v 1.67 2003/12/19 01:27:10 steve Exp $" +#ident "$Id: sys_display.c,v 1.68 2004/01/21 01:22:53 steve Exp $" #endif -# include "config.h" +# include "vpi_config.h" # include "vpi_user.h" # include @@ -1580,6 +1580,9 @@ void sys_display_register() /* * $Log: sys_display.c,v $ + * Revision 1.68 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.67 2003/12/19 01:27:10 steve * Fix various unsigned compare warnings. * diff --git a/vpi/sys_finish.c b/vpi/sys_finish.c index d95fae674..5aa7d3b2c 100644 --- a/vpi/sys_finish.c +++ b/vpi/sys_finish.c @@ -17,10 +17,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_finish.c,v 1.8 2003/02/21 03:24:03 steve Exp $" +#ident "$Id: sys_finish.c,v 1.9 2004/01/21 01:22:53 steve Exp $" #endif -# include "config.h" +# include "vpi_config.h" # include "vpi_user.h" # include @@ -59,6 +59,9 @@ void sys_finish_register() /* * $Log: sys_finish.c,v $ + * Revision 1.9 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.8 2003/02/21 03:24:03 steve * Make the $stop system task really vpiStop. * diff --git a/vpi/sys_lxt.c b/vpi/sys_lxt.c index baad17f17..fc84a3122 100644 --- a/vpi/sys_lxt.c +++ b/vpi/sys_lxt.c @@ -17,10 +17,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_lxt.c,v 1.23 2003/09/30 01:33:39 steve Exp $" +#ident "$Id: sys_lxt.c,v 1.24 2004/01/21 01:22:53 steve Exp $" #endif -# include "config.h" # include "sys_priv.h" # include "lxt_write.h" # include "vcd_priv.h" @@ -804,6 +803,9 @@ void sys_lxt_register() /* * $Log: sys_lxt.c,v $ + * Revision 1.24 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.23 2003/09/30 01:33:39 steve * dumpers must be aware of 64bit time. * diff --git a/vpi/sys_lxt2.c b/vpi/sys_lxt2.c index 68d2dc1b2..fba794232 100644 --- a/vpi/sys_lxt2.c +++ b/vpi/sys_lxt2.c @@ -17,10 +17,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_lxt2.c,v 1.4 2003/09/30 01:33:39 steve Exp $" +#ident "$Id: sys_lxt2.c,v 1.5 2004/01/21 01:22:53 steve Exp $" #endif -# include "config.h" # include "sys_priv.h" # include "lxt2_write.h" # include "vcd_priv.h" @@ -816,6 +815,9 @@ void sys_lxt2_register() /* * $Log: sys_lxt2.c,v $ + * Revision 1.5 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.4 2003/09/30 01:33:39 steve * dumpers must be aware of 64bit time. * diff --git a/vpi/sys_priv.h b/vpi/sys_priv.h index b4b685cdb..943bbec02 100644 --- a/vpi/sys_priv.h +++ b/vpi/sys_priv.h @@ -19,9 +19,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_priv.h,v 1.4 2003/10/30 03:43:20 steve Exp $" +#ident "$Id: sys_priv.h,v 1.5 2004/01/21 01:22:53 steve Exp $" #endif +# include "vpi_config.h" # include "vpi_user.h" /* @@ -48,6 +49,9 @@ extern PLI_UINT64 timerec_to_time64(const struct t_vpi_time*time); /* * $Log: sys_priv.h,v $ + * Revision 1.5 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.4 2003/10/30 03:43:20 steve * Rearrange fileio functions, and add ungetc. * diff --git a/vpi/sys_random.c b/vpi/sys_random.c index 7723a909e..79479b397 100644 --- a/vpi/sys_random.c +++ b/vpi/sys_random.c @@ -17,10 +17,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_random.c,v 1.8 2003/11/10 20:15:33 steve Exp $" +#ident "$Id: sys_random.c,v 1.9 2004/01/21 01:22:53 steve Exp $" #endif -# include "config.h" # include "sys_priv.h" # include @@ -203,6 +202,9 @@ void sys_random_register() /* * $Log: sys_random.c,v $ + * Revision 1.9 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.8 2003/11/10 20:15:33 steve * Simply MSVC compatibility patch. * diff --git a/vpi/sys_readmem.c b/vpi/sys_readmem.c index 86ac7189e..139f1295e 100644 --- a/vpi/sys_readmem.c +++ b/vpi/sys_readmem.c @@ -17,10 +17,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_readmem.c,v 1.14 2003/12/19 01:27:10 steve Exp $" +#ident "$Id: sys_readmem.c,v 1.15 2004/01/21 01:22:53 steve Exp $" #endif -# include "config.h" +# include "vpi_config.h" # include "vpi_user.h" # include @@ -576,6 +576,9 @@ void sys_readmem_register() /* * $Log: sys_readmem.c,v $ + * Revision 1.15 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.14 2003/12/19 01:27:10 steve * Fix various unsigned compare warnings. * diff --git a/vpi/sys_table.c b/vpi/sys_table.c index ddee1342e..6c5109487 100644 --- a/vpi/sys_table.c +++ b/vpi/sys_table.c @@ -17,10 +17,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_table.c,v 1.23 2003/10/30 04:52:54 steve Exp $" +#ident "$Id: sys_table.c,v 1.24 2004/01/21 01:22:53 steve Exp $" #endif -# include "config.h" +# include "vpi_config.h" # include "vpi_user.h" # include # include @@ -156,6 +156,9 @@ void (*vlog_startup_routines[])() = { /* * $Log: sys_table.c,v $ + * Revision 1.24 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.23 2003/10/30 04:52:54 steve * Call register for fileio functions. * diff --git a/vpi/sys_time.c b/vpi/sys_time.c index c6c229365..f2d8690bb 100644 --- a/vpi/sys_time.c +++ b/vpi/sys_time.c @@ -17,10 +17,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_time.c,v 1.9 2003/06/18 00:54:28 steve Exp $" +#ident "$Id: sys_time.c,v 1.10 2004/01/21 01:22:53 steve Exp $" #endif -# include "config.h" +# include "vpi_config.h" # include "vpi_user.h" # include @@ -169,6 +169,9 @@ void sys_time_register() /* * $Log: sys_time.c,v $ + * Revision 1.10 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.9 2003/06/18 00:54:28 steve * Account for all 64 bits in results of $time. * diff --git a/vpi/sys_vcd.c b/vpi/sys_vcd.c index 726874558..cd6f87d89 100644 --- a/vpi/sys_vcd.c +++ b/vpi/sys_vcd.c @@ -17,10 +17,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_vcd.c,v 1.52 2003/12/19 01:27:10 steve Exp $" +#ident "$Id: sys_vcd.c,v 1.53 2004/01/21 01:22:53 steve Exp $" #endif -# include "config.h" # include "sys_priv.h" /* @@ -811,6 +810,9 @@ void sys_vcd_register() /* * $Log: sys_vcd.c,v $ + * Revision 1.53 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.52 2003/12/19 01:27:10 steve * Fix various unsigned compare warnings. * diff --git a/vpi/sys_vcdoff.c b/vpi/sys_vcdoff.c index 10c0d6f9c..44c850863 100644 --- a/vpi/sys_vcdoff.c +++ b/vpi/sys_vcdoff.c @@ -17,10 +17,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_vcdoff.c,v 1.1 2003/03/06 20:04:42 steve Exp $" +#ident "$Id: sys_vcdoff.c,v 1.2 2004/01/21 01:22:53 steve Exp $" #endif -# include "config.h" # include "sys_priv.h" /* @@ -172,6 +171,9 @@ void sys_vcdoff_register() /* * $Log: sys_vcdoff.c,v $ + * Revision 1.2 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.1 2003/03/06 20:04:42 steve * Add means to suppress wveform output * diff --git a/vpi/vcd_priv.c b/vpi/vcd_priv.c index a7d418f57..0559ecb2f 100644 --- a/vpi/vcd_priv.c +++ b/vpi/vcd_priv.c @@ -17,11 +17,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: vcd_priv.c,v 1.4 2003/11/10 20:18:02 steve Exp $" +#ident "$Id: vcd_priv.c,v 1.5 2004/01/21 01:22:53 steve Exp $" #endif +# include "vpi_config.h" # include "vcd_priv.h" -# include "config.h" # include # include # include @@ -170,6 +170,9 @@ void set_nexus_ident(int nex, const char *id) /* * $Log: vcd_priv.c,v $ + * Revision 1.5 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * * Revision 1.4 2003/11/10 20:18:02 steve * Missing config.h. * diff --git a/vpi/vpi_config.h.in b/vpi/vpi_config.h.in new file mode 100644 index 000000000..d911880ab --- /dev/null +++ b/vpi/vpi_config.h.in @@ -0,0 +1,42 @@ +#ifndef __vpi_config_H +#define __config_H +/* + * Copyright (c) 2004 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: vpi_config.h.in,v 1.1 2004/01/21 01:22:53 steve Exp $" +#endif + +# undef HAVE_LIBIBERTY_H +# undef HAVE_MALLOC_H +# undef HAVE_DLFCN_H +# undef HAVE_DL_H +# undef HAVE_LIBZ +# undef HAVE_LIBBZ2 +# undef WORDS_BIGENDIAN + +# undef _LARGEFILE_SOURCE +# undef _LARGEFILE64_SOURCE + +/* + * $Log: vpi_config.h.in,v $ + * Revision 1.1 2004/01/21 01:22:53 steve + * Give the vip directory its own configure and vpi_config.h + * + */ +#endif // __config_H