VERILOG054: Functions should have an “automatic” lifetime to be used in synthesizable code
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| HIGH | - | - | Intentionality | Logical | 10min | synthesis, vscode, linter |
Description
Noncompliant code example
function logic [2:0] foo( // Noncompliant: No "automatic" lifetime logic [2:0] a, logic [2:0] b ); return a ^ b; endfunction : foo
Compliant solution
function automatic logic [2:0] foo( logic [2:0] a, logic [2:0] b ); return a ^ b; endfunction : foo
Articles & blog posts
Functions should have an automatic lifetime to be used in synthesizable code.
Parameters
No parameters.