VHDL003: Each case statement should define an “others” clause
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| HIGH | - | - | Intentionality | Complete | 5min | synthesis, do254-ss2, do254, vscode, simulation, linter, cnes, cnes-std-04000 |
Description
The requirement for a final others clause within a case statement is defensive programming.
The clause should either take appropriate action or contain a suitable comment as to why no action is taken.
Noncompliant code example
case my_case is when 0 => z <= a; when 1 => z <= b; when 2 => z <= c; end case;
Compliant solution
case my_case is when 0 => z <= a; when 1 => z <= b; when 2 => z <= c; when others => z <= d; end case;
Parameters
No parameters.