Contact us Start a Trial

Redundant "others"

If a case statement contains all the possible choices (usually in an enumerated datatype), you can safely remove the when others clause. Sigasi Visual HDL warns about this:

Unexpected ‘others’ choice, case statement covers all choices explicitly

case bits is
  when "00" => -- code
  when "01" => -- code
  when "10" => -- code
  when "11" => -- code
  when others => -- never reached: all cases are covered
end case;

There is some debate on this coding rule. However, the vast majority of synthesis tools do not take the others into account if all choices are enumerated. If the synthesis tool is set up to generate fault-tolerant hardware, the fallback state is the same as the reset state (for most synthesis tools). Check the manual of your synthesis tools and run some experiments. For more information, see VHDL case statements can do without the “others”.

If you still prefer to always have an others choice for case statements, the validation can be configured to Always require 'others' choice. When configured this way, there will be warnings on all case statements that do not have an others choice, even if that choice would be redundant.

Rule Configuration

This rule can be disabled for your project, or its severity and parameters can be modified in the project linting settings. Alternatively, it can be manually configured with the following template:

13/severity/${path}={error|warning|info|ignore}
13/params/style/${path}={disallow_redundant_others_choices|always_require_others_choice}