Commit Graph

7964 Commits

Author SHA1 Message Date
Cary R 3f203c4363 Don't crash if parameter/localparam defined from constant user function.
This patch avoids a crash when trying to use a parameter/localparam that
has been assigned a value from a constant user function. Icarus does not
currently support constant user functions so it creates a parameter with
a NULL value. This patch fixes a few places where this could crash the
compiler.
2010-06-08 11:09:05 -07:00
Cary R c7afb4f51a Call probe_expr_width() before elab_and_eval() when evaluating a path.
You need to probe the expression width before trying to elaborate and
evaluate an expression. The eval_path_component() routine was missing
this and was causing an assert.
2010-06-08 11:07:17 -07:00
Cary R b7264d21d5 Fix some definition/implementation name differences.
Update some of the definition argument names to match the recent
implementation name changes
2010-06-08 11:03:11 -07:00
Cary R 3fe68c4c04 Add escaped identifier support to the FST dumper and some clean up.
This patch adds escaped identifier support to the FST dumper and
cleans up the VCD and FST code a bit. Also a simple spelling fix.
2010-06-08 11:01:10 -07:00
Cary R ddf5748b48 Work around a bug in the SunPro C++ compiler.
This patch works around a bug in the current SunPro C++ compiler.
It does not define size_t in <cstddef>.
2010-06-08 10:59:19 -07:00
Stephen Williams c6465f4485 Fix assertion elaborating certain primitive port part selects
In sertail brimitives, the passed port may have part selects.
Make sure to call the test_width method on the expressions.
2010-06-01 09:17:36 -07:00
Cary R 1993bf6f69 Remove malloc.h support and for C++ files use <c...> include files.
The functions (malloc, free, etc.) that used to be provided in
malloc.h are now provided in cstdlib for C++ files and stdlib.h for
C files. Since we require a C99 compliant compiler it makes sense
that malloc.h is no longer needed.

This patch also modifies all the C++ files to use the <c...>
version of the standard C header files (e.g. <cstdlib> vs
<stdlib.h>). Some of the files used the C++ version and others did
not. There are still a few other header changes that could be done,
but this takes care of much of it.
2010-06-01 08:56:30 -07:00
Cary R 8122432e47 Remove OpenBSD compilation warning.
This is a trivial change to remove a warning when compiling using
the latest version of OpenBSD.
2010-06-01 08:55:08 -07:00
Cary R d113460cb2 Update fstapi.c from GTKWave to fix shadow warning. 2010-06-01 08:52:58 -07:00
Cary R 15a0cf4256 Fix shadow warnings found on OpenBSD.
gcc on OpenBSD reported shadow warnings for variables, arguments named
log, time and exp. This patch renanes those variables to logic, timerec
and expr.
2010-05-28 07:03:02 -07:00
Cary R 5a6683197a Fix config.h.in HAVE_ALLOCA_H and HAVE_FSEEKO defines
This patch fixes the config.h.in file to correctly undefine
these two defines so that configure can define them when
available.
2010-05-28 07:01:18 -07:00
Cary R 7fba664f4c More fstapi.c updates from GTKWave.
This syncs fstapi.c to the latest from GTKWave CVS. This cleans up
most of the issues. I still have two to track down, but I think they
are cppcheck bugs not fstapi.c deficiencies.
2010-05-28 07:00:02 -07:00
Cary R 51beee970b Update fstapi.c to remove redundant if checks before a free.
Free accepts a NULL argument so there is not need to check that a
variable is defined before calling free.
2010-05-25 20:28:02 -07:00
Cary R 32e29e394d More fstapi.c updates from GTKWave.
This fixes some compilation warnings under OpenSolaris.
2010-05-24 18:45:04 -07:00
Cary R 7969a58eeb Fix some large/negative immediate value compiler bugs.
Fix how immediate values are checked and allow a large negative
value to be returned from get_number_immediate().
2010-05-24 18:40:16 -07:00
Cary R d508960a9e Fix space issues in VPI directory 2010-05-23 17:19:59 -07:00
Cary R 6462b2879a Remove some 64 bit compiler warnings.
The fstHandle is only a uint32_t so to avoid compiler warnings on 64
bit systems cast this to long before casting to a pointer.

Also reformat some of the code to match the rest of the Icarus code.
2010-05-23 17:19:46 -07:00
Cary R 4192941748 Add fst dumper options and document lxt2 options.
This patch documents that the lxt2/lx2 dumper supports -speed and
-space options. It adds -speed, -space, -space-speed and
-speed-space options for the fst dumper. Here are results for a
gate level back annotated design using the fst dumper.

