When a user or system function is called on the RHS of a continuous assignment, and one of the function arguments is an undeclared identifier, the compiler reports the error correctly but then crashes. This patch fixes the crash.
This patch changes the method used to signal that a constant expression is being elaborated from flags stored in global variables to flags passed down the call chain. It also generates more informative error messages when variable references are found in a constant expression.
This patch ensures that the result of a shift is an undefined value if the right operand is an undefined value. It also improves the code generated for right shifts where the right operand is constant and optimises away shifts where the right operand is a constant 0. It also fixes a few places where the expression type (signed/unsigned) was not being set correctly.
This patch adds a check on the expression type before adjusting an unsized expression width up to integer_width. This adjustment should only be performed for vectorable expressions. The patch also fixes a few compiler warnings that only show up on 32-bit builds.
This patch modifies the compiler and the ivl interface to pass the type of indexed part select that is being represented (up/down) in a procedural L-value or R-value. This is needed by any back end that wants to correctly denormalize the (zero based) base expression.
When taking a variable part select of a parameter we need to give file and line information to the select not the parameter.
Constant user functions aren't currently supported. A suitable error message should be output when a user function call is encountered in a parameter expression. This got lost in the parameter expression rework.
The compiler currently performs parameter expression elaboration before performing parameter overrides. This means that the information needed to correctly determine the expression type and width may not be available at the time elaboration is performed. This patch reworks the code to delay elaboration until after all overrides have been performed. It also provides a new -g option that controls how the width of parameter expressions is calculated when the parameter itself is unsized.
This patch covers more than it should. It removes many of the -Wextra warnings in the main ivl directory. It also makes some minor code improvements, adds support for constant logicals in eval_tree (&&/||), adds support for correctly sign extending === and !==, it starts to standardize the eval_tree debug messages and fixes a strength bug in the target interface (found with -Wextra). The rest of the warnings and eval_tree() rework will need to come as a second patch.
This patch changes all the iterator code to use a prefix ++ instead of postfix since it is more efficient (no need for a temporary). It is likely that the compiler could optimize this away, but lets make it efficient from the start.
SystemVerilog .name() methods can be converted to equivilent system functions.
An unsized signed constant that is smaller than integer_width needs to be resized up to either the integer_width or the expression width whichever is smaller.
This patch mimics what was done for vectors, but is simpler since arrays don't use the endian information. It also needs to address the fact that .array/port assumes the expression is unsigned so any signed expression must be padded to make it larger than the maximum array word when it is converted to unsigned.
This patch modifies all the variable bit and indexed part selects to use a common routine. This routine determines the minimum width needed to calculate the result correctly, pads the expression if needed and then converts the expression to signed if required to make the calculation correct.
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.
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.
Some new shadow issues have crept in. This patch fixes these new issues and adds -Wshadow to the normal warning flags to keep any new occurrences from happening.