我的问题是关于在合成的状态机使用的第一状态。
我用莱迪思FPGA iCE40的EDA游乐场进行仿真和莱迪思的钻石程序员工作的合成。
在下面的例子我生成的一系列信号(该示例仅示出了参考状态机器的线)。 这在模拟正常工作; 即访问的第一种情况是sm_init_lattice
和所需的信号被产生)。 然而,合成版本直接转到sm_end
并在那里停留。 作为结果的输出信号保持为低。
-- state machine
type t_SM_peaks is (sm_init_lattice,
sm_high_start_up, sm_low_start_up, sm_peaks, sm_end);
signal r_SM_peaks : t_SM_peaks;
p_ARRAY_INTS_STDLOG_2D : process (i_Clk) is
begin
if rising_edge(i_Clk) then
case r_SM_peaks is
when sm_init_lattice =>
...
r_SM_peaks <= sm_high_start_up;
when sm_high_start_up =>
...
r_SM_peaks <= sm_low_start_up;
when sm_low_start_up =>
...
r_SM_peaks <= sm_peaks;
when sm_peaks =>
...
r_SM_peaks <= sm_end; -- peaks completed
when sm_end =>
...
r_SM_peaks <= sm_end;
when others =>
r_SM_peaks <= sm_high_start_up;
end case;
end if;
end process p_ARRAY_INTS_STDLOG_2D;
但是,如果我做一个变化如下(以“CHANGE”表示),那么我得到一套我需要的信号。
type t_SM_peaks is (sm_init_lattice,
sm_high_start_up, sm_low_start_up, sm_end, sm_peaks);
signal r_SM_peaks : t_SM_peaks;
p_ARRAY_INTS_STDLOG_2D : process (i_Clk) is
begin
if rising_edge(i_Clk) then
case r_SM_peaks is
when sm_init_lattice =>
...
r_SM_peaks <= sm_high_start_up;
when sm_high_start_up =>
...
r_SM_peaks <= sm_low_start_up;
when sm_low_start_up =>
...
r_SM_peaks <= sm_peaks;
when sm_peaks =>
...
r_SM_peaks <= sm_end; -- peaks completed
when sm_end =>
...
-- CHANGE - swapped 'sm_end' for 'sm_init_lattice'
--r_SM_peaks <= sm_end;
r_SM_peaks <= sm_init_lattice;
when others =>
r_SM_peaks <= sm_high_start_up;
end case;
end if;
end process p_ARRAY_INTS_STDLOG_2D;
任何人能解释发生了什么吗? 难道我做错了什么? 我会的任何建议表示感谢。