Functions

Overview

The TRANSITION procedure call is used for scheduling a state machine transition to a user specified state solely as a function of time. A valid state must be a non-negative integer literal or VHDL constant integer state name prefixed by 'st_'. If the transition_state value is given as the constant -1 then no transition will occur. Time delays before a transition are created by configuring a dual counter and specifying count values or timing function for the framework delay counter (slower counter), or divide counter (faster counter), or both. In many use cases, the delay_count value is given as an integer, and the divide_count value is given as a timing function indicating either us, ms, or seconds. At the expiration of the count (one clock cycle before rollover would occur), the delay.done and/or divide.done strobe signal is asserted, and the state machine is set to transition state on the next rising edge of the clock.

It should be noted that when using the TRANSITION procedure call, the delay counter and divide counter never hold the same count between clock cycles and have no explicit reset mechanism. The counters are always active in a state machine state in which the procedure is called and count upward on every clock cycle until they either roll over or are implicitly reset to zero when a transition occurs. This is in distinct contrast to the use case of TIME_COUNTER which also uses the delay counter and divide counter, except the TIME_COUNTER procedure call is allowed to explicitly reset the counters but is not allowed to cause a state machine transition. This separation of capability is by design, provides better semantics, and reduces debugging time than if one procedure call could perform all functions.

Usage Example

Todo:
Add Example Usage and image of state machine

Example API Call(s):

TRANSITION( st_start, 1, 1, next_state_rec, state_reg_rec );
TRANSITION( 2, 5, ms(1), next_state_rec, state_reg_rec );

Call Data [ 5 parameters (5 mandatory) ]

Parameters
[in]transition_state[1] integer state to transition to when delay_done asserted
[in]delay_count[2] integer delay count value (minus one) before rollover
[in]divide_count[3] integer divide count value (minus one) before rollover (faster counter)
[out]next_state_rec[4]
[in]state_reg_rec[5]

Return Data

Parameters
[in]state_reg_rec(M).delay.value[1] [integer] delay count value returned from framework
[in]state_reg_rec(M).delay.done[2] [std_logic] strobe asserted '1' before rollover
[in]state_reg_rec(M).divide.value[3] [integer] divide count value returned from framework
[in]state_reg_rec(M).divide.done[4] [std_logic] strobe asserted '1' before rollover

Command Reference

Voice and Hotkey Commands:

See also
Transition Commands

Command Parameter Mapping

Parameters
[in]transition_state[1] "go to [state] (<state>|<integer>)"
[in]delay_count[2] "delay <integer>"
[in]divide_count[3] "divide <integer>"
[out]next_state_rec[4]
[in]state_reg_rec[5]

Command Return Data

Parameters
[in]state_reg_rec(M).delay.value[1] [integer] "delay value"
[in]state_reg_rec(M).delay.done[2] [std_logic] "delay (done|strobe)"
[in]state_reg_rec(M).divide.value[3] [integer] "divide value"
[in]state_reg_rec(M).divide.done[4] [std_logic] "divide (done|strobe)"

Voice/HotKey Command Sequence

TRANSITION( 4, 10, ms(1), next_state_rec, state_reg_rec );

Voice Command HotKey Sequence
"transition to state four" tr4
"count ten" count 10
"divide one milli-second" divide 1ms

Notes and Warnings

Note
  1. delay_count or delay_count parameter value of -1, 0, or 1 are taken to mean 1 clock cycle.
Warning
The TRANSITION and TIME_COUNTER procedure calls utilize the same delay and divide counter hardware. Thus, the calls should not be used the same resource index.

See also
CONDITIONAL_TRANSITION
TIME_COUNTER
CONFIGURE_COUNTER
STATE MACHINE CONSTRUCTION
Timing Functions

Procedures

  TRANSITION(
transition_state: STATE_INTEGER
delay_count: in integer
divide_count: in integer
signal next_state_rec: out NSR
state_reg_rec: in SRR
)
  TRANSITION(
transition_state: STATE_INTEGER
delay_count: in integer
divide_count: in integer
signal next_state_rec: out NSR_ARRAY
state_reg_rec: in SRR_ARRAY
)
 Overloaded for array interface.