B
Brad Smallridge
Guest
I have a state machine done with one flag for each state. Most of the states
are sequential accomplished with a default assignment:
signal state : std_logic_vector(0 to 61);
begin
state<='0'&state(0 to 60);
There are some variations to the sequential flow. Elsewhere I assign data
paths to these states like this:
if state(33 to 36)>0 then
mem_out<=a;
elsif state(37)>0 then
mem_out<=b;
The elsif are a bit long and have an unnecessary priority logic to them as
state(33 to 36) trumps state(37) although I can be very sure that the states
are mutually exclusive by design.
I am of the understanding that a series of "if end if" statements would only
serve to put the priority on the last "if end if" statement and therefore
would still have priority logic.
So my question is how to get rid of the priority logic? If I have to resort
to a case statement, how do I code this succinctly with this long state
vector? And is there some other way to do it, perhaps with a variable?
Brad Smallridge
AiVision
are sequential accomplished with a default assignment:
signal state : std_logic_vector(0 to 61);
begin
state<='0'&state(0 to 60);
There are some variations to the sequential flow. Elsewhere I assign data
paths to these states like this:
if state(33 to 36)>0 then
mem_out<=a;
elsif state(37)>0 then
mem_out<=b;
The elsif are a bit long and have an unnecessary priority logic to them as
state(33 to 36) trumps state(37) although I can be very sure that the states
are mutually exclusive by design.
I am of the understanding that a series of "if end if" statements would only
serve to put the priority on the last "if end if" statement and therefore
would still have priority logic.
So my question is how to get rid of the priority logic? If I have to resort
to a case statement, how do I code this succinctly with this long state
vector? And is there some other way to do it, perhaps with a variable?
Brad Smallridge
AiVision