Compare commits

...
20 Commits
Author SHA1 Message Date
steve 793493d3ff Snapshot 20040118 2004-01-19 00:10:58 +00:00
steve 36785997cb Improve the gperf warning message. 2004-01-18 23:34:00 +00:00
steve 923a3ea537 The is_combinational function really need not recurse. 2004-01-18 23:26:54 +00:00
steve 8aca824c0f Further unify the configure.in scripts. 2004-01-15 20:52:32 +00:00
steve e6b25a4e20 Get the NEED_LU define right for win32. 2004-01-15 06:05:20 +00:00
steve d98b7ffb2e Remove duplicate NetEvProbe objects in nodangle. 2004-01-15 06:04:19 +00:00
steve e617e4a98c Handle wide expressions in wait condition. 2004-01-13 03:42:49 +00:00
steve 1970e41041 Get value for vpoiConstType correct. 2004-01-13 02:55:50 +00:00
steve e331b182a7 Synthesis debug messages. 2003-12-20 00:59:31 +00:00
steve 11b0cc5bf3 More thorough check that NetEvWait is asynchronous. 2003-12-20 00:33:39 +00:00
steve 5b0c7be6b7 Add ANSI style parameter port declarations. 2003-12-19 05:15:04 +00:00
steve 59ac435c71 Fix various unsigned compare warnings. 2003-12-19 01:27:10 +00:00
steve 57c3e86084 Debug dumps for synth2. 2003-12-17 16:52:39 +00:00
steve f0e0377a20 Add acc_set_scope function. 2003-12-17 15:45:07 +00:00
steve ae3198b505 Install target gets vvp.conf that is built, not from srcdir. 2003-12-12 19:58:40 +00:00
steve d4525ddc16 Some systems dlsym requires leading _ or not on whim. 2003-12-12 05:43:08 +00:00
steve 19e8a92729 Fix make check to support -tconf configuration method. 2003-12-12 04:36:48 +00:00
steve 1bd1d287e4 tfname can be constant. 2003-12-07 20:06:24 +00:00
steve 4c8c14ceec Ducument lxt2 access. 2003-12-07 20:05:56 +00:00
steve df968687e4 Generate VVP_EXECUTABLE flag in conf files. 2003-12-07 19:28:43 +00:00
43 changed files with 505 additions and 333 deletions
+2 -2
View File
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.160 2003/11/26 01:36:55 steve Exp $"
#ident "$Id: Makefile.in,v 1.161 2003/12/12 04:36:48 steve Exp $"
#
#
SHELL = /bin/sh
@@ -95,7 +95,7 @@ endif
# sure the basics were compiled properly.
check: all
for dir in $(SUBDIRS); do (cd $$dir ; $(MAKE) check); done
driver/iverilog -Ccheck.conf -ocheck.vvp -tvvp-check -B./ivlpp $(srcdir)/examples/hello.vl
driver/iverilog -B. -BPivlpp -tcheck -ocheck.vvp $(srcdir)/examples/hello.vl
vvp/vvp -M- -M./vpi ./check.vvp | grep 'Hello, World'
clean:
+7 -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: acc_user.h,v 1.19 2003/10/10 02:57:45 steve Exp $"
#ident "$Id: acc_user.h,v 1.20 2003/12/17 15:45:07 steve Exp $"
#endif
/*
@@ -195,6 +195,7 @@ extern void acc_close(void);
* codes that are accepted.
*/
extern int acc_configure(PLI_INT32 config_param, const char*value);
#define accEnableArgs 6
#define accDevelopmentVersion 11
extern int acc_fetch_argc(void);
@@ -258,6 +259,8 @@ extern int acc_object_of_type(handle object, PLI_INT32 type);
extern char*acc_product_version(void);
extern char*acc_set_scope(handle ref, ...);
extern int acc_set_value(handle obj, p_setval_value value,
p_setval_delay delay);
@@ -272,6 +275,9 @@ EXTERN_C_END
/*
* $Log: acc_user.h,v $
* Revision 1.20 2003/12/17 15:45:07 steve
* Add acc_set_scope function.
*
* Revision 1.19 2003/10/10 02:57:45 steve
* Some PLI1 stubs.
*
Vendored
+2 -2
View File
@@ -14,7 +14,7 @@
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 $"
#ident "$Id: aclocal.m4,v 1.2 2004/01/15 06:05:20 steve Exp $"
],[while (0) {}],
[AS_VAR_SET(ax_cv_cpp_ident, yes)],
[AS_VAR_SET(ax_cv_cpp_ident, no)])])
@@ -47,7 +47,7 @@ AC_DEFUN([AX_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
if test $ax_cv_c_underscores_leading = yes -a "$CYGWIN" != "yes" -a "$MINGW32" != "yes"; then
AC_DEFINE(NEED_LU)
fi
])# AX_C_UNDERSCORES_LEADING
+20 -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: async.cc,v 1.5 2003/09/04 20:28:05 steve Exp $"
#ident "$Id: async.cc,v 1.7 2004/01/18 23:26:54 steve Exp $"
#endif
# include "config.h"
@@ -36,6 +36,16 @@ bool NetCondit::is_asynchronous()
return false;
}
/*
* NetEvWait statements come from statements of the form @(...) in the
* Verilog source. These event waits are considered asynchronous if
* all of the events in the list are ANYEDGE, and all the inputs to
* the statement are included in the sensitivity list. If any of the
* events are posedge or negedge, the statement is synchronous
* (i.e. an edge-triggered flip-flop) and if any of the inputs are
* unaccounted for in the sensitivity list then the statement is a
* latch.
*/
bool NetEvWait::is_asynchronous()
{
/* The "sense" set contains the set of Nexa that are in the
@@ -64,6 +74,9 @@ bool NetEvWait::is_asynchronous()
delete sense;
delete inputs;
/* If it passes all the other tests, then this statement is
asynchronous. */
return true;
}
@@ -82,6 +95,12 @@ bool NetProcTop::is_asynchronous()
/*
* $Log: async.cc,v $
* Revision 1.7 2004/01/18 23:26:54 steve
* The is_combinational function really need not recurse.
*
* Revision 1.6 2003/12/20 00:33:39 steve
* More thorough check that NetEvWait is asynchronous.
*
* Revision 1.5 2003/09/04 20:28:05 steve
* Support time0 resolution of combinational threads.
*
+1 -1
View File
@@ -12,7 +12,7 @@ autoconf
for dir in vpip vvp tgt-vvp tgt-fpga libveriuser cadpli
do
echo "Autoconf in $dir..."
( cd ./$dir ; autoconf )
( cd ./$dir ; autoconf --include=.. )
done
echo "Precompiling lexor_keyword.gperf"
+3 -70
View File
@@ -133,81 +133,14 @@ AC_MSG_RESULT($EXTRALIBS)
## in order to know the name of the start symbol for the .vpi module.
#######################
AC_CYGWIN
AC_EXEEXT
AC_MINGW32
WIN32=no
AC_MSG_CHECKING("Checking for windows")
if test "$CYGWIN" = "yes" -o "$MINGW32" = "yes"
then
WIN32=yes
fi
AC_SUBST(WIN32)
AC_MSG_RESULT($WIN32)
AC_SUBST(EXEEXT)
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
*-*-cygwin*)
ident_support=
;;
*-*-darwin*)
ident_support=
;;
*-*-machten*)
ident_support=
;;
esac
AC_SUBST(ident_support)
AC_MSG_RESULT($ident_support)
AX_CPP_IDENT
# where to put vpi subdirectories
AC_MSG_CHECKING(for VPI subdirectories)
+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: ivl_dlfcn.h,v 1.1 2003/02/17 00:01:25 steve Exp $"
#ident "$Id: ivl_dlfcn.h,v 1.2 2003/12/12 05:43:08 steve Exp $"
#endif
#if defined(__MINGW32__)
@@ -65,7 +65,13 @@ inline ivl_dll_t ivl_dlopen(const char*name)
{ return dlopen(name,RTLD_LAZY); }
inline void* ivl_dlsym(ivl_dll_t dll, const char*nm)
{ return dlsym(dll, nm); }
{
void*sym = dlsym(dll, nm);
/* Not found? try without the leading _ */
if (sym == 0 && nm[0] == '_')
sym = dlsym(dll, nm+1);
return sym;
}
inline void ivl_dlclose(ivl_dll_t dll)
{ dlclose(dll); }
@@ -90,6 +96,9 @@ inline const char*dlerror(void)
/*
* $Log: ivl_dlfcn.h,v $
* Revision 1.2 2003/12/12 05:43:08 steve
* Some systems dlsym requires leading _ or not on whim.
*
* Revision 1.1 2003/02/17 00:01:25 steve
* Use a variant of ivl_dlfcn to do dynamic loading
* from within the cadpli module.
+4 -6
View File
@@ -1,6 +1,4 @@
# The make check target uses this to check the compilation of the
# compiler.
[-tvvp-check]
<ivl>./ivl %[N-N%N] -C%C -tdll -fDLL=./tgt-vvp/vvp.tgt -Fcprop -Fnodangle -fVPI_MODULE_PATH=vpi %f %m -- -
functor:cprop
functor:nodangle
-t:dll
flag:DLL=tgt-vvp/vvp.tgt
+7 -3
View File
@@ -10,9 +10,13 @@ AC_CHECK_TOOL(STRIP, strip, true)
AC_CHECK_PROGS(XGPERF,gperf,none)
if test "$XGPERF" = "none"
then
echo "*** Error: No suitable gperf found. ***"
echo " Please install the 'gperf' package."
exit 1
echo ""
echo "*** Warning: No suitable gperf found. ***"
echo " The gperf package is essential for building ivl from"
echo " CVS sources, or modifying the parse engine of ivl itself."
echo " You can get away without it when simply building from"
echo " snapshots or major releases."
echo ""
fi
AC_CHECK_PROGS(LEX,flex,none)
+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: design_dump.cc,v 1.144 2003/07/26 03:34:42 steve Exp $"
#ident "$Id: design_dump.cc,v 1.145 2003/12/17 16:52:39 steve Exp $"
#endif
# include "config.h"
@@ -495,6 +495,15 @@ void NetAssignNB::dump(ostream&o, unsigned ind) const
}
void NetAssignBase::dump(ostream&o, unsigned ind) const
{
if (const NetAssignNB *n1 = dynamic_cast<const NetAssignNB*>(this)) {
n1->dump(o,ind);
} else if (const NetAssign *n2 = dynamic_cast<const NetAssign*>(this)) {
n2->dump(o,ind);
}
}
/* Dump a block statement */
void NetBlock::dump(ostream&o, unsigned ind) const
{
@@ -1068,6 +1077,9 @@ void Design::dump(ostream&o) const
/*
* $Log: design_dump.cc,v $
* Revision 1.145 2003/12/17 16:52:39 steve
* Debug dumps for synth2.
*
* Revision 1.144 2003/07/26 03:34:42 steve
* Start handling pad of expressions in code generators.
*
+15 -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: main.c,v 1.61 2003/11/18 06:31:46 steve Exp $"
#ident "$Id: main.c,v 1.62 2003/12/12 04:36:48 steve Exp $"
#endif
# include "config.h"
@@ -99,6 +99,7 @@ const char sep = '/';
extern void cfreset(FILE*fd, const char*path);
const char*base = 0;
const char*pbase = 0;
const char*mtm = 0;
const char*opath = "a.out";
const char*npath = 0;
@@ -477,7 +478,11 @@ int main(int argc, char **argv)
switch (opt) {
case 'B':
base = optarg;
if (optarg[0] == 'P') {
pbase = optarg+1;
} else {
base=optarg;
}
break;
case 'c':
command_filename = malloc(strlen(optarg)+1);
@@ -567,6 +572,9 @@ int main(int argc, char **argv)
}
}
if (pbase == 0)
pbase = base;
if (version_flag || verbose_flag) {
printf("Icarus Verilog version " VERSION " ($Name: $)\n");
printf("Copyright 1998-2003 Stephen Williams\n");
@@ -624,7 +632,7 @@ int main(int argc, char **argv)
/* Start building the preprocess command line. */
sprintf(tmp, "%s%civlpp %s%s -D__ICARUS__=1 -f%s ", base,sep,
sprintf(tmp, "%s%civlpp %s%s -D__ICARUS__=1 -f%s ", pbase,sep,
verbose_flag?" -v":"",
e_flag?"":" -L", source_path);
@@ -689,7 +697,7 @@ int main(int argc, char **argv)
single file. This may be used to preprocess library
files. */
fprintf(iconfig_file, "ivlpp:%s%civlpp -D__ICARUS__ -L %s %s\n",
base, sep,
pbase, sep,
inc_list? inc_list : "",
def_list? def_list : "");
@@ -703,6 +711,9 @@ int main(int argc, char **argv)
/*
* $Log: main.c,v $
* Revision 1.62 2003/12/12 04:36:48 steve
* Fix make check to support -tconf configuration method.
*
* Revision 1.61 2003/11/18 06:31:46 steve
* Remove the iverilog.conf file.
*
+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: substit.c,v 1.4 2002/08/12 01:35:01 steve Exp $"
#ident "$Id: substit.c,v 1.5 2003/12/19 01:27:10 steve Exp $"
#endif
# include <string.h>
@@ -66,7 +66,7 @@ char* substitutions(const char*str)
cp += strlen(cp);
} else {
if ( (cp - buf) == nbuf ) {
if ( cp == (buf + nbuf) ) {
size_t old_size = nbuf;
nbuf = old_size + 32;
buf = realloc(buf, nbuf);
@@ -79,7 +79,7 @@ char* substitutions(const char*str)
/* Add the trailing nul to the string, and reallocate the
buffer to be a tight fit. */
if ( (cp - buf) == nbuf ) {
if ( cp == (buf + nbuf) ) {
size_t old_size = nbuf;
nbuf = old_size + 1;
buf = realloc(buf, nbuf);
@@ -96,6 +96,9 @@ char* substitutions(const char*str)
/*
* $Log: substit.c,v $
* Revision 1.5 2003/12/19 01:27:10 steve
* Fix various unsigned compare warnings.
*
* Revision 1.4 2002/08/12 01:35:01 steve
* conditional ident string using autoconfig.
*
+20 -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.293 2003/10/26 04:49:51 steve Exp $"
#ident "$Id: elaborate.cc,v 1.294 2004/01/13 03:42:49 steve Exp $"
#endif
# include "config.h"
@@ -1962,6 +1962,22 @@ NetProc* PEventStatement::elaborate_wait(Design*des, NetScope*scope,
return 0;
}
// If the condition expression is more then 1 bits, then
// generate a comparison operator to get the result down to
// one bit. Turn <e> into |<e>;
if (expr->expr_width() < 1) {
cerr << get_line() << ": internal error: "
"incomprehensible wait expression width (0)." << endl;
return 0;
}
if (expr->expr_width() > 1) {
assert(expr->expr_width() > 1);
NetEUReduce*cmp = new NetEUReduce('|', expr);
expr = cmp;
}
assert(expr->expr_width() == 1);
expr = new NetEBComp('N', expr, new NetEConst(verinum(verinum::V1)));
NetExpr*tmp = expr->eval_tree();
@@ -2612,6 +2628,9 @@ Design* elaborate(list<const char*>roots)
/*
* $Log: elaborate.cc,v $
* Revision 1.294 2004/01/13 03:42:49 steve
* Handle wide expressions in wait condition.
*
* Revision 1.293 2003/10/26 04:49:51 steve
* Attach line number information to for loop parts.
*
+2 -4
View File
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.31 2003/10/10 02:57:45 steve Exp $"
#ident "$Id: Makefile.in,v 1.32 2004/01/15 20:52:32 steve Exp $"
#
#
SHELL = /bin/sh
@@ -34,13 +34,11 @@ libdir64 = @libdir64@
includedir = $(prefix)/include
CC = @CC@ -I. -I.. -I$(srcdir) -I$(srcdir)/..
CXX = @CXX@ -I. -I.. -I$(srcdir) -I$(srcdir)/..
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
CPPFLAGS = @CPPFLAGS@ @DEFS@ @PICFLAG@
CXXFLAGS = @CXXFLAGS@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
STRIP = @STRIP@
@@ -86,7 +84,7 @@ dep:
mkdir dep
%.o: %.c
$(CC) -Wall $(CPPFLAGS) $(CFLAGS) -MD -c $< -o $*.o
$(CC) -Wall @ident_support@ $(CPPFLAGS) $(CFLAGS) -MD -c $< -o $*.o
mv $*.d dep
+31 -1
View File
@@ -17,12 +17,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: a_configure.c,v 1.3 2003/06/17 16:55:07 steve Exp $"
#ident "$Id: a_configure.c,v 1.4 2003/12/17 15:45:07 steve Exp $"
#endif
#include <acc_user.h>
#include <vpi_user.h>
#include "priv.h"
#include <string.h>
int acc_configure(PLI_INT32 config_param, const char*value)
{
@@ -39,6 +40,32 @@ int acc_configure(PLI_INT32 config_param, const char*value)
}
break;
case accEnableArgs:
if (pli_trace) {
fprintf(pli_trace, "acc_configure(accEnableArgs, %s)\n",
value);
}
rc = 1;
if (strcmp(value,"acc_set_scope") == 0) {
vpi_printf("XXXX acc_configure argument: Sorry: "
"(accEnableArgs, %s\n", value);
rc = 0;
} else if (strcmp(value,"no_acc_set_scope") == 0) {
vpi_printf("XXXX acc_configure argument: Sorry: "
"(accEnableArgs, %s\n", value);
rc = 0;
} else {
vpi_printf("XXXX acc_configure argument error. "
"(accEnableArgs, %s(invalid)\n", value);
rc = 0;
}
break;
default:
if (pli_trace) {
@@ -56,6 +83,9 @@ int acc_configure(PLI_INT32 config_param, const char*value)
/*
* $Log: a_configure.c,v $
* Revision 1.4 2003/12/17 15:45:07 steve
* Add acc_set_scope function.
*
* Revision 1.3 2003/06/17 16:55:07 steve
* 1) setlinebuf() for vpi_trace
* 2) Addes error checks for trace file opens
+26 -3
View File
@@ -17,24 +17,47 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: a_handle_object.c,v 1.1 2003/03/13 04:35:09 steve Exp $"
#ident "$Id: a_handle_object.c,v 1.2 2003/12/17 15:45:07 steve Exp $"
#endif
#include <vpi_user.h>
#include <acc_user.h>
#include "priv.h"
static vpiHandle search_scope = 0;
handle acc_handle_object(const char*name)
{
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
vpiHandle scope = vpi_handle(vpiScope, sys);
vpiHandle scope = search_scope? search_scope : vpi_handle(vpiScope, sys);
vpiHandle res = vpi_handle_by_name(name, scope);
if (pli_trace) {
fprintf(pli_trace, "acc_handle_object(%s <scope=%s>) --> .\n",
name, acc_fetch_fullname(scope));
}
return res;
}
char* acc_set_scope(handle ref, ...)
{
char*name;
search_scope = ref;
name = acc_fetch_fullname(search_scope);
if (pli_trace) {
fprintf(pli_trace, "acc_set_scope(<scope=%s>)\n", name);
}
return acc_fetch_fullname(ref);
}
/*
* $Log: a_handle_object.c,v $
* Revision 1.2 2003/12/17 15:45:07 steve
* Add acc_set_scope function.
*
* Revision 1.1 2003/03/13 04:35:09 steve
* Add a bunch of new acc_ and tf_ functions.
*
+1
View File
@@ -7,6 +7,7 @@ AC_PROG_RANLIB
AC_CYGWIN
AC_EXEEXT
AX_CPP_IDENT
# vvp32 is by default disabled
#enable_vvp32=no
+19 -9
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.7 2003/10/26 04:51:39 steve Exp $"
#ident "$Id: net_nex_output.cc,v 1.8 2003/12/20 00:59:31 steve Exp $"
#endif
# include "config.h"
@@ -38,15 +38,22 @@ void NetProc::nex_output(NexusSet&out)
void NetAssignBase::nex_output(NexusSet&out)
{
NetNet*lsig = lval_->sig();
assert(lsig);
assert(lval_->more == 0);
for (unsigned idx = 0 ; idx < lval_->lwidth() ; idx += 1) {
unsigned off = lval_->get_loff() + idx;
out.add(lsig->pin(off).nexus());
if (NetNet*lsig = lval_->sig()) {
assert(lval_->more == 0);
for (unsigned idx = 0 ; idx < lval_->lwidth() ; idx += 1) {
unsigned off = lval_->get_loff() + idx;
out.add(lsig->pin(off).nexus());
}
} else {
/* Quoting from netlist.h comments for class NetMemory:
* "This is not a node because memory objects can only be
* accessed by behavioral code."
*/
cerr << get_line() << ": internal error: "
<< "NetAssignBase::nex_output on unsupported lval ";
dump_lval(cerr);
cerr << endl;
}
}
void NetBlock::nex_output(NexusSet&out)
@@ -93,6 +100,9 @@ void NetWhile::nex_output(NexusSet&out)
/*
* $Log: net_nex_output.cc,v $
* Revision 1.8 2003/12/20 00:59:31 steve
* Synthesis debug messages.
*
* Revision 1.7 2003/10/26 04:51:39 steve
* Output of While is output of while substatement.
*
+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: netlist.h,v 1.306 2003/11/10 20:59:03 steve Exp $"
#ident "$Id: netlist.h,v 1.307 2003/12/17 16:52:39 steve Exp $"
#endif
/*
@@ -1463,6 +1463,7 @@ class NetAssignBase : public NetProc {
// This dumps all the lval structures.
void dump_lval(ostream&) const;
virtual void dump(ostream&, unsigned ind) const;
private:
NetAssign_*lval_;
@@ -3310,6 +3311,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
/*
* $Log: netlist.h,v $
* Revision 1.307 2003/12/17 16:52:39 steve
* Debug dumps for synth2.
*
* Revision 1.306 2003/11/10 20:59:03 steve
* Design::get_flag returns const char* instead of string.
*
+40 -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: nodangle.cc,v 1.19 2003/06/25 04:46:03 steve Exp $"
#ident "$Id: nodangle.cc,v 1.20 2004/01/15 06:04:19 steve Exp $"
#endif
# include "config.h"
@@ -52,6 +52,42 @@ void nodangle_f::event(Design*des, NetEvent*ev)
return;
}
/* Try to remove duplicate probes from the event. */
for (unsigned idx = 0 ; idx < ev->nprobe() ; idx += 1) {
unsigned jdx = idx + 1;
while (jdx < ev->nprobe()) {
NetEvProbe*ip = ev->probe(idx);
NetEvProbe*jp = ev->probe(jdx);
if (ip->edge() != jp->edge()) {
jdx += 1;
continue;
}
bool fully_connected = true;
for (unsigned jpin = 0; jpin < jp->pin_count(); jpin += 1) {
unsigned ipin = 0;
bool connected_flag = false;
for (ipin = 0 ; ipin < ip->pin_count(); ipin += 1)
if (connected(ip->pin(ipin), jp->pin(jpin))) {
connected_flag = true;
break;
}
if (!connected_flag) {
fully_connected = false;
break;
}
}
if (fully_connected) {
delete jp;
} else {
jdx += 1;
}
}
}
/* Try to find all the events that are similar to me, and
replace their references with references to me. */
list<NetEvent*> match;
@@ -169,6 +205,9 @@ void nodangle(Design*des)
/*
* $Log: nodangle.cc,v $
* Revision 1.20 2004/01/15 06:04:19 steve
* Remove duplicate NetEvProbe objects in nodangle.
*
* Revision 1.19 2003/06/25 04:46:03 steve
* Do not elide ports of cells.
*
+24 -9
View File
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: parse.y,v 1.185 2003/09/21 21:16:05 steve Exp $"
#ident "$Id: parse.y,v 1.187 2004/01/13 02:55:50 steve Exp $"
#endif
# include "config.h"
@@ -53,12 +53,12 @@ static struct {
YYLLOC_DEFAULT macro that makes up a yylloc value from existing
values. I need to supply an explicit version to account for the
text field, that otherwise won't be copied. */
# define YYLLOC_DEFAULT(Current, Rhs, N) \
Current.first_line = Rhs[1].first_line; \
Current.first_column = Rhs[1].first_column; \
Current.last_line = Rhs[N].last_line; \
Current.last_column = Rhs[N].last_column; \
Current.text = Rhs[1].text;
# define YYLLOC_DEFAULT(Current, Rhs, N) do { \
(Current).first_line = (Rhs)[1].first_line; \
(Current).first_column = (Rhs)[1].first_column; \
(Current).last_line = (Rhs)[N].last_line; \
(Current).last_column = (Rhs)[N].last_column; \
(Current).text = (Rhs)[1].text; } while (0)
/*
* These are some common strength pairs that are used as defaults when
@@ -227,10 +227,11 @@ const static struct str_pair_t str_strength = { PGate::STRONG, PGate::STRONG };
%left '*' '/' '%'
%left UNARY_PREC
/* to resolve dangling else ambiguity: */
/* to resolve dangling else ambiguity. */
%nonassoc less_than_K_else
%nonassoc K_else
%%
/* A degenerate source file can be completely empty. */
@@ -1429,8 +1430,9 @@ assign_list
module : attribute_list_opt module_start IDENTIFIER
{ pform_startmodule($3, @2.text, @2.first_line, $1); }
module_parameter_port_list_opt
list_of_ports_opt ';'
{ pform_module_set_ports($5); }
{ pform_module_set_ports($6); }
module_item_list_opt
K_endmodule
{ pform_endmodule($3);
@@ -1445,6 +1447,19 @@ range_delay : range_opt delay3_opt
{ $$.range = $1; $$.delay = $2; }
;
/* Module declarations include optional ANSII style module parameter
ports. These are simply advance ways to declare parameters, so
that the port declarations may use them. */
module_parameter_port_list_opt
:
| '#' '(' module_parameter_port_list ')'
;
module_parameter_port_list
: K_parameter parameter_assign
| module_parameter_port_list ',' parameter_assign
| module_parameter_port_list ',' K_parameter parameter_assign
;
module_item
: attribute_list_opt net_type signed_opt range_delay list_of_identifiers ';'
+5 -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: syn-rules.y,v 1.27 2003/08/26 16:26:02 steve Exp $"
#ident "$Id: syn-rules.y,v 1.28 2003/12/20 00:59:31 steve Exp $"
#endif
# include "config.h"
@@ -146,7 +146,7 @@ static void hookup_RAMDQ(NetRamDq*ram, NetESignal*d, NetNet*adr,
connect(ram->pin_Data(idx), d->bit(idx+rval_pinoffset));
}
/* Connect the Address pins from the adr net discovered by the
/* Connect the Address pins from the addr net discovered by the
caller. */
for (unsigned idx = 0 ; idx < ram->awidth() ; idx += 1) {
connect(ram->pin_Address(idx), adr->pin(idx));
@@ -155,8 +155,9 @@ static void hookup_RAMDQ(NetRamDq*ram, NetESignal*d, NetNet*adr,
/* Connect the input clock and the WE of the RAM. */
assert(pclk);
connect(ram->pin_InClock(), pclk->pin(0));
assert(ce);
connect(ram->pin_WE(), ce->pin(0));
if (ce) {
connect(ram->pin_WE(), ce->pin(0));
} /* XXX does ram CE default to true if not connected? */
/* This notices any other NetRamDq objects connected to the
same NetMemory, that have the same address pins and are
+125 -43
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.32 2003/10/27 02:18:04 steve Exp $"
#ident "$Id: synth2.cc,v 1.34 2003/12/20 00:59:31 steve Exp $"
#endif
# include "config.h"
@@ -27,6 +27,12 @@
# include "compiler.h"
# include <assert.h>
static int debug_synth2=0;
#define DEBUG_SYNTH2_ENTRY(class) if (debug_synth2) { cerr << "Enter " << class << "::" \
<< __FUNCTION__ << endl; dump(cerr, 4); }
#define DEBUG_SYNTH2_EXIT(class,val) if (debug_synth2) { cerr << "Exit " << class << "::" \
<< __FUNCTION__ << ", result " << val << endl; }
bool NetProc::synth_async(Design*des, NetScope*scope,
const NetNet*nex_map, NetNet*nex_out)
{
@@ -37,6 +43,8 @@ bool NetProc::synth_sync(Design*des, NetScope*scope, NetFF*ff,
const NetNet*nex_map, NetNet*nex_out,
const svector<NetEvProbe*>&events)
{
DEBUG_SYNTH2_ENTRY("NetProc")
if (events.count() > 0) {
cerr << get_line() << ": error: Events are unaccounted"
<< " for in process synthesis." << endl;
@@ -70,14 +78,27 @@ static unsigned find_nexus_in_set(const NetNet*nset, const Nexus*nex)
bool NetAssignBase::synth_async(Design*des, NetScope*scope,
const NetNet*nex_map, NetNet*nex_out)
{
DEBUG_SYNTH2_ENTRY("NetAssignBase")
NetNet*rsig = rval_->synthesize(des);
assert(rsig);
NetNet*lsig = lval_->sig();
assert(lsig);
if (!lsig) {
cerr << get_line() << ": error: NetAssignBase::synth_async on unsupported lval ";
dump_lval(cerr);
cerr << endl;
DEBUG_SYNTH2_EXIT("NetAssignBase",false)
return false;
}
assert(lval_->more == 0);
assert(lval_->lwidth() == nex_map->pin_count());
if (lval_->lwidth() != nex_map->pin_count()) {
cerr << get_line() << ": error: NetAssignBase::synth_async pin count mismatch, "
<< lval_->lwidth() << " != " << nex_map->pin_count() << endl;
DEBUG_SYNTH2_EXIT("NetAssignBase",false)
return false;
}
assert(nex_map->pin_count() <= rsig->pin_count());
for (unsigned idx = 0 ; idx < lval_->lwidth() ; idx += 1) {
@@ -86,6 +107,7 @@ bool NetAssignBase::synth_async(Design*des, NetScope*scope,
connect(nex_out->pin(ptr), rsig->pin(idx));
}
DEBUG_SYNTH2_EXIT("NetAssignBase",true)
return true;
}
@@ -98,8 +120,11 @@ bool NetAssignBase::synth_async(Design*des, NetScope*scope,
bool NetBlock::synth_async(Design*des, NetScope*scope,
const NetNet*nex_map, NetNet*nex_out)
{
if (last_ == 0)
DEBUG_SYNTH2_ENTRY("NetBlock")
if (last_ == 0) {
DEBUG_SYNTH2_EXIT("NetBlock",true)
return true;
}
bool flag = true;
NetProc*cur = last_;
@@ -137,12 +162,14 @@ bool NetBlock::synth_async(Design*des, NetScope*scope,
} while (cur != last_);
DEBUG_SYNTH2_EXIT("NetBlock",flag)
return flag;
}
bool NetCase::synth_async(Design*des, NetScope*scope,
const NetNet*nex_map, NetNet*nex_out)
{
DEBUG_SYNTH2_ENTRY("NetCase")
unsigned cur;
NetNet*esig = expr_->synthesize(des);
@@ -226,7 +253,7 @@ bool NetCase::synth_async(Design*des, NetScope*scope,
statement_map[sel_idx] = items_[item].statement;
}
/* Now that statements matches with mux inputs, synthesize the
/* Now that statements match with mux inputs, synthesize the
sub-statements. If I get to an input that has no statement,
then use the default statement there. */
NetNet*default_sig = 0;
@@ -250,7 +277,12 @@ bool NetCase::synth_async(Design*des, NetScope*scope,
default_sig = sig;
}
assert(statement_map[item]);
if (statement_map[item] == 0) {
/* Missing case and no default; this could still be
* synthesizable with synchronous logic, but not here. */
DEBUG_SYNTH2_EXIT("NetCase", false)
return false;
}
statement_map[item]->synth_async(des, scope, nex_map, sig);
for (unsigned idx = 0 ; idx < mux->width() ; idx += 1)
@@ -260,20 +292,25 @@ bool NetCase::synth_async(Design*des, NetScope*scope,
delete[]statement_map;
des->add_node(mux);
DEBUG_SYNTH2_EXIT("NetCase", true)
return true;
}
bool NetCondit::synth_async(Design*des, NetScope*scope,
const NetNet*nex_map, NetNet*nex_out)
{
DEBUG_SYNTH2_ENTRY("NetCondit")
NetNet*ssig = expr_->synthesize(des);
assert(ssig);
if (if_ == 0)
if (if_ == 0) {
DEBUG_SYNTH2_EXIT("NetCondit",false)
return false;
}
if (else_ == 0) {
cerr << get_line() << ": error: Asynchronous if statement"
<< " is missing the else clause." << endl;
DEBUG_SYNTH2_EXIT("NetCondit",false)
return false;
}
@@ -284,13 +321,25 @@ bool NetCondit::synth_async(Design*des, NetScope*scope,
NetNet::WIRE, nex_map->pin_count());
asig->local_flag(true);
if_->synth_async(des, scope, nex_map, asig);
bool flag;
flag = if_->synth_async(des, scope, nex_map, asig);
if (!flag) {
delete asig;
DEBUG_SYNTH2_EXIT("NetCondit",false)
return false;
}
NetNet*bsig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, nex_map->pin_count());
bsig->local_flag(true);
else_->synth_async(des, scope, nex_map, bsig);
flag = else_->synth_async(des, scope, nex_map, bsig);
if (!flag) {
delete asig;
delete bsig;
DEBUG_SYNTH2_EXIT("NetCondit",false)
return false;
}
NetMux*mux = new NetMux(scope, scope->local_symbol(),
nex_out->pin_count(), 2, 1);
@@ -308,17 +357,22 @@ bool NetCondit::synth_async(Design*des, NetScope*scope,
des->add_node(mux);
DEBUG_SYNTH2_EXIT("NetCondit",true)
return true;
}
bool NetEvWait::synth_async(Design*des, NetScope*scope,
const NetNet*nex_map, NetNet*nex_out)
{
return statement_->synth_async(des, scope, nex_map, nex_out);
DEBUG_SYNTH2_ENTRY("NetEvWait")
bool flag = statement_->synth_async(des, scope, nex_map, nex_out);
DEBUG_SYNTH2_EXIT("NetEvWait",flag)
return flag;
}
bool NetProcTop::synth_async(Design*des)
{
DEBUG_SYNTH2_ENTRY("NetProcTop")
NexusSet nex_set;
statement_->nex_output(nex_set);
@@ -330,6 +384,7 @@ bool NetProcTop::synth_async(Design*des)
bool flag = statement_->synth_async(des, scope(), nex_out, nex_out);
delete nex_out;
DEBUG_SYNTH2_EXIT("NetProcTop",flag)
return flag;
}
@@ -351,8 +406,11 @@ bool NetBlock::synth_sync(Design*des, NetScope*scope, NetFF*ff,
const NetNet*nex_map, NetNet*nex_out,
const svector<NetEvProbe*>&events_in)
{
if (last_ == 0)
DEBUG_SYNTH2_ENTRY("NetBlock")
if (last_ == 0) {
DEBUG_SYNTH2_EXIT("NetBlock",true)
return true;
}
bool flag = true;
@@ -492,6 +550,7 @@ bool NetBlock::synth_sync(Design*des, NetScope*scope, NetFF*ff,
taken up by the smaller NetFF devices. */
delete ff;
DEBUG_SYNTH2_EXIT("NetBlock",flag)
return flag;
}
@@ -505,6 +564,7 @@ bool NetCondit::synth_sync(Design*des, NetScope*scope, NetFF*ff,
const NetNet*nex_map, NetNet*nex_out,
const svector<NetEvProbe*>&events_in)
{
DEBUG_SYNTH2_ENTRY("NetCondit")
/* First try to turn the condition expression into an
asynchronous set/reset. If the condition expression has
inputs that are included in the sensitivity list, then it
@@ -570,9 +630,11 @@ bool NetCondit::synth_sync(Design*des, NetScope*scope, NetFF*ff,
assert(events_in.count() == 1);
assert(else_ != 0);
return else_->synth_sync(des, scope, ff, nex_map,
flag = else_->synth_sync(des, scope, ff, nex_map,
nex_out, svector<NetEvProbe*>(0))
&& flag;
DEBUG_SYNTH2_EXIT("NetCondit",flag)
return flag;
}
delete expr_input;
@@ -601,34 +663,41 @@ bool NetCondit::synth_sync(Design*des, NetScope*scope, NetFF*ff,
asig->local_flag(true);
bool flag = if_->synth_async(des, scope, nex_map, asig);
assert(asig->pin_count() == ff->width());
/* Collect the set/reset value into a verinum. If
this turns out to be entirely 0 values, then
use the Sclr input. Otherwise, use the Aset
input and save the set value. */
verinum tmp (verinum::V0, ff->width());
for (unsigned bit = 0 ; bit < ff->width() ; bit += 1) {
assert(asig->pin(bit).nexus()->drivers_constant());
tmp.set(bit, asig->pin(bit).nexus()->driven_value());
}
assert(tmp.is_defined());
if (tmp.is_zero()) {
connect(ff->pin_Sclr(), rst->pin(0));
if (!flag) {
/* This path leads nowhere */
delete asig;
} else {
connect(ff->pin_Sset(), rst->pin(0));
ff->sset_value(tmp);
assert(asig->pin_count() == ff->width());
/* Collect the set/reset value into a verinum. If
this turns out to be entirely 0 values, then
use the Sclr input. Otherwise, use the Aset
input and save the set value. */
verinum tmp (verinum::V0, ff->width());
for (unsigned bit = 0 ; bit < ff->width() ; bit += 1) {
assert(asig->pin(bit).nexus()->drivers_constant());
tmp.set(bit, asig->pin(bit).nexus()->driven_value());
}
assert(tmp.is_defined());
if (tmp.is_zero()) {
connect(ff->pin_Sclr(), rst->pin(0));
} else {
connect(ff->pin_Sset(), rst->pin(0));
ff->sset_value(tmp);
}
delete a_set;
assert(else_ != 0);
flag = else_->synth_sync(des, scope, ff, nex_map,
nex_out, svector<NetEvProbe*>(0))
&& flag;
DEBUG_SYNTH2_EXIT("NetCondit",flag)
return flag;
}
delete a_set;
assert(else_ != 0);
return else_->synth_sync(des, scope, ff, nex_map,
nex_out, svector<NetEvProbe*>(0))
&& flag;
}
delete a_set;
@@ -645,7 +714,9 @@ bool NetCondit::synth_sync(Design*des, NetScope*scope, NetFF*ff,
/* If this is an if/then/else, then it is likely a
combinational if, and I should synthesize it that way. */
if (if_ && else_) {
return synth_async(des, scope, nex_map, nex_out);
bool flag = synth_async(des, scope, nex_map, nex_out);
DEBUG_SYNTH2_EXIT("NetCondit",flag)
return flag;
}
assert(if_);
@@ -694,16 +765,16 @@ bool NetCondit::synth_sync(Design*des, NetScope*scope, NetFF*ff,
}
bool flag = if_->synth_sync(des, scope, ff, nex_map, nex_out, events_in);
if (flag == false)
return flag;
return true;
DEBUG_SYNTH2_EXIT("NetCondit",flag)
return flag;
}
bool NetEvWait::synth_sync(Design*des, NetScope*scope, NetFF*ff,
const NetNet*nex_map, NetNet*nex_out,
const svector<NetEvProbe*>&events_in)
{
DEBUG_SYNTH2_ENTRY("NetEvWait")
if (events_in.count() > 0) {
cerr << get_line() << ": error: Events are unaccounted"
<< " for in process synthesis." << endl;
@@ -755,6 +826,7 @@ bool NetEvWait::synth_sync(Design*des, NetScope*scope, NetFF*ff,
<< " are valid clock inputs." << endl;
cerr << get_line() << ": : Perhaps the clock"
<< " is read by a statement or expression?" << endl;
DEBUG_SYNTH2_EXIT("NetEvWait",false)
return false;
}
@@ -766,11 +838,13 @@ bool NetEvWait::synth_sync(Design*des, NetScope*scope, NetFF*ff,
bool flag = statement_->synth_sync(des, scope, ff,
nex_map, nex_out, events);
DEBUG_SYNTH2_EXIT("NetEvWait",flag)
return flag;
}
bool NetProcTop::synth_sync(Design*des)
{
DEBUG_SYNTH2_ENTRY("NetProcTop")
NexusSet nex_set;
statement_->nex_output(nex_set);
@@ -805,6 +879,7 @@ bool NetProcTop::synth_sync(Design*des)
delete nex_q;
DEBUG_SYNTH2_EXIT("NetProcTop",flag)
return flag;
}
@@ -880,12 +955,19 @@ void synth2_f::process(class Design*des, class NetProcTop*top)
void synth2(Design*des)
{
debug_synth2 = atoi(des->get_flag("ivl-synth2-debug"));
synth2_f synth_obj;
des->functor(&synth_obj);
}
/*
* $Log: synth2.cc,v $
* Revision 1.34 2003/12/20 00:59:31 steve
* Synthesis debug messages.
*
* Revision 1.33 2003/12/17 16:52:39 steve
* Debug dumps for synth2.
*
* Revision 1.32 2003/10/27 02:18:04 steve
* Handle special case of FF with enable and constant data.
*
+6 -2
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.61 2003/12/03 02:46:24 steve Exp $"
#ident "$Id: t-dll-proc.cc,v 1.62 2003/12/19 01:27:10 steve Exp $"
#endif
# include "config.h"
@@ -747,7 +747,7 @@ bool dll_target::proc_wait(const NetEvWait*net)
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;
ivl_event_t ev_tmp=0;
for (unsigned idx = 0 ; idx < ev_scope->nevent_ ; idx += 1) {
const char*ename = ivl_event_basename(ev_scope->event_[idx]);
@@ -756,6 +756,7 @@ bool dll_target::proc_wait(const NetEvWait*net)
break;
}
}
// XXX should we assert(ev_tmp)?
if (net->nevents() == 1)
stmt_cur_->u_.wait_.event = ev_tmp;
@@ -842,6 +843,9 @@ void dll_target::proc_while(const NetWhile*net)
/*
* $Log: t-dll-proc.cc,v $
* Revision 1.62 2003/12/19 01:27:10 steve
* Fix various unsigned compare warnings.
*
* Revision 1.61 2003/12/03 02:46:24 steve
* Add support for wait on list of named events.
*
+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: t-dll.cc,v 1.124 2003/11/26 01:37:38 steve Exp $"
#ident "$Id: t-dll.cc,v 1.125 2003/12/12 05:43:08 steve Exp $"
#endif
# include "config.h"
@@ -73,7 +73,13 @@ inline ivl_dll_t ivl_dlopen(const char*name)
{ return dlopen(name,RTLD_LAZY); }
inline void* ivl_dlsym(ivl_dll_t dll, const char*nm)
{ return dlsym(dll, nm); }
{
void*sym = dlsym(dll, nm);
/* Not found? try without the leading _ */
if (sym == 0 && nm[0] == '_')
sym = dlsym(dll, nm+1);
return sym;
}
inline void ivl_dlclose(ivl_dll_t dll)
{ dlclose(dll); }
@@ -2170,6 +2176,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/*
* $Log: t-dll.cc,v $
* Revision 1.125 2003/12/12 05:43:08 steve
* Some systems dlsym requires leading _ or not on whim.
*
* Revision 1.124 2003/11/26 01:37:38 steve
* Warning about sprintf.
*
+1 -21
View File
@@ -75,26 +75,6 @@ esac
AC_SUBST(WIN32)
AC_MSG_RESULT($WIN32)
AC_MSG_CHECKING("for ident support in C compiler")
ident_support='-DHAVE_CVS_IDENT=1'
case "${host}" in
*-*-cygwin*)
ident_support=
;;
*-*-darwin*)
ident_support=
;;
*-*-machten*)
ident_support=
;;
esac
AC_SUBST(ident_support)
AC_MSG_RESULT($ident_support)
AX_CPP_IDENT
AC_OUTPUT(Makefile)
+12 -6
View File
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.16 2003/11/01 04:22:51 steve Exp $"
#ident "$Id: Makefile.in,v 1.18 2003/12/12 19:58:40 steve Exp $"
#
#
SHELL = /bin/sh
@@ -43,7 +43,7 @@ CXXFLAGS = @CXXFLAGS@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
all: dep vvp.tgt
all: dep vvp.tgt vvp.conf vvp-s.conf
dep:
mkdir dep
@@ -67,6 +67,12 @@ endif
vvp.tgt: $O $(TGTDEPLIBS)
$(CC) @shared@ -o $@ $O $(TGTLDFLAGS)
vvp.conf: $(srcdir)/vvp.conf.in
echo 'flag:VVP_EXECUTABLE=$(bindir)/vvp' | cat $(srcdir)/vvp.conf.in - > vvp.conf
vvp-s.conf: $(srcdir)/vvp-s.conf.in
echo 'flag:VVP_EXECUTABLE=$(bindir)/vvp' | cat $(srcdir)/vvp-s.conf.in - > vvp-s.conf
Makefile: Makefile.in config.status
./config.status
@@ -83,11 +89,11 @@ install: all installdirs $(libdir)/ivl/vvp.tgt $(libdir)/ivl/vvp.conf $(libdir)/
$(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.conf: vvp.conf
$(INSTALL_DATA) $< $(libdir)/ivl/vvp.conf
$(libdir)/ivl/vvp-s.conf: $(srcdir)/vvp-s.conf
$(INSTALL_DATA) $(srcdir)/vvp-s.conf $(libdir)/ivl/vvp-s.conf
$(libdir)/ivl/vvp-s.conf: vvp-s.conf
$(INSTALL_DATA) $< $(libdir)/ivl/vvp-s.conf
installdirs: ../mkinstalldirs
+1 -21
View File
@@ -82,26 +82,6 @@ esac
AC_SUBST(WIN32)
AC_MSG_RESULT($WIN32)
AC_MSG_CHECKING("for ident support in C compiler")
ident_support='-DHAVE_CVS_IDENT=1'
case "${host}" in
*-*-cygwin*)
ident_support=
;;
*-*-darwin*)
ident_support=
;;
*-*-machten*)
ident_support=
;;
esac
AC_SUBST(ident_support)
AC_MSG_RESULT($ident_support)
AX_CPP_IDENT
AC_OUTPUT(Makefile)
+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: draw_mux.c,v 1.6 2003/02/25 03:40:45 steve Exp $"
#ident "$Id: draw_mux.c,v 1.7 2003/12/19 01:27:10 steve Exp $"
#endif
# include "vvp_priv.h"
@@ -124,11 +124,11 @@ static void draw_lpm_mux_bitslice(ivl_lpm_t net, unsigned slice)
vvp_mangle_id(ivl_lpm_basename(net)), slice);
if ((2 << (sel-1))/2 < size) {
if ((2U << (sel-1))/2 < size) {
fprintf(vvp_out, "L_%s.%s/%u/2/%u, ",
vvp_mangle_id(ivl_scope_name(ivl_lpm_scope(net))),
vvp_mangle_id(ivl_lpm_basename(net)),
slice, (2 << (sel-1))/2);
slice, (2U << (sel-1))/2);
} else {
fprintf(vvp_out, "C<x>, ");
}
@@ -185,6 +185,9 @@ void draw_lpm_mux(ivl_lpm_t net)
/*
* $Log: draw_mux.c,v $
* Revision 1.7 2003/12/19 01:27:10 steve
* Fix various unsigned compare warnings.
*
* Revision 1.6 2003/02/25 03:40:45 steve
* Eliminate use of ivl_lpm_name function.
*
+5 -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: eval_real.c,v 1.9 2003/05/25 02:50:08 steve Exp $"
#ident "$Id: eval_real.c,v 1.10 2003/12/19 01:27:10 steve Exp $"
#endif
/*
@@ -103,7 +103,7 @@ static int draw_binary_real(ivl_expr_t exp)
static int draw_number_real(ivl_expr_t exp)
{
int idx;
unsigned int idx;
int res = allocate_word();
const char*bits = ivl_expr_bits(exp);
unsigned wid = ivl_expr_width(exp);
@@ -298,6 +298,9 @@ int draw_eval_real(ivl_expr_t exp)
/*
* $Log: eval_real.c,v $
* Revision 1.10 2003/12/19 01:27:10 steve
* Fix various unsigned compare warnings.
*
* Revision 1.9 2003/05/25 02:50:08 steve
* Add % in real expressions.
*
+8 -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: vvp_scope.c,v 1.97 2003/10/09 23:45:03 steve Exp $"
#ident "$Id: vvp_scope.c,v 1.98 2003/12/19 01:27:10 steve Exp $"
#endif
# include "vvp_priv.h"
@@ -55,7 +55,7 @@ const char *vvp_mangle_id(const char *id)
do {
int n = se - inp;
int nlen = strlen(id) + 4*(++nesc) + 1;
unsigned int nlen = strlen(id) + 4*(++nesc) + 1;
if (out_len < nlen) {
out = (char *) realloc(out, nlen);
assert(out);
@@ -105,7 +105,7 @@ const char *vvp_mangle_name(const char *id)
do {
int n = se - inp;
int nlen = strlen(id) + 2*(++nesc) + 1;
unsigned int nlen = strlen(id) + 2*(++nesc) + 1;
if (out_len < nlen) {
out = (char *) realloc(out, nlen);
assert(out);
@@ -502,7 +502,7 @@ const char* draw_net_input(ivl_nexus_t nex)
level = 0;
while (ndrivers) {
int inst;
unsigned int inst;
for (inst = 0; inst < ndrivers; inst += 4) {
if (ndrivers > 4)
fprintf(vvp_out, "RS_%p/%d/%d .resolv tri",
@@ -628,7 +628,7 @@ static void draw_delay(ivl_net_logic_t lptr)
static void draw_udp_def(ivl_udp_t udp)
{
unsigned init;
int i;
unsigned i;
switch (ivl_udp_init(udp))
{
@@ -1658,6 +1658,9 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent)
/*
* $Log: vvp_scope.c,v $
* Revision 1.98 2003/12/19 01:27:10 steve
* Fix various unsigned compare warnings.
*
* Revision 1.97 2003/10/09 23:45:03 steve
* Emit .event inputs before the .event statement.
*
+3 -3
View File
@@ -1,10 +1,10 @@
Summary: Icarus Verilog
Name: verilog
Version: 0.7.20031202
Version: 0.7.20040118
Release: 0
Copyright: GPL
Group: Applications/Engineering
Source: ftp://icarus.com/pub/eda/verilog/snapshots/verilog-20031202.tar.gz
Source: ftp://icarus.com/pub/eda/verilog/snapshots/verilog-20040118.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-20031202
%setup -n verilog-20040118
%build
%ifarch x86_64
+2 -2
View File
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.49 2003/10/30 03:43:19 steve Exp $"
#ident "$Id: Makefile.in,v 1.50 2004/01/15 20:52:32 steve Exp $"
#
#
SHELL = /bin/sh
@@ -61,7 +61,7 @@ dep:
mkdir dep
%.o: %.c
$(CC) -Wall -I$(srcdir)/.. -I$(srcdir) -I.. $(CPPFLAGS) $(CFLAGS) -MD -c $< -o $*.o
$(CC) -Wall @ident_support@ -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_fileio.o \
+14 -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_display.c,v 1.66 2003/10/30 03:43:19 steve Exp $"
#ident "$Id: sys_display.c,v 1.67 2003/12/19 01:27:10 steve Exp $"
#endif
# include "config.h"
@@ -169,6 +169,7 @@ static void format_time(unsigned mcd, int fsize,
char*bp, *start_address;
int idx;
unsigned int fusize;
int fraction_chars, fraction_pad, value_chop, whole_fill;
/* This is the format precision expressed as the power of 10
@@ -179,10 +180,9 @@ static void format_time(unsigned mcd, int fsize,
/* If the fsize is <0, then use the value from the
$timeformat. If the fsize is >=0, then it overrides the
$timeformat value. */
if (fsize < 0)
fsize = timeformat_info.width;
fusize = (fsize<0) ? timeformat_info.width : (unsigned) fsize;
assert(fsize < (sizeof buf - 1));
assert(fusize < (sizeof buf - 1));
/* This is the number of characters to the right of the
@@ -228,12 +228,12 @@ static void format_time(unsigned mcd, int fsize,
whole_fill = 0;
/* This is the expected start address of the output. It
accounts for the fsize value that is chosen. The output
accounts for the f(u)size value that is chosen. The output
will be filled out to complete the buffer. */
if (fsize == 0)
if (fusize == 0)
start_address = buf;
else
start_address = buf + sizeof buf - fsize - 1;
start_address = buf + sizeof buf - fusize - 1;
/* Now start the character pointers, ready to start copying
the value into the format. */
@@ -286,7 +286,7 @@ static void format_time(unsigned mcd, int fsize,
/* Fill the leading characters to make up the desired
width. This may require a '0' if the last character
written was the decimal point. */
if (fsize > 0) {
if (fusize > 0) {
while (bp > start_address) {
if (*bp == '.')
*--bp = '0';
@@ -452,7 +452,7 @@ static int format_str_char(vpiHandle scope, unsigned int mcd,
{ char* value_str = value.value.str;
if (leading_zero==1){
// Strip away all leading zeros from string
int i=0;
unsigned int i=0;
while(i< (strlen(value_str)-1) && value_str[i]=='0')
i++;
value_str += i;
@@ -643,7 +643,7 @@ static int format_str_char(vpiHandle scope, unsigned int mcd,
if (!(is_constant(argv[idx])
&& vpi_get(vpiConstType, argv[idx]) == vpiStringConst)) {
int i=0;
unsigned int i=0;
// Strip away all leading zeros from string
while((i < (strlen(value_str)-1))
&& (value_str[i]==' '))
@@ -833,7 +833,7 @@ static void do_display(unsigned int mcd, struct strobe_cb_info*info)
{
char*fmt;
s_vpi_value value;
int idx;
unsigned int idx;
int size;
for (idx = 0 ; idx < info->nitems ; idx += 1) {
@@ -1580,6 +1580,9 @@ void sys_display_register()
/*
* $Log: sys_display.c,v $
* Revision 1.67 2003/12/19 01:27:10 steve
* Fix various unsigned compare warnings.
*
* Revision 1.66 2003/10/30 03:43:19 steve
* Rearrange fileio functions, and add ungetc.
*
+5 -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_readmem.c,v 1.13 2003/05/10 16:06:50 steve Exp $"
#ident "$Id: sys_readmem.c,v 1.14 2003/12/19 01:27:10 steve Exp $"
#endif
# include "config.h"
@@ -132,7 +132,7 @@ static int sys_readmem_calltf(char*name)
/* min_addr and max_addr are equal to start_addr and stop_addr if
start_addr<stop_addr or vice versa if not... */
int min_addr, max_addr;
unsigned min_addr, max_addr;
/*======================================== Get parameters */
@@ -576,6 +576,9 @@ void sys_readmem_register()
/*
* $Log: sys_readmem.c,v $
* Revision 1.14 2003/12/19 01:27:10 steve
* Fix various unsigned compare warnings.
*
* Revision 1.13 2003/05/10 16:06:50 steve
* $readmem more flexible with file name argument.
*
+5 -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_vcd.c,v 1.51 2003/10/29 03:28:27 steve Exp $"
#ident "$Id: sys_vcd.c,v 1.52 2003/12/19 01:27:10 steve Exp $"
#endif
# include "config.h"
@@ -67,7 +67,7 @@ static void gen_new_vcd_id(void)
{
static unsigned value = 0;
unsigned v = ++value;
int i;
unsigned int i;
for (i=0; i < sizeof(vcdid)-1; i++) {
vcdid[i] = (char)((v%94)+33); /* for range 33..126 */
@@ -811,6 +811,9 @@ void sys_vcd_register()
/*
* $Log: sys_vcd.c,v $
* Revision 1.52 2003/12/19 01:27:10 steve
* Fix various unsigned compare warnings.
*
* Revision 1.51 2003/10/29 03:28:27 steve
* Add the PLU_UINT64_FMT string for formatting output.
*
+9 -3
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.30 2003/10/30 03:42:51 steve Exp $"
#ident "$Id: vpi_user.h,v 1.32 2004/01/13 02:55:50 steve Exp $"
#endif
@@ -57,7 +57,7 @@ typedef struct __vpiHandle *vpiHandle;
typedef struct t_vpi_systf_data {
PLI_INT32 type;
PLI_INT32 subtype;
char *tfname;
const char *tfname;
PLI_INT32 (*calltf)(char*);
PLI_INT32 (*compiletf)(char*);
PLI_INT32 (*sizetf)();
@@ -192,7 +192,7 @@ typedef struct t_vpi_value {
#define vpiTimePrecision 12
#define vpiNetType 22
# define vpiWire 1
#define vpiConstType 43
#define vpiConstType 40
# define vpiDecConst 1
# define vpiRealConst 2
# define vpiBinaryConst 3
@@ -412,6 +412,12 @@ EXTERN_C_END
/*
* $Log: vpi_user.h,v $
* Revision 1.32 2004/01/13 02:55:50 steve
* Get value for vpoiConstType correct.
*
* Revision 1.31 2003/12/07 20:06:24 steve
* tfname can be constant.
*
* Revision 1.30 2003/10/30 03:42:51 steve
* Details on the vpi_get_file function.
*
+3 -70
View File
@@ -127,81 +127,14 @@ AC_MSG_RESULT($EXTRALIBS)
## in order to know the name of the start symbol for the .vpi module.
#######################
AC_CYGWIN
AC_EXEEXT
AC_MINGW32
WIN32=no
AC_MSG_CHECKING("Checking for windows")
if test "$CYGWIN" = "yes" -o "$MINGW32" = "yes"
then
WIN32=yes
fi
AC_SUBST(WIN32)
AC_MSG_RESULT($WIN32)
AC_SUBST(EXEEXT)
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
*-*-cygwin*)
ident_support=
;;
*-*-darwin*)
ident_support=
;;
*-*-machten*)
ident_support=
;;
esac
AC_SUBST(ident_support)
AC_MSG_RESULT($ident_support)
AX_CPP_IDENT
# If not otherwise specified, set the libdir64 variable
# to the same as libdir.
+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: ivl_dlfcn.h,v 1.8 2003/02/16 05:42:06 steve Exp $"
#ident "$Id: ivl_dlfcn.h,v 1.9 2003/12/12 05:43:08 steve Exp $"
#endif
#if defined(__MINGW32__)
@@ -65,7 +65,13 @@ inline ivl_dll_t ivl_dlopen(const char*name, bool global_flag)
{ return dlopen(name,RTLD_LAZY|(global_flag?RTLD_GLOBAL:0)); }
inline void* ivl_dlsym(ivl_dll_t dll, const char*nm)
{ return dlsym(dll, nm); }
{
void*sym = dlsym(dll, nm);
/* Not found? try without the leading _ */
if (sym == 0 && nm[0] == '_')
sym = dlsym(dll, nm+1);
return sym;
}
inline void ivl_dlclose(ivl_dll_t dll)
{ dlclose(dll); }
@@ -90,6 +96,9 @@ inline const char*dlerror(void)
/*
* $Log: ivl_dlfcn.h,v $
* Revision 1.9 2003/12/12 05:43:08 steve
* Some systems dlsym requires leading _ or not on whim.
*
* Revision 1.8 2003/02/16 05:42:06 steve
* Take the global_flag to ivl_dlopen.
*
+5 -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: vpi_tasks.cc,v 1.24 2003/06/18 00:54:28 steve Exp $"
#ident "$Id: vpi_tasks.cc,v 1.25 2003/12/07 20:05:56 steve Exp $"
#endif
/*
@@ -95,7 +95,7 @@ static char *systask_get_str(int type, vpiHandle ref)
assert((ref->vpi_type->type_code == vpiSysTaskCall)
|| (ref->vpi_type->type_code == vpiSysFuncCall));
char *bn = rfp->defn->info.tfname;
const char *bn = rfp->defn->info.tfname;
char *rbuf = need_result_buf(strlen(bn) + 1, RBUF_STR);
switch (type) {
@@ -487,6 +487,9 @@ void* vpi_get_userdata(vpiHandle ref)
/*
* $Log: vpi_tasks.cc,v $
* Revision 1.25 2003/12/07 20:05:56 steve
* Ducument lxt2 access.
*
* Revision 1.24 2003/06/18 00:54:28 steve
* Account for all 64 bits in results of $time.
*
+9 -2
View File
@@ -1,4 +1,4 @@
.TH vvp 1 "$Date: 2003/03/06 20:04:42 $" Version "$Date: 2003/03/06 20:04:42 $"
.TH vvp 1 "$Date: 2003/12/07 20:05:56 $" Version "$Date: 2003/12/07 20:05:56 $"
.SH NAME
vvp - Icarus Verilog vvp runtime engine
@@ -84,13 +84,20 @@ the expense of some file size.
The \fB-lxt-none\fP variant actually suppresses all waveform
output. This can make long simulations run faster.
.TP 8
.B -lxt2
The LXT2 format is slower then LXT (faster then VCD) but takes less
space, and is written out incrementally. Thus, you can view lxt2 files
while a simulation is still running (or paused) or if your simulation
crashes or is killed, you still have a useful dump.
.SH ENVIRONMENT
.PP
The vvp command also accepts some environment variables that control
its behavior. These can be used to make semi-permanent changes.
.TP 8
.B IVERILOG_DUMPER=\fIlxt|vcd|none\fP
.B IVERILOG_DUMPER=\fIlxt|lxt2|vcd|none\fP
This selects the output format for the waveform output. Normally,
waveforms are dumped in vcd format, but this variable can be used to
select lxt format, which is far more compact, though limited to