Conditional Branching - 2024.1 English

Vivado Design Suite User Guide: Programming and Debugging (UG908)

Document ID
UG908
Release Date
2024-05-30
Version
2024.1 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 previously with <condition1> and <condition2>, refer to the section Conditional Statements.