Compare commits

...
59 Commits
Author SHA1 Message Date
steve 973b4d9bcb Pre-gcc3 compile error. 2003-12-03 04:27:10 +00:00
steve 2a60768ffe Snapshot 20031202 2003-12-03 03:31:39 +00:00
steve e56b77a43f Add support for wait on list of named events. 2003-12-03 02:46:23 +00:00
steve 9967bfcbfd Handle erroneous event lists. 2003-12-03 01:54:07 +00:00
steve 2c4358c9ff Propagate named event outputs, if any. 2003-11-26 01:47:18 +00:00
steve be0b42f210 Warning about sprintf. 2003-11-26 01:37:38 +00:00
steve cf33bedc2d Properly initialize vpi_module_list with system. 2003-11-26 01:37:14 +00:00
steve 0b538ceed6 The _pli_types.h header file is generated, not copied from srcdir. 2003-11-26 01:36:55 +00:00
steve 8d4c3a8620 Document the IVERILOG_ICONFIG variable. 2003-11-26 01:36:25 +00:00
steve 700d51ff8a Fix reset race in test bench. 2003-11-25 18:35:31 +00:00
steve cceb2bd2c5 Remove the iverilog.conf file. 2003-11-18 06:31:45 +00:00
steve 12033d7bd4 Move the DLL= flag to target config files. 2003-11-13 05:55:33 +00:00
steve c96b0402be Package the new conf files. 2003-11-13 05:54:03 +00:00
steve 5068e3ea15 Pass flags through the temporary config file. 2003-11-13 04:09:49 +00:00
steve 435f06bd21 ivl -F and -t flags are onpassed throught the -C file. 2003-11-13 03:10:37 +00:00
steve 534a656be8 devices need show_cmp_gt 2003-11-12 03:20:14 +00:00
steve d10da2121f Clean up manual definitions of PLI_UINT64_FMT. 2003-11-12 02:38:44 +00:00
steve 43f28b53a3 Design::get_flag returns const char* instead of string. 2003-11-10 20:59:03 +00:00
steve 995cd449c5 Include config.h 2003-11-10 20:19:32 +00:00
steve 7fa531c5db Missing config.h. 2003-11-10 20:18:02 +00:00
steve df08760ef8 Simply MSVC compatibility patch. 2003-11-10 20:15:33 +00:00
steve a7c773262e missing include of config.h 2003-11-10 20:11:01 +00:00
steve f58b124101 Fix return value warnings. 2003-11-10 19:44:30 +00:00
steve 8eccb7b9a1 Remove redundant scope tokens. 2003-11-10 19:39:20 +00:00
steve bc0ead2842 Spelling fixes in comments. 2003-11-08 20:06:21 +00:00
steve 80570c7c78 some header files in the build directory, as well as srcdir. 2003-11-08 19:30:15 +00:00
steve ed831e7c32 Move come configure tests to aclocal.m4 2003-11-08 19:27:50 +00:00
steve 074dcc934a Do not remove constants accessible to VPI. 2003-11-08 17:53:34 +00:00
steve 9db45e398e Make sure makefile picks up include paths. 2003-11-08 16:20:33 +00:00
steve 4f40eb0a00 Implement basic fflush. 2003-11-07 19:40:05 +00:00
steve 1dfbe0f7f2 Fix conditional compilation of readline history. 2003-11-07 05:58:02 +00:00
steve c5f7e7837b Start the vvp target config files. 2003-11-01 04:22:50 +00:00
steve faf33458fd Accept functors in the config file. 2003-11-01 04:22:30 +00:00
steve 0607970eca Add support for a target static config file. 2003-11-01 04:21:57 +00:00
steve c4e069e505 Handle adders that use Cout for the top bit. 2003-10-31 03:45:50 +00:00
steve 7fd669fcc0 NetEUReduce has its own dup_expr method. 2003-10-31 02:47:11 +00:00
steve fad43d78b0 Donot elide FF that has set or clr connections. 2003-10-31 02:40:06 +00:00
steve 5aadc310f7 Call register for fileio functions. 2003-10-30 04:52:54 +00:00
steve 930e5137ac Catch real variables in net expressions. 2003-10-30 04:31:34 +00:00
steve 02ec36806c Rearrange fileio functions, and add ungetc. 2003-10-30 03:43:19 +00:00
steve e88c3a20a2 Details on the vpi_get_file function. 2003-10-30 03:42:51 +00:00
steve 5ff3bcc7fb Add the PLU_UINT64_FMT string for formatting output. 2003-10-29 03:28:27 +00:00
steve 4236b8a95e Portably handle time format of VCD prints. 2003-10-29 03:23:12 +00:00
steve 89fca07dc8 Add the iverilog-fpga man page. 2003-10-27 06:12:47 +00:00
steve 4eae8426a9 More flexible width handling for synthesized add. 2003-10-27 06:04:21 +00:00
steve 1b8034818c Emit constants for LPM device. 2003-10-27 02:18:27 +00:00
steve a503e2d91f Handle special case of FF with enable and constant data. 2003-10-27 02:18:04 +00:00
steve 65ae69843b Improve -V messages, 2003-10-26 22:43:42 +00:00
steve 1c99c629b1 Support constant evaluation of binary ^ operator. 2003-10-26 04:54:56 +00:00
steve edaa7df6d2 Output of While is output of while substatement. 2003-10-26 04:51:38 +00:00
steve 847448139c Case with empty statements has no inputs. 2003-10-26 04:50:46 +00:00
steve ee172bdccf Attach line number information to for loop parts. 2003-10-26 04:49:51 +00:00
steve 5496a38499 vvp_signal_label does not return a unique string. 2003-10-25 02:07:57 +00:00
steve 8dab4c6b53 memory index need not be self determined width. 2003-10-20 01:44:28 +00:00
steve 3e44a7121d Include net objects in list display. 2003-10-15 02:17:39 +00:00
steve d4f3349fe0 Syntax error on 32bit systems. 2003-10-14 18:05:18 +00:00
steve f2382e209a Document the --install-dir and -m32 flags. 2003-10-14 00:40:06 +00:00
steve 123e4c7f65 Report the configure vpi install directory. 2003-10-14 00:31:31 +00:00
steve bb8785962f Support 32bit compile on AMD64 systems. 2003-10-13 20:57:34 +00:00
77 changed files with 1772 additions and 1228 deletions
+18 -11
View File
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.154 2003/09/19 03:30:04 steve Exp $"
#ident "$Id: Makefile.in,v 1.160 2003/11/26 01:36:55 steve Exp $"
#
#
SHELL = /bin/sh
@@ -40,6 +40,8 @@ libdir = @libdir@
includedir = @includedir@
mandir = @mandir@
libdir64 = @libdir64@
dllib=@DLLIB@
rdynamic=@rdynamic@
strip_dynamic=@strip_dynamic@
@@ -156,7 +158,10 @@ ifeq (@WIN32@,yes)
else
iverilog-vpi: iverilog-vpi.sh
sed -e 's;@SHARED@;@shared@;' -e 's;@PIC@;@PICFLAG@;' \
-e 's;@INCLUDEDIR@;@includedir@;' -e 's;@LIBDIR@;@libdir@;' $< > $@
-e 's;@INCLUDEDIR@;@includedir@;' \
-e 's;@LIBDIR64@;@libdir64@;' \
-e 's;@VPIDIR1@;@vpidir1@;' -e 's;@VPIDIR2@;@vpidir2@;' \
-e 's;@LIBDIR@;@libdir@;' $< > $@
chmod +x $@
endif
@@ -210,7 +215,9 @@ else
WIN32_INSTALL = $(bindir)/iverilog-vpi
endif
install: all installdirs $(libdir)/ivl/ivl@EXEEXT@ $(libdir)/ivl/iverilog.conf $(includedir)/ivl_target.h $(includedir)/_pli_types.h $(includedir)/vpi_user.h $(includedir)/acc_user.h $(includedir)/veriuser.h $(WIN32_INSTALL) $(INSTALL_DOC)
XNF_INSTALL = $(libdir)/ivl/xnf.conf $(libdir)/ivl/xnf-s.conf
install: all installdirs $(libdir)/ivl/ivl@EXEEXT@ $(includedir)/ivl_target.h $(includedir)/_pli_types.h $(includedir)/vpi_user.h $(includedir)/acc_user.h $(includedir)/veriuser.h $(WIN32_INSTALL) $(INSTALL_DOC) $(XNF_INSTALL)
for dir in $(SUBDIRS); do (cd $$dir ; $(MAKE) $@); done
for tgt in $(TARGETS); do (cd $$tgt ; $(MAKE) $@); done
for dir in vpi ivlpp driver; \
@@ -223,17 +230,17 @@ $(libdir)/ivl/ivl@EXEEXT@: ./ivl@EXEEXT@
$(INSTALL_PROGRAM) ./ivl@EXEEXT@ $(libdir)/ivl/ivl@EXEEXT@
$(STRIP) $(strip_dynamic) $(libdir)/ivl/ivl@EXEEXT@
# Install iverilog.conf whenever ivl.exe is installed. This
# forces iverilog.conf to be treated similarly, in spite of
# dates in the source bundle.
$(libdir)/ivl/iverilog.conf: $(libdir)/ivl/ivl@EXEEXT@
$(INSTALL_DATA) $(srcdir)/iverilog.conf $(libdir)/ivl/iverilog.conf
$(libdir)/ivl/xnf-s.conf: $(srcdir)/xnf-s.conf
$(INSTALL_DATA) $(srcdir)/xnf-s.conf $(libdir)/ivl/xnf-s.conf
$(libdir)/ivl/xnf.conf: $(srcdir)/xnf.conf
$(INSTALL_DATA) $(srcdir)/xnf.conf $(libdir)/ivl/xnf.conf
$(includedir)/ivl_target.h: $(srcdir)/ivl_target.h
$(INSTALL_DATA) $(srcdir)/ivl_target.h $(includedir)/ivl_target.h
$(includedir)/_pli_types.h: $(srcdir)/_pli_types.h
$(INSTALL_DATA) $(srcdir)/_pli_types.h $(includedir)/_pli_types.h
$(includedir)/_pli_types.h: _pli_types.h
$(INSTALL_DATA) $< $(includedir)/_pli_types.h
$(includedir)/vpi_user.h: $(srcdir)/vpi_user.h
$(INSTALL_DATA) $(srcdir)/vpi_user.h $(includedir)/vpi_user.h
@@ -279,7 +286,7 @@ uninstall:
for tgt in $(TARGETS); do (cd $$tgt ; $(MAKE) $@); done
for dir in vpi ivlpp driver; \
do (cd $$dir ; $(MAKE) $@); done
for f in iverilog.conf ivl; \
for f in xnf.conf xnf-s.conf ivl; \
do rm -f $(libdir)/ivl/$$f; done
-rmdir $(libdir)/ivl
for f in verilog iverilog-vpi gverilog@EXEEXT@; \
+5 -1
View File
@@ -17,9 +17,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: PData.cc,v 1.1 2003/01/26 21:15:58 steve Exp $"
#ident "$Id: PData.cc,v 1.2 2003/11/10 20:11:01 steve Exp $"
#endif
# include "config.h"
# include "PData.h"
PData::PData(const hname_t&h)
@@ -38,6 +39,9 @@ const hname_t&PData::name() const
/*
* $Log: PData.cc,v $
* Revision 1.2 2003/11/10 20:11:01 steve
* missing include of config.h
*
* Revision 1.1 2003/01/26 21:15:58 steve
* Rework expression parsing and elaboration to
* accommodate real/realtime values and expressions.
+9 -5
View File
@@ -1,5 +1,5 @@
THE ICARUS VERILOG COMPILATION SYSTEM
September 17, 2000
Copyright 2000-2003 Stephen Williams
1.0 What is ICARUS Verilog?
@@ -67,6 +67,14 @@ on a UNIX-like system:
- termcap
The readline library in turn uses termcap.
If you are building from CVS, you will also need software to generate
the configure scripts.
- autoconf 2.53
This generates configure scripts from configure.in. The 2.53
or later versions are known to work, autoconf 2.13 is
reported to *not* work.
2.2 Compilation
Unpack the tar-ball and cd into the verilog-######### directory
@@ -346,10 +354,6 @@ constructs.
- Event controls inside non-blocking assignments are not supported.
i.e.: a <= @(posedge clk) b;
- Lists of named events of the form @(event_1 or event_2) are not
supported. Named events are otherwise supported, and lists of
other kinds of events are also supported.
- Macro arguments are not supported. `define macros are supported,
but they cannot take arguments.
+21 -7
View File
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: _pli_types.h.in,v 1.3 2003/10/02 21:30:06 steve Exp $"
#ident "$Id: _pli_types.h.in,v 1.7 2003/11/12 02:38:44 steve Exp $"
#endif
# undef HAVE_INTTYPES_H
@@ -27,7 +27,7 @@
#ifdef HAVE_INTTYPES_H
/*
* If the host enhironment has the stdint.h header file,
* If the host environment has the stdint.h header file,
* then use that to size our PLI types.
*/
#ifndef __STDC_FORMAT_MACROS
@@ -45,11 +45,13 @@ typedef unsigned short PLI_UINT16;
typedef signed char PLI_BYTE8;
typedef unsigned char PLI_UBYTE8;
# define PLI_UINT64_FMT PRIu64
#else
/*
* If we do not have the c99 stdint.h header file, then use
* configure detenction to guess the pli types ourselves.
* configure detection to guess the pli types ourselves.
*/
# define SIZEOF_UNSIGNED_LONG_LONG 8
@@ -59,21 +61,21 @@ typedef unsigned char PLI_UBYTE8;
#if SIZEOF_UNSIGNED >= 8
typedef unsigned PLI_UINT64;
typedef int PLI_INT64;
# define TIME_FMT "%u"
# define PLI_UINT64_FMT "u"
#else
# if SIZEOF_UNSIGNED_LONG >= 8
typedef unsigned long PLI_UINT64;
typedef long PLI_INT64;
# define TIME_FMT "%lu"
# define PLI_UINT64_FMT "lu"
# else
# if SIZEOF_UNSIGNED_LONG_LONG > SIZEOF_UNSIGNED_LONG
typedef unsigned long long PLI_UINT64;
typedef long long PLI_INT64;
# define TIME_FMT "%llu"
# define PLI_UINT64_FMT "llu"
# else
typedef unsigned long PLI_UINT64;
typedef long PLI_INT64;
# define TIME_FMT "%lu"
# define PLI_UINT64_FMT "lu"
# endif
# endif
#endif
@@ -88,6 +90,18 @@ typedef unsigned char PLI_UBYTE8;
/*
* $Log: _pli_types.h.in,v $
* Revision 1.7 2003/11/12 02:38:44 steve
* Clean up manual definitions of PLI_UINT64_FMT.
*
* Revision 1.6 2003/11/08 20:06:21 steve
* Spelling fixes in comments.
*
* Revision 1.5 2003/10/29 03:28:27 steve
* Add the PLU_UINT64_FMT string for formatting output.
*
* Revision 1.4 2003/10/29 03:23:12 steve
* Portably handle time format of VCD prints.
*
* Revision 1.3 2003/10/02 21:30:06 steve
* Use configured TIME_FMT in vcd dump printf.
*
Vendored
+69
View File
@@ -0,0 +1,69 @@
# AX_CPP_IDENT
# ------------
# Check if the C compiler supports #ident
# Define and substitute ident_support if so.
#
# It would be simpler and more consistent with the rest of the autoconf
# structure to AC_DEFINE(HAVE_CPP_IDENT) instead of
# ident_support='-DHAVE_CVS_IDENT=1' and AC_SUBST(ident_support), but that
# change would require all C files in the icarus top level directory to
# put #include <config.h> before the #ifdef HAVE_CVS_IDENT (and change
# HAVE_CVS_IDENT to HAVE_CPP_IDENT). That would also remove all special
# ident_support handling from the Makefile. Manyana.
#
AC_DEFUN([AX_CPP_IDENT],
[AC_CACHE_CHECK([for ident support in C compiler], ax_cv_cpp_ident,
[AC_TRY_COMPILE([
#ident "$Id: aclocal.m4,v 1.1 2003/11/08 19:27:50 steve Exp $"
],[while (0) {}],
[AS_VAR_SET(ax_cv_cpp_ident, yes)],
[AS_VAR_SET(ax_cv_cpp_ident, no)])])
if test $ax_cv_cpp_ident = yes; then
ident_support='-DHAVE_CVS_IDENT=1'
fi
AC_SUBST(ident_support)
])# AC_CPP_IDENT
# _AX_C_UNDERSCORES_MATCH_IFELSE(PATTERN, ACTION-IF-MATCH, ACTION-IF-NOMATCH)
# ------------------------------
# Sub-macro for AX_C_UNDERSCORES_LEADING and AX_C_UNDERSCORES_TRAILING.
# Unwarranted assumptions:
# - the object file produced by AC_COMPILE_IFELSE is called "conftest.$ac_objext"
# - the nm(1) utility is available, and its name is "nm".
AC_DEFUN([_AX_C_UNDERSCORES_MATCH_IF],
[AC_COMPILE_IFELSE([void underscore(void){}],
[AS_IF([nm conftest.$ac_objext|grep $1 >/dev/null 2>/dev/null],[$2],[$3])],
[AC_MSG_ERROR([underscore test crashed])]
)])
# AX_C_UNDERSCORES_LEADING
# ---------------------------------
# Check if symbol names in object files produced by C compiler have
# leading underscores. Define NEED_LU if so.
AC_DEFUN([AX_C_UNDERSCORES_LEADING],
[AC_CACHE_CHECK([for leading underscores], ax_cv_c_underscores_leading,
[_AX_C_UNDERSCORES_MATCH_IF([_underscore],
[AS_VAR_SET(ax_cv_c_underscores_leading, yes)],
[AS_VAR_SET(ax_cv_c_underscores_leading, no)])])
if test $ax_cv_c_underscores_leading = yes; then
AC_DEFINE(NEED_LU)
fi
])# AX_C_UNDERSCORES_LEADING
# AX_C_UNDERSCORES_TRAILING
# ---------------------------------
# Check if symbol names in object files produced by C compiler have
# trailing underscores. Define NEED_TU if so.
AC_DEFUN([AX_C_UNDERSCORES_TRAILING],
[AC_CACHE_CHECK([for trailing underscores], ax_cv_c_underscores_trailing,
[_AX_C_UNDERSCORES_MATCH_IF([underscore_],
[AS_VAR_SET(ax_cv_c_underscores_trailing, yes)],
[AS_VAR_SET(ax_cv_c_underscores_trailing, no)])])
if test $ax_cv_c_underscores_trailing = yes; then
AC_DEFINE(NEED_TU)
fi
])# AX_C_UNDERSCORES_TRAILING
+2 -2
View File
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.7 2003/10/09 01:07:20 steve Exp $"
#ident "$Id: Makefile.in,v 1.8 2003/11/08 19:30:15 steve Exp $"
#
#
SHELL = /bin/sh
@@ -69,7 +69,7 @@ dep:
mkdir dep
%.o: %.c
$(CC) -Wall -I$(srcdir) -I$(srcdir)/.. $(CPPFLAGS) $(CFLAGS) -MD -c $<
$(CC) -Wall -I$(srcdir) -I$(srcdir)/.. -I.. $(CPPFLAGS) $(CFLAGS) -MD -c $<
mv $*.d dep
O = cadpli.o
+11 -2
View File
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: compiler.h,v 1.17 2003/09/25 00:25:14 steve Exp $"
#ident "$Id: compiler.h,v 1.19 2003/11/13 05:55:33 steve Exp $"
#endif
# include <list>
@@ -64,7 +64,7 @@
/*
* These are flags to enable various sorts of warnings. By default all
* the warnings are of, the -W<list> parameter arranges for each to be
* the warnings are off, the -W<list> parameter arranges for each to be
* enabled.
*/
@@ -81,6 +81,9 @@ extern bool warn_portbinding;
/* This is true if verbose output is requested. */
extern bool verbose_flag;
/* Path to a directory useful for finding subcomponents. */
extern const char*basedir;
/* This is an ordered list of library suffixes to search. */
extern list<const char*>library_suff;
extern int build_library_index(const char*path, bool key_case_sensitive);
@@ -105,6 +108,12 @@ extern StringHeapLex lex_strings;
/*
* $Log: compiler.h,v $
* Revision 1.19 2003/11/13 05:55:33 steve
* Move the DLL= flag to target config files.
*
* Revision 1.18 2003/11/08 20:06:21 steve
* Spelling fixes in comments.
*
* Revision 1.17 2003/09/25 00:25:14 steve
* Summary list of missing modules.
*
+12 -50
View File
@@ -211,62 +211,24 @@ AC_MSG_RESULT($shared)
## in order to know the name of the start symbol for the .vpi module.
#######################
AC_MSG_CHECKING("for leading and/or trailing underscores")
cat << EOF > underscore.c
void underscore(void){}
EOF
$CC $shared -c underscore.c > /dev/null 2>&1
CC_LEADING_UNDERSCORE=no
CC_TRAILING_UNDERSCORE=no
output=`nm underscore.o|grep _underscore 2>&1`
if test ! -z "$output" -a "$CYGWIN" != "yes" -a "$MINGW32" != "yes"; then
CC_LEADING_UNDERSCORE=yes
AC_DEFINE(NEED_LU)
fi
output=`nm underscore.o|grep underscore_ 2>&1`
if test ! -z "$output"; then
CC_TRAILING_UNDERSCORE=yes
AC_DEFINE(NEED_TU)
fi
if test "$CC_LEADING_UNDERSCORE" = yes; then
AC_DEFINE(WLU)
fi
if test "$CC_TRAILING_UNDERSCORE" = yes; then
AC_DEFINE(WTU)
fi
rm underscore.c underscore.o
AC_MSG_RESULT("$CC_LEADING_UNDERSCORE $CC_TRAILING_UNDERSCORE")
AX_C_UNDERSCORES_LEADING
AX_C_UNDERSCORES_TRAILING
#######################
## end of test for underscores
#######################
AC_MSG_CHECKING("for ident support in C compiler")
ident_support='-DHAVE_CVS_IDENT=1'
case "${host}" in
AX_CPP_IDENT
*-*-cygwin*)
ident_support=
;;
*-*-darwin*)
ident_support=
;;
*-*-machten*)
ident_support=
;;
esac
AC_SUBST(ident_support)
AC_MSG_RESULT($ident_support)
# 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)
+20 -3
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: cprop.cc,v 1.44 2003/04/25 05:06:32 steve Exp $"
#ident "$Id: cprop.cc,v 1.46 2003/11/08 17:53:34 steve Exp $"
#endif
# include "config.h"
@@ -277,10 +277,14 @@ void cprop_functor::lpm_ff(Design*des, NetFF*obj)
{
// Look for and count unlinked FF outputs. Note that if the
// Data and Q pins are connected together, they can be removed
// from the circuit.
// from the circuit, since it doesn't do anything.
unsigned unlinked_count = 0;
for (unsigned idx = 0 ; idx < obj->width() ; idx += 1) {
if (connected(obj->pin_Data(idx), obj->pin_Q(idx))) {
if (connected(obj->pin_Data(idx), obj->pin_Q(idx))
&& (! obj->pin_Sclr().is_linked())
&& (! obj->pin_Sset().is_linked())
&& (! obj->pin_Aclr().is_linked())
&& (! obj->pin_Aset().is_linked())) {
obj->pin_Data(idx).unlink();
obj->pin_Q(idx).unlink();
}
@@ -990,6 +994,13 @@ void cprop_dc_functor::lpm_const(Design*des, NetConst*obj)
assert(tmp->scope());
// If the net is a signal name from the source,
// then users will probably want to see it in the
// waveform dump, so unhooking the constant will
// make it look wrong.
if (! tmp->local_flag())
return;
// If the net has an eref, then there is an
// expression somewhere that reads this signal. So
// the constant does get read.
@@ -1027,6 +1038,12 @@ void cprop(Design*des)
/*
* $Log: cprop.cc,v $
* Revision 1.46 2003/11/08 17:53:34 steve
* Do not remove constants accessible to VPI.
*
* Revision 1.45 2003/10/31 02:40:06 steve
* Donot elide FF that has set or clr connections.
*
* Revision 1.44 2003/04/25 05:06:32 steve
* Handle X values in constant == nets.
*
+2 -10
View File
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.21 2003/09/26 21:25:58 steve Exp $"
#ident "$Id: Makefile.in,v 1.22 2003/11/18 06:31:46 steve Exp $"
#
#
SHELL = /bin/sh
@@ -57,17 +57,11 @@ clean:
distclean: clean
rm -f Makefile
O = main.o build_string.o lexor.o parse.o substit.o cflexor.o cfparse.o
O = main.o substit.o cflexor.o cfparse.o
iverilog@EXEEXT@: $O
$(CC) $(LDFLAGS) $O -o iverilog@EXEEXT@ @EXTRALIBS@
lexor.c: lexor.lex
flex -s -olexor.c $(srcdir)/lexor.lex
parse.h parse.c: parse.y
bison --verbose -t -d -o parse.c $(srcdir)/parse.y
cflexor.c: cflexor.lex
flex -s -Pcf -ocflexor.c $(srcdir)/cflexor.lex
@@ -79,8 +73,6 @@ main.o: main.c globals.h
$(CC) $(CFLAGS) -c -DCXX='"@CXX@"' -DIVL_ROOT='"@libdir@/ivl"' -DIVL_INC='"@includedir@"' -DIVL_LIB='"@libdir@"' -DDLLIB='"@DLLIB@"' $(srcdir)/main.c
build_string.o: build_string.c globals.h
lexor.o: lexor.c parse.h globals.h
parse.o: parse.c globals.h
cflexor.o: cflexor.c cfparse.h cfparse_misc.h globals.h
cfparse.o: cfparse.c globals.h cfparse_misc.h
-158
View File
@@ -1,158 +0,0 @@
/*
* Copyright (c) 2000 Stephen Williams ([email protected])
*
* 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: build_string.c,v 1.13 2003/09/23 05:57:15 steve Exp $"
#endif
# include "config.h"
# include "globals.h"
# include <string.h>
# include <assert.h>
int build_string(char*output, size_t olen, const char*pattern)
{
char tmp_buf[1024];
char*output_save = output;
while (*pattern) {
if (*pattern == '%') {
pattern += 1;
switch (*pattern) {
case 0:
break;
case '%':
*output++ = '%';
break;
case '[': {
const char*tail;
pattern += 1;
assert(*pattern);
tail = strchr(pattern+1, ']');
assert(tail);
strncpy(tmp_buf, pattern+1, tail-pattern-1);
tmp_buf[tail-pattern-1] = 0;
if (((*pattern == 'v') && verbose_flag)
|| ((*pattern == 'N') && npath)) {
int rc = build_string(output, olen,
tmp_buf);
output += rc;
olen -= rc;
}
pattern = tail;
break;
}
case 'B':
strcpy(output, base);
output += strlen(base);
olen -= strlen(base);
break;
case 'C':
strcpy(output, iconfig_path);
output += strlen(iconfig_path);
olen -= strlen(iconfig_path);
break;
case 'f':
if (f_list) {
strcpy(output, f_list);
output += strlen(f_list);
olen -= strlen(f_list);
}
break;
case 'N':
if (npath) {
strcpy(output, npath);
output += strlen(npath);
olen -= strlen(npath);
}
break;
case 't':
strcpy(output, targ);
output += strlen(targ);
olen -= strlen(targ);
break;
}
pattern += 1;
} else {
*output++ = *pattern++;
olen -= 1;
}
}
*output = 0;
return output-output_save;
}
/*
* $Log: build_string.c,v $
* Revision 1.13 2003/09/23 05:57:15 steve
* Pass -m flag from driver via iconfig file.
*
* Revision 1.12 2003/09/22 01:12:09 steve
* Pass more ivl arguments through the iconfig file.
*
* Revision 1.11 2002/08/12 01:35:01 steve
* conditional ident string using autoconfig.
*
* Revision 1.10 2002/05/28 02:25:03 steve
* Pass library paths through -Cfile instead of command line.
*
* Revision 1.9 2002/05/28 00:50:39 steve
* Add the ivl -C flag for bulk configuration
* from the driver, and use that to run library
* modules through the preprocessor.
*
* Revision 1.8 2002/05/24 01:13:00 steve
* Support language generation flag -g.
*
* Revision 1.7 2002/04/04 05:26:13 steve
* Add dependency generation.
*
* Revision 1.6 2001/11/16 05:07:19 steve
* Add support for +libext+ in command files.
*
* Revision 1.5 2001/10/20 23:02:40 steve
* Add automatic module libraries.
*
* Revision 1.4 2001/07/25 03:10:50 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.3 2001/07/03 04:09:25 steve
* Generate verbuse status messages (Stephan Boettcher)
*
* Revision 1.2 2000/10/28 03:45:47 steve
* Use the conf file to generate the vvm ivl string.
*
* Revision 1.1 2000/10/08 22:36:56 steve
* iverilog with an iverilog.conf configuration file.
*
*/
+11 -56
View File
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: globals.h,v 1.16 2002/08/12 01:35:01 steve Exp $"
#ident "$Id: globals.h,v 1.19 2003/11/18 06:31:46 steve Exp $"
#endif
# include <stddef.h>
@@ -29,15 +29,7 @@ extern const char*base;
/* This is the path to the iconfig file sent to ivl. */
extern char* iconfig_path;
/* This is a list of all the -f<key>=<value> options from the
command line, concatenated together. */
extern char*f_list;
extern char*mod_list;
/* This is the optional -Tmin|typ|max setting. */
extern const char*mtm;
extern char* iconfig_common_path;
/* Ths is the optional -M<dependfile> value, if one was supplied. */
extern const char*depfile;
@@ -57,9 +49,6 @@ extern int synth_flag;
/* This is the name of the selected target. */
extern const char*targ;
/* This is the language generation flag. */
extern const char*generation;
/* Perform variable substitutions on the string. */
extern char* substitutions(const char*str);
@@ -86,12 +75,17 @@ extern char warning_flags[];
extern char* library_flags;
extern char* library_flags2;
extern const char*lookup_pattern(const char*key);
extern int build_string(char*out, size_t olen, const char*pattern);
/*
* $Log: globals.h,v $
* Revision 1.19 2003/11/18 06:31:46 steve
* Remove the iverilog.conf file.
*
* Revision 1.18 2003/11/13 04:09:49 steve
* Pass flags through the temporary config file.
*
* Revision 1.17 2003/11/01 04:21:57 steve
* Add support for a target static config file.
*
* Revision 1.16 2002/08/12 01:35:01 steve
* conditional ident string using autoconfig.
*
@@ -106,44 +100,5 @@ extern int build_string(char*out, size_t olen, const char*pattern);
* Add the ivl -C flag for bulk configuration
* from the driver, and use that to run library
* modules through the preprocessor.
*
* Revision 1.12 2002/05/24 01:13:00 steve
* Support language generation flag -g.
*
* Revision 1.11 2002/04/04 05:26:13 steve
* Add dependency generation.
*
* Revision 1.10 2001/11/16 05:07:19 steve
* Add support for +libext+ in command files.
*
* Revision 1.9 2001/11/13 03:30:26 steve
* The +incdir+ plusarg can take multiple directores,
* and add initial support for +define+ in the command file.
*
* Revision 1.8 2001/11/12 18:47:32 steve
* Support +incdir in command files, and ignore other
* +args flags. Also ignore -a and -v flags.
*
* Revision 1.7 2001/11/12 01:26:36 steve
* More sophisticated command file parser.
*
* Revision 1.6 2001/10/23 00:37:30 steve
* The -s flag can now be repeated on the iverilog command.
*
* Revision 1.5 2001/10/20 23:02:40 steve
* Add automatic module libraries.
*
* Revision 1.4 2001/07/03 04:09:25 steve
* Generate verbuse status messages (Stephan Boettcher)
*
* Revision 1.3 2000/11/09 21:58:00 steve
* Remember to include the -S condition.
*
* Revision 1.2 2000/10/28 03:45:47 steve
* Use the conf file to generate the vvm ivl string.
*
* Revision 1.1 2000/10/08 22:36:56 steve
* iverilog with an iverilog.conf configuration file.
*
*/
#endif
+13 -16
View File
@@ -1,10 +1,10 @@
.TH iverilog 1 "$Date: 2003/08/09 04:31:44 $" Version "$Date: 2003/08/09 04:31:44 $"
.TH iverilog 1 "$Date: 2003/11/26 01:36:25 $" Version "$Date: 2003/11/26 01:36:25 $"
.SH NAME
iverilog - Icarus Verilog compiler
.SH SYNOPSIS
.B iverilog
[-ESVv] [-Cpath] [-ccmdfile] [-g1|-g2|-g3.0] [-Dmacro[=defn]] [-pflag=value]
[-ESVv] [-Bpath] [-ccmdfile] [-g1|-g2|-g3.0] [-Dmacro[=defn]] [-pflag=value]
[-Iincludedir] [-mmodule] [-Mfile] [-Nfile] [-ooutputfilename]
[-stopmodule] [-ttype] [-Tmin/typ/max] [-Wclass] [-ypath] sourcefile
@@ -21,11 +21,12 @@ types are added as code generators are implemented.
\fIiverilog\fP accepts the following options:
.TP 8
.B -B\fIbase\fP
The \fIiverilog\fP program uses external programs to preprocess and
compile the Verilog source. Normally, the path used to locate these
tools is built into the \fIiverilog\fP program. However, the \fB-B\fP
switch allows the user to select a different set of programs. The path
given is used to locate \fIivlpp\fP, \fIivl\fP and the VPI modules.
The \fIiverilog\fP program uses external programs and configuration
files to preprocess and compile the Verilog source. Normally, the path
used to locate these tools is built into the \fIiverilog\fP
program. However, the \fB-B\fP switch allows the user to select a
different set of programs. The path given is used to locate
\fIivlpp\fP, \fIivl\fP, code generators and the VPI modules.
.TP 8
.B -c\fIfile\fP
This flag specifies an input file that contains a list of Verilog
@@ -33,14 +34,6 @@ source files. This is similar to the \fIcommand file\fP of other
Verilog simulators, in that it is a file that contains the file names
instead of taking them on the command line. See \fBCommand Files\fP below.
.TP 8
.B -C\fIpath\fP
This flag selects the driver configuration file to use. Normally, the
iverilog program will read its configuration file from
/usr/lib/ivl/iverilog.conf (or the install path configured at compile
time) but the user can specify the path to a different configuration
file. This is useful when testing new configuration files. See the
installed configuration file for a summary of the file format.
.TP 8
.B -D\fImacro\fP
Defines macro \fImacro\fP with the string `1' as its definition. This
form is normally only used to trigger ifdef conditionals in the
@@ -127,7 +120,11 @@ Use this switch to specify the target output format. See the
Turn on verbose messages. This will print the command lines that are
executed to perform the actual compilation, along with version
information from the various components, as well as the version of the
product as a whole.
product as a whole. You will notice that the command lines include
a reference to a key temporary file that passes information to the
compiler proper. To keep that file from being deleted at the end
of the process, provide a file name of your own in the environment
variable \fBIVERILOG_ICONFIG\fP.
.TP 8
.B -V
Print the version of the compiler, and exit.
-80
View File
@@ -1,80 +0,0 @@
%{
/*
* Copyright (c) 2000 Stephen Williams ([email protected])
*
* 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: lexor.lex,v 1.6 2003/08/26 16:26:02 steve Exp $"
#endif
# include "config.h"
# include <string.h>
# include "parse.h"
%}
%x CTOKENS
%x PATTERN
%%
"#".* { /* eat comments */; }
"\n" { /* eat line-ends */; }
"\r" { /* eat line-ends */; }
"[" { BEGIN(CTOKENS); return '['; }
<CTOKENS>"]" { BEGIN(0); return ']'; }
<CTOKENS>[ \t\b]+ { /* skip white space */; }
<CTOKENS>"-S" { return CT_S; }
<CTOKENS>"-t"[a-zA-Z0-9\-_]+ {
yylval.text = strdup(yytext+2);
return CT_t; }
"<"[^>]*">" {
BEGIN(PATTERN);
yylval.text = strdup(yytext);
return PATTERN_NAME; }
<PATTERN>.* {
BEGIN(0);
/* Trim off a trailing \r. This is an issue in the DOS world. */
if (yytext[strlen(yytext)-1] == '\r')
yytext[strlen(yytext)-1] = 0;
yylval.text = strdup(yytext);
return PATTERN_TEXT; }
. { fprintf(stderr, "driver lexor: Unmatched character: %c\n", yytext[0]); }
%%
void reset_lexor(FILE*fd)
{
yyrestart(fd);
}
int yywrap()
{
return 1;
}
+79 -78
View File
@@ -17,14 +17,29 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: main.c,v 1.56 2003/09/26 21:25:58 steve Exp $"
#ident "$Id: main.c,v 1.61 2003/11/18 06:31:46 steve Exp $"
#endif
# include "config.h"
const char NOTICE[] =
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
" the Free Software Foundation; either version 2 of the License, or\n"
" (at your option) any later version.\n"
"\n"
" This program is distributed in the hope that it will be useful,\n"
" but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
" GNU General Public License for more details.\n"
"\n"
" You should have received a copy of the GNU General Public License\n"
" along with this program; if not, write to the Free Software\n"
" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\n"
;
const char HELP[] =
"Usage: iverilog [-ESvV] [-B base] [-C path] [-c cmdfile] [-g1|-g2|-g3.0]\n"
"Usage: iverilog [-ESvV] [-B base] [-c cmdfile] [-g1|-g2|-g3.0]\n"
" [-D macro[=defn]] [-I includedir] [-M depfile] [-m module]\n"
" [-N file] [-o filename] [-p flag=value]\n"
" [-s topmodule] [-t target] [-T min|typ|max]\n"
@@ -99,8 +114,6 @@ char*def_list = 0;
char*mod_list = 0;
char*command_filename = 0;
char*f_list = 0;
/* These are used to collect the list of file names that will be
passed to ivlpp. Keep the list in a file because it can be a long
list. */
@@ -111,6 +124,9 @@ unsigned source_count = 0;
char*iconfig_path = 0;
FILE*iconfig_file = 0;
static char iconfig_common_path_buf[4096] = "";
char*iconfig_common_path = iconfig_common_path_buf;
int synth_flag = 0;
int verbose_flag = 0;
int command_file = 0;
@@ -195,32 +211,53 @@ static const char*my_tempfile(const char*str, FILE**fout)
*/
static int t_default(char*cmd, unsigned ncmd)
{
int rc;
const char*pattern;
unsigned rc;
unsigned ncmd_start = ncmd;
pattern = lookup_pattern("<ivl>");
if (pattern == 0) {
fprintf(stderr, "No such target: %s\n", targ);
return -1;
snprintf(tmp, sizeof tmp, " | %s/ivl", base);
rc = strlen(tmp);
cmd = realloc(cmd, ncmd+rc+1);
strcpy(cmd+ncmd, tmp);
ncmd += rc;
if (verbose_flag) {
const char*vv = " -v";
rc = strlen(vv);
cmd = realloc(cmd, ncmd+rc+1);
strcpy(cmd+ncmd, vv);
ncmd += rc;
}
tmp[0] = ' ';
tmp[1] = '|';
tmp[2] = ' ';
rc = build_string(tmp+3, sizeof tmp - 3, pattern);
cmd = realloc(cmd, ncmd+3+rc+1);
if (npath != 0) {
snprintf(tmp, sizeof tmp, " -N%s", npath);
rc = strlen(tmp);
cmd = realloc(cmd, ncmd+rc+1);
strcpy(cmd+ncmd, tmp);
ncmd += rc;
}
snprintf(tmp, sizeof tmp, " -C%s", iconfig_path);
rc = strlen(tmp);
cmd = realloc(cmd, ncmd+rc+1);
strcpy(cmd+ncmd, tmp);
ncmd += rc;
snprintf(tmp, sizeof tmp, " -C%s -- -", iconfig_common_path);
rc = strlen(tmp);
cmd = realloc(cmd, ncmd+rc+1);
strcpy(cmd+ncmd, tmp);
ncmd += rc;
#ifdef __MINGW32__
{
char *t;
for (t = tmp; *t; t++)
for (t = cmd+ncmd_start; *t; t++)
{
if (*t == '/') *t = '\\';
}
}
#endif
strcpy(cmd+ncmd, tmp);
if (verbose_flag)
printf("translate: %s\n", cmd);
@@ -359,7 +396,6 @@ int process_generation(const char*name)
int main(int argc, char **argv)
{
const char*config_path = 0;
char*cmd;
unsigned ncmd;
int e_flag = 0;
@@ -437,15 +473,12 @@ int main(int argc, char **argv)
return 1;
}
while ((opt = getopt(argc, argv, "B:C:c:D:Ef:g:hI:M:m:N::o:p:Ss:T:t:vVW:y:Y:")) != EOF) {
while ((opt = getopt(argc, argv, "B:c:D:Ef:g:hI:M:m:N::o:p:Ss:T:t:vVW:y:Y:")) != EOF) {
switch (opt) {
case 'B':
base = optarg;
break;
case 'C':
config_path = optarg;
break;
case 'c':
command_filename = malloc(strlen(optarg)+1);
strcpy(command_filename, optarg);
@@ -459,17 +492,7 @@ int main(int argc, char **argv)
case 'f':
fprintf(stderr, "warning: The -f flag is moved to -p\n");
case 'p':
if (f_list == 0) {
f_list = malloc(strlen(" -p")+strlen(optarg)+1);
strcpy(f_list, " -p");
strcat(f_list, optarg);
} else {
f_list = realloc(f_list, strlen(f_list) +
strlen(" -p") +
strlen(optarg) + 1);
strcat(f_list, " -p");
strcat(f_list, optarg);
}
fprintf(iconfig_file, "flag:%s\n", optarg);
break;
case 'g':
@@ -545,15 +568,20 @@ int main(int argc, char **argv)
}
if (version_flag || verbose_flag) {
printf("Icarus Verilog version " VERSION "\n");
printf("Icarus Verilog version " VERSION " ($Name: $)\n");
printf("Copyright 1998-2003 Stephen Williams\n");
printf("$Name: $\n");
puts(NOTICE);
if (version_flag)
return 0;
}
/* Make a common conf file path to reflect the target. */
sprintf(iconfig_common_path, "%s%c%s%s.conf",
base,sep, targ, synth_flag? "-s" : "");
/* Write values to the iconfig file. */
fprintf(iconfig_file, "basedir:%s\n", base);
if (mtm != 0) fprintf(iconfig_file, "-T:%s\n", mtm);
fprintf(iconfig_file, "generation:%s\n", generation);
fprintf(iconfig_file, "warnings:%s\n", warning_flags);
@@ -593,24 +621,6 @@ int main(int argc, char **argv)
return 1;
}
/* Load the iverilog.conf file to get our substitution
strings. */
{ char path[1024];
FILE*fd;
if (config_path) {
strcpy(path, config_path);
} else {
sprintf(path, "%s%civerilog.conf", base,sep);
}
fd = fopen(path, "r");
if (fd == 0) {
fprintf(stderr, "Config file \"%s\" not found\n",path);
return 1;
}
reset_lexor(fd);
yyparse();
}
/* Start building the preprocess command line. */
@@ -693,6 +703,21 @@ int main(int argc, char **argv)
/*
* $Log: main.c,v $
* Revision 1.61 2003/11/18 06:31:46 steve
* Remove the iverilog.conf file.
*
* Revision 1.60 2003/11/13 05:55:33 steve
* Move the DLL= flag to target config files.
*
* Revision 1.59 2003/11/13 04:09:49 steve
* Pass flags through the temporary config file.
*
* Revision 1.58 2003/11/01 04:21:57 steve
* Add support for a target static config file.
*
* Revision 1.57 2003/10/26 22:43:42 steve
* Improve -V messages,
*
* Revision 1.56 2003/09/26 21:25:58 steve
* Warnings cleanup.
*
@@ -710,29 +735,5 @@ int main(int argc, char **argv)
*
* Revision 1.51 2003/02/22 04:12:49 steve
* Add the portbind warning.
*
* Revision 1.50 2003/01/10 19:01:04 steve
* Only use libiberty.h if available.
*
* Revision 1.49 2002/12/04 03:26:59 steve
* Mingw32 compatible temp file management.
*
* Revision 1.48 2002/12/04 02:29:36 steve
* Use O_EXCL when opening temp files.
*
* Revision 1.47 2002/08/12 01:27:48 steve
* Escape the backslash in the windows file name.
*
* Revision 1.46 2002/08/10 22:36:59 steve
* No longer any nead for -rdynamic flag
*
* Revision 1.45 2002/08/10 22:27:13 steve
* Kill links to vvm.
*
* Revision 1.44 2002/07/15 00:33:50 steve
* Improve temporary file name guess.
*
* Revision 1.43 2002/07/14 23:32:31 steve
* No longer need the .exe on generated files.
*/
-168
View File
@@ -1,168 +0,0 @@
%{
/*
* Copyright (c) 2000 Stephen Williams ([email protected])
*
* 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: parse.y,v 1.7 2003/09/26 21:25:58 steve Exp $"
#endif
# include "config.h"
# include <stdio.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
# include <stdlib.h>
# include <string.h>
# include "globals.h"
void yyerror(const char*);
enum drive_code_t {
CODE_S,
CODE_t,
};
struct drive_cond {
struct drive_cond*next;
enum drive_code_t code;
char* text;
};
static struct drive_cond *cur_cond = 0;
static void add_cond(enum drive_code_t code, char*text)
{
struct drive_cond*tmp;
tmp = calloc(1, sizeof(struct drive_cond));
tmp->code = code;
tmp->text = text;
tmp->next = cur_cond;
cur_cond = tmp;
}
struct drive_pattern {
struct drive_pattern*next;
char*name;
char*text;
struct drive_cond*cond;
};
static struct drive_pattern *patterns = 0;
static struct drive_pattern *plast = 0;
static void add_pattern(char*name, char*text)
{
struct drive_pattern*tmp;
tmp = calloc(1, sizeof(struct drive_pattern));
tmp->name = name;
tmp->text = text;
tmp->cond = cur_cond;
tmp->next = 0;
if (plast) {
plast->next = tmp;
plast = tmp;
} else {
patterns = tmp;
plast = tmp;
}
}
const char*lookup_pattern(const char*key)
{
struct drive_pattern*cur;
struct drive_cond*cc;
for (cur = patterns ; cur ; cur = cur->next) {
if (strcmp(key, cur->name) != 0)
continue;
for (cc = cur->cond ; cc ; cc = cc->next) {
switch (cc->code) {
case CODE_S:
if (synth_flag)
continue;
break;
case CODE_t:
if (strcmp(targ, cc->text) == 0)
continue;
break;
}
break;
}
if (cc) continue;
return cur->text;
}
return 0;
}
%}
%union {
char*text;
};
%token <text> PATTERN_NAME PATTERN_TEXT
%token <text> CT_t
%token CT_S
%%
start: section_list ;
section_list
: section
| section_list section
;
section : '[' ctoken_list ']' pattern_list { cur_cond = 0; } ;
ctoken_list
: ctoken
| ctoken_list ctoken
;
ctoken : CT_S { add_cond(CODE_S, 0); }
| CT_t { add_cond(CODE_t, $1); }
;
pattern_list
: pattern
| pattern_list pattern
;
pattern : PATTERN_NAME PATTERN_TEXT
{ add_pattern($1, $2); }
;
%%
void yyerror(const char*msg)
{
fprintf(stderr, "%s\n", msg);
}
+11 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: dup_expr.cc,v 1.15 2003/05/30 02:55:32 steve Exp $"
#ident "$Id: dup_expr.cc,v 1.16 2003/10/31 02:47:11 steve Exp $"
#endif
# include "config.h"
@@ -121,6 +121,13 @@ NetEUnary* NetEUnary::dup_expr() const
return tmp;
}
NetEUReduce* NetEUReduce::dup_expr() const
{
NetEUReduce*tmp = new NetEUReduce(op_, expr_->dup_expr());
assert(tmp);
return tmp;
}
NetEVariable* NetEVariable::dup_expr() const
{
NetEVariable*tmp = new NetEVariable(var_);
@@ -129,6 +136,9 @@ NetEVariable* NetEVariable::dup_expr() const
/*
* $Log: dup_expr.cc,v $
* Revision 1.16 2003/10/31 02:47:11 steve
* NetEUReduce has its own dup_expr method.
*
* Revision 1.15 2003/05/30 02:55:32 steve
* Support parameters in real expressions and
* as real expressions, and fix multiply and
+23 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_net.cc,v 1.120 2003/09/23 03:31:28 steve Exp $"
#ident "$Id: elab_net.cc,v 1.122 2003/10/30 04:31:34 steve Exp $"
#endif
# include "config.h"
@@ -1358,6 +1358,13 @@ NetNet* PEIdent::elaborate_net(Design*des, NetScope*scope,
connect(sig->pin(idx), cp->pin(idx));
}
if (var != 0) {
cerr << get_line() << ": sorry: " << path_
<< " is a real in a net/wire context." << endl;
des->errors += 1;
return 0;
}
/* Fallback, this may be an implicitly declared net. */
if (sig == 0) {
@@ -1490,7 +1497,16 @@ NetNet* PEIdent::elaborate_net_ram_(Design*des, NetScope*scope,
return 0;
}
/* Even if this expression must be fully self determined, the
index expression does not, so make sure this flag is off
while elaborating the address expression. */
const bool must_be_self_determined_save = must_be_self_determined_flag;
must_be_self_determined_flag = false;
NetNet*adr = msb_->elaborate_net(des, scope, 0, 0, 0, 0);
must_be_self_determined_flag = must_be_self_determined_save;
if (adr == 0)
return 0;
@@ -2387,6 +2403,12 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
/*
* $Log: elab_net.cc,v $
* Revision 1.122 2003/10/30 04:31:34 steve
* Catch real variables in net expressions.
*
* Revision 1.121 2003/10/20 01:44:28 steve
* memory index need not be self determined width.
*
* Revision 1.120 2003/09/23 03:31:28 steve
* Catch unsized expressions in continuous assigns.
*
+9 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elaborate.cc,v 1.292 2003/09/25 00:25:14 steve Exp $"
#ident "$Id: elaborate.cc,v 1.293 2003/10/26 04:49:51 steve Exp $"
#endif
# include "config.h"
@@ -2116,6 +2116,7 @@ NetProc* PForStatement::elaborate(Design*des, NetScope*scope) const
assert(id2);
NetBlock*top = new NetBlock(NetBlock::SEQU, 0);
top->set_line(*this);
/* make the expression, and later the initial assignment to
the condition variable. The statement in the for loop is
@@ -2136,10 +2137,12 @@ NetProc* PForStatement::elaborate(Design*des, NetScope*scope) const
etmp->set_width(lv->lwidth());
NetAssign*init = new NetAssign(lv, etmp);
init->set_line(*this);
top->append(init);
NetBlock*body = new NetBlock(NetBlock::SEQU, 0);
body->set_line(*this);
/* Elaborate the statement that is contained in the for
loop. If there is an error, this will return 0 and I should
@@ -2162,6 +2165,7 @@ NetProc* PForStatement::elaborate(Design*des, NetScope*scope) const
etmp = expr2_->elaborate_expr(des, scope);
etmp->set_width(lv->lwidth());
NetAssign*step = new NetAssign(lv, etmp);
step->set_line(*this);
body->append(step);
@@ -2187,6 +2191,7 @@ NetProc* PForStatement::elaborate(Design*des, NetScope*scope) const
/* All done, build up the loop. */
NetWhile*loop = new NetWhile(ce, body);
loop->set_line(*this);
top->append(loop);
return top;
}
@@ -2607,6 +2612,9 @@ Design* elaborate(list<const char*>roots)
/*
* $Log: elaborate.cc,v $
* Revision 1.293 2003/10/26 04:49:51 steve
* Attach line number information to for loop parts.
*
* Revision 1.292 2003/09/25 00:25:14 steve
* Summary list of missing modules.
*
+27 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: eval_tree.cc,v 1.57 2003/09/04 01:52:50 steve Exp $"
#ident "$Id: eval_tree.cc,v 1.59 2003/10/31 02:47:11 steve Exp $"
#endif
# include "config.h"
@@ -150,6 +150,24 @@ NetEConst* NetEBBits::eval_tree()
break;
}
case '^': {
unsigned cnt = lwid;
if (cnt > wid) cnt = wid;
if (cnt > rwid) cnt = rwid;
for (unsigned idx = 0 ; idx < cnt ; idx += 1)
res.set(idx, lval.get(idx) ^ rval.get(idx));
if (lwid < rwid)
for (unsigned idx = lwid ; idx < rwid ; idx += 1)
res.set(idx, rval.get(idx));
if (rwid < lwid)
for (unsigned idx = rwid ; idx < lwid ; idx += 1)
res.set(idx, lval.get(idx));
break;
}
default:
return 0;
}
@@ -1401,6 +1419,8 @@ NetEConst* NetEUnary::eval_tree()
return new NetEConst(val);
}
case '!':
assert(0);
default:
return 0;
}
@@ -1495,6 +1515,12 @@ NetEConst* NetEUReduce::eval_tree()
/*
* $Log: eval_tree.cc,v $
* Revision 1.59 2003/10/31 02:47:11 steve
* NetEUReduce has its own dup_expr method.
*
* Revision 1.58 2003/10/26 04:54:56 steve
* Support constant evaluation of binary ^ operator.
*
* Revision 1.57 2003/09/04 01:52:50 steve
* Evaluate real parameter expressions that contain real parameters.
*
+2 -1
View File
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* $Id: sqrt-virtex.v,v 1.3 2003/07/05 20:22:18 steve Exp $"
* $Id: sqrt-virtex.v,v 1.4 2003/11/25 18:35:31 steve Exp $"
*/
/*
@@ -269,6 +269,7 @@ module main;
task reset_dut;
begin
reset = 1;
@(posedge clk) ;
#1 reset = 0;
@(negedge clk) ;
end
+15 -3
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: expr_synth.cc,v 1.50 2003/09/26 02:44:27 steve Exp $"
#ident "$Id: expr_synth.cc,v 1.52 2003/11/10 19:39:20 steve Exp $"
#endif
# include "config.h"
@@ -44,7 +44,13 @@ NetNet* NetEBAdd::synthesize(Design*des)
NetNet*lsig = left_->synthesize(des);
NetNet*rsig = right_->synthesize(des);
assert(expr_width() >= lsig->pin_count());
assert(expr_width() >= rsig->pin_count());
lsig = pad_to_width(des, lsig, expr_width());
rsig = pad_to_width(des, rsig, expr_width());
assert(lsig->pin_count() == rsig->pin_count());
unsigned width=lsig->pin_count();
@@ -810,7 +816,7 @@ NetNet* NetESignal::synthesize(Design*des)
assert(scope);
string name = scope->local_symbol();
NetNet*tmp = new NetNet(scope, name, NetNet::NetNet::WIRE, wid);
NetNet*tmp = new NetNet(scope, name, NetNet::WIRE, wid);
tmp->local_flag(true);
for (unsigned idx = 0 ; idx < wid ; idx += 1)
@@ -821,6 +827,12 @@ NetNet* NetESignal::synthesize(Design*des)
/*
* $Log: expr_synth.cc,v $
* Revision 1.52 2003/11/10 19:39:20 steve
* Remove redundant scope tokens.
*
* Revision 1.51 2003/10/27 06:04:21 steve
* More flexible width handling for synthesized add.
*
* Revision 1.50 2003/09/26 02:44:27 steve
* Assure ternary arguments are wide enough.
*
+12 -1
View File
@@ -1,4 +1,4 @@
.TH iverilog-vpi 1 "$Date: 2003/08/26 04:45:47 $" Version "$Date: 2003/08/26 04:45:47 $"
.TH iverilog-vpi 1 "$Date: 2003/10/14 00:40:06 $" Version "$Date: 2003/10/14 00:40:06 $"
.SH NAME
iverilog-vpi - Compile front end for VPI modules
@@ -33,6 +33,12 @@ Normally, the output VPI module will be named after the first source
file passed to the command. This flag sets the name (without the .vpi
suffix) of the output vpi module.
.TP 8
.B --install-dir
This flag causes the program to print the install directory for VPI
modules, then exit. It is a convenience for makefiles or automated
plug-in installers.
.SH "PC-ONLY OPTIONS"
The PC port of \fIiverilog-vpi\fP includes two special flags needed to
@@ -77,6 +83,11 @@ Print the linker flags (LDFLAGS) needed to link a VPI module.
.B --ldlibs
Print the libraries (LDLIBS) needed to link a VPI module.
.TP 8
.B -m32
On 64bit systems that support it (and support vvp32) this flag
requests a 32bit vpi binary instead of the default 64bit binary.
.P
Example GNU makefile that takes advantage of these flags:
.IP "" 4
+24 -3
View File
@@ -17,7 +17,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: iverilog-vpi.sh,v 1.10 2003/08/26 04:45:47 steve Exp $"
#ident "$Id: iverilog-vpi.sh,v 1.13 2003/10/14 18:05:18 steve Exp $"
# These are the variables used for compiling files
CC=gcc
@@ -26,9 +26,20 @@ CFLAGS="@PIC@ -O -I@INCLUDEDIR@"
# These are used for linking...
LD=gcc
LDFLAGS="@SHARED@ -L@LIBDIR@"
LDFLAGS32="@SHARED@ -L@LIBDIR@"
LDFLAGS64="@SHARED@ -L@LIBDIR64@"
LDFLAGS="$LDFLAGS64"
LDLIBS="-lveriuser -lvpi"
INSTDIR64="@VPIDIR1@"
INSTDIR32="@VPIDIR2@"
if test x$INSTDIR32 = x
then
INSTDIR32=$INSTDIR64
fi
INSTDIR="$INSTDIR64"
CCSRC=
CXSRC=
OBJ=
@@ -69,6 +80,11 @@ do
-l*) LIB="$LIB $parm"
;;
-m32) LDFLAGS="-m32 $LDFLAGS32"
CFLAGS="-m32 $CFLAGS"
INSTDIR="$INSTDIR32"
;;
--cflags)
echo "$CFLAGS"
exit;
@@ -83,12 +99,17 @@ do
echo "$LDLIBS"
exit;
;;
--install-dir)
echo "@LIBDIR@/ivl/$INSTDIR"
exit
;;
esac
done
if [ x$OUT = x ]; then
echo "Usage: $0 [src and obj files]..."
echo "Usage: $0 [src and obj files]..." 1>&2
exit 0
fi
-78
View File
@@ -1,78 +0,0 @@
# The iverilog.conf configuration file provides to the iverilog driver
# strings based on switches that are passed by the user on the command
# line.
#
# Comments start from the hash (#) character and run to the end of the
# line.
#
# Conditions are a list of requirements between [] characters. For the
# set of patterns following a string to b activated, all the
# conditions must be true. Valid conditions are:
#
# -S -- The -S flag is passed to iverilog
# -t<string> -- The -t<string> parameters is passed to iverilog
#
#
# Patterns have a name and text. The name has the form <key> where the
# key is some key value that is required by iverilog. The commonly
# used keys are:
#
# <ivl>
# The string here is the command line needed to take the
# preprocessor output (ivlpp) and compile it with the
# target. All target types use this key.
#
# The pattern text includes %<code> substitutions. iverilog
# substitutes values for the %<code> sequences within the text.
#
# %B Substitute the base libdir, -B flag of iverilog.
#
# %C Substitute the path to the temporary config file.
#
# %f Substitute the -f flags from the command line.
#
# %N Substitute the value of the -N<path> flag.
#
# %[<c><text>]
# This substitution pattern is magical, and is the only
# multicharacter pattern. This tests the code <c>, and
# substitutes <text> into the output only if <c> is true.
# The <text> may include further substitution strings, and is
# terminated by a ``]'' character.
# This is the null (no op) target. There is a synthesis version and a
# non-synthesis version. Normally, this does not matter, but this can
# be useful and interesting if the -N flag is included.
[-tnull -S]
<ivl>%B/ivl %[v-v] -C%C %[N-N%N] -tdll -fDLL=%B/null.tgt -Fsynth -Fsyn-rules -- -
[-tnull]
<ivl>%B/ivl %[v-v] -C%C %[N-N%N] -tdll -fDLL=%B/null.tgt -- -
# --
# The vvp target generates code that the vvp simulation engine can execute.
# These rules support synthesized and non-synthesized variants.
[-tvvp -S]
<ivl>%B/ivl %[v-v] -C%C %[N-N%N] -tdll -fDLL=%B/vvp.tgt -fVVP_EXECUTABLE=%B/../../bin/vvp -Fsynth2 -Fsynth -Fsyn-rules -Fcprop -Fnodangle %f -- -
[-tvvp]
<ivl>%B/ivl %[v-v] -C%C %[N-N%N] -tdll -fDLL=%B/vvp.tgt -fVVP_EXECUTABLE=%B/../../bin/vvp -Fcprop -Fnodangle %f -- -
# This is the XNF code generator.
[-txnf]
<ivl>%B/ivl -C%C %[v-v] %[N-N%N] -txnf -Fsynth -Fsyn-rules -Fxnfio -Fcprop -Fnodangle -- -
# And this is another XNF code generator, under development.
[-tfpga]
<ivl>%B/ivl -C%C %[v-v] %[N-N%N] %f -tdll -fDLL=%B/fpga.tgt -Fsynth2 -Fsynth -Fsyn-rules -Fcprop -Fnodangle -- -
# --
# This is the pal code generator. The target module requires the -fpart=<type>
# flag to specify the part type.
[-tpal]
<ivl>%B/ivl -C%C %[v-v] %[N-N%N] %f -tdll -fDLL=%B/pal.tgt -Fsynth -Fsyn-rules -Fcprop -Fnodangle -- -
+2 -1
View File
@@ -178,11 +178,12 @@ ivl_stmt_cond_false
ivl_stmt_cond_true
ivl_stmt_delay_expr
ivl_stmt_delay_val
ivl_stmt_event
ivl_stmt_events
ivl_stmt_lval
ivl_stmt_lvals
ivl_stmt_lwidth
ivl_stmt_name
ivl_stmt_nevent
ivl_stmt_nexus
ivl_stmt_nexus_count
ivl_stmt_parm
+11 -4
View File
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: ivl_target.h,v 1.122 2003/08/22 23:14:26 steve Exp $"
#ident "$Id: ivl_target.h,v 1.124 2003/12/03 02:46:24 steve Exp $"
#endif
#ifdef __cplusplus
@@ -85,7 +85,7 @@ _BEGIN_DECL
* ivl_net_logic_t
* This object represents various built in logic devices. In fact,
* this includes just about every directional device that has a
* single output, including logic gates and nmos, pmos and cmon
* single output, including logic gates and nmos, pmos and cmos
* devices. There is also the occasional Icarus Verilog creation.
*
* ivl_nexus_t
@@ -1168,8 +1168,9 @@ extern ivl_statement_t ivl_stmt_cond_true(ivl_statement_t net);
extern ivl_expr_t ivl_stmt_delay_expr(ivl_statement_t net);
/* IVL_ST_DELAY */
extern unsigned long ivl_stmt_delay_val(ivl_statement_t net);
/* IVL_ST_WAIT */
extern ivl_event_t ivl_stmt_event(ivl_statement_t net);
/* IVL_ST_WAIT IVL_ST_TRIGGER */
extern unsigned ivl_stmt_nevent(ivl_statement_t net);
extern ivl_event_t ivl_stmt_events(ivl_statement_t net, unsigned idx);
/* IVL_ST_ASSIGN IVL_ST_ASSIGN_NB IVL_ST_CASSIGN IVL_ST_DEASSIGN
IVL_ST_FORCE IVL_ST_RELEASE */
extern ivl_lval_t ivl_stmt_lval(ivl_statement_t net, unsigned idx);
@@ -1232,6 +1233,12 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
* Revision 1.124 2003/12/03 02:46:24 steve
* Add support for wait on list of named events.
*
* Revision 1.123 2003/11/08 20:06:21 steve
* Spelling fixes in comments.
*
* Revision 1.122 2003/08/22 23:14:26 steve
* Preserve variable ranges all the way to the vpi.
*
+140 -87
View File
@@ -19,7 +19,7 @@ const char COPYRIGHT[] =
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: main.cc,v 1.72 2003/09/26 02:17:14 steve Exp $"
#ident "$Id: main.cc,v 1.79 2003/11/26 01:37:14 steve Exp $"
#endif
# include "config.h"
@@ -75,13 +75,16 @@ extern "C" const char*optarg;
/* Count errors detected in flag processing. */
unsigned flag_errors = 0;
const char VERSION[] = "$Name: $ $State: Exp $";
const char VERSION[] = "$Name: $";
const char*basedir = ".";
const char*target = "null";
generation_t generation_flag = GN_DEFAULT;
map<string,string> flags;
map<string,const char*> flags;
char*vpi_module_list = 0;
map<string,unsigned> missing_modules;
@@ -123,6 +126,47 @@ const bool CASE_SENSITIVE = false;
const bool CASE_SENSITIVE = true;
#endif
extern void cprop(Design*des);
extern void synth(Design*des);
extern void synth2(Design*des);
extern void syn_rules(Design*des);
extern void nodangle(Design*des);
extern void xnfio(Design*des);
typedef void (*net_func)(Design*);
static struct net_func_map {
const char*name;
void (*func)(Design*);
} func_table[] = {
{ "cprop", &cprop },
{ "nodangle",&nodangle },
{ "synth", &synth },
{ "synth2", &synth2 },
{ "syn-rules", &syn_rules },
{ "xnfio", &xnfio },
{ 0, 0 }
};
queue<net_func> net_func_queue;
net_func name_to_net_func(const string&name)
{
for (unsigned idx = 0 ; func_table[idx].name ; idx += 1)
if (name == func_table[idx].name)
return func_table[idx].func;
return 0;
}
const char *net_func_to_name(const net_func func)
{
for (unsigned idx = 0 ; func_table[idx].name ; idx += 1)
if (func == func_table[idx].func)
return func_table[idx].name;
return "This cannot happen";
}
static void process_generation_flag(const char*gen)
{
if (strcmp(gen,"1") == 0)
@@ -138,6 +182,23 @@ static void process_generation_flag(const char*gen)
generation_flag = GN_DEFAULT;
}
static void parm_to_flagmap(const string&flag)
{
string key;
const char*value;
unsigned off = flag.find('=');
if (off > flag.size()) {
key = flag;
value = "";
} else {
key = flag.substr(0, off);
value = strdup(flag.substr(off+1).c_str());
}
flags[key] = value;
}
/*
* Read the contents of a config file. This file is a temporary
* configuration file made by the compiler driver to carry the bulky
@@ -161,9 +222,21 @@ static void process_generation_flag(const char*gen)
* -T:<min/typ/max>
* Select which expression to use.
*
* -t:<target>
* Usually, "-t:dll"
*
* basedir:<path>
* Location to look for installed sub-components
*
* depfile:<path>
* Give the path to an output dependency file.
*
* flag:<name>=<string>
* Generic compiler flag strings.
*
* functor:<name>
* Append a named functor to the processing path.
*
* generation:<1|2|3.0>
* This is the generation flag
*
@@ -188,10 +261,14 @@ static void read_iconfig_file(const char*ipath)
char buf[8*1024];
FILE*ifile = fopen(ipath, "r");
if (ifile == 0)
if (ifile == 0) {
cerr << "ERROR: Unable to read config file: " << ipath << endl;
return;
}
while (fgets(buf, sizeof buf, ifile) != 0) {
if (buf[0] == '#')
continue;
char*cp = strchr(buf, ':');
if (cp == 0)
continue;
@@ -212,9 +289,26 @@ static void read_iconfig_file(const char*ipath)
}
}
if (strcmp(buf, "depfile") == 0) {
if (strcmp(buf, "basedir") == 0) {
basedir = strdup(cp);
} else if (strcmp(buf, "depfile") == 0) {
depfile_name = strdup(cp);
} else if (strcmp(buf, "flag") == 0) {
string parm = cp;
parm_to_flagmap(parm);
} else if (strcmp(buf,"functor") == 0) {
net_func tmp = name_to_net_func(cp);
if (tmp == 0) {
cerr << "No such design transform function ``"
<< cp << "''." << endl;
flag_errors += 1;
break;
}
net_func_queue.push(tmp);
} else if (strcmp(buf, "generation") == 0) {
process_generation_flag(cp);
@@ -222,10 +316,22 @@ static void read_iconfig_file(const char*ipath)
ivlpp_string = strdup(cp);
} else if (strcmp(buf,"module") == 0) {
flags["VPI_MODULE_LIST"] = flags["VPI_MODULE_LIST"]+","+cp;
if (vpi_module_list == 0) {
vpi_module_list = strdup(cp);
} else {
char*tmp = (char*)realloc(vpi_module_list,
strlen(vpi_module_list)
+ strlen(cp)
+ 2);
strcat(tmp, ",");
strcat(tmp, cp);
vpi_module_list = tmp;
}
flags["VPI_MODULE_LIST"] = vpi_module_list;
} else if (strcmp(buf, "out") == 0) {
flags["-o"] = cp;
flags["-o"] = strdup(cp);
} else if (strcmp(buf, "root") == 0) {
roots.push_back(strdup(cp));
@@ -255,6 +361,9 @@ static void read_iconfig_file(const char*ipath)
} else if (strcmp(buf, "-Y") == 0) {
library_suff.push_back(strdup(cp));
} else if (strcmp(buf,"-t") == 0) {
target = strdup(cp);
} else if (strcmp(buf,"-T") == 0) {
if (strcmp(cp,"min") == 0) {
min_typ_max_flag = MIN;
@@ -275,63 +384,8 @@ static void read_iconfig_file(const char*ipath)
}
}
static void parm_to_flagmap(const string&flag)
{
string key, value;
unsigned off = flag.find('=');
if (off > flag.size()) {
key = flag;
value = "";
} else {
key = flag.substr(0, off);
value = flag.substr(off+1);
}
flags[key] = value;
}
extern Design* elaborate(list <const char*>root);
extern void cprop(Design*des);
extern void synth(Design*des);
extern void synth2(Design*des);
extern void syn_rules(Design*des);
extern void nodangle(Design*des);
extern void xnfio(Design*des);
typedef void (*net_func)(Design*);
static struct net_func_map {
const char*name;
void (*func)(Design*);
} func_table[] = {
{ "cprop", &cprop },
{ "nodangle",&nodangle },
{ "synth", &synth },
{ "synth2", &synth2 },
{ "syn-rules", &syn_rules },
{ "xnfio", &xnfio },
{ 0, 0 }
};
net_func name_to_net_func(const string&name)
{
for (unsigned idx = 0 ; func_table[idx].name ; idx += 1)
if (name == func_table[idx].name)
return func_table[idx].func;
return 0;
}
const char *net_func_to_name(const net_func func)
{
for (unsigned idx = 0 ; func_table[idx].name ; idx += 1)
if (func == func_table[idx].func)
return func_table[idx].name;
return "This cannot happen";
}
#if defined(HAVE_TIMES)
static double cycles_diff(struct tms *a, struct tms *b)
{
@@ -362,34 +416,23 @@ int main(int argc, char*argv[])
const char* net_path = 0;
const char* pf_path = 0;
int opt;
queue<net_func> net_func_queue;
struct tms cycles[5];
library_suff.push_back(".v");
flags["VPI_MODULE_LIST"] = "system";
vpi_module_list = strdup("system");
flags["VPI_MODULE_LIST"] = vpi_module_list;
flags["-o"] = "a.out";
min_typ_max_flag = TYP;
min_typ_max_warn = 10;
while ((opt = getopt(argc, argv, "C:F:f:hN:P:p:t:Vv")) != EOF) switch (opt) {
while ((opt = getopt(argc, argv, "C:f:hN:P:p:Vv")) != EOF) switch (opt) {
case 'C':
read_iconfig_file(optarg);
break;
case 'F': {
net_func tmp = name_to_net_func(optarg);
if (tmp == 0) {
cerr << "No such design transform function ``"
<< optarg << "''." << endl;
flag_errors += 1;
break;
}
net_func_queue.push(tmp);
break;
}
case 'f':
parm_to_flagmap(optarg);
break;
@@ -405,9 +448,6 @@ int main(int argc, char*argv[])
case 'p':
parm_to_flagmap(optarg);
break;
case 't':
target = optarg;
break;
case 'v':
verbose_flag = true;
# if defined(HAVE_TIMES)
@@ -432,12 +472,10 @@ int main(int argc, char*argv[])
"usage: ivl <options> <file>\n"
"options:\n"
"\t-C <name> Config file from driver.\n"
"\t-F <name> Apply netlist function <name>.\n"
"\t-h Print usage information, and exit.\n"
"\t-N <file> Dump the elaborated netlist to <file>.\n"
"\t-P <file> Write the parsed input to <file>.\n"
"\t-p <assign> Set a parameter value.\n"
"\t-t <name> Select target <name>.\n"
"\t-v Print progress indications"
#if defined(HAVE_TIMES)
" and execution times"
@@ -446,12 +484,6 @@ int main(int argc, char*argv[])
"\t-V Print version and copyright information, and exit.\n"
;
cout << "Netlist functions:" << endl;
for (unsigned idx = 0 ; func_table[idx].name ; idx += 1)
cout << "\t-F " << func_table[idx].name << endl;
cout << "Target types:" << endl;
for (unsigned idx = 0 ; target_table[idx] ; idx += 1)
cout << "\t-t " << target_table[idx]->name << endl;
return 0;
}
@@ -684,6 +716,27 @@ int main(int argc, char*argv[])
/*
* $Log: main.cc,v $
* Revision 1.79 2003/11/26 01:37:14 steve
* Properly initialize vpi_module_list with system.
*
* Revision 1.78 2003/11/13 05:55:33 steve
* Move the DLL= flag to target config files.
*
* Revision 1.77 2003/11/13 04:09:49 steve
* Pass flags through the temporary config file.
*
* Revision 1.76 2003/11/13 03:10:38 steve
* ivl -F and -t flags are onpassed throught the -C file.
*
* Revision 1.75 2003/11/10 20:59:03 steve
* Design::get_flag returns const char* instead of string.
*
* Revision 1.74 2003/11/01 04:22:30 steve
* Accept functors in the config file.
*
* Revision 1.73 2003/10/26 22:43:42 steve
* Improve -V messages,
*
* Revision 1.72 2003/09/26 02:17:14 steve
* Delete pform when done with it.
*
+6 -3
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: net_design.cc,v 1.41 2003/09/20 01:05:36 steve Exp $"
#ident "$Id: net_design.cc,v 1.42 2003/11/10 20:59:03 steve Exp $"
#endif
# include "config.h"
@@ -462,9 +462,9 @@ void NetScope::evaluate_parameters(Design*des)
}
string Design::get_flag(const string&key) const
const char* Design::get_flag(const string&key) const
{
map<string,string>::const_iterator tmp = flags_.find(key);
map<string,const char*>::const_iterator tmp = flags_.find(key);
if (tmp == flags_.end())
return "";
else
@@ -617,6 +617,9 @@ void Design::delete_process(NetProcTop*top)
/*
* $Log: net_design.cc,v $
* Revision 1.42 2003/11/10 20:59:03 steve
* Design::get_flag returns const char* instead of string.
*
* Revision 1.41 2003/09/20 01:05:36 steve
* Obsolete find_symbol and find_event from the Design class.
*
+8 -2
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: net_nex_input.cc,v 1.10 2003/07/26 03:34:42 steve Exp $"
#ident "$Id: net_nex_input.cc,v 1.11 2003/10/26 04:50:46 steve Exp $"
#endif
# include "config.h"
@@ -259,7 +259,10 @@ NexusSet* NetCase::nex_input()
for (unsigned idx = 0 ; idx < nitems_ ; idx += 1) {
assert(items_[idx].statement);
/* Skip cases that have empty statements. */
if (items_[idx].statement == 0)
continue;
NexusSet*tmp = items_[idx].statement->nex_input();
assert(tmp);
result->add(*tmp);
@@ -377,6 +380,9 @@ NexusSet* NetWhile::nex_input()
/*
* $Log: net_nex_input.cc,v $
* Revision 1.11 2003/10/26 04:50:46 steve
* Case with empty statements has no inputs.
*
* Revision 1.10 2003/07/26 03:34:42 steve
* Start handling pad of expressions in code generators.
*
+10 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: net_nex_output.cc,v 1.6 2002/09/17 04:39:20 steve Exp $"
#ident "$Id: net_nex_output.cc,v 1.7 2003/10/26 04:51:39 steve Exp $"
#endif
# include "config.h"
@@ -85,8 +85,17 @@ void NetEvWait::nex_output(NexusSet&out)
statement_->nex_output(out);
}
void NetWhile::nex_output(NexusSet&out)
{
if (proc_ != 0)
proc_->nex_output(out);
}
/*
* $Log: net_nex_output.cc,v $
* Revision 1.7 2003/10/26 04:51:39 steve
* Output of While is output of while substatement.
*
* Revision 1.6 2002/09/17 04:39:20 steve
* Account for part select in l-value.
*
+7 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: netlist.cc,v 1.219 2003/09/03 23:32:10 steve Exp $"
#ident "$Id: netlist.cc,v 1.220 2003/11/10 19:44:30 steve Exp $"
#endif
# include "config.h"
@@ -1840,6 +1840,7 @@ bool NetEBinary::has_width() const
NetEBinary* NetEBinary::dup_expr() const
{
assert(0);
return 0;
}
NetEBLogic::NetEBLogic(char op, NetExpr*l, NetExpr*r)
@@ -1958,6 +1959,7 @@ unsigned NetMemory::index_to_address(long idx) const
NetEMemory* NetEMemory::dup_expr() const
{
assert(0);
return 0;
}
NetEEvent::NetEEvent(NetEvent*e)
@@ -2072,6 +2074,7 @@ const NetNet* NetEBitSel::sig() const
NetEBitSel* NetEBitSel::dup_expr() const
{
assert(0);
return 0;
}
NetETernary::NetETernary(NetExpr*c, NetExpr*t, NetExpr*f)
@@ -2199,6 +2202,9 @@ const NetProc*NetTaskDef::proc() const
/*
* $Log: netlist.cc,v $
* Revision 1.220 2003/11/10 19:44:30 steve
* Fix return value warnings.
*
* Revision 1.219 2003/09/03 23:32:10 steve
* Oops, missing pin_Sset implementation.
*
+22 -8
View File
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: netlist.h,v 1.302 2003/09/20 01:05:36 steve Exp $"
#ident "$Id: netlist.h,v 1.306 2003/11/10 20:59:03 steve Exp $"
#endif
/*
@@ -86,7 +86,7 @@ class NetObj : public Attrib, public virtual LineInfo {
public:
public:
// The name of the object must be a a perallocated string. A
// The name of the object must be a permallocated string. A
// lex_strings string, for example.
explicit NetObj(NetScope*s, const char*n, unsigned npins);
virtual ~NetObj();
@@ -207,7 +207,7 @@ class Link {
verinum::V init_;
// These members name the pin of the link. If the name
// has width, then the ninst_ member is the index of the
// has width, then the inst_ member is the index of the
// pin.
string name_;
unsigned inst_;
@@ -322,7 +322,7 @@ class NexusSet {
class NetNode : public NetObj {
public:
// The name paramter must be a permallocated string.
// The name parameter must be a permallocated string.
explicit NetNode(NetScope*s, const char*n, unsigned npins);
virtual ~NetNode();
@@ -1637,7 +1637,7 @@ class NetCAssign : public NetProc, public NetNode {
/*
* A condit represents a conditional. It has an expression to test,
* and a pair of statements to select from. If the original statement
* has empty clauses, then the NetProc for it will be a nul pointer.
* has empty clauses, then the NetProc for it will be a null pointer.
*/
class NetCondit : public NetProc {
@@ -2270,6 +2270,7 @@ class NetWhile : public NetProc {
void emit_proc_recurse(struct target_t*) const;
virtual NexusSet* nex_input();
virtual void nex_output(NexusSet&);
virtual bool emit_proc(struct target_t*) const;
virtual void dump(ostream&, unsigned ind) const;
@@ -2868,6 +2869,7 @@ class NetEUReduce : public NetEUnary {
virtual bool set_width(unsigned w);
virtual NetNet* synthesize(Design*);
virtual NetEUReduce* dup_expr() const;
virtual NetEConst* eval_tree();
};
@@ -3163,9 +3165,9 @@ class Design {
steps can then use the get_flag() function to get the value
of an interesting key. */
void set_flags(const map<string,string>&f) { flags_ = f; }
void set_flags(const map<string,const char*>&f) { flags_ = f; }
string get_flag(const string&key) const;
const char* get_flag(const string&key) const;
NetScope* make_root_scope(const char*name);
NetScope* find_root_scope();
@@ -3257,7 +3259,7 @@ class Design {
NetProcTop*procs_;
NetProcTop*procs_idx_;
map<string,string> flags_;
map<string,const char*> flags_;
int des_precision_;
@@ -3308,6 +3310,18 @@ extern ostream& operator << (ostream&, NetNet::Type);
/*
* $Log: netlist.h,v $
* Revision 1.306 2003/11/10 20:59:03 steve
* Design::get_flag returns const char* instead of string.
*
* Revision 1.305 2003/11/08 20:06:21 steve
* Spelling fixes in comments.
*
* Revision 1.304 2003/10/31 02:47:11 steve
* NetEUReduce has its own dup_expr method.
*
* Revision 1.303 2003/10/26 04:51:38 steve
* Output of While is output of while substatement.
*
* Revision 1.302 2003/09/20 01:05:36 steve
* Obsolete find_symbol and find_event from the Design class.
*
+15 -3
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: synth2.cc,v 1.31 2003/08/28 04:11:19 steve Exp $"
#ident "$Id: synth2.cc,v 1.32 2003/10/27 02:18:04 steve Exp $"
#endif
# include "config.h"
@@ -539,6 +539,8 @@ bool NetCondit::synth_sync(Design*des, NetScope*scope, NetFF*ff,
NetNet*asig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, nex_map->pin_count());
asig->local_flag(true);
assert(if_ != 0);
bool flag = if_->synth_async(des, scope, nex_map, asig);
assert(asig->pin_count() == ff->width());
@@ -567,6 +569,7 @@ bool NetCondit::synth_sync(Design*des, NetScope*scope, NetFF*ff,
delete expr_input;
assert(events_in.count() == 1);
assert(else_ != 0);
return else_->synth_sync(des, scope, ff, nex_map,
nex_out, svector<NetEvProbe*>(0))
&& flag;
@@ -578,10 +581,15 @@ bool NetCondit::synth_sync(Design*des, NetScope*scope, NetFF*ff,
is not asyncronous because we know the condition is not
included in the sensitivity list, but if the if_ case is
constant (has no inputs) then we can model this as a
synchronous set/reset. */
synchronous set/reset.
This is only synchronous set/reset if there is a true and a
false clause, and no inputs. The "no inputs" requirement is
met if the assignments are of all constant values. */
assert(if_ != 0);
NexusSet*a_set = if_->nex_input();
if (a_set->count() == 0) {
if ((a_set->count() == 0) && if_ && else_) {
NetNet*rst = expr_->synthesize(des);
assert(rst->pin_count() == 1);
@@ -617,6 +625,7 @@ bool NetCondit::synth_sync(Design*des, NetScope*scope, NetFF*ff,
delete a_set;
assert(else_ != 0);
return else_->synth_sync(des, scope, ff, nex_map,
nex_out, svector<NetEvProbe*>(0))
&& flag;
@@ -877,6 +886,9 @@ void synth2(Design*des)
/*
* $Log: synth2.cc,v $
* Revision 1.32 2003/10/27 02:18:04 steve
* Handle special case of FF with enable and constant data.
*
* Revision 1.31 2003/08/28 04:11:19 steve
* Spelling patch.
*
+32 -5
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-api.cc,v 1.104 2003/09/03 23:33:30 steve Exp $"
#ident "$Id: t-dll-api.cc,v 1.106 2003/12/03 02:46:24 steve Exp $"
#endif
# include "config.h"
@@ -32,7 +32,7 @@
extern "C" const char*ivl_design_flag(ivl_design_t des, const char*key)
{
return des->self->get_flag(key).c_str();
return des->self->get_flag(key);
}
extern "C" int ivl_design_process(ivl_design_t des,
@@ -1720,13 +1720,34 @@ extern "C" unsigned long ivl_stmt_delay_val(ivl_statement_t net)
return net->u_.delay_.delay_;
}
extern "C" ivl_event_t ivl_stmt_event(ivl_statement_t net)
extern "C" unsigned ivl_stmt_nevent(ivl_statement_t net)
{
switch (net->type_) {
case IVL_ST_WAIT:
return net->u_.wait_.event_;
return net->u_.wait_.nevent;
case IVL_ST_TRIGGER:
return net->u_.trig_.event_;
return 1;
default:
assert(0);
}
return 0;
}
extern "C" ivl_event_t ivl_stmt_events(ivl_statement_t net, unsigned idx)
{
switch (net->type_) {
case IVL_ST_WAIT:
assert(idx < net->u_.wait_.nevent);
if (net->u_.wait_.nevent == 1)
return net->u_.wait_.event;
else
return net->u_.wait_.events[idx];
case IVL_ST_TRIGGER:
assert(idx == 0);
return net->u_.wait_.event;
default:
assert(0);
}
@@ -1913,6 +1934,12 @@ extern "C" ivl_variable_type_t ivl_variable_type(ivl_variable_t net)
/*
* $Log: t-dll-api.cc,v $
* Revision 1.106 2003/12/03 02:46:24 steve
* Add support for wait on list of named events.
*
* Revision 1.105 2003/11/10 20:59:03 steve
* Design::get_flag returns const char* instead of string.
*
* Revision 1.104 2003/09/03 23:33:30 steve
* Pass FF synchronous set values to code generator.
*
+63 -51
View File
@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-proc.cc,v 1.60 2003/06/24 01:38:03 steve Exp $"
#ident "$Id: t-dll-proc.cc,v 1.61 2003/12/03 02:46:24 steve Exp $"
#endif
# include "config.h"
@@ -698,6 +698,7 @@ bool dll_target::proc_trigger(const NetEvTrig*net)
assert(stmt_cur_->type_ == IVL_ST_NONE);
stmt_cur_->type_ = IVL_ST_TRIGGER;
stmt_cur_->u_.wait_.nevent = 1;
/* Locate the event by name. Save the ivl_event_t in the
statement so that the generator can find it easily. */
@@ -707,7 +708,7 @@ bool dll_target::proc_trigger(const NetEvTrig*net)
for (unsigned idx = 0 ; idx < ev_scope->nevent_ ; idx += 1) {
const char*ename = ivl_event_basename(ev_scope->event_[idx]);
if (strcmp(ev->name(), ename) == 0) {
stmt_cur_->u_.wait_.event_ = ev_scope->event_[idx];
stmt_cur_->u_.wait_.event = ev_scope->event_[idx];
break;
}
}
@@ -734,63 +735,71 @@ bool dll_target::proc_wait(const NetEvWait*net)
stmt_cur_->u_.wait_.stmt_ = (struct ivl_statement_s*)
calloc(1, sizeof(struct ivl_statement_s));
if (net->nevents() != 1) {
cerr << net->get_line() << ": internal error: "
<< "multiple events not supported." << endl;
return false;
stmt_cur_->u_.wait_.nevent = net->nevents();
if (net->nevents() > 1) {
stmt_cur_->u_.wait_.events = (ivl_event_t*)
calloc(net->nevents(), sizeof(ivl_event_t*));
}
/* Locate the event by name. Save the ivl_event_t in the
statement so that the generator can find it easily. */
const NetEvent*ev = net->event(0);
ivl_scope_t ev_scope = lookup_scope_(ev->scope());
for (unsigned edx = 0 ; edx < net->nevents() ; edx += 1) {
for (unsigned idx = 0 ; idx < ev_scope->nevent_ ; idx += 1) {
const char*ename = ivl_event_basename(ev_scope->event_[idx]);
if (strcmp(ev->name(), ename) == 0) {
stmt_cur_->u_.wait_.event_ = ev_scope->event_[idx];
break;
}
}
/* Locate the event by name. Save the ivl_event_t in the
statement so that the generator can find it easily. */
const NetEvent*ev = net->event(edx);
ivl_scope_t ev_scope = lookup_scope_(ev->scope());
ivl_event_t ev_tmp;
/* If this is an event with a probe, then connect up the
pins. This wasn't done during the ::event method because
the signals weren't scanned yet. */
if (ev->nprobe() >= 1) {
ivl_event_t evnt = stmt_cur_->u_.wait_.event_;
unsigned iany = 0;
unsigned ineg = evnt->nany;
unsigned ipos = ineg + evnt->nneg;
for (unsigned idx = 0 ; idx < ev->nprobe() ; idx += 1) {
const NetEvProbe*pr = ev->probe(idx);
unsigned base = 0;
switch (pr->edge()) {
case NetEvProbe::ANYEDGE:
base = iany;
iany += pr->pin_count();
for (unsigned idx = 0 ; idx < ev_scope->nevent_ ; idx += 1) {
const char*ename = ivl_event_basename(ev_scope->event_[idx]);
if (strcmp(ev->name(), ename) == 0) {
ev_tmp = ev_scope->event_[idx];
break;
case NetEvProbe::NEGEDGE:
base = ineg;
ineg += pr->pin_count();
break;
case NetEvProbe::POSEDGE:
base = ipos;
ipos += pr->pin_count();
break;
}
for (unsigned bit = 0; bit < pr->pin_count(); bit += 1) {
ivl_nexus_t nex = (ivl_nexus_t)
pr->pin(bit).nexus()->t_cookie();
assert(nex);
evnt->pins[base+bit] = nex;
}
}
if (net->nevents() == 1)
stmt_cur_->u_.wait_.event = ev_tmp;
else
stmt_cur_->u_.wait_.events[edx] = ev_tmp;
/* If this is an event with a probe, then connect up the
pins. This wasn't done during the ::event method because
the signals weren't scanned yet. */
if (ev->nprobe() >= 1) {
unsigned iany = 0;
unsigned ineg = ev_tmp->nany;
unsigned ipos = ineg + ev_tmp->nneg;
for (unsigned idx = 0 ; idx < ev->nprobe() ; idx += 1) {
const NetEvProbe*pr = ev->probe(idx);
unsigned base = 0;
switch (pr->edge()) {
case NetEvProbe::ANYEDGE:
base = iany;
iany += pr->pin_count();
break;
case NetEvProbe::NEGEDGE:
base = ineg;
ineg += pr->pin_count();
break;
case NetEvProbe::POSEDGE:
base = ipos;
ipos += pr->pin_count();
break;
}
for (unsigned bit = 0
; bit < pr->pin_count()
; bit += 1) {
ivl_nexus_t nex = (ivl_nexus_t)
pr->pin(bit).nexus()->t_cookie();
assert(nex);
ev_tmp->pins[base+bit] = nex;
}
}
}
}
/* The ivl_statement_t for the wait statement is not complete
@@ -833,6 +842,9 @@ void dll_target::proc_while(const NetWhile*net)
/*
* $Log: t-dll-proc.cc,v $
* Revision 1.61 2003/12/03 02:46:24 steve
* Add support for wait on list of named events.
*
* Revision 1.60 2003/06/24 01:38:03 steve
* Various warnings fixed.
*
+23 -3
View File
@@ -17,13 +17,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.cc,v 1.121 2003/09/03 23:33:29 steve Exp $"
#ident "$Id: t-dll.cc,v 1.124 2003/11/26 01:37:38 steve Exp $"
#endif
# include "config.h"
# include <iostream>
# include <stdio.h> // sprintf()
# include "compiler.h"
# include "t-dll.h"
# include "netmisc.h"
@@ -562,8 +563,18 @@ void dll_target::add_root(ivl_design_s &des_, const NetScope *s)
bool dll_target::start_design(const Design*des)
{
list<NetScope *> root_scopes;
dll_path_ = des->get_flag("DLL");
dll_ = ivl_dlopen(dll_path_.c_str());
const char*dll_path_ = des->get_flag("DLL");
dll_ = ivl_dlopen(dll_path_);
if ((dll_ == 0) && (dll_path_[0] != '/')) {
size_t len = strlen(basedir) + 1 + strlen(dll_path_) + 1;
char*tmp = new char[len];
sprintf(tmp, "%s/%s", basedir, dll_path_);
dll_ = ivl_dlopen(tmp);
delete[]tmp;
}
if (dll_ == 0) {
cerr << "error: " << dll_path_ << " failed to load." << endl;
cerr << dll_path_ << ": " << dlerror() << endl;
@@ -2159,6 +2170,15 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/*
* $Log: t-dll.cc,v $
* Revision 1.124 2003/11/26 01:37:38 steve
* Warning about sprintf.
*
* Revision 1.123 2003/11/13 05:55:33 steve
* Move the DLL= flag to target config files.
*
* Revision 1.122 2003/11/10 20:59:04 steve
* Design::get_flag returns const char* instead of string.
*
* Revision 1.121 2003/09/03 23:33:29 steve
* Pass FF synchronous set values to code generator.
*
+13 -8
View File
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.h,v 1.106 2003/09/03 23:33:29 steve Exp $"
#ident "$Id: t-dll.h,v 1.108 2003/12/03 02:46:24 steve Exp $"
#endif
# include "target.h"
@@ -95,7 +95,6 @@ struct dll_target : public target_t, public expr_scan_t {
void memory(const NetMemory*);
ivl_dll_t dll_;
string dll_path_;
ivl_design_s des_;
@@ -653,16 +652,16 @@ struct ivl_statement_s {
ivl_expr_t*parms_;
} stask_;
struct { /* IVL_ST_TRIGGER */
ivl_event_t event_;
} trig_;
struct { /* IVL_ST_UTASK */
ivl_scope_t def;
} utask_;
struct { /* IVL_ST_WAIT */
ivl_event_t event_;
struct { /* IVL_ST_TRIGGER IVL_ST_WAIT */
unsigned nevent;
union {
ivl_event_t event;
ivl_event_t*events;
};
ivl_statement_t stmt_;
} wait_;
@@ -684,6 +683,12 @@ struct ivl_variable_s {
/*
* $Log: t-dll.h,v $
* Revision 1.108 2003/12/03 02:46:24 steve
* Add support for wait on list of named events.
*
* Revision 1.107 2003/11/10 20:59:04 steve
* Design::get_flag returns const char* instead of string.
*
* Revision 1.106 2003/09/03 23:33:29 steve
* Pass FF synchronous set values to code generator.
*
+6 -3
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-xnf.cc,v 1.49 2003/07/05 20:42:08 steve Exp $"
#ident "$Id: t-xnf.cc,v 1.50 2003/11/10 20:59:04 steve Exp $"
#endif
# include "config.h"
@@ -225,7 +225,7 @@ void target_xnf::draw_sym_with_lcaname(ostream&os, string lca,
bool target_xnf::start_design(const Design*des)
{
out_.open(des->get_flag("-o").c_str(), ios::out | ios::trunc);
out_.open(des->get_flag("-o"), ios::out | ios::trunc);
string ncfpath = des->get_flag("ncf");
if (ncfpath != "")
@@ -235,7 +235,7 @@ bool target_xnf::start_design(const Design*des)
out_ << "PROG,verilog,$Name: $,\"Icarus Verilog\"" << endl;
ncf_ << "# Generated by Icarus Verilog $Name: $" << endl;
if (des->get_flag("part") != "") {
if (des->get_flag("part") != 0) {
out_ << "PART," << des->get_flag("part") << endl;
ncf_ << "CONFIG PART=" << des->get_flag("part") << ";" << endl;
}
@@ -932,6 +932,9 @@ extern const struct target tgt_xnf = { "xnf", &target_xnf_obj };
/*
* $Log: t-xnf.cc,v $
* Revision 1.50 2003/11/10 20:59:04 steve
* Design::get_flag returns const char* instead of string.
*
* Revision 1.49 2003/07/05 20:42:08 steve
* Fix some enumeration warnings.
*
+34 -3
View File
@@ -17,7 +17,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.13 2003/08/22 04:27:10 steve Exp $"
#ident "$Id: Makefile.in,v 1.15 2003/11/13 03:10:38 steve Exp $"
#
#
SHELL = /bin/sh
@@ -27,6 +27,7 @@ VERSION = 0.0
prefix = @prefix@
exec_prefix = @exec_prefix@
srcdir = @srcdir@
mandir = @mandir@
VPATH = $(srcdir)
@@ -68,6 +69,13 @@ endif
fpga.tgt: $O $(TGTDEPLIBS)
$(CC) @shared@ -o $@ $O $(TGTLDFLAGS)
iverilog-fpga.ps: $(srcdir)/iverilog-fpga.man
man -t $(srcdir)/iverilog-fpga.man > iverilog-fpga.ps
iverilog-fpga.pdf: iverilog-fpga.ps
ps2pdf iverilog-fpga.ps iverilog-fpga.pdf
Makefile: Makefile.in config.status
./config.status
@@ -79,17 +87,40 @@ distclean: clean
check: all
install: all installdirs $(libdir)/ivl/fpga.tgt
ifeq (@WIN32@,yes)
INSTALL_DOC = $(prefix)/iverilog-fpga.pdf $(mandir)/man1/iverilog-fpga.1
INSTALL_DOCDIR = $(mandir)/man1
all: iverilog-fpga.pdf
else
INSTALL_DOC = $(mandir)/man1/iverilog-fpga.1
INSTALL_DOCDIR = $(mandir)/man1
endif
install: all installdirs $(libdir)/ivl/fpga.tgt $(INSTALL_DOC) $(libdir)/ivl/fpga.conf $(libdir)/ivl/fpga-s.conf
$(libdir)/ivl/fpga.tgt: ./fpga.tgt
$(INSTALL_PROGRAM) ./fpga.tgt $(libdir)/ivl/fpga.tgt
$(libdir)/ivl/fpga.conf: $(srcdir)/fpga.conf
$(INSTALL_DATA) $(srcdir)/fpga.conf $(libdir)/ivl/fpga.conf
$(libdir)/ivl/fpga-s.conf: $(srcdir)/fpga-s.conf
$(INSTALL_DATA) $(srcdir)/fpga-s.conf $(libdir)/ivl/fpga-s.conf
$(mandir)/man1/iverilog-fpga.1: $(srcdir)/iverilog-fpga.man
$(INSTALL_DATA) $(srcdir)/iverilog-fpga.man $(mandir)/man1/iverilog-fpga.1
$(prefix)/iverilog-fpga.pdf: iverilog-fpga.pdf
$(INSTALL_DATA) iverilog-fpga.pdf $(prefix)/iverilog-fpga.pdf
installdirs: ../mkinstalldirs
$(srcdir)/../mkinstalldirs $(libdir)/ivl
uninstall:
rm -f $(libdir)/ivl/fpga.tgt
rm -f $(INSTALL_DOC)
rm -f $(libdir)/ivl/fpga-s.conf
rm -f $(libdir)/ivl/fpga.conf
-include $(patsubst %.o, dep/%.d, $O)
+8 -4
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: d-generic-edif.c,v 1.16 2003/07/02 00:48:03 steve Exp $"
#ident "$Id: d-generic-edif.c,v 1.17 2003/11/12 03:20:14 steve Exp $"
#endif
# include "device.h"
@@ -463,9 +463,10 @@ const struct device_s d_generic_edif = {
0, /* draw_pad not implemented */
edif_show_logic,
edif_show_generic_dff,
0,
0,
0,
0, /* show_cmp_eq */
0, /* show_cmp_ne */
0, /* show_cmp_ge */
0, /* show_cmp_gt */
0,
0, /* show_add */
0, /* show_sub */
@@ -476,6 +477,9 @@ const struct device_s d_generic_edif = {
/*
* $Log: d-generic-edif.c,v $
* Revision 1.17 2003/11/12 03:20:14 steve
* devices need show_cmp_gt
*
* Revision 1.16 2003/07/02 00:48:03 steve
* No longer export generic-edif functions.
*
+5 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: d-generic.c,v 1.13 2003/06/24 03:55:00 steve Exp $"
#ident "$Id: d-generic.c,v 1.14 2003/11/12 03:20:14 steve Exp $"
#endif
# include "device.h"
@@ -505,6 +505,7 @@ const struct device_s d_generic = {
generic_show_cmp_eq,
generic_show_cmp_eq,
0, /* ge not implemented */
0, /* gt not implemented */
generic_show_mux,
generic_show_add,
0, /* subtract not implemented */
@@ -515,6 +516,9 @@ const struct device_s d_generic = {
/*
* $Log: d-generic.c,v $
* Revision 1.14 2003/11/12 03:20:14 steve
* devices need show_cmp_gt
*
* Revision 1.13 2003/06/24 03:55:00 steve
* Add ivl_synthesis_cell support for virtex2.
*
+86 -6
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: d-lpm.c,v 1.8 2003/09/03 23:34:09 steve Exp $"
#ident "$Id: d-lpm.c,v 1.11 2003/11/12 03:20:14 steve Exp $"
#endif
/*
@@ -644,6 +644,7 @@ static void lpm_show_mux(ivl_lpm_t net)
static void lpm_show_add(ivl_lpm_t net)
{
unsigned idx;
unsigned cell_width;
char cellname[32];
edif_cell_t cell;
edif_cellref_t ref;
@@ -654,18 +655,27 @@ static void lpm_show_add(ivl_lpm_t net)
if (ivl_lpm_type(net) == IVL_LPM_SUB)
type = "SUB";
/* Figure out the width of the cell. Normally, it is the LPM
width known by IVL. But if the top data input bits are
unconnected, then we really have a width one less, and we
can use the cout to fill out the output width. */
cell_width = ivl_lpm_width(net);
if ( (ivl_lpm_data(net,cell_width-1) == 0)
&& (ivl_lpm_datab(net,cell_width-1) == 0) )
cell_width -= 1;
/* Find the correct ADD/SUB device in the library, search by
name. If the device is not there, then create it and put it
in the library. */
sprintf(cellname, "%s%u", type, ivl_lpm_width(net));
sprintf(cellname, "%s%u", type, cell_width);
cell = edif_xlibrary_findcell(xlib, cellname);
if (cell == 0) {
unsigned pins = ivl_lpm_width(net) * 3 + 1;
unsigned pins = cell_width * 3 + 1;
cell = edif_xcell_create(xlib, strdup(cellname), pins);
for (idx = 0 ; idx < ivl_lpm_width(net) ; idx += 1) {
for (idx = 0 ; idx < cell_width ; idx += 1) {
sprintf(cellname, "Result%u", idx);
edif_cell_portconfig(cell, idx*3+0, strdup(cellname),
@@ -691,7 +701,7 @@ static void lpm_show_add(ivl_lpm_t net)
/* Connect the pins of the instance to the nexa. Access the
cell pins by name. */
for (idx = 0 ; idx < ivl_lpm_width(net) ; idx += 1) {
for (idx = 0 ; idx < cell_width ; idx += 1) {
unsigned pin;
sprintf(cellname, "Result%u", idx);
@@ -712,6 +722,13 @@ static void lpm_show_add(ivl_lpm_t net)
jnt = edif_joint_of_nexus(edf, ivl_lpm_datab(net, idx));
edif_add_to_joint(jnt, ref, pin);
}
if (cell_width < ivl_lpm_width(net)) {
unsigned pin = edif_cell_port_byname(cell, "Cout");
jnt = edif_joint_of_nexus(edf, ivl_lpm_q(net, cell_width));
edif_add_to_joint(jnt, ref, pin);
}
}
static void lpm_show_mult(ivl_lpm_t net)
@@ -785,6 +802,58 @@ static void lpm_show_mult(ivl_lpm_t net)
}
static void lpm_show_constant(ivl_net_const_t net)
{
edif_cell_t cell0 = edif_xlibrary_findcell(xlib, "cell0");
edif_cell_t cell1 = edif_xlibrary_findcell(xlib, "cell1");
edif_cellref_t ref0 = 0, ref1 = 0;
const char*bits;
unsigned idx;
if (cell0 == 0) {
cell0 = edif_xcell_create(xlib, "cell0", 1);
edif_cell_portconfig(cell0, 0, "Result0", IVL_SIP_OUTPUT);
edif_cell_pstring(cell0, "LPM_Type", "LPM_CONSTANT");
edif_cell_pinteger(cell0, "LPM_Width", 1);
edif_cell_pinteger(cell0, "LPM_CValue", 0);
}
if (cell1 == 0) {
cell1 = edif_xcell_create(xlib, "cell1", 1);
edif_cell_portconfig(cell1, 0, "Result0", IVL_SIP_OUTPUT);
edif_cell_pstring(cell1, "LPM_Type", "LPM_CONSTANT");
edif_cell_pinteger(cell1, "LPM_Width", 1);
edif_cell_pinteger(cell1, "LPM_CValue", 1);
}
bits = ivl_const_bits(net);
for (idx = 0 ; idx < ivl_const_pins(net) ; idx += 1) {
if (bits[idx] == '1') {
if (ref1 == 0)
ref1 = edif_cellref_create(edf, cell1);
} else {
if (ref0 == 0)
ref0 = edif_cellref_create(edf, cell0);
}
}
for (idx = 0 ; idx < ivl_const_pins(net) ; idx += 1) {
edif_joint_t jnt;
jnt = edif_joint_of_nexus(edf, ivl_const_pin(net,idx));
if (bits[idx] == '1')
edif_add_to_joint(jnt, ref1, 0);
else
edif_add_to_joint(jnt, ref0, 0);
}
}
const struct device_s d_lpm_edif = {
lpm_show_header,
lpm_show_footer,
@@ -795,16 +864,27 @@ const struct device_s d_lpm_edif = {
0,
0,
0,
0, /* show_cmp_gt */
lpm_show_mux, /* show_mux */
lpm_show_add, /* show_add */
lpm_show_add, /* show_sub */
0, /* show_shiftl */
0, /* show_shiftr */
lpm_show_mult /* show_mult */
lpm_show_mult, /* show_mult */
lpm_show_constant /* show_constant */
};
/*
* $Log: d-lpm.c,v $
* Revision 1.11 2003/11/12 03:20:14 steve
* devices need show_cmp_gt
*
* Revision 1.10 2003/10/31 03:45:50 steve
* Handle adders that use Cout for the top bit.
*
* Revision 1.9 2003/10/27 02:18:27 steve
* Emit constants for LPM device.
*
* Revision 1.8 2003/09/03 23:34:09 steve
* Support synchronous set of LPM_FF devices.
*
+5 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: d-virtex.c,v 1.32 2003/08/15 02:23:53 steve Exp $"
#ident "$Id: d-virtex.c,v 1.33 2003/11/12 03:20:14 steve Exp $"
#endif
# include "device.h"
@@ -835,6 +835,7 @@ const struct device_s d_virtex_edif = {
virtex_eq,
virtex_eq,
virtex_ge,
0, /* show_cmp_gt */
virtex_mux,
virtex_add,
virtex_add,
@@ -845,6 +846,9 @@ const struct device_s d_virtex_edif = {
/*
* $Log: d-virtex.c,v $
* Revision 1.33 2003/11/12 03:20:14 steve
* devices need show_cmp_gt
*
* Revision 1.32 2003/08/15 02:23:53 steve
* Add synthesis support for synchronous reset.
*
+5 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: d-virtex2.c,v 1.18 2003/07/04 00:10:09 steve Exp $"
#ident "$Id: d-virtex2.c,v 1.19 2003/11/12 03:20:14 steve Exp $"
#endif
# include "device.h"
@@ -84,6 +84,7 @@ const struct device_s d_virtex2_edif = {
virtex_eq,
virtex_eq,
virtex_ge,
0, /* show_cmp_gt */
virtex_mux,
virtex_add,
virtex_add,
@@ -94,6 +95,9 @@ const struct device_s d_virtex2_edif = {
/*
* $Log: d-virtex2.c,v $
* Revision 1.19 2003/11/12 03:20:14 steve
* devices need show_cmp_gt
*
* Revision 1.18 2003/07/04 00:10:09 steve
* Generate MUXF5 based 4-input N-wide muxes.
*
+10 -1
View File
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: device.h,v 1.12 2003/08/09 03:23:03 steve Exp $"
#ident "$Id: device.h,v 1.14 2003/11/12 03:20:14 steve Exp $"
#endif
# include <ivl_target.h>
@@ -53,6 +53,7 @@ struct device_s {
void (*show_cmp_eq)(ivl_lpm_t net);
void (*show_cmp_ne)(ivl_lpm_t net);
void (*show_cmp_ge)(ivl_lpm_t net);
void (*show_cmp_gt)(ivl_lpm_t net);
/* This method draws MUX devices */
void (*show_mux)(ivl_lpm_t net);
/* This method draws ADD devices */
@@ -63,6 +64,8 @@ struct device_s {
void (*show_shiftr)(ivl_lpm_t net);
/* Multipliers */
void (*show_mult)(ivl_lpm_t net);
/* Constants */
void (*show_constant)(ivl_net_const_t net);
};
/*
@@ -77,6 +80,12 @@ extern device_t device_from_arch(const char*arch);
/*
* $Log: device.h,v $
* Revision 1.14 2003/11/12 03:20:14 steve
* devices need show_cmp_gt
*
* Revision 1.13 2003/10/27 02:18:27 steve
* Emit constants for LPM device.
*
* Revision 1.12 2003/08/09 03:23:03 steve
* Add support for IVL_LPM_MULT device.
*
+7
View File
@@ -0,0 +1,7 @@
functor:synth2
functor:synth
functor:syn-rules
functor:cprop
functor:nodangle
-t:dll
flag:DLL=fpga.tgt
+19 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: fpga.c,v 1.9 2003/08/07 04:04:01 steve Exp $"
#ident "$Id: fpga.c,v 1.10 2003/10/27 02:18:28 steve Exp $"
#endif
# include "config.h"
@@ -88,6 +88,19 @@ static void show_pads(ivl_scope_t scope)
}
}
static void show_constants(ivl_design_t des)
{
unsigned idx;
if (device->show_constant == 0)
return;
for (idx = 0 ; idx < ivl_design_consts(des) ; idx += 1) {
ivl_net_const_t con = ivl_design_const(des, idx);
device->show_constant(con);
}
}
/*
* This is the main entry point that ivl uses to invoke me, the code
* generator.
@@ -135,6 +148,8 @@ int target_design(ivl_design_t des)
netlist. */
show_scope_gates(root, 0);
show_constants(des);
/* Call the device driver to close out the file. */
device->show_footer(des);
@@ -145,6 +160,9 @@ int target_design(ivl_design_t des)
/*
* $Log: fpga.c,v $
* Revision 1.10 2003/10/27 02:18:28 steve
* Emit constants for LPM device.
*
* Revision 1.9 2003/08/07 04:04:01 steve
* Add an LPM device type.
*
+7
View File
@@ -0,0 +1,7 @@
functor:synth2
functor:synth
functor:syn-rules
functor:cprop
functor:nodangle
-t:dll
flag:DLL=fpga.tgt
+13 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: gates.c,v 1.13 2003/08/09 03:23:03 steve Exp $"
#ident "$Id: gates.c,v 1.14 2003/11/12 03:20:14 steve Exp $"
#endif
# include <ivl_target.h>
@@ -96,6 +96,15 @@ static void show_gate_lpm(ivl_lpm_t net)
device->show_cmp_ge(net);
break;
case IVL_LPM_CMP_GT:
if (device->show_cmp_gt == 0) {
fprintf(stderr, "fpga.tgt: IVL_LPM_CMP_GT not supported"
" by this target.\n");
return;
}
device->show_cmp_gt(net);
break;
case IVL_LPM_FF:
if (device->show_dff == 0) {
fprintf(stderr, "fpga.tgt: IVL_LPM_FF not supported"
@@ -168,6 +177,9 @@ int show_scope_gates(ivl_scope_t net, void*x)
/*
* $Log: gates.c,v $
* Revision 1.14 2003/11/12 03:20:14 steve
* devices need show_cmp_gt
*
* Revision 1.13 2003/08/09 03:23:03 steve
* Add support for IVL_LPM_MULT device.
*
+187
View File
@@ -0,0 +1,187 @@
.TH iverilog-fpga 1 "$Date: 2003/10/27 06:12:47 $" Version "$Date: 2003/10/27 06:12:47 $"
.SH NAME
iverilog-fpga \- FPGA code generator for Icarus Verilog
.SH SYNOPSIS
.B iverilog -tfpga
[iverilog-options] sourcefile
.SH DESCRIPTION
.PP
The FPGA code generator supports a variety of FPGA devices, writing
EDIF output depending on the target. You can select the architecture
of the device, and the detailed part name. The architecture is used to
select library primitives, and the detailed part name is written into
the generated file for the use of downstream tools.
The code generator is invoked with the -tfpga flag to iverilog. It
understands the part= and the arch= parameters, which can be set with
the -p flag of iverilog:
iverilog -parch=virtex -ppart=v50-pq240-6 -tfpga foo.vl
This example selects the Virtex architecture, and give the detailed
part number as v50-pq240-6. The output is written into a.out unless a
different output file is specified with the -o flag.
.SH OPTIONS
.l
\fIiverilog -tfpga\fP accepts the following options:
.TP 8
.B -parch=\fIfamily\fP
The \fIfamily\fP setting further specifies the target device
family. See FPGA FAMILIES below.
.TP 8
.B -ppart=\fIdevice\fP
This specifies a specific device in the form of a detailed part
number. The format of this number is defined by the part vendor. In
most cases, the device string is taken literally and written as is to
the EDIF output.
.SH "FPGA FAMILIES"
The following is a list of architecture types that this code generator
supports.
.TP 8
.B lpm
This is a device independent format, where the gates are device types
as defined by the LPM 2 1 0 specification. Some backend tools may take
this format, or users may write interface libraries to connect these
netlists to the device in question.
The \fBlpm\fP family is the default if no other is specified.
.TP 8
.B virtex
If this is selected, then the output is formatted as an EDIF 2 0 0 file,
suitable for Virtex class devices. This is supposed to know that you
are targeting a Virtex part, so can generate primitives instead of
using external macros. It includes the VIRTEX internal library, and
should work properly for any Virtex part.
.TP 8
.B virtex2
If this is selected, then the output is EDIF 2 0 0 suitable for
Virtex-II and Virtex-II Pro devices. It uses the VIRTEX2 library, but
is very similar to the Virtex target.
.SH "EDIF ROOT PORTS"
The EDIF format is explicit about the interface into an EDIF file. The
code generator uses that control to generate an explicit interface
definition into the design. (This is *not* the same as the PADS of a
part.) The generated EDIF interface section contains port definitions,
including the proper direction marks.
With the (rename ...) s-exp in EDIF, it is possible to assign
arbitrary text to port names. The EDIF code generator therefore does
not resort to the mangling that is needed for internal symbols. The
base name of the signal that is an input or output is used as the name
of the port, complete with the proper case.
However, since the ports are single bit ports, the name of vectors
includes the string "[0]" where the number is the bit number. For
example, the module:
.nf
module main(out, in);
output out;
input [2:0] in;
[...]
endmodule
.fi
creates these ports:
.nf
out OUTPUT
in[0] INPUT
in[1] INPUT
in[2] INPUT
.fi
Target tools, including Xilinx Foundation tools, understand the []
characters in the name and recollect the signals into a proper bus
when presenting the vector to the user.
.SH "PADS AND PIN ASSIGNMENT"
The ports of a root module may be assigned to specific pins, or to a
generic pad. If a signal (that is a port) has a PAD attribute, then
the value of that attribute is a list of locations, one for each bit
of the signal, that specifies the pin for each bit of the signal. For
example:
.nf
module main( (* PAD = "P10" *) output out,
(* PAD = "P20,P21,P22" *) input [2:0] in);
[...]
endmodule
.fi
In this example, port ``out'' is assigned to pin 10, and port ``in''
is assigned to pins 20-22. If the architecture supports it, a pin
number of 0 means let the back end tools choose a pin. The format of
the pin number depends on the architecture family being targeted, so
for example Xilinx family devices take the name that is associated
with the "LOC" attribute.
NOTE: If a module port is assigned to a pin (and therefore attached to
a PAD) then it is *not* connected to a port of the EDIF file. This is
because the PAD (and possibly IBUF or OBUF) would become an extra
driver to the port. An error.
.SH "SPECIAL DEVICES"
The code generator supports the "cellref" attribute attached to logic
devices to cause specific device types be generated, instead of the
usual device that the code generator might generate. For example, to
get a clock buffer out of a Verilog buf:
.nf
buf my_gbuf(out, in);
$attribute(my_buf, "cellref", "GBUF:O,I");
.fi
The "cellref" attribute tells the code generator to use the given
cell. The syntax of the value is:
.nf
<cell type>:<pin name>,...
.fi
The cell type is the name of the library part to use. The pin names
are the names of the type in the library, in the order that the logic
device pins are connected.
.SH EXAMPLES
.TB 8
.I COMPILING WITH XILINX FOUNDATION/iSE
Compile a single-file design with command line tools like so:
.nf
% iverilog -parch=virtex -o foo.edf foo.vl
% edif2ngd foo.edf foo.ngo
% ngdbuild -p v50-pq240 foo.ngo foo.ngd
% map -o map.ncd foo.ngd
% par -w map.ncd foo.ncd
.fi
.SH "AUTHOR"
.nf
Steve Williams ([email protected])
.SH SEE ALSO
iverilog(1),
.BR "<http://www.icarus.com/eda/verilog/>"
.SH COPYRIGHT
.nf
Copyright \(co 2003 Stephen Williams
This document can be freely redistributed according to the terms of the
GNU General Public License version 2.0
+10 -2
View File
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.9 2003/08/22 04:27:10 steve Exp $"
#ident "$Id: Makefile.in,v 1.10 2003/11/13 03:10:38 steve Exp $"
#
#
SHELL = /bin/sh
@@ -73,17 +73,25 @@ clean:
distclean: clean
rm -f Makefile config.status config.log config.cache
install: all installdirs $(libdir)/ivl/null.tgt
install: all installdirs $(libdir)/ivl/null.tgt $(INSTALL_DOC) $(libdir)/ivl/null.conf $(libdir)/ivl/null-s.conf
$(libdir)/ivl/null.tgt: ./null.tgt
$(INSTALL_PROGRAM) ./null.tgt $(libdir)/ivl/null.tgt
$(libdir)/ivl/null.conf: $(srcdir)/null.conf
$(INSTALL_DATA) $(srcdir)/null.conf $(libdir)/ivl/null.conf
$(libdir)/ivl/null-s.conf: $(srcdir)/null-s.conf
$(INSTALL_DATA) $(srcdir)/null-s.conf $(libdir)/ivl/null-s.conf
installdirs: ../mkinstalldirs
$(srcdir)/../mkinstalldirs $(includedir) $(bindir) $(libdir)/ivl
uninstall:
rm -f $(libdir)/ivl/null.tgt
rm -f $(libdir)/ivl/null.conf
rm -f $(libdir)/ivl/null-s.conf
-include $(patsubst %.o, dep/%.d, $O)
+5
View File
@@ -0,0 +1,5 @@
functor:synth2
functor:synth
functor:syn-rules
-t:dll
flag:DLL=null.tgt
+2
View File
@@ -0,0 +1,2 @@
-t:dll
flag:DLL=null.tgt
+26 -3
View File
@@ -17,10 +17,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: stub.c,v 1.81 2003/07/26 03:34:43 steve Exp $"
#ident "$Id: stub.c,v 1.84 2003/12/03 04:27:10 steve Exp $"
#endif
# include "config.h"
# include <assert.h>
/*
* This is a sample target module. All this does is write to the
@@ -483,8 +484,21 @@ static void show_statement(ivl_statement_t net, unsigned ind)
break;
case IVL_ST_WAIT: {
ivl_event_t evnt = ivl_stmt_event(net);
fprintf(out, "%*s@(%s)\n", ind, "", ivl_event_name(evnt));
const char*comma = "";
fprintf(out, "%*s@(", ind, "");
for (idx = 0 ; idx < ivl_stmt_nevent(net) ; idx += 1) {
ivl_event_t evnt = ivl_stmt_events(net, idx);
if (evnt == 0)
fprintf(out, "%s/*ERROR*/", comma);
else
fprintf(out, "%s%s", comma, ivl_event_name(evnt));
comma = ", ";
}
fprintf(out, ")\n");
show_statement(ivl_stmt_sub_stmt(net), ind+4);
break;
}
@@ -878,6 +892,15 @@ int target_design(ivl_design_t des)
/*
* $Log: stub.c,v $
* Revision 1.84 2003/12/03 04:27:10 steve
* Pre-gcc3 compile error.
*
* Revision 1.83 2003/12/03 02:46:24 steve
* Add support for wait on list of named events.
*
* Revision 1.82 2003/12/03 01:54:07 steve
* Handle erroneous event lists.
*
* Revision 1.81 2003/07/26 03:34:43 steve
* Start handling pad of expressions in code generators.
*
+8 -2
View File
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.15 2003/02/28 20:21:13 steve Exp $"
#ident "$Id: Makefile.in,v 1.16 2003/11/01 04:22:51 steve Exp $"
#
#
SHELL = /bin/sh
@@ -78,11 +78,17 @@ distclean: clean
check: all
install: all installdirs $(libdir)/ivl/vvp.tgt
install: all installdirs $(libdir)/ivl/vvp.tgt $(libdir)/ivl/vvp.conf $(libdir)/ivl/vvp-s.conf
$(libdir)/ivl/vvp.tgt: ./vvp.tgt
$(INSTALL_PROGRAM) ./vvp.tgt $(libdir)/ivl/vvp.tgt
$(libdir)/ivl/vvp.conf: $(srcdir)/vvp.conf
$(INSTALL_DATA) $(srcdir)/vvp.conf $(libdir)/ivl/vvp.conf
$(libdir)/ivl/vvp-s.conf: $(srcdir)/vvp-s.conf
$(INSTALL_DATA) $(srcdir)/vvp-s.conf $(libdir)/ivl/vvp-s.conf
installdirs: ../mkinstalldirs
$(srcdir)/../mkinstalldirs $(libdir)/ivl
+7
View File
@@ -0,0 +1,7 @@
functor:synth2
functor:synth
functor:syn-rules
functor:cprop
functor:nodangle
-t:dll
flag:DLL=vvp.tgt
+4
View File
@@ -0,0 +1,4 @@
functor:cprop
functor:nodangle
-t:dll
flag:DLL=vvp.tgt
+29 -6
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vvp_process.c,v 1.89 2003/09/04 20:28:06 steve Exp $"
#ident "$Id: vvp_process.c,v 1.91 2003/12/03 02:46:24 steve Exp $"
#endif
# include "vvp_priv.h"
@@ -1052,6 +1052,7 @@ static int show_stmt_force(ivl_statement_t net)
ivl_signal_t lsig;
unsigned idx;
static unsigned force_functor_label = 0;
char*tmp_label;
assert(ivl_stmt_lvals(net) == 1);
lval = ivl_stmt_lval(net, 0);
@@ -1062,12 +1063,14 @@ static int show_stmt_force(ivl_statement_t net)
assert(ivl_lval_part_off(lval) == 0);
force_functor_label += 1;
tmp_label = strdup(vvp_signal_label(lsig));
for (idx = 0 ; idx < ivl_lval_pins(lval) ; idx += 1) {
fprintf(vvp_out, "f_%u.%u .force V_%s[%u], %s;\n",
force_functor_label, idx,
vvp_signal_label(lsig), idx,
tmp_label, idx,
draw_net_input(ivl_stmt_nexus(net, idx)));
}
}
free(tmp_label);
for (idx = 0 ; idx < ivl_lval_pins(lval) ; idx += 1) {
fprintf(vvp_out, " %%force f_%u.%u, 1;\n",
@@ -1220,7 +1223,7 @@ static int show_stmt_repeat(ivl_statement_t net, ivl_scope_t sscope)
static int show_stmt_trigger(ivl_statement_t net)
{
ivl_event_t ev = ivl_stmt_event(net);
ivl_event_t ev = ivl_stmt_events(net, 0);
assert(ev);
fprintf(vvp_out, " %%set E_%p, 0;\n", ev);
return 0;
@@ -1240,9 +1243,23 @@ static int show_stmt_utask(ivl_statement_t net)
static int show_stmt_wait(ivl_statement_t net, ivl_scope_t sscope)
{
ivl_event_t ev = ivl_stmt_event(net);
fprintf(vvp_out, " %%wait E_%p;\n", ev);
if (ivl_stmt_nevent(net) == 1) {
ivl_event_t ev = ivl_stmt_events(net, 0);
fprintf(vvp_out, " %%wait E_%p;\n", ev);
} else {
unsigned idx;
static unsigned int cascade_counter = 0;
ivl_event_t ev = ivl_stmt_events(net, 0);
fprintf(vvp_out, "Ewait_%u .event/or E_%p", cascade_counter, ev);
for (idx = 1 ; idx < ivl_stmt_nevent(net) ; idx += 1) {
ev = ivl_stmt_events(net, idx);
fprintf(vvp_out, ", E_%p", ev);
}
fprintf(vvp_out, ";\n %%wait Ewait_%u;\n", cascade_counter);
cascade_counter += 1;
}
/* Always clear the expression lookaside after a
%wait. Anything can happen while the thread is waiting. */
clear_expression_lookaside();
@@ -1557,6 +1574,12 @@ int draw_func_definition(ivl_scope_t scope)
/*
* $Log: vvp_process.c,v $
* Revision 1.91 2003/12/03 02:46:24 steve
* Add support for wait on list of named events.
*
* Revision 1.90 2003/10/25 02:07:57 steve
* vvp_signal_label does not return a unique string.
*
* Revision 1.89 2003/09/04 20:28:06 steve
* Support time0 resolution of combinational threads.
*
+12 -4
View File
@@ -1,10 +1,10 @@
Summary: Icarus Verilog
Name: verilog
Version: 0.7.20031009
Version: 0.7.20031202
Release: 0
Copyright: GPL
Group: Applications/Engineering
Source: ftp://icarus.com/pub/eda/verilog/snapshots/verilog-20031009.tar.gz
Source: ftp://icarus.com/pub/eda/verilog/snapshots/verilog-20031202.tar.gz
URL: http://www.icarus.com/eda/verilog/index.html
Packager: Stephen Williams <[email protected]>
@@ -22,7 +22,7 @@ engineering formats, including simulation. It strives to be true
to the IEEE-1364 standard.
%prep
%setup -n verilog-20031009
%setup -n verilog-20031202
%build
%ifarch x86_64
@@ -41,6 +41,7 @@ make prefix=$RPM_BUILD_ROOT/usr install
%attr(-,root,root) %doc examples/*
%attr(-,root,root) /usr/man/man1/iverilog.1.gz
%attr(-,root,root) /usr/man/man1/iverilog-fpga.1.gz
%attr(-,root,root) /usr/man/man1/iverilog-vpi.1.gz
%attr(-,root,root) /usr/man/man1/vvp.1.gz
@@ -50,9 +51,16 @@ make prefix=$RPM_BUILD_ROOT/usr install
%attr(-,root,root) /usr/lib/ivl/ivl
%attr(-,root,root) /usr/lib/ivl/ivlpp
%attr(-,root,root) /usr/lib/ivl/null.tgt
%attr(-,root,root) /usr/lib/ivl/null.conf
%attr(-,root,root) /usr/lib/ivl/null-s.conf
%attr(-,root,root) /usr/lib/ivl/vvp.tgt
%attr(-,root,root) /usr/lib/ivl/vvp.conf
%attr(-,root,root) /usr/lib/ivl/vvp-s.conf
%attr(-,root,root) /usr/lib/ivl/fpga.tgt
%attr(-,root,root) /usr/lib/ivl/iverilog.conf
%attr(-,root,root) /usr/lib/ivl/fpga.conf
%attr(-,root,root) /usr/lib/ivl/fpga-s.conf
%attr(-,root,root) /usr/lib/ivl/xnf.conf
%attr(-,root,root) /usr/lib/ivl/xnf-s.conf
%ifarch x86_64
%attr(-,root,root) /usr/bin/vvp32
%attr(-,root,root) /usr/lib/ivl/vpi64/system.vpi
+16 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: verinum.cc,v 1.40 2003/05/25 03:01:19 steve Exp $"
#ident "$Id: verinum.cc,v 1.41 2003/10/26 04:54:56 steve Exp $"
#endif
# include "config.h"
@@ -843,8 +843,23 @@ verinum::V operator & (verinum::V l, verinum::V r)
return verinum::V1;
}
verinum::V operator ^ (verinum::V l, verinum::V r)
{
if (l == verinum::V0)
return r;
if (r == verinum::V0)
return l;
if ((l == verinum::V1) && (r == verinum::V1))
return verinum::V0;
return verinum::Vx;
}
/*
* $Log: verinum.cc,v $
* Revision 1.41 2003/10/26 04:54:56 steve
* Support constant evaluation of binary ^ operator.
*
* Revision 1.40 2003/05/25 03:01:19 steve
* Get length of trimed unsigned value right.
*
+5 -1
View File
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: verinum.h,v 1.24 2003/04/14 03:40:21 steve Exp $"
#ident "$Id: verinum.h,v 1.25 2003/10/26 04:54:56 steve Exp $"
#endif
# include <string>
@@ -112,6 +112,7 @@ extern ostream& operator<< (ostream&, verinum::V);
extern verinum::V operator | (verinum::V l, verinum::V r);
extern verinum::V operator & (verinum::V l, verinum::V r);
extern verinum::V operator ^ (verinum::V l, verinum::V r);
extern verinum::V operator == (const verinum&left, const verinum&right);
extern verinum::V operator <= (const verinum&left, const verinum&right);
@@ -143,6 +144,9 @@ extern verinum v_not(const verinum&left);
/*
* $Log: verinum.h,v $
* Revision 1.25 2003/10/26 04:54:56 steve
* Support constant evaluation of binary ^ operator.
*
* Revision 1.24 2003/04/14 03:40:21 steve
* Make some effort to preserve bits while
* operating on constant values.
+4 -4
View File
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.48 2003/10/10 03:34:15 steve Exp $"
#ident "$Id: Makefile.in,v 1.49 2003/10/30 03:43:19 steve Exp $"
#
#
SHELL = /bin/sh
@@ -64,9 +64,9 @@ dep:
$(CC) -Wall -I$(srcdir)/.. -I$(srcdir) -I.. $(CPPFLAGS) $(CFLAGS) -MD -c $< -o $*.o
mv $*.d dep
O = sys_table.o sys_convert.o sys_deposit.o sys_display.o sys_finish.o \
sys_plusargs.o sys_random.o sys_readmem.o sys_readmem_lex.o sys_time.o \
sys_vcd.o sys_vcdoff.o vcd_priv.o mt19937int.o priv.o stringheap.o
O = sys_table.o sys_convert.o sys_deposit.o sys_display.o sys_fileio.o \
sys_finish.o sys_plusargs.o sys_random.o sys_readmem.o sys_readmem_lex.o \
sys_time.o sys_vcd.o sys_vcdoff.o vcd_priv.o mt19937int.o priv.o stringheap.o
ifeq (@HAVE_LIBZ@,yes)
O += sys_lxt.o lxt_write.o sys_lxt2.o lxt2_write.o
+5 -246
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: sys_display.c,v 1.65 2003/08/26 03:51:05 steve Exp $"
#ident "$Id: sys_display.c,v 1.66 2003/10/30 03:43:19 steve Exp $"
#endif
# include "config.h"
@@ -69,7 +69,7 @@ struct strobe_cb_info {
unsigned mcd;
};
static int is_constant(vpiHandle obj)
int is_constant(vpiHandle obj)
{
if (vpi_get(vpiType, obj) == vpiConstant)
return vpiConstant;
@@ -1204,77 +1204,6 @@ static int sys_monitoroff_calltf(char*name)
return 0;
}
/*
* Implement the $fopen system function.
*/
static int sys_fopen_calltf(char *name)
{
s_vpi_value value;
unsigned char *mode_string = 0;
vpiHandle call_handle = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, call_handle);
vpiHandle item = argv ? vpi_scan(argv) : 0;
vpiHandle mode = item ? vpi_scan(argv) : 0;
if (item == 0) {
vpi_printf("%s: file name parameter missing.\n", name);
return 0;
}
if (mode == 0) {
argv = 0;
}
if (! is_constant(item)) {
vpi_printf("ERROR: %s parameter must be a constant\n", name);
vpi_free_object(argv);
return 0;
}
if (vpi_get(vpiConstType, item) != vpiStringConst) {
vpi_printf("ERROR: %s parameter must be a string.\n", name);
vpi_free_object(argv);
return 0;
}
if (mode) {
if (! is_constant(mode)) {
vpi_printf("ERROR: %s parameter must be a constant\n", name);
vpi_free_object(argv);
return 0;
}
if (vpi_get(vpiConstType, mode) != vpiStringConst) {
vpi_printf("ERROR: %s parameter must be a string.\n", name);
vpi_free_object(argv);
return 0;
}
value.format = vpiStringVal;
vpi_get_value(mode, &value);
mode_string = strdup(value.value.str);
}
value.format = vpiStringVal;
vpi_get_value(item, &value);
value.format = vpiIntVal;
if (mode) {
value.value.integer = vpi_fopen(value.value.str, mode_string);
free(mode_string);
} else
value.value.integer = vpi_mcd_open(value.value.str);
vpi_put_value(call_handle, &value, 0, vpiNoDelay);
return 0;
}
static int sys_fopen_sizetf(char*x)
{
return 32;
}
/* Implement $fdisplay and $fwrite.
* Perhaps this could be merged into sys_display_calltf.
*/
@@ -1342,143 +1271,6 @@ static int sys_fdisplay_calltf(char *name)
return 0;
}
/*
* Implement $fclose system function
*/
static int sys_fclose_calltf(char *name)
{
unsigned int mcd;
int type;
s_vpi_value value;
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, sys);
vpiHandle item = vpi_scan(argv);
if (item == 0) {
vpi_printf("%s: mcd parameter missing.\n", name);
return 0;
}
type = vpi_get(vpiType, item);
switch (type) {
case vpiReg:
case vpiRealVal:
case vpiIntegerVar:
break;
default:
vpi_printf("ERROR: %s mcd parameter must be of integral type",
name);
vpi_printf(", got vpiType=%d\n", type);
vpi_free_object(argv);
return 0;
}
value.format = vpiIntVal;
vpi_get_value(item, &value);
mcd = value.value.integer;
vpi_mcd_close(mcd);
return 0;
}
static int sys_fputc_calltf(char *name)
{
unsigned int mcd;
int type;
unsigned char x;
s_vpi_value value, xvalue;
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, sys);
vpiHandle item = vpi_scan(argv);
FILE *fp;
if (item == 0) {
vpi_printf("%s: mcd parameter missing.\n", name);
return 0;
}
type = vpi_get(vpiType, item);
switch (type) {
case vpiReg:
case vpiRealVal:
case vpiIntegerVar:
break;
default:
vpi_printf("ERROR: %s mcd parameter must be of integral", name);
vpi_printf(", got vpiType=%d\n", type);
vpi_free_object(argv);
return 0;
}
value.format = vpiIntVal;
vpi_get_value(item, &value);
mcd = value.value.integer;
if (IS_MCD(mcd)) return EOF;
item = vpi_scan(argv);
xvalue.format = vpiIntVal;
vpi_get_value(item, &xvalue);
x = xvalue.value.integer;
fp = vpi_get_file(mcd);
if (!fp) return EOF;
return fputc(x, fp);
}
static int sys_fgetc_calltf(char *name)
{
unsigned int mcd;
int type;
s_vpi_value value, rval;
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, sys);
vpiHandle item = vpi_scan(argv);
FILE *fp;
if (item == 0) {
vpi_printf("%s: mcd parameter missing.\n", name);
return 0;
}
type = vpi_get(vpiType, item);
switch (type) {
case vpiReg:
case vpiRealVal:
case vpiIntegerVar:
break;
default:
vpi_printf("ERROR: %s mcd parameter must be of integral", name);
vpi_printf(", got vpiType=%d\n", type);
vpi_free_object(argv);
return 0;
}
value.format = vpiIntVal;
vpi_get_value(item, &value);
mcd = value.value.integer;
rval.format = vpiIntVal;
fp = vpi_get_file(mcd);
if (!fp || IS_MCD(mcd))
rval.value.integer = EOF;
else
rval.value.integer = fgetc(fp);
vpi_put_value(sys, &rval, 0, vpiNoDelay);
return 0;
}
static int sys_fgetc_sizetf(char*x)
{
return 32;
}
static int sys_timeformat_compiletf(char *xx)
{
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
@@ -1729,24 +1521,6 @@ void sys_display_register()
tf_data.user_data = "$monitoroff";
vpi_register_systf(&tf_data);
//============================== fopen
tf_data.type = vpiSysFunc;
tf_data.tfname = "$fopen";
tf_data.calltf = sys_fopen_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = sys_fopen_sizetf;
tf_data.user_data = "$fopen";
vpi_register_systf(&tf_data);
//============================== fclose
tf_data.type = vpiSysTask;
tf_data.tfname = "$fclose";
tf_data.calltf = sys_fclose_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = 0;
tf_data.user_data = "$fclose";
vpi_register_systf(&tf_data);
//============================== fdisplay
tf_data.type = vpiSysTask;
tf_data.tfname = "$fdisplay";
@@ -1787,24 +1561,6 @@ void sys_display_register()
tf_data.compiletf = 0;
tf_data.sizetf = 0;
tf_data.user_data = "$fwrite";
vpi_register_systf(&tf_data);
//============================== fputc
tf_data.type = vpiSysTask;
tf_data.tfname = "$fputc";
tf_data.calltf = sys_fputc_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = 0;
tf_data.user_data = "$fputc";
vpi_register_systf(&tf_data);
//============================== fgetc
tf_data.type = vpiSysFunc;
tf_data.tfname = "$fgetc";
tf_data.calltf = sys_fgetc_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = sys_fgetc_sizetf;
tf_data.user_data = "$fgetc";
vpi_register_systf(&tf_data);
//============================ timeformat
@@ -1824,6 +1580,9 @@ void sys_display_register()
/*
* $Log: sys_display.c,v $
* Revision 1.66 2003/10/30 03:43:19 steve
* Rearrange fileio functions, and add ungetc.
*
* Revision 1.65 2003/08/26 03:51:05 steve
* Add support for fstrobe system tasks.
*
+396
View File
@@ -0,0 +1,396 @@
/*
* 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: sys_fileio.c,v 1.2 2003/11/07 19:40:05 steve Exp $"
#endif
# include "vpi_user.h"
# include "sys_priv.h"
# include <assert.h>
# include <string.h>
# include <stdio.h>
# include <stdlib.h>
#define IS_MCD(mcd) !((mcd)>>31&1)
/*
* Implement the $fopen system function.
*/
static int sys_fopen_calltf(char *name)
{
s_vpi_value value;
unsigned char *mode_string = 0;
vpiHandle call_handle = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, call_handle);
vpiHandle item = argv ? vpi_scan(argv) : 0;
vpiHandle mode = item ? vpi_scan(argv) : 0;
if (item == 0) {
vpi_printf("%s: file name parameter missing.\n", name);
return 0;
}
if (mode == 0) {
argv = 0;
}
if (! is_constant(item)) {
vpi_printf("ERROR: %s parameter must be a constant\n", name);
vpi_free_object(argv);
return 0;
}
if (vpi_get(vpiConstType, item) != vpiStringConst) {
vpi_printf("ERROR: %s parameter must be a string.\n", name);
vpi_free_object(argv);
return 0;
}
if (mode) {
if (! is_constant(mode)) {
vpi_printf("ERROR: %s parameter must be a constant\n", name);
vpi_free_object(argv);
return 0;
}
if (vpi_get(vpiConstType, mode) != vpiStringConst) {
vpi_printf("ERROR: %s parameter must be a string.\n", name);
vpi_free_object(argv);
return 0;
}
value.format = vpiStringVal;
vpi_get_value(mode, &value);
mode_string = strdup(value.value.str);
}
value.format = vpiStringVal;
vpi_get_value(item, &value);
value.format = vpiIntVal;
if (mode) {
value.value.integer = vpi_fopen(value.value.str, mode_string);
free(mode_string);
} else
value.value.integer = vpi_mcd_open(value.value.str);
vpi_put_value(call_handle, &value, 0, vpiNoDelay);
return 0;
}
static int sys_fopen_sizetf(char*x)
{
return 32;
}
/*
* Implement $fclose system function
*/
static int sys_fclose_calltf(char *name)
{
unsigned int mcd;
int type;
s_vpi_value value;
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, sys);
vpiHandle item = vpi_scan(argv);
if (item == 0) {
vpi_printf("%s: mcd parameter missing.\n", name);
return 0;
}
type = vpi_get(vpiType, item);
switch (type) {
case vpiReg:
case vpiRealVal:
case vpiIntegerVar:
break;
default:
vpi_printf("ERROR: %s mcd parameter must be of integral type",
name);
vpi_printf(", got vpiType=%d\n", type);
vpi_free_object(argv);
return 0;
}
value.format = vpiIntVal;
vpi_get_value(item, &value);
mcd = value.value.integer;
vpi_mcd_close(mcd);
return 0;
}
static int sys_fflush_calltf(char *name)
{
fflush(0);
return 0;
}
static int sys_fputc_calltf(char *name)
{
unsigned int mcd;
int type;
unsigned char x;
s_vpi_value value, xvalue;
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, sys);
vpiHandle item = vpi_scan(argv);
FILE *fp;
if (item == 0) {
vpi_printf("%s: mcd parameter missing.\n", name);
return 0;
}
type = vpi_get(vpiType, item);
switch (type) {
case vpiReg:
case vpiRealVal:
case vpiIntegerVar:
break;
default:
vpi_printf("ERROR: %s mcd parameter must be of integral", name);
vpi_printf(", got vpiType=%d\n", type);
vpi_free_object(argv);
return 0;
}
value.format = vpiIntVal;
vpi_get_value(item, &value);
mcd = value.value.integer;
if (IS_MCD(mcd)) return EOF;
item = vpi_scan(argv);
xvalue.format = vpiIntVal;
vpi_get_value(item, &xvalue);
x = xvalue.value.integer;
fp = vpi_get_file(mcd);
if (!fp) return EOF;
return fputc(x, fp);
}
static int sys_fgetc_calltf(char *name)
{
unsigned int mcd;
int type;
s_vpi_value value, rval;
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, sys);
vpiHandle item = vpi_scan(argv);
FILE *fp;
if (item == 0) {
vpi_printf("%s: mcd parameter missing.\n", name);
return 0;
}
type = vpi_get(vpiType, item);
switch (type) {
case vpiReg:
case vpiRealVal:
case vpiIntegerVar:
break;
default:
vpi_printf("ERROR: %s mcd parameter must be of integral", name);
vpi_printf(", got vpiType=%d\n", type);
vpi_free_object(argv);
return 0;
}
value.format = vpiIntVal;
vpi_get_value(item, &value);
mcd = value.value.integer;
rval.format = vpiIntVal;
fp = vpi_get_file(mcd);
if (!fp || IS_MCD(mcd))
rval.value.integer = EOF;
else
rval.value.integer = fgetc(fp);
vpi_put_value(sys, &rval, 0, vpiNoDelay);
return 0;
}
static int sys_fgetc_sizetf(char*x)
{
return 32;
}
static int sys_ungetc_compiletf(char*name)
{
int type;
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, sys);
vpiHandle item = vpi_scan(argv);
if (item == 0) {
vpi_printf("%s: mcd parameter missing.\n", name);
return 0;
}
type = vpi_get(vpiType, item);
switch (type) {
case vpiReg:
case vpiRealVal:
case vpiIntegerVar:
break;
default:
vpi_printf("ERROR: %s mcd parameter must be of integral", name);
vpi_printf(", got vpiType=%d\n", type);
vpi_free_object(argv);
return 0;
}
return 0;
}
static int sys_ungetc_calltf(char *name)
{
unsigned int mcd;
unsigned char x;
s_vpi_value value, xvalue, rval;
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, sys);
vpiHandle item = vpi_scan(argv);
FILE *fp;
rval.format = vpiIntVal;
assert(item);
value.format = vpiIntVal;
vpi_get_value(item, &value);
mcd = value.value.integer;
if (IS_MCD(mcd)) {
rval.value.integer = EOF;
vpi_put_value(sys, &rval, 0, vpiNoDelay);
return 0;
}
item = vpi_scan(argv);
xvalue.format = vpiIntVal;
vpi_get_value(item, &xvalue);
x = xvalue.value.integer;
fp = vpi_get_file(mcd);
if ( !fp ) {
rval.value.integer = EOF;
vpi_put_value(sys, &rval, 0, vpiNoDelay);
return 0;
}
ungetc(x, fp);
rval.value.integer = 0;
vpi_put_value(sys, &rval, 0, vpiNoDelay);
return 0;
}
static int sys_ungetc_sizetf(char*x)
{
return 32;
}
void sys_fileio_register()
{
s_vpi_systf_data tf_data;
//============================== fopen
tf_data.type = vpiSysFunc;
tf_data.tfname = "$fopen";
tf_data.calltf = sys_fopen_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = sys_fopen_sizetf;
tf_data.user_data = "$fopen";
vpi_register_systf(&tf_data);
//============================== fclose
tf_data.type = vpiSysTask;
tf_data.tfname = "$fclose";
tf_data.calltf = sys_fclose_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = 0;
tf_data.user_data = "$fclose";
vpi_register_systf(&tf_data);
//============================== fflush
tf_data.type = vpiSysTask;
tf_data.tfname = "$fflush";
tf_data.calltf = sys_fflush_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = 0;
tf_data.user_data = "$fflush";
vpi_register_systf(&tf_data);
//============================== fputc
tf_data.type = vpiSysTask;
tf_data.tfname = "$fputc";
tf_data.calltf = sys_fputc_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = 0;
tf_data.user_data = "$fputc";
vpi_register_systf(&tf_data);
//============================== fgetc
tf_data.type = vpiSysFunc;
tf_data.tfname = "$fgetc";
tf_data.calltf = sys_fgetc_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = sys_fgetc_sizetf;
tf_data.user_data = "$fgetc";
vpi_register_systf(&tf_data);
//============================== ungetc
tf_data.type = vpiSysFunc;
tf_data.tfname = "$ungetc";
tf_data.calltf = sys_ungetc_calltf;
tf_data.compiletf = sys_ungetc_compiletf;
tf_data.sizetf = sys_ungetc_sizetf;
tf_data.user_data = "$ungetc";
vpi_register_systf(&tf_data);
}
/*
* $Log: sys_fileio.c,v $
* Revision 1.2 2003/11/07 19:40:05 steve
* Implement basic fflush.
*
* Revision 1.1 2003/10/30 03:43:20 steve
* Rearrange fileio functions, and add ungetc.
*
*/
+6 -1
View File
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: sys_priv.h,v 1.3 2003/09/30 01:33:39 steve Exp $"
#ident "$Id: sys_priv.h,v 1.4 2003/10/30 03:43:20 steve Exp $"
#endif
# include "vpi_user.h"
@@ -42,10 +42,15 @@ extern void sgenrand(struct context_s *context, unsigned long seed);
extern unsigned long genrand(struct context_s *context);
extern int is_constant(vpiHandle obj);
extern PLI_UINT64 timerec_to_time64(const struct t_vpi_time*time);
/*
* $Log: sys_priv.h,v $
* Revision 1.4 2003/10/30 03:43:20 steve
* Rearrange fileio functions, and add ungetc.
*
* Revision 1.3 2003/09/30 01:33:39 steve
* dumpers must be aware of 64bit time.
*
+11 -2
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: sys_random.c,v 1.7 2003/05/15 00:38:29 steve Exp $"
#ident "$Id: sys_random.c,v 1.8 2003/11/10 20:15:33 steve Exp $"
#endif
# include "config.h"
@@ -108,7 +108,13 @@ static int sys_dist_uniform_sizetf(char*x)
/* Icarus seed cookie */
#define COOKIE 0x1ca1ca1c
static struct context_s global_context = { .mti = NP1 };
static struct context_s global_context = {
#if !defined(_MSC_VER)
.mti =
#else
// For MSVC simply use the fact that mti is located first
#endif
NP1 };
static int sys_random_calltf(char*name)
{
@@ -197,6 +203,9 @@ void sys_random_register()
/*
* $Log: sys_random.c,v $
* Revision 1.8 2003/11/10 20:15:33 steve
* Simply MSVC compatibility patch.
*
* Revision 1.7 2003/05/15 00:38:29 steve
* Eliminate some redundant vpi_put_values.
*
+6 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: sys_table.c,v 1.22 2003/09/13 01:28:47 steve Exp $"
#ident "$Id: sys_table.c,v 1.23 2003/10/30 04:52:54 steve Exp $"
#endif
# include "config.h"
@@ -27,6 +27,7 @@
# include <string.h>
extern void sys_convert_register();
extern void sys_fileio_register();
extern void sys_finish_register();
extern void sys_deposit_register();
extern void sys_display_register();
@@ -140,6 +141,7 @@ static void sys_lxt_or_vcd_register()
void (*vlog_startup_routines[])() = {
sys_convert_register,
sys_fileio_register,
sys_finish_register,
sys_deposit_register,
sys_display_register,
@@ -154,6 +156,9 @@ void (*vlog_startup_routines[])() = {
/*
* $Log: sys_table.c,v $
* Revision 1.23 2003/10/30 04:52:54 steve
* Call register for fileio functions.
*
* Revision 1.22 2003/09/13 01:28:47 steve
* Disable lxt when zlib is missing.
*
+13 -11
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: sys_vcd.c,v 1.49 2003/10/08 23:14:29 steve Exp $"
#ident "$Id: sys_vcd.c,v 1.51 2003/10/29 03:28:27 steve Exp $"
#endif
# include "config.h"
@@ -39,10 +39,6 @@
#endif
# include "vcd_priv.h"
#ifdef HAVE_INTTYPES_H
# define TIME_FMT PRIu64
#endif
static FILE*dump_file = 0;
static const char*units_names[] = {
@@ -184,7 +180,7 @@ static int variable_cb_2(p_cb_data cause)
PLI_UINT64 now = timerec_to_time64(cause->time);
if (now != vcd_cur_time) {
fprintf(dump_file, "#%lu\n", now);
fprintf(dump_file, "#%" PLI_UINT64_FMT "\n", now);
vcd_cur_time = now;
}
@@ -234,7 +230,7 @@ static int dumpvars_cb(p_cb_data cause)
fprintf(dump_file, "$enddefinitions $end\n");
if (!dump_is_off) {
fprintf(dump_file, "#%lu\n", dumpvars_time);
fprintf(dump_file, "#%" PLI_UINT64_FMT "\n", dumpvars_time);
fprintf(dump_file, "$dumpvars\n");
vcd_checkpoint();
fprintf(dump_file, "$end\n");
@@ -254,7 +250,7 @@ inline static int install_dumpvars_callback(void)
if (dumpvars_status == 2) {
vpi_mcd_printf(1, "VCD Error:"
" $dumpvars ignored,"
" previously called at simtime %lu\n",
" previously called at simtime %" PLI_UINT64_FMT "\n",
dumpvars_time);
return 1;
}
@@ -293,7 +289,7 @@ static int sys_dumpoff_calltf(char*name)
now64 = timerec_to_time64(&now);
if (now64 > vcd_cur_time)
fprintf(dump_file, "#%" TIME_FMT "\n", now64);
fprintf(dump_file, "#%" PLI_UINT64_FMT "\n", now64);
vcd_cur_time = now64;
fprintf(dump_file, "$dumpoff\n");
@@ -324,7 +320,7 @@ static int sys_dumpon_calltf(char*name)
now64 = timerec_to_time64(&now);
if (now64 > vcd_cur_time)
fprintf(dump_file, "#" TIME_FMT "\n", now64);
fprintf(dump_file, "#%" PLI_UINT64_FMT "\n", now64);
vcd_cur_time = now64;
fprintf(dump_file, "$dumpon\n");
@@ -350,7 +346,7 @@ static int sys_dumpall_calltf(char*name)
now64 = timerec_to_time64(&now);
if (now64 > vcd_cur_time)
fprintf(dump_file, "#" TIME_FMT "\n", now64);
fprintf(dump_file, "#%" PLI_UINT64_FMT "\n", now64);
vcd_cur_time = now.low;
fprintf(dump_file, "$dumpall\n");
@@ -815,6 +811,12 @@ void sys_vcd_register()
/*
* $Log: sys_vcd.c,v $
* Revision 1.51 2003/10/29 03:28:27 steve
* Add the PLU_UINT64_FMT string for formatting output.
*
* Revision 1.50 2003/10/29 03:23:12 steve
* Portably handle time format of VCD prints.
*
* Revision 1.49 2003/10/08 23:14:29 steve
* TIME_FMT does not include the % character.
*
+5 -1
View File
@@ -17,10 +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.3 2003/04/28 01:03:11 steve Exp $"
#ident "$Id: vcd_priv.c,v 1.4 2003/11/10 20:18:02 steve Exp $"
#endif
# include "vcd_priv.h"
# include "config.h"
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
@@ -169,6 +170,9 @@ void set_nexus_ident(int nex, const char *id)
/*
* $Log: vcd_priv.c,v $
* Revision 1.4 2003/11/10 20:18:02 steve
* Missing config.h.
*
* Revision 1.3 2003/04/28 01:03:11 steve
* Fix stringheap list management failure.
*
+17 -1
View File
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vpi_user.h,v 1.29 2003/07/15 03:49:22 steve Exp $"
#ident "$Id: vpi_user.h,v 1.30 2003/10/30 03:42:51 steve Exp $"
#endif
@@ -237,6 +237,19 @@ extern PLI_INT32 vpi_flush(void);
extern PLI_INT32 vpi_mcd_flush(PLI_UINT32 mcd);
/* proposed extensions */
/*
* These functions are proposed extensions to Verilog, and
* are described by the Verilog PLI task force as issue#347.
*
* The vpi_fopen() function is exactly the same as the $fopen system
* function. That is, it takes a path string and a mode string, and
* opens the file. The result is a 32bit value with bit 31 set, the
* remaining bits made up a small integer to represent the file.
*
* The vpi_get_file(fd) function takes as input a descriptor as
* returned by vpi_fopen or $fopen. Bit 31 must be set. The result
* is the C FILE* that represents the file.
*/
extern PLI_INT32 vpi_fopen(const char*name, const char*mode);
extern FILE *vpi_get_file(PLI_INT32 fd);
@@ -399,6 +412,9 @@ EXTERN_C_END
/*
* $Log: vpi_user.h,v $
* Revision 1.30 2003/10/30 03:42:51 steve
* Details on the vpi_get_file function.
*
* Revision 1.29 2003/07/15 03:49:22 steve
* Spelling fixes.
*
+3 -2
View File
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.57 2003/10/08 23:09:09 steve Exp $"
#ident "$Id: Makefile.in,v 1.58 2003/11/08 16:20:33 steve Exp $"
#
#
SHELL = /bin/sh
@@ -48,6 +48,7 @@ YACC = @YACC@
CPPFLAGS = -I. -I.. -I $(srcdir) -I$(srcdir)/.. @CPPFLAGS@ @DEFS@
CXXFLAGS = @CXXFLAGS@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ @EXTRALIBS@
@@ -112,7 +113,7 @@ dep:
mkdir dep
%.o: %.cc
$(CXX) @ident_support@ $(CPPFLAGS) $(MDIR1) $(MDIR2) $(CXXFLAGS) -MD -c $< -o $*.o
$(CXX) @ident_support@ $(CPPFLAGS) $(CFLAGS) $(MDIR1) $(MDIR2) $(CXXFLAGS) -MD -c $< -o $*.o
mv $*.d dep/$*.d
%.o: %.c
+7 -1
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: event.cc,v 1.12 2003/04/23 03:09:25 steve Exp $"
#ident "$Id: event.cc,v 1.13 2003/11/26 01:47:18 steve Exp $"
#endif
# include "event.h"
@@ -111,6 +111,9 @@ void named_event_functor_s::set(vvp_ipoint_t ptr, bool push,
}
vpip_run_named_event_callbacks(handle);
/* This event may nest, so progagate if I have an output. */
if (out) functor_set(out, 0, St0, true);
}
/*
@@ -194,6 +197,9 @@ void compile_named_event(char*label, char*name)
/*
* $Log: event.cc,v $
* Revision 1.13 2003/11/26 01:47:18 steve
* Propagate named event outputs, if any.
*
* Revision 1.12 2003/04/23 03:09:25 steve
* VPI Access to named events.
*
+19 -2
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: stop.cc,v 1.8 2003/05/16 03:50:28 steve Exp $"
#ident "$Id: stop.cc,v 1.10 2003/11/07 05:58:02 steve Exp $"
#endif
/*
@@ -214,6 +214,17 @@ static void cmd_list(unsigned, char*[])
sig->msb, sig->lsb);
break;
case vpiNet:
sig = (struct __vpiSignal*) table[idx];
if ((sig->msb == 0) && (sig->lsb == 0))
printf("net : %s%s\n", sig->name,
sig->signed_flag? "signed " : "");
else
printf("net : %s%s[%d:%d]\n", sig->name,
sig->signed_flag? "signed " : "",
sig->msb, sig->lsb);
break;
default:
printf("%8d: <vpi handle>\n",
table[idx]->vpi_type->type_code);
@@ -413,7 +424,7 @@ void stop_handler(int rc)
first += 1;
if (first[0] != 0) {
#ifdef HAVE_READLINE_HISTORY
#ifdef HAVE_READLINE_HISTORY_H
add_history(first);
#endif
invoke_command(first);
@@ -441,6 +452,12 @@ void stop_handler(int rc)
/*
* $Log: stop.cc,v $
* Revision 1.10 2003/11/07 05:58:02 steve
* Fix conditional compilation of readline history.
*
* Revision 1.9 2003/10/15 02:17:39 steve
* Include net objects in list display.
*
* Revision 1.8 2003/05/16 03:50:28 steve
* Fallback functionality if readline is not present.
*
+5 -1
View File
@@ -17,9 +17,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vthread.cc,v 1.116 2003/09/26 02:15:15 steve Exp $"
#ident "$Id: vthread.cc,v 1.117 2003/11/10 20:19:32 steve Exp $"
#endif
# include "config.h"
# include "vthread.h"
# include "codes.h"
# include "schedule.h"
@@ -2759,6 +2760,9 @@ bool of_JOIN_UFUNC(vthread_t thr, vvp_code_t cp)
/*
* $Log: vthread.cc,v $
* Revision 1.117 2003/11/10 20:19:32 steve
* Include config.h
*
* Revision 1.116 2003/09/26 02:15:15 steve
* Slight performance tweaks of scheduler.
*
+6
View File
@@ -0,0 +1,6 @@
functor:synth
functor:syn-rules
functor:xnfio
functor:cprop
functor:nodangle
-t:xnf
+6
View File
@@ -0,0 +1,6 @@
functor:synth
functor:syn-rules
functor:xnfio
functor:cprop
functor:nodangle
-t:xnf