Commit Graph

5600 Commits

Author SHA1 Message Date
Martin Whitaker 4818db887e Fix for LXT/LXT2 output using MinGW.
When using MinGW, routines registered via atexit() inside a
DLL are only called when the DLL is detached. If not detached
manually, DLLs are automatically detached *after* all remaining
open files are closed. This meant that by the time the LXT or
LXT2 close_dumpfile routine was called, the dump file handle
was no longer valid, so any remaining output was lost. This
patch fixes the problem by manually detaching the VPI modules.
2010-02-08 21:07:45 -08:00
Stephen Williams fad5e362ce Add yet more key characters to the gperf command.
The last patch to add key charasters apparently wasn't enough
for gperf 2.7.
2010-02-05 23:09:39 -08:00
Cary R 09a7c63692 Fix autoconf.sh gperf key flags
When I added the SV/Verilog-AMS keywords I forgot to update the
gperf keys in autoconf.sh. This patch makes them match the Makefile.
2010-02-05 22:35:08 -08:00
Stephen Williams 8d65d0735a Fix broken $() substitution in command files. 2010-02-04 16:07:27 -08:00
Cary R b1dc84ccd1 Fix release of variables.
This patch fixes the release of varaibles to work correctly.
2010-02-01 11:51:51 -08:00
Cary R fefc195540 Fix MinGW compile warnings.
This patch fixes a few compile warnings found with the latest
MinGW compiler.
2010-02-01 11:45:32 -08:00
Cary R 7866e92761 Fix an obscure memory leak and fix formatting.
This patch fixes an obscure memory leak and make the formatting
of these two routines match the rest of the code in the file.
2010-01-23 09:44:13 -08:00
Cary R 634d47bfe8 Add all the Verilog-AMS 2.3.1 keywords.
Like I did for SystemVerilog the other day this patch adds all the
Verilog-AMS 2.3.1 keywords. This necessitated adding one my byte
to the gperf -k argument (byte 9) to make the laplace_?? tokens
have a unique hash.
2010-01-23 09:40:56 -08:00
Cary R 511a274b41 Add all the SystemVerilog (1800-2005) keywords.
This patch adds the SystemVerilog keywords to Icarus. This allows
use to easily verify that out plain Verilog does not contain any
SystemVerilog keywords. The keywords are not parsed in any way.
When parsing a Verilog file using -gsystem-verilog any identifier
that is a keyword will cause a parse error. It is the users
responsibility to figure out the problem since bison does not
give nice error message when it finds a keyword instead of an
identifier.
2010-01-23 09:35:07 -08:00
Martin Whitaker 14b2037ce4 Fix for pr2922063.
When handling the $signed/$unsigned system functions, the compiler
was applying the new signed/unsigned property to the NetExpr object
representing the input argument. This caused the input argument to
be evaluated incorrectly. This patch fixes this by applying the new
property to the NetExpr object created to pad the result to the
required size.

In testing this fix, it was also discovered that the width of the
input argument expression was not being calculated correctly. This
patch also fixes this issue.
2010-01-23 09:29:40 -08:00
Nick Gasson b855b0368d Fix build with gcc-4.5
New version of GCC does not like the X::X() construct.
2010-01-23 09:24:42 -08:00
Martin Whitaker f95593716f Fix for pr2924354.
Creation of implicit nets requires knowledge of whether an identifier
has been declared before it is used. Currently implicit nets are
created during elaboration, but by this stage the order of declaration
and use is not known. This patch moves the creation of implicit nets
into the parser stage.
2010-01-23 09:10:00 -08:00
Stephen Williams 9fbb12d9cf Make sure all vvp_vector8_t::val_ bytes are initialized
Often the val_ array is treated as a word (for speed) so make sure
all the bytes of val_ are initialized, even if not used.
2010-01-12 14:45:57 -08:00
Martin Whitaker b4f070e60b Rework of lexical scope handling in parser.
This patch modifies the parser to use a single stack to track lexical
scopes, rather than starting a new stack for each generate construct.
2010-01-12 10:41:43 -08:00
Cary R 6eb5f593f0 realloc() to the correct string.
Someone had mistyped the destination of the realloc. It should
have been the original string not the input buffer.
2010-01-12 10:34:49 -08:00
Martin Whitaker d497b1a694 Fix for pr2929913.
After changing an array word, vvp propagates the change to every port
attached to the array. The code did not properly handle the case of
an array port declared in an automatic scope with an associated array
declared in a static scope.
2010-01-12 10:25:09 -08:00
Cary R 5a0363ebd3 Fix some constant bit/part select bugs and add warnings.
This patch fixes a few bugs in constant bit/part selects and
adds optional warnings for out of bound or undefined selects.
2010-01-12 10:19:35 -08:00
Stephen Williams d0b1936fb5 Optimize handling of invert gates / Tweak vvp_vector8_t performance
The process of inverting and copying can be collapsed into a single
operation that should run a little faster. Also, inverting readily
vectorizes itself. I've also possibly reduced useless vvp_not_fun
iterations.

