J
Jim Granville
Guest
Jerker Hammarberg (DST) wrote:
Q0.D = SeriesOfTerms0;
Q1.D = SeriesOfTerms1;
Each valid state will have a number of hold-until-next-move-true terms,
but states not covered will have NO .D terms, and so their NEXT state is
Q0.D = 0;
Q1.D = 0;
or to the 00 state.
If you code
IF State=11 THEN immediate_next = 00, then no more logic is generated,
as that is implicit.
So it will get out of there automatically. With one-hot, the actual
problem is that where it GOES NEXT is also not on the state map, whereas
with other schemes, esp if you implicitly include 0000, then there is a
recovery path.
With .D registers, and you can consider FSMs as low level coded as:If you consider .D registered FSMs, then if you have enumerated 00000
as a legal state, that naturally maps what you call recovery logic.
If the tools choose one-hot, and take 00000 as illegal/not possible,
(since it is not a one-hot state) then you loose the natural recovery
path. ie the state encoding itself CAN affect the recovery, as if you
avoid the .D recovery path of all low, your FSM will not perform
the same as one that includes all lows as a specified state.
But that only solves the problem for one specific illegal state... or do
I misunderstand something? Say I have a three-state machine, where XST
by default would encode the states "100", "010", and "001". So there are
now five illegal states. If I follow your suggestion, I could encode the
states like "00", "10", and "01". But there is still one illegal state,
namely "11". I agree this is a lot better and it significantly reduces
the risk of falling into the illegal state, but the risk is still there.
And if the machine somehow falls into this illegal state, I want there
to be some recovery logic to take the machine out of it.
Simply put - no matter what encoding I use, there will always be illegal
states (except when the number of states is an exact power of two, so
that I can assign each state vector configuration to a legal state). And
if there are illegal states, the machine can fall into them. And if the
machine can fall into an illegal state, I want it to get out of there
automatically.
Q0.D = SeriesOfTerms0;
Q1.D = SeriesOfTerms1;
Each valid state will have a number of hold-until-next-move-true terms,
but states not covered will have NO .D terms, and so their NEXT state is
Q0.D = 0;
Q1.D = 0;
or to the 00 state.
If you code
IF State=11 THEN immediate_next = 00, then no more logic is generated,
as that is implicit.
So it will get out of there automatically. With one-hot, the actual
problem is that where it GOES NEXT is also not on the state map, whereas
with other schemes, esp if you implicitly include 0000, then there is a
recovery path.
See above.Try Gray or Johnson, and make sure the 00000 is an
enumerated/specified state, and see what happens ?
I have tried binary encoding, and indeed wouldn't hang anymore. But
considering what I wrote above, I don't feel confident that it really
solved the problem - I believe I just reduced the probability for it to
happen. But I would happily be proved wrong!