VERILOG2039: Constant functions should not access nonexistent ranges of dynamic arrays
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| HIGH | - | - | Intentionality | Logical | 10min | synthesis, vscode, simulation, linter |
Description
Noncompliant code example
typedef int ret_type[2]; localparam ret_type foo = func(); function ret_type func; automatic int i[] = new [2]; return i[6:7]; // Noncompliant endfunction
A constant function tried to access a nonexistent range of a dynamic array.
Parameters
No parameters.