我用VHDL编写了一个测试平台,当rst
增加到1000时我需要重置count_rst
信号。我不能将值0或其他值设置为count_rst
。我哪里错了?
部分代码:
signal count_rst : integer := 0;
signal rst : std_logic := '1';
signal clk : std_logic := '1';
process
begin
clk <= '1';
if count_rst = 0 then
rst <= '0';
else
rst <= '1';
end if;
if count_rst > 999 then
count_rst <= 0;
rst <= '0';
end if;
count_rst <= count_rst + 1;
wait for clk_period/2;
clk <= '0';
wait for clk_period/2;
end process;