Commit Graph

7149 Commits

Author SHA1 Message Date
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
Cary R bf54c838a6 Update lxt_write.h and lxt2_write.h from GTKWave
This patch updates the lxt_write.h and lxt2_write.h header files
to the latest ones from GTKWave CVS. It also adds HAVE_INTTYPES_H
to the vpi_config.h.in header.
2010-05-01 09:51:54 -07:00
Cary R 2da20e8d28 Don't free a NULL iterator in $dumpvars.
This patch fixes two places where Icarus under certain conditions
would try to free a NULL iterator value in $dumpvars(). $dumpvars()
can have a NULL argument to indicate that all variables should be
dumped. Under two error conditions the code was trying to free
this NULL argument reference.

The standard does not define if vpi_free_object() can support a
NULL reference. Icarus does not currently allow it (it asserts).
2010-05-01 09:47:42 -07:00
Cary R e0001de3ba Add support for bit <-> real conversion for output ports.
This patch adds support for converting bit based ports to real signals.
You can only do this for single instances. Arrayed instance would
create multiple instances driving the same real signal.

Any real port can be connected to a bit based signal. The only limitation
is that the signal width must be an integer multiple of the instance
count since all the real conversions must have the same width.

Also add an error message for an arrayed instance with real to real
output connections. Again multiple drivers.

This patch also adds errors for inout real and bit based inout ports
driving a real signal. There is no logical way to deal with the full
capabilities of inout and real ports/signals. So for now they are not
allowed.
2010-04-27 12:12:04 -07:00
Cary R 2eb01605b1 Remove obsolete VAMS $log function.
This patch remove the old VAMS $log function. It could create confusion
with the Verilog $log task. Recent versions of VAMS and 1364-2005 use
$log10 for the base 10 logarithm.
2010-04-27 12:09:07 -07:00
Stephen Williams e6945db9b4 Test script includes 2005 system functions. 2010-04-27 11:56:33 -07:00
Stephen Williams c4098cffdf Account for unsized arguments to comparisons.
Comparison expressions have sorta-self-determined arguments.
Handle the special cause that some of the arguments may be
themselves unsized, and so expecting to be even wider then
otherwise.
2010-04-27 11:55:59 -07:00
Stephen Williams 46a22e9ea2 Make binary expressions use their tested width in self-determined context
Operands to reduction unary operators are self determined, so
evaluate the operands that way. But this means that binary expressions
in this context should take pains to use their test_width tested
expression width.

This exposed a case where the test_width methods were not called
for self-determined expressions. Fix that too.
2010-04-23 15:29:06 -07:00
Cary R d7ae1ed204 No need to have an if for a delete (found with cppcheck).
It is acceptable to call delete on a NULL object. It's also acceptable
to assign the value to zero if it is already zero. Removing the
superfluous if should produce slightly better code since there is no
conditional to deal with except for what is likely in the delete
implementation, but that should be highly optimized.
2010-04-23 11:40:35 -07:00
Cary R b91657dbb9 Fix a few more cppcheck issues.
Here are some more cleanups recommended by cppcheck. Mostly fixing the
variable scope and removing some unneeded code.
2010-04-23 11:40:26 -07:00
Cary R e269a2f23c A `timescale takes precedence over a SV timeunit/precision.
A `timescale directive is defined to take precedence over either
a timeunit or timeprecision even if they are after the directive.
2010-04-14 19:53:32 -07:00
Cary R 23a1ec9f53 Fix thread modulus code to sign extend correctly.
When the width of a long long match the vector width we do not need
to sign extend and using the << operator for this case is undefined.
2010-04-13 21:32:22 -07:00
Stephen Williams 8cbff6def0 Cleanup various style issues.
This patch cleans up some style issues: no need to check that a value
is defined before freeing or deleting it, use C++ style casts, make
sure to NULL terminate strncpy(), empty() is faster than size() for
size == 0 or size >= 0 checks, re-scope some variables, etc.
2010-04-13 21:29:15 -07:00
Cary R 6f9e364dab Fix a comment typo 2010-04-13 21:12:19 -07:00
Cary R 3aaacd4c79 Do not search up for a symbol if a hierarchical path was given.
When searching for a symbol we do not want to search up the
hierarchical stack if the symbol we are searching for was
prefixed with a hierarchical path.
2010-04-13 21:08:13 -07:00
Cary R 4c87d89370 Fix some space errors. 2010-04-13 20:55:05 -07:00