<none>  12.88 seconds 3.5 Meg dump file.
-space  12.89 seconds 2.9 Meg dump file.
-speed  12.36 seconds 4.6 Meg dump file.
-<both> 12.84 seconds 3.2 Meg dump file.
2010-05-23 17:18:27 -07:00
Cary R 0eac9f8e9d For VCD and FST dumpers only sort scope list when needed.
We keep a scope list that is checked to verify that we do not try
to dump duplicate scopes or variables. Since the scan_item routine
can not add duplicate scopes we only need to sort the list after
the scan_item routine is called. Calling it every time a scope
was added was creating a significant startup delay for gate level
simulations since the sort routine is called for every scope in
the design (possibly thousands of times).

This mostly matches what was done for the LXT dumper except the
LXT dumper was incorrectly sorting before not after scan_item
was called. This would not catch a duplicate variable just
after a scope was added in a $dumpvars call.
2010-05-23 17:16:48 -07:00
Cary R f268af3580 Fix lxt2 space/speed flags.
The lxt2 routine was referencing the lxt not the lxt2 versions
of the space/speed flags. This also adds the lx2 version of the
flags. These were already supported in the sys_table.c file.
2010-05-21 17:29:21 -07:00
Cary R cf264caabb Slight update to fst documentation (incremental support) 2010-05-21 17:26:58 -07:00
Cary R f11ba81202 Add initial fst support.
This patch is a slight modification to files Tony Bybell (the author of
GTKWave) send to me. We still have a few more changes we plan to make,
but this should be functional enough for initial testing. Multi-treading
and speed/size flags will be added shortly.
2010-05-21 17:26:44 -07:00
Cary R 09d59d744d Fix memory leak on error in driver/main.c. 2010-05-19 07:51:08 -07:00
Cary R adfbd796b9 Check that the C and C++ compilers match.
Since we have not tested and some of the flags are not configured to
support mixed compiler compilation do not allow it for now.
2010-05-19 07:49:23 -07:00
Cary R 420519193d make_pair has a PExpr* as a second argument
The make_pair() routine has a PExpr* as the second argument. Not all
compilers can promote a child correctly, so just assign the child type
to a PExpr* when they are created solves this issue.
2010-05-17 20:54:54 -07:00
Cary R 1c0408d9b9 More configuration updates for OpenSolaris
This patch updates the shared and PICFLAGS to support the Sun compiler.
It also reorganizes how the dependency and warning flags are set.
2010-05-17 20:53:28 -07:00
Cary R ecacd7bae9 Make sure to call vpi_config.h first.
vpi_config.h defines _FILE_OFFSET_BITS. This must be defined before
any system includes files are processed, so vpi_config.h must be
called first. This patch puts vpi_config.h first. It also removes
direct calls for both vpi_config.h and vpi_user.h when sys_priv.h
is included since it already includes these two files.

It also updates the code to always include vpi_user.h using double
quotes.
2010-05-17 20:51:59 -07:00
Cary R 9613c269d2 Fix some unreachable code warnings.
This patch fixes three unreachable code warnings reported by the Sun
compiler. It also simplifies one of the files in the process.
2010-05-17 20:50:46 -07:00
Cary R 22f91d2d34 A NULL iterator is not portable.
Trying to return a NULL iterator on failure is not portable. It is
better to assert since we have already verified that a parameter
should exist.
2010-05-17 20:48:27 -07:00
Cary R 80bf64fc27 Use -xMMD instead of -xMD on OpenSolaris.
Using -xMD generates dependencies for all files including the
system files. This could point to some system .cc files and
was causing GNU make to try to build these files if the
dependency files existed. Using -xMMD generates only the
dependencies outside the system directories.

