This patch extends the compiler to support all specparam declarations allowed by the 1364-2005 standard. For compatibility with other simulators, it allows specparam values to be used in any constant expression, but outputs a warning message and disables run-time annotation of a specparam if it is used in an expression that must be evaluated at compile time.
When dynamic indexing of early dimensions is not needed, we can get pretty far with getting packed arrays to work.
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.
During elaboration, it is sometimes efficient to collapse a collections of PV drivers to a net to a single concatenation. This removes a bunch of resolutions and other nodes, and also is the only way that 2-value logic should work.
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.
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.
This patch add code to print a warning message if it finds both a default and `timescale based delays. The -Wall or more specifically the -Wtimescale flag can be used to find the module with the missing `timescale directive.
This patch adds messages in various places to warn that constant user functions are not supported. It uses a global variable to indicate when we are in a constant context. This is a bit of a kludge, but works well without needing to change a bunch of code. It is interesting to note that ports are elaborated late enough that if we had the constant function evaluation code they would evaluate correctly. This also applies to the function return range, the concatenation repeat, specparams and initial values. Signal definitions are early enough that elaboration is what is failing because the function body is not available (has not been elaborated). The same thing applies to both parameters and localparms.
…nts. This patch adds logical support for real values (!, && and ||). It also prints an appropriate error message when a real value is incorrectly given to an operator that does not allow real arguments (bit-wise, reduction, shift and repeat/concatenation).
This fixes up the elaboration of binary expressions found in parameter expressions. Parameter expressions are special because they elaborate early, before all the other parameters are necessarily completed.
unary expressions that have problems should not assert in the test_width method. Instead, let the error propagate back and be handled during expression elaboration. This found a few places where expression widths/types weren't probed before elaboration.
When padding a signal or when creating a local signal the file and line information should be related to where the new object was created not the signal value it is being created from. This patch modifies the NetE* pad_to_width() routines to take a LineInfo object to set the location to the correct value. It fixes some set_line() calls to use the correct location. It fixes ports to not set the file/line information if it is already defined. Doing this was causing the definition of signals to become the instantiation instead of the real module declaration.
This patch splits any VVP net functor that needs to access both statically and automatically allocated state into two sub-classes, one for handling operations on statically allocated state, the other for handling operations on automatically allocated state. This undoes the increase in run-time memory use introduced when automatic task/function support was first introduced. This patch also fixes various issues with event handling in automatic scopes. Event expressions in automatic scopes may now reference either statically or automatically allocated variables or arrays, or part selects or word selects thereof. More complex expressions (e.g. containing arithmetic or logical operators, function calls, etc.) are not currently supported. This patch introduces some error checking for language constructs that may not reference automatically allocated variables. Further error checking will follow in a subsequent patch.
Later passes need the intermediate results for width and size so that some special cases, were self-determined arguments occur, can be processed properly during elaboration. This can be especially tricky and interesting for ternary expressions.
There are cases where the r-value doesn't pad itself to the width that is requested by the call to elaborate_expr. This impacts the elaboration of PGAssign. Pad/sign extend as appropreate.