FPGA型号,spartan-627M时钟下产生的40ms计时器,然后做了一个10ms的脉冲信号
process(clk_27)
begin
if rising_edge(clk_27) then
case (cnt_40ms) is
when xx | xx | xx | xx =>
sig1 <= '1';
when others =>
sig1 <= '0';
end case;
end if;
end process;
然后这个信号在59m时钟下需要使用启动一个状态机,使用如下;
process(clk_59)
begin
if rising_edge(clk_59) then
sig1_reg1 <= sig1;
sig1_reg2 <= sig1_reg1;
sig1_reg3 <= sig1_reg2;
sig1_rise <= (not sig1_reg3) and reg2;
end if;
end process;
process(clk_59)
begin
if rising_edge(clk_59) then
case state is ----状态机
when idle =>
if sig1_rise = '1' then
state <= s0;
else
state <= idle;
end if;
when s0 =>
.......
end case;
end if;
end process
I didn't approve your design as this totally asynthonous design. It is not reliable for digital circuit. But at current design, you should consider multi-cycle constraints to sure all data pathes to satisfy timing requirement.