Commit Graph

6240 Commits

Author SHA1 Message Date
Patrick Doyle 2ffc2d36f2 Keep expression width when evaluating expressions ahead of time.
Added 'expr_wid' parameter to calls to 'eval_expr()' within
PEBinary::elaborate_eval_expr_base_()'.  This makes a specific problem
go away and may even be the correct thing to do.
2010-08-06 22:13:13 -07:00
Stephen Williams f23a56e632 Revert "Add $info, $warning and $error as aliases to $display"
This reverts commit 99619bc326.
The $error functions are already well supported in devel, so this
patch does nt belong there. Oops.
2010-07-31 17:12:12 -07:00
Stephen Williams 99619bc326 Add $info, $warning and $error as aliases to $display
Submitted by voiz@sourceforge.net
2010-07-30 19:11:34 -07:00
Cary R 029a61d074 Fix the white space errors in tgt-vvp 2010-07-30 18:59:38 -07:00
Cary R 314714997f Add support for variable UDP delays.
This patch adds support for a UDP with variable delays. In the process the
intrinsic support for delays was removed from the UDP functor and replaced
with a call to the .delay functor. Both a normal gate and a UDP now use the
same code to generate the delay.
2010-07-30 18:59:29 -07:00
Cary R 86653ddff9 Remove some cppcheck warnings.
This patch modifies the code to remove some more cppcheck warnings.
2010-07-30 18:50:52 -07:00
Cary R 44b08a4630 Update fstapi.c to latest from gtkwave 3.3.10 2010-07-19 21:22:13 -07:00
Cary R 30fa8f64fa Cleanup some compiler warnings under CentOS 5.5
This patch cleans up a couple of warnings when compiling on CentOS 5.5
using gcc 4.1.2.
2010-07-19 21:20:24 -07:00
Stephen Williams a436f7f794 Draw code for a delayed enable to tranif gates. 2010-07-19 21:14:29 -07:00
Stephen Williams ae3b6a9de2 Show tranif delays in the diagnostic dumps. 2010-07-18 20:43:42 -07:00
Cary R df4722b92c The switch gates do not support a strength specification.
This patch splits the switch types out of the gates to allow
them to be defined to not take a strength specification.
2010-07-13 19:21:02 -07:00
Cary R 5fe5171e49 Fix bug when calculating the decay time from two variable delays.
We need to also update the decay time if the new rise/fall value
is less than the minimum value and we are in ignore decay mode.
2010-07-13 18:23:21 -07:00
Cary R 13fb07dc17 Add support for only two variable delays and add delay checks.
This patch adds checks that the delay count is correct for the
various gates and adds support for a missing variable decay
time. For this case the decay time is the minimum of the rise
and fall times. This is denoted by setting the decay variable
to 0 in the vvp file. vvp notes this and sets an ignore decay
time property in the base delay. This turns off the ability
to set the decay time and the minimum delay calculation will
also update the decay time.
2010-07-13 18:23:16 -07:00
Cary R 6fbf47025f We have already verified that we have a 64 bit immediate value.
These checks are not needed since we have already verified that
we have a 64 bit immediate value. This is likely old code that
should have been removed when the original functionality was
changed.
2010-07-13 16:25:19 -07:00
Cary R 2bf3f5d1d3 Push tranif delays to the code generator.
This patch pushes delays for tranif gates to the code generator.
We still need to add checks for the number of delays, etc. For
now an error message is printed when a tranif gate is given a
non-zero delay.
2010-07-13 16:04:05 -07:00
Cary R a8198b38fb Add unlimited tail recursion for the real ternary operator.
This patch modifies the real ternary operator code to support
unlimited tail recursion without overflowing the thread
registers. Head recursion is still limited by the available
registers.

It fixes the thread word checks to use a new define that has
the correct number of thread words (16). It adds a message
instead of just an assert if the thread words are exhausted.

And it also changes some of the error messages to use vvp.tgt
in the message to be consistent with the other messages.
2010-07-11 17:24:37 -07:00
Stephen Williams fb1853144b Continuous assignments have their own driver
Elaborate conditional assignments with BUFZ devices that do *NOT*
preserve strengths. Add a BUFT (transparent) device that can be
used in those cases where I really need a transparent buffer.
2010-07-11 17:16:15 -07:00
Cary R 4dcebe4024 Only set the multiply width if it is greater than zero and vectorable
We only need to set the width of a multiple if the width is greater
than zero and if the expression is vectorable. This matches what is
done for addition.
2010-07-06 20:15:51 -07:00
Cary R ed29161614 Update fstapi files to match the GTKWave 3.3.8 release.
This patch updates fstapi.{c,h} to match the ones in the GTKWave
3.3.8 release.
2010-07-01 16:37:10 -07:00
Cary R 21d15ceece Fix the compiler and modpath scaling of real delays.
A real delay must be scaled and rounded using the local precision
before it is finally scaled to the simulation time units. This
patch fixes the compiler to do this correctly or generate the
correct code for run time calculated delays. Delays in a CA
already worked correctly. The run time was also fixed to scale
modpath (SDF back annotation) delays correctly.
2010-06-18 16:11:54 -07:00
Cary R 3868334f5c Fix some on error memory leaks in vvp.
This patch modifies the vvp main code to cleanup if there was an
error compiling the input file. There are still a few issues, but
this takes care of most of them.
2010-06-18 15:52:21 -07:00
Cary R 07ee2e7dff On error there is no need to pop the scope.
The error routines for task and function definitions were incorrectly
popping the scope. This should not be done since no scope was pushed.
Also assert that the current_task/function is 0 to catch that kind of
error like the other definition rules.
2010-06-18 15:48:00 -07:00
Cary R 263dff6fbe Update fstapi.c to match latest from GTKWave. 2010-06-11 15:41:00 -07:00
Cary R 3f6aff47c9 Add run time support for calling system functions as task.
This patch adds two new opcodes and the infrastructure needed to call
system functions as tasks. The normal %vpi_call will generate an error
if a system function is called as a task. %vpi_call/w will generate a
warning and will ignore any value returned by the function. %vpi_call/i
will ignore the system function return value and will not print a
message. Adding this is a feature request and is supported in
SystemVerilog. Next I need to add flags to control this depending on
the compiler generation and possibly other flags.

I may leave the cast to void (%vpi_call/i) functionality unimplemented
for now.
2010-06-11 15:39:16 -07:00
Cary R 3d63f664c8 Cache vpi_call error messages so we can include file and line info.
This patch caches the vpi_call error messages (task/function does
not exist, task being called as a function and function being
called as a task). This allows us to display the file name and line
number information for the invalid usage.
2010-06-08 11:11:52 -07:00
Cary R b2d479eaf6 Don't crash when using `define value for an `include argument.
When pushing the current file path we need to get past any `define
expansions that have been pushed onto the stack to find the real
file path.

This patch is partially based on a patch submitted by Steve Tell.
2010-06-08 11:10:32 -07:00
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