Hi.
I had to designed a big (more than 30 states) state machine for my work. I wrote something like :
I am not sure about two points :
1) I wrote it within a single process. It means that state and outputs are changed at the same time. Most of the exemples I saw on the web are using 2, or sometimes 3 process to design a state machine. Is this a problem?
2) and more important : I declared my state variable as a variable and not as a signal. I looked on the web and cannot find a single exemple where "state" is declare as variable! why am I the only one to do this? is this another problem?
thank you
I had to designed a big (more than 30 states) state machine for my work. I wrote something like :
if rst = '0' then
state := init
out1 <=
out2 <=
elsif rising_edge(clk) then
state := init
out1 <=
out2 <=
elsif rising_edge(clk) then
case state is
when init =>
when init =>
state := ...
out1 <= ...
out2 <= ...
when ... =>out1 <= ...
out2 <= ...
state := ...
out1 <= ...
out2 <= ...
out1 <= ...
out2 <= ...
I am not sure about two points :
1) I wrote it within a single process. It means that state and outputs are changed at the same time. Most of the exemples I saw on the web are using 2, or sometimes 3 process to design a state machine. Is this a problem?
2) and more important : I declared my state variable as a variable and not as a signal. I looked on the web and cannot find a single exemple where "state" is declare as variable! why am I the only one to do this? is this another problem?
thank you