G
Gunit
Guest
Can someone suggest how I can set flags in a combinatorial part of a
Mealy type state machine, that are used to determine how the state
machine vectors between states, without having to clear the flags on
each iteration of the state machine process?
For example, I have states a,b,c,d,e,f. On start-up, the state machine
vectors a->b->c->, in state 'c' some input condition causes the state
machine to vector back to state 'a', with this branch of the state
machine taken, a flag has been set so that when the state machine
vectors 'a' to state 'b' with the flag set, the state machine will
vector from state b to state 'f'. In state 'f' I clear the flag. State
'c' is the only state that the flag is set, state 'f' is the only
state that the flag is cleared.
When I synthesise the state machine, I get a warning
"'flag' is not always assigned. Storage may be needed.."
Am I avoiding generating a latch if I am certain that the flag will be
cleared in a subsequent state, or is this bad practice in general??
Thanks in advance
Sion
Mealy type state machine, that are used to determine how the state
machine vectors between states, without having to clear the flags on
each iteration of the state machine process?
For example, I have states a,b,c,d,e,f. On start-up, the state machine
vectors a->b->c->, in state 'c' some input condition causes the state
machine to vector back to state 'a', with this branch of the state
machine taken, a flag has been set so that when the state machine
vectors 'a' to state 'b' with the flag set, the state machine will
vector from state b to state 'f'. In state 'f' I clear the flag. State
'c' is the only state that the flag is set, state 'f' is the only
state that the flag is cleared.
When I synthesise the state machine, I get a warning
"'flag' is not always assigned. Storage may be needed.."
Am I avoiding generating a latch if I am certain that the flag will be
cleared in a subsequent state, or is this bad practice in general??
Thanks in advance
Sion