Browse Source

removed useless v_count variable and replaced it by using i loop variable

pull/1/head
T. Meissner 10 years ago
parent
commit
faac81128b
1 changed files with 6 additions and 14 deletions
  1. +6
    -14
      test/QueueT.vhd

+ 6
- 14
test/QueueT.vhd View File

@ -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


Loading…
Cancel
Save