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.
TRANSITION( st_start, 1, 1, next_state_rec, state_reg_rec );
TRANSITION( 2, 5, ms(1), next_state_rec, state_reg_rec );
[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] |
[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 |
Voice and Hotkey Commands:
[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] |
[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)" |
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 |
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. |