Martin Whitaker
1f7588d3a4
Add support for darray initialisation from another darray.
...
Fixes GitHub issue #164 .
(cherry picked from commit 5ca058bfb5 )
2017-10-08 17:53:53 +01:00
Martin Whitaker
a907200fb9
Generate proper error messages for invalid dynamic array initialisers.
...
Invalid user code should not result in an "internal_error".
(cherry picked from commit 8a36849fda )
2017-10-08 17:53:21 +01:00
Martin Whitaker
b04d5a9068
Fix for GitHub issue #142 - assertion failure when parameter expression
...
contains undefined variable.
(cherry picked from commit 8f6f999ea7 )
2017-01-29 20:24:56 +00:00
Martin Whitaker
09ff851483
Fix for GitHub issue #130 part 2 : assertion failure on unsupported cast.
...
(cherry picked from commit 7cac4677bf )
2016-11-25 22:36:00 +00:00
Henry Wong
ce88deaa97
Fix segfault when error in multi-dimensional part select.
...
(cherry picked from commit 182c08b528 )
2016-11-25 21:33:47 +00:00
Martin Whitaker
8bd4e9d481
Refactor to use new pad_to_width/cast_to_width functions.
...
(cherry picked from commit 7f475d4210 )
2016-03-25 22:42:20 +00:00
Martin Whitaker
04ae07f03c
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.
(cherry picked from commit dc1c3a4043 )
2016-03-25 22:41:50 +00:00
Martin Whitaker
e2aae72880
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.
(cherry picked from commit 0199ad129d )
2016-02-23 21:27:55 +00:00
Cary R
e13a52637a
A concatenation or the expression being replicated must have a non-zero width
2015-08-18 16:23:33 -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
Maciej Suminski
103828577b
ivl: Fixed indentations.
2014-11-27 17:36:23 +01:00
Maciej Suminski
89d1125979
ivl: Bit selection using variables in strings.
2014-11-27 17:36:23 +01:00
Maciej Suminski
43c6a0bacd
ivl: Casting to int.
2014-11-27 17:36:23 +01:00
Maciej Suminski
13f861a963
ivl: Added PECastType to handle type casting.
2014-11-27 17:36:23 +01:00
Stephen Williams
82ca4cf641
Add a warning if an expression pads itself to a crazy width.
2014-11-25 14:49:04 -08:00
Stephen Williams
a98f21aa65
Merge branch 'master' into vec4-stack
...
Conflicts:
elab_lval.cc
netmisc.cc
tgt-vvp/eval_object.c
tgt-vvp/vvp_process.c
vvp/codes.h
vvp/compile.cc
vvp/opcodes.txt
vvp/vpi_tasks.cc
vvp/vpi_vthr_vector.cc
vvp/vthread.cc
2014-10-21 09:12:02 -07:00
Cary R
d85096c56a
Add support for implict this in class methods
2014-09-16 17:08:57 -07:00
Stephen Williams
480668fee6
Add support for classes defined in $root scope.
2014-09-15 17:37:30 -07:00
Stephen Williams
ea4b000be6
Get arrayed property expressions down to the ivl_target API.
2014-09-15 17:37:30 -07:00
Stephen Williams
697701a26e
Sorry messages for property arrays.
2014-09-07 17:48:19 -07:00
Stephen Williams
88e951418b
Handle elaboration of class properties referenced within sub-scopes.
2014-09-06 16:26:08 -07:00
Stephen Williams
d1a35d5152
Handle nil queue as a was to delete a queue.
...
Treat this like assigning null to a dynamic array. This deletes the
queue and thus has the effect of clearing it.
2014-09-02 12:19:58 -07:00
Stephen Williams
886b6cd349
Debug messages.
2014-08-30 10:18:57 -07:00
Stephen Williams
dec4cd5071
Handle arrays of class objects.
...
This goes all the way down to the vvp level, where we create support
for arrays of objects, generate the new code in the -tvvp code
generator, and elaborate the arrays in the first place.
2014-08-30 10:18:57 -07:00
Cary R
b4d0c43a96
Remove some compile warnings.
2014-08-25 18:24:58 -07:00
Martin Whitaker
e5f49baaac
Fix for GitHub issue #37 - bug in expression width pruning.
...
If an expression contains a division, remainder, or right shift operation,
set the expression min_width to UINT_MAX to flag that the expression width
cannot be pruned. Using UINT_MAX ensures that the min_width won't change
as we continue to elaborate the expression.
2014-08-25 20:27:22 +01:00
Stephen Williams
8c2d51142b
Elaborate pop_back/pop_front methods on dynamic arrays.
2014-08-21 16:44:46 -07:00
Stephen Williams
c9ff48bd4e
Add support for dynamic array/queue "last" index ($)
...
Internally, treat the "$" as a special expression type that takes
as an argument the signal that is being indexed. In the vvp target,
use the $last system function to implement this.
2014-08-21 16:44:45 -07:00
Stephen Williams
da63ef02d4
Implement the size method for queues.
...
This works by translating it to a $size() system function call.
The $size function is already implemented for dynamic queues and
it is easy enough to expand it for queues.
2014-08-21 16:44:45 -07:00
Stephen Williams
a730572e37
Elaborate size method of darray/queue objects.
2014-08-21 16:44:45 -07:00
Stephen Williams
6d052d4ff7
Handle queue types and expressions at pform level.
2014-08-21 16:44:45 -07:00
Martin Whitaker
e82bafcb84
Fix for GitHub issue #30 : failed assertion in eval_tree.cc
...
The root cause was the constant propagation done during elaboration
of a multiply operation, which didn't check for mixed real/logic
expressions.
2014-06-20 20:52:15 +01:00