J
Jerker Hammarberg (DST)
Guest
Hi all! I'd like to once again bring up the subject of state machines
running into illegal states (illegal in the sense that the state vector does
not correspond to any of the states defined in the VHDL code), because
despite having spent half a day googling and reading related threads, I'm
still left with a couple of questions:
1. Most discussions cover how to recover from illegal states, but few cover
how it actually happens. What are the (I presume) electrical reasons to that
a state machine runs into an illegal state in the first place? Is there
anything one can do to reduce the risk? Assume all FSM inputs connected to
I/O pins are synchronized with one FF each, and the whole design is
synchronous. Does anyone know of a good tutorial on this issue? I could add
that in my case, the transition into an illegal state almost always happen
immediately upon startup of the system, if it happens.
2. How can I force Xilinx XST (6.2 SP3) to produce a safe FSM that recovers
from an illegal state? A "when others => state <= IDLE;" clause doesn't seem
to help (which I think is stupid, isn't this problem so well known that they
should make XST recognize it instead of optimizing it away?). I realize that
changing coding style to "Binary" will reduce the number of illegal state
and thus the risk for it to happen, but it's not completely safe, unless the
number of states is a power of two. What's more, binary coding style seems
to increase slice utilization for the whole design by up to 10%.
Thanks in advance!
/Jerker
running into illegal states (illegal in the sense that the state vector does
not correspond to any of the states defined in the VHDL code), because
despite having spent half a day googling and reading related threads, I'm
still left with a couple of questions:
1. Most discussions cover how to recover from illegal states, but few cover
how it actually happens. What are the (I presume) electrical reasons to that
a state machine runs into an illegal state in the first place? Is there
anything one can do to reduce the risk? Assume all FSM inputs connected to
I/O pins are synchronized with one FF each, and the whole design is
synchronous. Does anyone know of a good tutorial on this issue? I could add
that in my case, the transition into an illegal state almost always happen
immediately upon startup of the system, if it happens.
2. How can I force Xilinx XST (6.2 SP3) to produce a safe FSM that recovers
from an illegal state? A "when others => state <= IDLE;" clause doesn't seem
to help (which I think is stupid, isn't this problem so well known that they
should make XST recognize it instead of optimizing it away?). I realize that
changing coding style to "Binary" will reduce the number of illegal state
and thus the risk for it to happen, but it's not completely safe, unless the
number of states is a power of two. What's more, binary coding style seems
to increase slice utilization for the whole design by up to 10%.
Thanks in advance!
/Jerker