It's possible that the OpenSolaris make knows how to deal with
this correctly, but Icarus needs GNU make.
2010-05-13 19:14:38 -07:00
Cary R 8caad6ed7c Remove extra '\' in verinum as_string().
This is generating an octal constant but there is no reason to have
three '\' characters. You need two to get the leading '\', but the
last one is not needed.
2010-05-13 19:14:24 -07:00
Cary R d2be4293a3 Not all compilers support struct definition inside an anonymous union
The SunPro compiler does not support struct definitions inside an
anonymous union. This patch moves the struct definition so that both
gcc and SunPro 12.1 compile this without issue.
2010-05-13 19:14:12 -07:00
Cary R 1be00e0322 Not all compilers support dynamic array creation (array[<variable>]).
gcc supports creating an array with a run time defined size. The
SunPro compiler for OpenSolaris does not. This patch converts the
array creation to use conventional (malloc based) array creation.
2010-05-13 19:11:14 -07:00
Cary R 42bc41ca5b VVP cleanup of ',' at end of enum and missing extern "C"
This patch is similar to the previous patches and cleans up a single
place in the vvp directory where an enum had a trailing ',' and a
place where a C++ routine needed extern "C".
2010-05-13 19:10:08 -07:00
Cary R ffa1f1139b Update lxt_write.c to fix OpenSolaris compile warning. 2010-05-13 19:07:25 -07:00
Cary R 128f3d29cc Fix new shadow issues and add -Wshadow to gcc compile.
Some new shadow issues have crept in. This patch fixes these new
issues and adds -Wshadow to the normal warning flags to keep any
new occurrences from happening.
2010-05-13 19:04:13 -07:00
Cary R b6b43b5dec C++ functions passed to C should be declared extern "C" (second patch)
The SunPro compiler was complaining about C++ routines that
were being passed to the ivl C routines if the C++ routines
were not declared extern "C".
2010-05-13 19:01:55 -07:00
Cary R dd33d25e3c C++ functions passed to C should be declared extern "C"
The SunPro compiler was complaining about C++ routines that
were being passed to the ivl C routines if the C++ routines
were not declared extern "C".
2010-05-13 19:00:41 -07:00
Cary R ab91d2b1a3 Don't place a semicolon after code implementation
The SunPro compiler does not like a ';' after a code implementation
block.
2010-05-13 18:59:24 -07:00
Cary R c0a592bec2 Don't place a trailing ',' after the last enum item.
The SunPro compiler does not like having a ',' after the last
enum item.
2010-05-13 18:56:44 -07:00
Cary R 3f433b325f lxt_write.c and lxt2_write.c reference <config.h> not "vpi_config.h"
Since the base lxt_write.c and lxt2_write.c files reference <config.h>
instead of "vpi_config.h" all their definitions need to be moved to
the main config.h include file.
2010-05-13 18:55:38 -07:00
Cary R 2aa627d89f Update all Makefile.in files to support OpenSolaris
This patch updates all the Makefile.in files and configure.in
as follows:

Do not use the -Wall warning flag when using the SunPro compiler.

The SunPro compiler uses -xMD instead of -MD.

There are still more fixes needed before Icarus will compile
on OpenSolaris.
2010-05-13 18:54:09 -07:00
Cary R c8d160a007 Update lxt_write.c and lxt2_write.c to latest files from GTKWave.
These files were updated based on a patch I sent Tony.
2010-05-13 18:47:54 -07:00
Stephen Williams 459593cb59 Special handling for forced tran ports.
Tran islands must do their calculations using the forced values,
if any. But the output from a port must also be subject to force
filtering. It's a little ugly, but hopefully won't hurt the more
normal case.
2010-05-04 19:20:36 -07:00
Stephen Williams d779c6d58b Remove dead class vvp_fun_signal8.
This class is no longer used. net8 nodes exist entirely within
filters (no functor at all) and strength aware variables don't
exist.
2010-05-04 17:36:44 -07:00
Cary R c5307dc82b Comparison and reduction operators only delay a single output bit.
The comparison and reduction operators only have a single output bit
that can be delayed.

The comparison of real values always produces a logical value so the
delay type is not dependent on the arguments type.
2010-05-03 14:41:59 -07:00
Cary R 92f2ee18e7 Call probe_expr_width() for repeat expression.
The repeat expression is evaluated in a self determined context
(expression width == -1). It needs to call probe_expr_width() to
figure out the width needed by the expression before calling
elab_and_eval() to elaborate the expression.
2010-05-03 14:37:25 -07:00
Cary R 26b95b94f7 $dist_erlang needs to use rtl_dist_erlang.
The erlang distribution calltf routine was incorrectly using the
normal distribution.
2010-05-03 14:34:50 -07:00
Cary R 8dfe9961c8 Remove bitchar_to_idx() function in tgt-vvp/vvp_process.c
This function is no longer used and was likely replaced with a
different scheme, so serves no useful purpose.
2010-05-03 14:33:14 -07:00
Cary R 6451523f73 tgt-stub/memory.c is no longer needed/valid
The tgt-stub/memory.c file is not used and uses an obsolete ivl
interface so it serves no useful purpose.
2010-05-01 09:53:42 -07:00