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.
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 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.
This patch adds support for passing the delay selection to vvp. It adds a new header :ivl_delay_selection "<value>"; that has the values TYPICAL, MINIMUM or MAXIMUM depending on the -T flag to iverilog. This information is needed by $sdf_annotate to select that appropriate value for a triplet when "TOOL_CONTROL" is specified (default).
This patch adds checks in various places to prevent the user from taking a concatenation of a real value.
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.
This includes enough API to get the branch nexus bits and signals and show them in the dump. This also includes creating the reference ground for branch access functions that use the implicit ground.
Put together the infrastructure for elaborating analog statements, including create the NetAnalogTop objects that hold analog statements and are in turn held by the design. While doing this, clean up the various unique initial/always enumerations to use the ivl_process_type_t type.
When elaborating a parameter expression fails we need to set the expression to 0 since it has already been partially allocated. Doing this allows us to not evaluate the dummy expression later.
When generate schems and instance arrays are nested, it takes multiple iterations of elaborate scope, defparams and evaluate parameters before everything is worked out. Rework the work item processing so that the loop elaborates scopes and runs defparams in phases. The phases are needed so that we can tell when the remaining defparams are orphaned.
The l-value of a defparam assignment is a hierarchical name that may include array selects to select scopes from module arrays. Therefore it makes no sense to store parsed defparams in a map. Instead, they should go into an ordered list. This also maked more sense because later defparams *may* have the same name as a previous defparam, and will override the previous defparam. So replace the map of parsed defparams with a list of parsed defparams. Also, as soon as the defparam expression is elaborated, the list entry is no longer needed, so delete it. Save memory.
It is possible for defparams to not find their target the first time around, because the elaboration of the target scope is not yet done. So retry the defparams once for each scope by putting it on a work item in the elaborator_work_items list.
This patch adds the time and realtime types to parameters and local parameters. It also makes the width (range) of an integer parameter match the variable "integer_width" (normally 32 bits). It also converts a real value to an integer when a range is implicitly or explicitly given. This all matches what the standard specifies. Fixed an error in converting -1 to a unsized verinum.
When parameters are replaced, the expression that is replaced is deleted so make sure the pointer in the map is properly updated. Also, make sure the defparam expression itself is not deleted because it is used to print messages, such as design dumps.
localparam declarations were messing up the state of parser variables so that the default types of following parameters got messed up.
Rather then join islands while branches are initially created, save the island creating for the end. This way, the process is actually recursive and greedy, reliably collecting branches into islands without conflict.
Classing parameter declarations do not need value range processing, and in fact it can get in the way.
Before this, the types of parameters were always logic, only the width and signed-ness could be controlled. A parameter may take on implicit real values if the expression were real. With this patch, the type for the parameter can be explicitly set to logic or real. This also means that the parameter real valued expressions need to be more crefully treated, possibly with casting integral expressions to real values, or real expressions to integral values.
If there is a value range for a logic/bool parameter, then test the configured value with the range and report an error if the range is out of bounds.
Parameters get their signedness from the expression that is assigned to them unless the type is explicitly expressed where the parameter is declared.
Rework the handling of file names to use a perm_string heap to hold the file names, instead of the custom file name heap in the lexor. Also rename the get_line to get_fileline to reflect its real duties. This latter chage touched a lot of files.