VERILOG2039: Constant functions should not access nonexistent ranges of dynamic arrays

Summary

Count: 1

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