-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtb_priority.vhd
46 lines (41 loc) · 1.08 KB
/
tb_priority.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
-- priority encoder testbench
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity tb_priority is
end tb_priority;
architecture bhv of tb_priority is
signal a : std_logic_vector(31 downto 0) := (others => '0');
signal b : std_logic_vector(4 downto 0);
begin
uut : entity work.priority(rtl)
port map( a=>a, b=>b);
process
begin
a <= (0=>'1', others=>'0');
wait for 10 ns;
a <= (4=>'1', others=>'0');
wait for 10 ns;
a <= (7=>'1', others=>'0');
wait for 10 ns;
a <= (12=>'1', others=>'0');
wait for 10 ns;
a <= (15=>'1', others=>'0');
wait for 10 ns;
a <= (25=>'1', others=>'0');
wait for 10 ns;
a <= (30=>'1', others=>'0');
wait for 10 ns;
a <= (31=>'1', others=>'0');
wait for 30 ns;
a <= x"0100AF00";
wait for 10 ns;
a <= x"F0AC0301";
wait for 10 ns;
a <= x"002F0001";
wait for 10 ns;
a <= x"FFFFFFFF";
wait for 10 ns;
wait;
end process;
end bhv;