Martin Whitaker
1069a0ef02
Don't evaluate built-in system functions if they are overridden.
...
We don't support evaluating user-defined system functions at compile
time. If possible, defer evaluation until run time. If used in a
constant expression, output a "sorry" message.
2019-10-19 16:12:17 +01:00
Martin Whitaker
9f7dc732ab
Add error recovery for invalid cast expressions.
2019-10-11 19:04:23 +01:00
Martin Whitaker
d56e90c3f4
Fix casts to integer types.
...
Casting from signed to unsigned types and vice versa is legal in SV,
as is casting from a larger to a smaller size. Obey Verilog rules
for expression bit width and signedness.
2019-10-10 23:48:11 +01:00
Martin Whitaker
f2ca63a5a1
Disable debug output when debug_elaborate is not set.
2019-10-06 18:10:58 +01:00
Martin Whitaker
de54a58991
Fix issue #265 - emit a sensible error message when an explicit cast is needed.
2019-10-06 17:54:44 +01:00
Cary R
e4ef928751
Fix some space issues
2019-09-29 17:11:19 -07:00
Stephen Williams
7b66de0711
Handle nested packed strucdts in r-values.
2019-09-24 15:05:39 -07:00
Martin Whitaker
02ee1c65d0
Support dynamic array initialisation in variable declarations.
2019-09-16 20:35:27 +01:00
Martin Whitaker
34bb98676a
Fix assertion failure on illegal SV cast.
...
Bug reported on iverilog-devel on 2018-02027.
2019-09-07 14:35:19 +01:00
Martin Whitaker
c4f71db00a
Update some comments.
2019-05-10 20:00:04 +01:00
Martin Whitaker
230f0bc13c
Fix GitHub issue #219 and #220 - incorrect results from SV size cast.
2018-12-15 11:11:35 +00:00
Martin Whitaker
e71a76a1e2
Fix signed/unsigned comparison warning.
2018-10-06 20:40:54 +01:00
Martin Whitaker
f1608e163f
Fix implicit fallthrough warnings when building with recent GCC.
2018-10-06 20:15:42 +01:00
Martin Whitaker
87c01c55c0
Don't allow non-vectorable arguments to $signed/$unsigned.
...
This led to an assertion failure in many cases (see br1029).
1364-2012 indicates it is illegal.
2018-05-14 22:13:56 +01:00
Cary R
c68a7fede3
Fix spacing
2017-11-20 07:30:52 -08:00
Cary R
3fc9ad2db0
Add support for the wild compare operators ==? and !=?
2017-11-17 19:32:50 -08:00
Cary R
d23b046203
Update the enumeration methods to set their width test attributes correctly
2017-11-17 13:09:14 -08:00
Martin Whitaker
5ca058bfb5
Add support for darray initialisation from another darray.
...
Fixes GitHub issue #164 .
2017-10-08 17:51:33 +01:00
Martin Whitaker
8a36849fda
Generate proper error messages for invalid dynamic array initialisers.
...
Invalid user code should not result in an "internal_error".
2017-10-08 12:59:30 +01:00
Martin Whitaker
8f6f999ea7
Fix for GitHub issue #142 - assertion failure when parameter expression
...
contains undefined variable.
2017-01-29 10:47:54 +00:00
Martin Whitaker
7cac4677bf
Fix for GitHub issue #130 part 2 : assertion failure on unsupported cast.
2016-11-25 22:11:13 +00:00
Henry Wong
182c08b528
Fix segfault when error in multi-dimensional part select.
2016-10-27 10:59:31 -07:00
Cary R
5853e32f82
Fix some cppcheck warning issues
2016-09-13 23:45:25 -07:00
Cary R
c706c5dd90
The array properties can be available in a constant context
...
For most arrays the various properties are available as constant
values and can be evaluated in the compiler.
2016-09-11 14:25:00 -07:00
Martin Whitaker
7f475d4210
Refactor to use new pad_to_width/cast_to_width functions.
2016-03-25 22:23:45 +00:00
Martin Whitaker
dc1c3a4043
Fix for GitHub issue #94 - enhance support for SystemVerilog size casting.
...
Allow the size expression to be any constant expression. Also ensure that
the expression width and type are correctly calculated and applied.
2016-03-25 21:49:28 +00:00
Martin Whitaker
0199ad129d
Fix expression type for compressed assignment statements.
...
A compressed assignment statement should give exactly the same
result as the equivalent uncompressed statement. This means
that the type (signed/unsigned) of the LHS affects the type of
the RHS expression (unlike in normal assignments). We need to
take care that bit/part selects and concatenations are correctly
identified as unsigned values, even in the cases where they
reduce to a single whole signal.
2016-02-23 16:53:01 +00:00
Maciej Suminski
32fab21e95
ivl: Allow concatenating strings returned by function calls.
2016-01-07 11:11:04 +01:00
Cary R
399384d81b
Fix some cppcheck warnings and bugs
2015-12-19 17:19:19 -08:00
Christian Taedcke
6d5aabd4f0
Make a few constructors explicit.
...
This removes cppcheck warnings.
2015-10-22 12:33:33 +02:00
Cary R
e682029648
A concatenation or the expression being replicated must have a non-zero width
2015-08-18 16:22:50 -07:00
Larry Doolittle
3e2196651a
Remove unused parameter to indices_to_expressions
...
need_addr has been hanging around, unused, since commit 078a3fd4 on Jan 17, 2014.
2015-07-31 09:48:33 -07:00
Martin Whitaker
44dfc41004
Detect and report excess function arguments.
...
Also enhance a couple of error messages.
2015-06-21 09:07:11 +01:00
Larry Doolittle
b23faff27c
Just a few more spelling fixes
...
Includes some user-visible messages
2015-06-17 08:09:34 -07:00
Larry Doolittle
2739f83702
Spelling fixes in C and C++ comments
2015-06-04 15:00:29 -07:00
Martin Whitaker
ab688613cc
Fix for br978 - assertion involving addition of $ivlh_to_unsigned() result.
...
$ivlh_to_unsigned, unlike $signed and $signed, can cause a reduction
in width. The shared PECallFunction::cast_to_width_ method did not
support this.
2015-05-22 00:05:39 +01:00
Martin Whitaker
301a7e587b
Fix for GitHub issue #62 - assertion failure on too many array/vector indices.
...
Provide an error message for invalid code that contains more indices than
there are dimensions.
2015-04-25 22:57:14 +01:00
Martin Whitaker
22d15f9ca9
Fix handling of expression width with $ivlh_to_unsigned.
...
The first argument to $ivlh_to_unsigned should be treated as having
a self-determined width.
2015-04-25 09:20:31 +01:00
Maciej Suminski
83d721232d
ivl: $ivlh_to_unsigned() also tests its argument width.
2015-03-27 20:53:14 +01:00
Cary R
102d2d534f
Remove extra warning code.
2015-03-09 14:35:31 -07:00
Cary R
bddfcac823
The === and !== operators cannot be used with a SV string
2015-03-02 15:34:22 -08:00
Maciej Suminski
8b3667f76e
ivl: Casting vectors to dynamic arrays.
2015-02-04 16:02:38 +01:00
Maciej Suminski
a52242745a
ivl: Casting dynamic arrays to vectors.
2015-02-04 16:02:38 +01:00
Maciej Suminski
35401f0e2c
ivl: Functions may return dynamic arrays.
2015-01-12 11:08:31 +01:00
Cary R
96472e5537
For a signed R-value we can use the full width when converting to long
...
When trying to get the value we can use the full width of a long if the
expression is signed.
2014-12-10 14:41:27 -08:00
Stephen Williams
38f277d81b
Merge branch 'master' into vec4-stack
...
Conflicts:
vvp/array.cc
vvp/vthread.cc
2014-12-02 11:21:58 -08:00
Maciej Suminski
c3a318f14e
ivl: Casting vectors to strings.
2014-11-27 17:36:23 +01:00
Maciej Suminski
b2deae7ba9
ivl: More meaningful errors messages. Minor code formatting.
2014-11-27 17:36:23 +01:00
Maciej Suminski
675dd91403
ivl: Added sign checking & casting between integers of different size.
2014-11-27 17:36:23 +01:00
Maciej Suminski
b12e00d875
ivl: String to vector casting.
2014-11-27 17:36:23 +01:00