Also, include some minor tweaks to the vvp_vector8_t handling of
vector copies. This is more to clean up code, although it should
slightly improve performance as well.
2010-01-11 11:42:25 -08:00
Cary R 85e0f8a328 Fix major error in lxt2 info allocation.
The zero element was already returned so it can not be reused a
second time. This was crashing when things went off the end of
the list since the do all functor was off by one.
2010-01-10 16:24:47 -08:00
Stephen Williams 76cc024f67 Optimize the per-signal vcd_info structure
In a typical debug simulation run, a user tracing all the signals
in the simulation may wind up creating millions of these. Rework
the vcd_info structure to be more compact and possibly faster to
scan.
2010-01-10 11:41:51 -08:00
Stephen Williams 94d75e0170 Add missing pthread.h header file. 2010-01-09 16:29:24 -08:00
Stephen Williams 3e7d191abb Add missing header includes. 2010-01-09 13:45:17 -08:00
Stephen Williams ffeeeaf0af Merge branch 'vcd-thread' 2010-01-09 10:39:12 -08:00
Stephen Williams 2638cd9f6e Fix build --with-valgrind broken by scope thread rework.
The scope thread rework broek --with-valgrind builds due to the
different handling of the list of threads. Rework valgrind enabled
handling of the thread set within a scope.
2010-01-09 10:38:24 -08:00
Stephen Williams 7fc6b02e96 Batch vcd work item creation
Rather then lock/unlock the work queue ring for every item, save
tons of pthread lock manipulation by allocating to the producer
in batches. Over the long run, this doesn't change the CPU balance
or hold up either thread, but it eliminates almost 3/4 of the
lock/unlock episodes.
2010-01-09 10:08:16 -08:00
Stephen Williams 76ebde4cd2 Blend time stamp into other work items.
The time change is usually a trivial operation, so instead carry
a timestamp on all the work items and let the work thread decide
on its own when to do a SET_TIME operation. This reduces some
pthread overhead and thus gets us some better performance.
2010-01-08 21:46:32 -08:00
Stephen Williams 06270cdd2b Basic work queue thread for lxt2 output. 2010-01-08 20:20:26 -08:00
Picture Elements Inc a919ee385d Merge branch 'master' of ssh://steve-icarus@icarus.com/home/u/icarus/steve/git/verilog 2010-01-06 21:38:56 -08:00
Stephen Williams 5533252cc1 Add generic single-step-display for vvp_gen_event_s objects.
This gives a little bit more specificity to the event step
display.
2010-01-06 21:40:26 -08:00
Picture Elements Inc 5c0094e8fd Fix typeinfo build error. 2010-01-06 21:38:45 -08:00
Stephen Williams dda197e39b Rework the scope thread list to use a std::set
The scope contains the threads running within. The rework of this
patch allows all threads to know their scope, and cleans up the
handling of threads listed in the scope.
2010-01-06 18:43:53 -08:00
Stephen Williams 3ddb421fbf Add some single-step debugging
Work out the basis for single-stepping events in the scheduler,
and fill in some basic single-step results.
2010-01-06 16:08:20 -08:00
Cary R c74ca4a502 If you have C++ .o files you need to link with g++ 2010-01-06 13:50:44 -08:00
Cary R 3dcaf6253b Use CXXFLAGS when compiling C++ programs.
We already have this flag so we may as well us it in the vpi
directory to compile C++ programs.
2010-01-06 13:50:37 -08:00
Cary R 458258d554 A signal select is signed if the select not the signal is signed.
The padding for a signal select was using the signal to determine
if the padding should be singed or not. In reality this should be
unsigned padding unless the select was enclosed in a $signed().
2010-01-06 13:47:24 -08:00
Cary R ea4bae7c33 vpi_get_vlog_info should return the version information.
This patch fixes vpi_get_vlog_info to return the VERSION.
2010-01-06 13:45:07 -08:00
Stephen Williams 53ec59a97f Rework vcd id-mapping for scalability
Huge designs have huge sets of unique nexus ids. Use more efficient
algorithms to map them and detect aliases.
2010-01-06 10:46:39 -08:00
Cary R 3cef85b06b Add +timescale to the command file.
This patch adds a +timescale command to the command file
syntax that can be used to set the default time scale of
the simulation.
2009-12-30 08:35:29 -08:00
Stephen Williams d2dd0daa3c Fix references to version_base.h in Makefiles. 2009-12-28 09:49:35 -08:00
Cary R ebac088511 A constant real number is not unsized.
We can have unsized bit values, but reals always have a size.
2009-12-28 09:28:29 -08:00
Cary R 0f0cadd0eb Add suffix support for windows (both MinGW and Cygwin).
dlltool which is used by both MinGW and Cygwin to create dynamic
libraries must have the name of the executable it creates the
library/information from exactly match the installed executable
name. If we have a suffix then it must be used. This patch adds
that to the build process for vvp since it can be installed with
a suffix. It also modifies the check routines since you must run
vvp with a suffix if the library it links to was built for a
suffixed executable.
2009-12-24 20:55:26 -05:00
Cary R a1e2bfc93c Having lround() does not mean llround() is available.
We need to check for both lround() and llround() for at
least Cygwin.
2009-12-24 20:47:19 -05:00
Martin Whitaker b416176c4d Fix for pr2913404.
In combination with the patch to make all operations on thread words
operate on 64-bit values, this patch ensures casts between real values
and large vector values work correctly.
2009-12-21 09:59:12 -08:00
Martin Whitaker 13cad6f268 Make vvp thread word storage consistently 64 bits.
The vvp thread word storage had previously been changed to always store
64-bit values, but some instructions still only operate on native long
values. This patch ensures all instructions that modify thread words
support 64-bit values.
2009-12-21 09:56:22 -08:00
Cary R f6d1a891a1 Use the correct line information in crop_to_width()
This was using its own information instead of the input nets information.
2009-12-18 14:00:43 -08:00
Cary R 5ff8aa701a Reuse the number of input information.
This was already assigned to a variable so lets use that instead of
geting it again.
2009-12-18 14:00:34 -08:00
Cary R 3ed6c0cfa4 Properly extend/crop a user function argument in a continuous assignment.
When passing an argument to a user function in a continuous assignment
we need to sign extend the value if it is signed and too short. We need
to crop an argument if it is too long.
2009-12-18 13:59:15 -08:00
Cary R b3d828885c Function arg. expressions need to use the expr. width and arg. width.
When evaluating a function argument expression we need to use either
the expression width or the argument width which ever is larger. This
matches the way normal assignments work. We then only take the bits
needed at the end.
2009-12-18 13:55:02 -08:00
Cary R 260828a095 A ternary can be signed.
If the two branches of a ternary are signed then the result will
also be signed.
2009-12-18 13:43:30 -08:00
Nick Gasson 47d3b3365b VHDL: fix spurious resize seen in pr2911213
Another case when ivl_scope_sig list was used instead of
ivl_scope_param.
2009-12-18 13:38:12 -08:00