diff --git a/test/QueueT.vhd b/test/QueueT.vhd index b4751d8..0d22273 100644 --- a/test/QueueT.vhd +++ b/test/QueueT.vhd @@ -21,29 +21,25 @@ begin SimpleQueueTestP : process is variable v_data : std_logic_vector(63 downto 0); - variable v_count : natural := 0; begin -- check initial emptiness assert sv_simple_queue.is_empty report "ERROR: queue should be empty!" severity failure; for i in 0 to 63 loop - sv_simple_queue.push(std_logic_vector(to_unsigned(v_count, 64))); - v_count := v_count + 1; + sv_simple_queue.push(std_logic_vector(to_unsigned(i, 64))); end loop; -- check that it's full assert sv_simple_queue.is_full report "ERROR: queue should be full!" severity failure; -- empty the queue - v_count := 0; for i in 0 to 63 loop sv_simple_queue.pop(v_data); - assert v_data = std_logic_vector(to_unsigned(v_count, 64)) - report "ERROR: read data should be " & integer'image(v_count) & + assert v_data = std_logic_vector(to_unsigned(i, 64)) + report "ERROR: read data should be " & integer'image(i) & " instead of " & integer'image(to_integer(unsigned(v_data))) severity failure; - v_count := v_count + 1; end loop; -- check emptiness assert sv_simple_queue.is_empty @@ -56,29 +52,25 @@ begin ListQueueTestP : process is variable v_data : std_logic_vector(63 downto 0); - variable v_count : natural := 0; begin -- check initial emptiness assert sv_list_queue.is_empty report "ERROR: queue should be empty!" severity failure; for i in 0 to 63 loop - sv_list_queue.push(std_logic_vector(to_unsigned(v_count, 64))); - v_count := v_count + 1; + sv_list_queue.push(std_logic_vector(to_unsigned(i, 64))); end loop; -- check that it's full assert sv_list_queue.is_full report "ERROR: queue should be full!" severity failure; -- empty the queue - v_count := 0; for i in 0 to 63 loop sv_list_queue.pop(v_data); - assert v_data = std_logic_vector(to_unsigned(v_count, 64)) - report "ERROR: read data should be " & integer'image(v_count) & + assert v_data = std_logic_vector(to_unsigned(i, 64)) + report "ERROR: read data should be " & integer'image(i) & " instead of " & integer'image(to_integer(unsigned(v_data))) severity failure; - v_count := v_count + 1; end loop; -- check emptiness assert sv_list_queue.is_empty