N
Niv
Guest
I have a state machine which goes through a regular stepping process
for a lot of states (35), to produce a short clock burst (and other
control signals) so I was wondering if its possible to put a loop
inside a case statement!!
e.g. could I change this:
CASE state IS
WHEN s0 => next_state s1;
WHEN s1 => next_state s1;
WHEN s2 => next_state s1;
....
....
WHEN s34 => next_state s35;
WHEN OTHERS => reset_state; -- capture errors
END CASE;
to this:
CASE state IS
FOR i IN 0 TO 34 LOOP
WHEN s(i) => next_state s(i+1);
END LOOP;
WHEN OTHERS => reset_state; -- capture errors
END CASE;
Obviously the state type declaration will need modifying as well
(somehow).
Is any of this possible, just occurred to me & haven't got time right
now to try.
Just wondering, as it might be a tad neater.
for a lot of states (35), to produce a short clock burst (and other
control signals) so I was wondering if its possible to put a loop
inside a case statement!!
e.g. could I change this:
CASE state IS
WHEN s0 => next_state s1;
WHEN s1 => next_state s1;
WHEN s2 => next_state s1;
....
....
WHEN s34 => next_state s35;
WHEN OTHERS => reset_state; -- capture errors
END CASE;
to this:
CASE state IS
FOR i IN 0 TO 34 LOOP
WHEN s(i) => next_state s(i+1);
END LOOP;
WHEN OTHERS => reset_state; -- capture errors
END CASE;
Obviously the state type declaration will need modifying as well
(somehow).
Is any of this possible, just occurred to me & haven't got time right
now to try.
Just wondering, as it might be a tad neater.