VERILOG2121: A constant function should not access a queue with a reversed range

Summary

Count: 1

ReliabilitySecurityMaintainabilityCode attributeEffort to fixTags
HIGH--Intentionality | Logical10minsynthesis, vscode, simulation, linter

Description

Noncompliant code example

typedef int ret_type[$];
localparam ret_type foo = func();
function ret_type func;
  automatic int i[$] = {1, 2, 3};
  return i[2:0]; // Noncompliant: Reversed selection range [2:0] for queue will always yield an empty result
endfunction

A constant function is accessing a queue with a reversed range, which is defined to always yield an empty queue.

Parameters

No parameters.