The syntax for a case
statement is:
case (expression)
value1: statement1;
value2: statement2;
value3: statement3;
default: statement4;
endcase
The default statement inside a case
statement is optional. The
values are evaluated in order, so if both value1
and
value3
are true, statement1
is performed.
In addition to case
, there are also
the casex
and casez
statements. These statements let you handle don't cares
in the values
(casex
) or tri-state conditions in the values
(casez
).
If unique or priority case statements are used, Vivado synthesis treats those as parallel_case
and full_case
respectively.