Case Statement - Case Statement - 2022.2 English - UG901

Vivado Design Suite User Guide: Synthesis (UG901)

Document ID
UG901
Release Date
2022-11-16
Version
2022.2 English

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 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.