VERILOG2102: Constant functions should not contain static variables with initializer
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| HIGH | - | - | Intentionality | Logical | 5min | synthesis, vscode, linter, simulation |
Description
A constant function contains a static variable with an initializer. That initializer will be skipped during constant evaluation, which could lead to unintuitive results.
Noncompliant code example
localparam int foo = func(); function int func; static int i = 1; return i; endfunction
Parameters
No parameters.