VERILOG2046: Enum members that are specified as ranges should only define ranges with integer literals
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| HIGH | - | - | Consistency | Conventional | 10min | portability, synthesis, vscode, linter, simulation |
Description
Noncompliant code example
localparam int i = 1;
typedef enum { A[i:3] } e_t;
Compliant solution
typedef enum { A[1:3] } e_t;
An enum member that is specified as a range should only define this range with integer literals (constant expressions are not allowed by the standard).
Parameters
No parameters.