A
ALuPin@web.de
Guest
Hi,
When checking some condition which is responsible for jumping
back to some known state within a state machine
I have done the following :
process(rst, clk)
begin
if rst='1' then
ls_state <= s_ini;
elsif rising_edge(clk) then
case ls_state is
...
when s_0 =>
...
if ls_condition='1' then
ls_state <= s_known;
end if;
when s_1 =>
...
if ls_condition='1' then
ls_state <= s_known;
end if;
when s_2 =>
...
if ls_condition='1' then
ls_state <= s_known;
end if;
...
end case;
end if;
end process;
Can the FSM be replaced with the following description ?
process(rst, clk)
begin
if rst='1' then
ls_state <= s_ini;
elsif rising_edge(clk) then
case ls_state is
...
when s_0 =>
...
when s_1 =>
...
when s_2 =>
...
end case;
if ls_condition='1' then
ls_state <= s_known;
end if;
end if;
end process;
Thank you for your comments.
Rgds
André
When checking some condition which is responsible for jumping
back to some known state within a state machine
I have done the following :
process(rst, clk)
begin
if rst='1' then
ls_state <= s_ini;
elsif rising_edge(clk) then
case ls_state is
...
when s_0 =>
...
if ls_condition='1' then
ls_state <= s_known;
end if;
when s_1 =>
...
if ls_condition='1' then
ls_state <= s_known;
end if;
when s_2 =>
...
if ls_condition='1' then
ls_state <= s_known;
end if;
...
end case;
end if;
end process;
Can the FSM be replaced with the following description ?
process(rst, clk)
begin
if rst='1' then
ls_state <= s_ini;
elsif rising_edge(clk) then
case ls_state is
...
when s_0 =>
...
when s_1 =>
...
when s_2 =>
...
end case;
if ls_condition='1' then
ls_state <= s_known;
end if;
end if;
end process;
Thank you for your comments.
Rgds
André