|
@ -2,6 +2,8 @@ library ieee; |
|
|
use ieee.std_logic_1164.all; |
|
|
use ieee.std_logic_1164.all; |
|
|
use ieee.numeric_std.all; |
|
|
use ieee.numeric_std.all; |
|
|
|
|
|
|
|
|
|
|
|
use work.AssertP.all; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
entity QueueT is |
|
|
entity QueueT is |
|
@ -23,28 +25,19 @@ begin |
|
|
variable v_data : std_logic_vector(63 downto 0); |
|
|
variable v_data : std_logic_vector(63 downto 0); |
|
|
begin |
|
|
begin |
|
|
-- check initial emptiness |
|
|
-- check initial emptiness |
|
|
assert sv_simple_queue.is_empty |
|
|
|
|
|
report "ERROR: queue should be empty!" |
|
|
|
|
|
severity failure; |
|
|
|
|
|
|
|
|
assert_true(sv_simple_queue.is_empty); |
|
|
for i in 0 to 63 loop |
|
|
for i in 0 to 63 loop |
|
|
sv_simple_queue.push(std_logic_vector(to_unsigned(i, 64))); |
|
|
sv_simple_queue.push(std_logic_vector(to_unsigned(i, 64))); |
|
|
end loop; |
|
|
end loop; |
|
|
-- check that it's full |
|
|
-- check that it's full |
|
|
assert sv_simple_queue.is_full |
|
|
|
|
|
report "ERROR: queue should be full!" |
|
|
|
|
|
severity failure; |
|
|
|
|
|
|
|
|
assert_true(sv_simple_queue.is_full); |
|
|
-- empty the queue |
|
|
-- empty the queue |
|
|
for i in 0 to 63 loop |
|
|
for i in 0 to 63 loop |
|
|
sv_simple_queue.pop(v_data); |
|
|
sv_simple_queue.pop(v_data); |
|
|
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; |
|
|
|
|
|
|
|
|
assert_equal(v_data, std_logic_vector(to_unsigned(i, 64))); |
|
|
end loop; |
|
|
end loop; |
|
|
-- check emptiness |
|
|
-- check emptiness |
|
|
assert sv_simple_queue.is_empty |
|
|
|
|
|
report "ERROR: queue should be empty!" |
|
|
|
|
|
severity failure; |
|
|
|
|
|
|
|
|
assert_true(sv_simple_queue.is_empty); |
|
|
report "INFO: t_simple_queue test finished successfully"; |
|
|
report "INFO: t_simple_queue test finished successfully"; |
|
|
wait; |
|
|
wait; |
|
|
end process SimpleQueueTestP; |
|
|
end process SimpleQueueTestP; |
|
@ -54,31 +47,22 @@ begin |
|
|
variable v_data : std_logic_vector(63 downto 0); |
|
|
variable v_data : std_logic_vector(63 downto 0); |
|
|
begin |
|
|
begin |
|
|
-- check initial emptiness |
|
|
-- check initial emptiness |
|
|
assert sv_list_queue.is_empty |
|
|
|
|
|
report "ERROR: queue should be empty!" |
|
|
|
|
|
severity failure; |
|
|
|
|
|
|
|
|
assert_true(sv_list_queue.is_empty); |
|
|
for i in 0 to 63 loop |
|
|
for i in 0 to 63 loop |
|
|
sv_list_queue.push(std_logic_vector(to_unsigned(i, 64))); |
|
|
sv_list_queue.push(std_logic_vector(to_unsigned(i, 64))); |
|
|
end loop; |
|
|
end loop; |
|
|
-- check that it's full |
|
|
-- check that it's full |
|
|
assert sv_list_queue.is_full |
|
|
|
|
|
report "ERROR: queue should be full!" |
|
|
|
|
|
severity failure; |
|
|
|
|
|
|
|
|
assert_true(sv_list_queue.is_full); |
|
|
-- empty the queue |
|
|
-- empty the queue |
|
|
for i in 0 to 63 loop |
|
|
for i in 0 to 63 loop |
|
|
sv_list_queue.pop(v_data); |
|
|
sv_list_queue.pop(v_data); |
|
|
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; |
|
|
|
|
|
|
|
|
assert_equal(v_data, std_logic_vector(to_unsigned(i, 64))); |
|
|
end loop; |
|
|
end loop; |
|
|
-- check emptiness |
|
|
-- check emptiness |
|
|
assert sv_list_queue.is_empty |
|
|
|
|
|
report "ERROR: queue should be empty!" |
|
|
|
|
|
severity failure; |
|
|
|
|
|
|
|
|
assert_true(sv_list_queue.is_empty); |
|
|
report "INFO: t_list_queue test finished successfully"; |
|
|
report "INFO: t_list_queue test finished successfully"; |
|
|
wait; |
|
|
wait; |
|
|
end process ListQueueTestP; |
|
|
end process ListQueueTestP; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end architecture sim; |
|
|
|
|
|
|
|
|
end architecture sim; |