Commit Graph

5664 Commits

Author SHA1 Message Date
Cary R 2777a8b00b V0.9: A concatenation may also need a BUFZ to hold the drive strength
Just like a select a concatenation needs a BUFZ to hold the drive strength.
2013-02-12 18:37:09 -08:00
Cary R c84eec1d60 V0.9: minor fixes to br916 patch 2013-02-04 11:45:42 -08:00
Martin Whitaker 0f4658135e V0.9: Stopgap fix for br916.
Currently, when a variable expression is passed to a system task,
the expression value is stored in thread memory. Values stored
in thread memory cannot safely be passed to $strobe or $monitor,
because the thread memory may get reused or deallocated before
the $strobe or $monitor task actually executes. As a temporary
measure, we just trap this case and terminate with a "sorry"
message. A proper fix would require the expression value to be
calculated at the time the $strobe or $monitor executes, not at
the time it is called.
2013-02-04 11:45:35 -08:00
Martin Whitaker 200951275c Fix logic value returned for unambiguous HiZ1 strength.
If a strength aware net has an unambiguous HiZ1 strength, VVP treats
it as a logic '1'. It should be treated as a logic 'z'. An ambiguous
HiZ1/HiZ0 strength should also be treated as a logic 'z'.
2013-01-28 19:07:08 -08:00
Cary R 9b1c1a5d48 Fix space issue 2013-01-25 10:34:34 -08:00
Cary R edf741106d V0.9: Handle undefined L-value selects
L-value bit selects were incorrectly converting an undefined index to 0.

L-value part selects were asserting if an undefined index was given.

This patch unifies how all these are handle (including indexed part selects).

The base is set to an undefined value and an appropriate width is used.
A warning message is always printed since this is not a simple out of
range issue. It is the responsibility of the code generator to skip the
assignment, but we always want to execute the R-value since it could have
a side effect.
2013-01-25 10:32:52 -08:00
Cary R 4b805a2b89 Remove space issues 2013-01-21 19:29:34 -08:00
Martin Whitaker 8ae15b93cf Fix for bug 915 (was 3592746).
probe_expr_width() must be called before calling elab_and_eval(), to
determine the expression type.
2013-01-21 19:12:07 -08:00
Martin Whitaker 66338431f5 Fix for bug 913 (was 3587570).
probe_expr_width() must be called before calling elab_and_eval(), to
determine the expression type.
2013-01-21 19:02:08 -08:00
Martin Whitaker 0a06cf5d28 V0.9: Fix display of net array words when data type is signed.
When VVP compiles a .array statement for a net array, it does not
know the data type, so initialises the array signed_flag to false.
We need to set the signed_flag to the correct value once we know
the data type, to allow the VPI routines to correctly format the
data.
2013-01-21 18:46:59 -08:00
Martin Whitaker 15fee99abb Fix for pr3571573.
This patchs adds an implementation of recv_vec4_pv() to the vvp_fun_concat
class. This was already present in devel, so just needed to be backported
to v0.9.
2013-01-21 18:24:39 -08:00
Cary R 0ab44eca13 Update fstapi.c from GTKWave to fix MinGW compile. 2012-11-27 09:19:29 -08:00
Cary R 760ab91a36 Update fstapi.c and lxt2_write.c to latest from GTKWave
This just fixes warnings in cppcheck
2012-11-15 15:33:05 -08:00
Stephen Williams fc41668cf1 Make use of LDFLAGS when linking *.tgt files
Submitted by Ahmed El-Mahmoudy
2012-11-03 10:27:59 -07:00
Stephen Williams b8bcb016aa Fix licensing issues.
Remove des.v, which has incompatible restrictions.
Repair some copyright names (Remove Picture Elements)
Update FSF address.
2012-10-01 09:06:51 -07:00
Stephen Williams a233e21cd8 Prepare for 0.9.6 release. 2012-09-05 18:20:12 -07:00
Stephen Williams 87c691654e Spelling fixes. 2012-09-05 17:55:20 -07:00
Cary R 1f6aec6e26 Add %u support to the scanf routines. 2012-09-05 14:24:09 -07:00
Cary R 61cfb9e1fd Add support for %z to the scanf() routines 2012-09-04 18:46:37 -07:00
Cary R 01c4cd3dad Windows (mingw) _vsnprintf() returns -1 not the required size on overflow.
Windows and hence mingw does not follow the standard regarding the return
value of vsnprintf(). The mingw code needs to iteratively search for a
buffer large enough to print the output.
2012-08-31 10:57:31 -07:00
Cary R 62f1aa135b Cleanup after the va_copy()
I missed that va_end() needs to be called on the new ap created by va_copy().
2012-08-31 09:22:36 -07:00
Cary R 5794098aa4 Save the va_list so it can be reused if needed.
The second call to vsnprintf() needs to have a copy of the argument list
so it can run correctly. On some system vsnprintf() destorys the original
argument list.
2012-08-30 20:04:25 -07:00
Cary R 9d5f438872 Allocate a string buffer as needed in the code generator and vvp display code
When sending a string to a system task/function allocate the space needed
to avoid truncating the string vs using a large fixed buffer.

