Difference between revisions of "Static elaboration"
(Created page with "'''Q: What does 'static elaboration' do?''' Static elaboration runs after analysis. It modifies the parsetree. During static elaboration: * Identify top-level modules and tr...") |
m (Reorganize for clarity) |
||
(5 intermediate revisions by one other user not shown) | |||
Line 11: | Line 11: | ||
* In each module, parameter values are replaced with constant values by evaluating the constant expression assigned to them. Constant expressions include constant function calls, some system function calls AMS function calls and all operators. | * In each module, parameter values are replaced with constant values by evaluating the constant expression assigned to them. Constant expressions include constant function calls, some system function calls AMS function calls and all operators. | ||
* Function and task calls are checked for their validity (if they are defined in higher level of hierarchy and used in lower level). | * Function and task calls are checked for their validity (if they are defined in higher level of hierarchy and used in lower level). | ||
+ | |||
Sequential code, blocking assignments, tasks and functions are left as is because they are not part of any static context. Only exception are constant function calls - they are replaced with their return values. | Sequential code, blocking assignments, tasks and functions are left as is because they are not part of any static context. Only exception are constant function calls - they are replaced with their return values. | ||
− | Runtime flag 'veri_replace_const_exprs' when set to 1 is to replace following constant expressions with literals | + | If the purpose of the application is to synthesize the design (RTL elaboration), static elaboration is not needed. |
+ | |||
+ | Runtime flag 'veri_replace_const_exprs' when set to 1 is to replace following constant expressions with literals: | ||
* Bounds of packed and unpacked ranges in all data declarations. | * Bounds of packed and unpacked ranges in all data declarations. | ||
Line 21: | Line 24: | ||
* Reject and error limits of VeriPathPulse values. | * Reject and error limits of VeriPathPulse values. | ||
* Indexed expressions only if the indexed expression is a bit-select on the LHS of a continuous assignment or output/inout port of module or gate instantiation. | * Indexed expressions only if the indexed expression is a bit-select on the LHS of a continuous assignment or output/inout port of module or gate instantiation. | ||
+ | |||
+ | Using 'veri_replace_const_exprs' makes an extra pass on the elaborated parsetree, increasing total time. | ||
+ | |||
+ | |||
+ | There are other runtime flags controlling static elaboration process, e.g. | ||
+ | |||
+ | veri_cleanup_base_modules | ||
+ | veri_copy_top_before_static_elab | ||
+ | veri_do_not_uniquify_interface_instances | ||
+ | veri_preserve_array_instances | ||
+ | veri_preserve_interface_array_instances | ||
+ | vhdl_uniquify_all_instances | ||
+ | vhdl_copy_top_before_static_elab | ||
+ | vhdl_replace_const_exprs | ||
+ | ... | ||
+ | |||
+ | Please see vhdl/VhdlRuntimeFlags.h and verilog/VeriRuntimeFlags.h for a complete list and for more details. |
Latest revision as of 13:55, 14 September 2023
Q: What does 'static elaboration' do?
Static elaboration runs after analysis. It modifies the parsetree. During static elaboration:
- Identify top-level modules and tree of instantiations under this.
- Defparam statements and module instantiations are processed to calculate the parameter values of the modules for every instantiation.
- Hierarchical names are checked for their validity and usage. These hierarchical names remain in designs.
- Generate statements are processed. For generate unrolled, if/case generate selects the correct concurrent statements to be present in the module.
- Instance arrays are flattened.
- Depending on hierarchical name usage and defparam values the same module gets different signatures. They are replicated and proper values are passed within them hierarchically before attaching them to the corresponding instantiations.
- In each module, parameter values are replaced with constant values by evaluating the constant expression assigned to them. Constant expressions include constant function calls, some system function calls AMS function calls and all operators.
- Function and task calls are checked for their validity (if they are defined in higher level of hierarchy and used in lower level).
Sequential code, blocking assignments, tasks and functions are left as is because they are not part of any static context. Only exception are constant function calls - they are replaced with their return values.
If the purpose of the application is to synthesize the design (RTL elaboration), static elaboration is not needed.
Runtime flag 'veri_replace_const_exprs' when set to 1 is to replace following constant expressions with literals:
- Bounds of packed and unpacked ranges in all data declarations.
- Default values of all declared objects if those are constant.
- Delay values
- Reject and error limits of VeriPathPulse values.
- Indexed expressions only if the indexed expression is a bit-select on the LHS of a continuous assignment or output/inout port of module or gate instantiation.
Using 'veri_replace_const_exprs' makes an extra pass on the elaborated parsetree, increasing total time.
There are other runtime flags controlling static elaboration process, e.g.
veri_cleanup_base_modules veri_copy_top_before_static_elab veri_do_not_uniquify_interface_instances veri_preserve_array_instances veri_preserve_interface_array_instances vhdl_uniquify_all_instances vhdl_copy_top_before_static_elab vhdl_replace_const_exprs ...
Please see vhdl/VhdlRuntimeFlags.h and verilog/VeriRuntimeFlags.h for a complete list and for more details.