VHDL003: Each case statement should define an “others” clause

Summary

Count: 1

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