VHDL1064: Choices outside of range should be removed
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| MEDIUM | - | - | Intentionality | Logical | 30min | synthesis, bug-finder, do254-ss2, do254, linty-ultra |
Description
Noncompliant code example
X : in integer range 7 downto 0;
...
case X is
when 0 =>
Z <= A;
when 1 to 8 => -- Noncompliant: '8' is outside of range 7 downto 0
Z <= B;
end case;
Compliant solution
X : in integer range 7 downto 0;
...
case X is
when 0 =>
Z <= A;
when 1 to 7 =>
Z <= B;
end case;
Choices outside of range are useless and should be removed.
Parameters
No parameters.