M
MJ
Guest
Hello,
I have a question about "if (....)" and "wait until ..." usage in
testbenches.
I want to wait for a start pulse from the DUT in the testbench to do
some other things.
Process_A does not work. Ready1 is never set.
Process_B works. Why? What is wrong?
Here is are the two processes:
Process_A : process
begin
ready1 <= '0';
if (rising_edge(transfer_start)) then
-- do something ...
ready1 <= '1';
wait for c_clock_cycle;
ready1 <= '0';
end if;
wait;
end process;
Process_B : process
begin
ready2 <= '0';
wait until rising_edge(transfer_start);
-- do something ...
ready2 <= '1';
wait for c_clock_cycle;
ready2 <= '0';
wait;
end process;
I have a question about "if (....)" and "wait until ..." usage in
testbenches.
I want to wait for a start pulse from the DUT in the testbench to do
some other things.
Process_A does not work. Ready1 is never set.
Process_B works. Why? What is wrong?
Here is are the two processes:
Process_A : process
begin
ready1 <= '0';
if (rising_edge(transfer_start)) then
-- do something ...
ready1 <= '1';
wait for c_clock_cycle;
ready1 <= '0';
end if;
wait;
end process;
Process_B : process
begin
ready2 <= '0';
wait until rising_edge(transfer_start);
-- do something ...
ready2 <= '1';
wait for c_clock_cycle;
ready2 <= '0';
wait;
end process;