I write a testbench in VHDL, and there I need to reset rst
signal when count_rst
increases to 1000. And I can't set a value of 0 or others to count_rst
. Where am I wrong?
Part of code:
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;