条件分支 - 2023.2 简体中文

Vivado Design Suite 用户指南: 编程和调试 (UG908)

Document ID
UG908
Release Date
2023-10-19
Version
2023.2 简体中文

触发器状态机语言支持对应每个状态的单向、双向和三向条件分支。

  • 单向分支涉及使用 goto 操作,且其中不含任何 if/elseif/else/endif 构造:
        state my_state_0:
          goto my_state_1;
  • 双向条件分支使用 goto 操作,且其中包含 if/else/endif 构造:
    state my_state_0: 
        if (<condition1>) then 
          goto my_state_1; 
        else
          goto my_state_0; 
        endif 
  • 三向条件分支使用 goto 操作,且其中包含 if/else/elseif/endif 构造:
      state my_state_0: 
        if (<condition1>) then 
          goto my_state_1;
        elseif (<condition2>) then 
          goto my_state_2; 
        else
          goto my_state_0; 
        endif 

如需了解有关如何使用 <condition1><condition2> 来构建先前所示条件语句的更多信息,请参阅“条件语句”部分。