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.