Altera_Forum
Honored Contributor
10 years agoGood design, bad design -> one-clock-states in state-machines
Hi,
another question is giong through my mind: Is it possible (good design) to create one or more states which exit to next state without any condition. example:
if (rising_edge(clock)) then
case (current_state) is
--------------------------------------------------------------------
-- Idle State
--------------------------------------------------------------------
when S000 =>
Signal_Data <= X"00";
Signal_Ctrl <='0';
sig_Start_IN <= Start_IN;
if ((sig_Start_IN = '0') AND (Start_IN = '1')) then
current_state <= S010;
else
current_state <= current_state;
end if;
--------------------------------------------------------------------
-- State010
--------------------------------------------------------------------
when S010 =>
Signal_Data <= X"34";
Signal_Ctrl <='0';
current_state <= S020;
--------------------------------------------------------------------
-- State020
--------------------------------------------------------------------
when S020 =>
Signal_Data <= X"F2";
Signal_Ctrl <='1';
current_state <= S000;
--------------------------------------------------------------------
-- What else could be done?
--------------------------------------------------------------------
when others =>
current_state <= S000;
end case;
end if;
Is this a problem for synthesis? I never seen such a one-clock-state without condition in other codes before and therefore I don't know is it good or bad to do this. No one ever mentioned such states. What do you think? Save or unsave to do this? PS: I don't want a discussion about how much sense it makes to implement this or what it can be good for. I just want to know if this will work securely.