Yes and no.
The real questions is: "safe from what?". State machines just don't go wild
out of blue.
In fact, this question is very hard to answer. Consider this: you detect an
invalid code in the middle of some complex situation, should you only reset
the module? Reset your chip? Reset the whole board? Reset the system? In
your module, go to a default state? What can you do in the default state?
What about the state of all of the output ports in your module just before
the failure? Can you just set them back to a default state? What about the
other modules that are connected these outputs? What about their internal
state?....
It all depends on the situation, the objectives of the whole system design,
the probabilities of such failures and the cost you're willing to pay to
protect your system from them. Sometimes it is going to be very complex and
in some simpler cases, a reset would do the trick...
<
[email protected]> wrote in message
news:
[email protected] oups.com...
> Hello, I was curious if anyone can comment on writing safe state
> machines in AHDL. I often use One-hot encoding in my state machines and
> am curious how safe it is. I set the State Machine setting in Quartus
> for One-hot Encoding, does this force all my state machines to be safe.
> If I just add the line to my state machine:
>
> When Others => StateMachine = StateA; -- go back to start
>
> will the state machine be considered safe?
>
> thanks,
> joe