In vvp allocate and use an exactly sized buffer for the MCD print routine if
the fixed buffer is not large enough. Using a fixed buffer keeps normal
printing fast.
2012-08-30 19:12:23 -07:00
Martin Whitaker 267ba427a3 Fix for pr3561350.
When a new NetEBMult object is created, the compiler guesses the
expression width based on the sum of the operand widths. When we
duplicate an expression, we need to override this with the width
from the original expression.
2012-08-29 10:29:56 -07:00
Martin Whitaker a3987a112b V0.9: Fix for pr3557493.
defparam assignments found inside a generate block were being stored
in the enclosing module scope. They should be stored in the generate
block scope.
2012-08-21 17:46:50 -07:00
Cary R e8b40e14b9 Update lxt, lxt2 and fst files to latest from GTKWave 2012-08-16 14:56:32 -07:00
Cary R 34bb00144f V0.9: back port some cross compile changes 2012-08-13 18:09:00 -07:00
Cary R 0a518c1786 V0.9: update uninstall include directory rule 2012-08-13 17:12:00 -07:00
Martin Whitaker cd029fe35d Fix time scaling in PLI TF routines for MinGW.
When built with MinGW, pow() may not always generate an exact integer
result when supplied with integer operands. Converting the result to an
integer before we use it seems to be enough to work round this issue.
2012-08-06 13:39:40 -07:00
Martin Whitaker 693574107b V0.9: Add missing semi-colons in parser rules.
Also add null actions to prevent older versions of bison failing due
to type clashes, plus a few minor spelling/formatting fixes.
2012-08-01 15:39:56 -07:00
Martin Whitaker db3b1d9bf0 Handle error case of zero width in indexed part select.
The compiler doesn't currently check that the width of an indexed
part select is non-zero. If code contains this erroneous case, the
compiler can crash (with an assertion failure). This patch causes
the compiler to output a suitable error message and recover. It
also fixes a potential crash if an illegal expresson is encountered.
(cherry picked from commit c4ff8300d3)
2012-07-27 18:49:48 -07:00
Martin Whitaker d3563bc210 V0.9: Allow a UDP instance to have a simple real delay.
The parser does not distinguish between module and UDP instances, so
a UDP delay is handled by the rules used for parsing module parameter
overrides. Although these rules had been relaxed to accept the case of
a simple decimal value (e.g. #10), they did not allow a simple real
value (e.g. #0.1).
2012-07-27 18:35:08 -07:00
Martin Whitaker 52f15498b9 V0.9: Fix elaboration order in generate blocks.
Currently, localparam declarations inside generate blocks are
elaborated after any nested generate constructs are elaborated.
This prevents the localparams being used by the nested constructs.
Reversing the elaboration order fixes this bug.
2012-07-01 12:15:02 -07:00
Martin Whitaker 27cb31db4b V0.9: Fix for pr3527022.
This patch adds support for an explicit range or type in a parameter
declaration that is part of a module parameter port list.
2012-05-18 13:57:18 -07:00
Cary R a6ca1a7ce8 V0.9: For a delayed vpi_put_value() copy any pointer data members.
When vpi_put_value() is asked to delay the assignment any pointer data
needs to be duplicated so that the caller can clean up the locally
allocated memory without causing memory access problems.
2012-04-02 15:31:32 -07:00
Martin Whitaker ca2319153f V0.9 - Fix for pr3499807.
Output a "sorry" message to inform the user that tranif delays are
not supported.
2012-03-12 09:06:16 -07:00
Cary R 0210d49cf8 V0.9: Fix the formatting of time values that are less than 1
This patch is a modification of a user contributed patch that fixes the
time formatting when the time is less than 1 and $timeformat() is used.
2012-01-23 18:52:49 -08:00
Cary R c292f77f28 V0.9: Remove crash for function def with zero args and warn on calls
Normal Verilog does not allow a function to be defined without at
least an input argument. This patch fixes a crash that was happening
when a function with no arguments was defined. It also adds checks
and prints a descriptive error message when calling a function without
an argument.

The development branch allows this in SV.
2012-01-09 19:12:55 -08:00
Cary R 5f47d660a1 V0.9: remove unneeded -s flags for flex
I added these in a previous patch, but they are not needed and
generate a warning.
2012-01-07 11:35:43 -08:00
Cary R b47fad7d19 V0.9: Update lex/yacc builds to be consistent and to support parallel builds
Not all the lex/yacc (flex/bison) targets were using a consistent syntax.
This patch fixes that and explicitly serializes the *.c/*.cc and *.h build.
Not doing this was causing problem when using make -j. The issue appears to
be that if two targets are specified for a rule (e.g. file.cc file.h: file.y)
make does not realize they are both built by the same call so the rule is
executed twice. Once for the .cc target and once for the .h target. This is
not a problem for a serial build. To work around this only use the .c/.cc
file in the main target and then make the .h file depend on the .c/.cc file
as a sub-target.
2012-01-04 18:40:37 -08:00
Cary R e1789e7fb9 V0.9: To reduce error divide by an integer vs multiple by a fraction.
This same change was done in the vpi directory. This patch fixes the
issues in the libveriuser directory. This fixed a fail in the vpi
timescale test under MinGW.
2011-12-16 19:09:48 -08:00
Martin Whitaker 2b67a6d465 Add support for param declarations with signed type but no range
The standard allows a parameter (or localparam) declaration of the
form "parameter signed my_param = ...". The parser currently rejects
this. A small adjustment is also required in the parameter evaluation
code to correctly apply the type.
2011-12-16 13:52:18 -08:00
Martin Whitaker c96619527a Fix for pr3452808.
The tran island rework included an optimisation that meant that an
island port would only be resolved once the initial value for the net
attached to that port had propagated to the port. However, v0.9 does
not propagate initial values in some cases, so this optimisation
cannot be used.
2011-12-10 12:09:26 -08:00
Cary R 0fa7764eac V0.9:Don't pad a real argument to a user task.
The compiler was incorrectly padding real arguments to tasks if they were
assigned to vectored arguments greater than 1 bit wide. This was asserting
for some cases and generating incorrect code for others.
2011-12-05 19:07:10 -08:00
Cary R c60877999c V0.9: Define turn_sig_to_wire_on_release_ to false in constructor.
Not giving this a default value was leaving the value undefined under
some circumstances. This was producing incorrect results on Cygwin.
2011-11-25 17:06:02 -08:00
Cary R fff46da881 v0.9: Treat an empty @* as something that will never trigger.
An @* with no sensitivities should be treated as something that will
never trigger vs something that will run continuously. This patch makes
this change and adds a warning when an @* has no sensitivities since
this is almost certainly a coding bug.
2011-11-23 17:34:00 -08:00
Cary R 34d8eb27c7 V0.9: Add support for a named block to only have variable definitions.
It is legal for a named block to contain variable definitions and
no statements. This patch fixes this for both style of blocks. It
also organizes the block parsing code to be a bit more clear, adds
an error case for fork/join and changes on check for size() > 0 for
the more efficient ! empty().
2011-11-22 20:48:43 -08:00
Stephen Williams e97ca19a25 Add --always and --dirty to git describe. 2011-11-19 09:05:36 -08:00
Cary R 68c6e578ae V0.9: For wire and/or nets we need all the net resolution to be and/or.
If a wired and/or net has more than four connections all the other
resolution branches must also be wired and/or. All other nets can
just be tri since tri0/tri1 only needs the final resolution to be
an active pull up/down.
2011-11-19 08:48:31 -08:00
Cary R 8e1c507984 V0.9: Assert that sync/async set/clear are not supported for a DFF primitive.
Since synthesis is not currently supported we do not support/generate
sync/async set or clear control inputs. This is further complicated by
the fact that the VVP DFF primitive is not fully implemented.
2011-11-17 14:42:07 -08:00