Counters - 2021.1 English

Vivado Design Suite User Guide Programming and Debugging (UG908)

Document ID
UG908
Release Date
2021-06-16
Version
2021.1 English

The four built-in 16-bit counters have fixed names and are called $counter0, $counter1, $counter2, $counter3. The counters can be reset, incremented, and used in conditional statements.

  • To reset a counter, use the reset_counter action:
    state my_state_0:
      reset_counter $counter0;
          goto my_state_1;
  • To increment a counter, use the increment_counter action:
    state my_state_0:
      increment_counter $counter3;
          goto my_state_1;

For more information on how to use counters in conditional statements, refer to Conditional Statements.