Conditional Branching - 2021.2 English

Vivado Design Suite User Guide: Programming and Debugging

Document ID
UG908
Release Date
2021-10-22
Version
2021.2 English

The trigger state machine language supports one-, two-, and three-way conditional branching per state.

  • One-way branching involves using goto actions without any if/elseif/else/endif constructs:
        state my_state_0:
          goto my_state_1;
  • Two-way conditional branching uses goto actions with if/else/endif constructs:
    state my_state_0: 
        if (<condition1>) then 
          goto my_state_1; 
        else
          goto my_state_0; 
        endif 
  • Three-way conditional branching uses goto actions with if/else/elseif/endif constructs:
      state my_state_0: 
        if (<condition1>) then 
          goto my_state_1;
        elseif (<condition2>) then 
          goto my_state_2; 
        else
          goto my_state_0; 
        endif 

For more information on how to construct conditional statements represented above with <condition1> and <condition2>, refer to the section Conditional Statements.