VERILOG054: Functions should have an “automatic” lifetime to be used in synthesizable code

Summary

Count: 1

ReliabilitySecurityMaintainabilityCode attributeEffort to fixTags
HIGH--Intentionality | Logical10minsynthesis, 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.