blob: f105be829404ee45b54cb1a6c58822db40e7b5c6 (
plain)
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
47
48
49
50
51
52
53
54
|
entity tb_multiplexers_3 is
end tb_multiplexers_3;
library ieee;
use ieee.std_logic_1164.all;
architecture behav of tb_multiplexers_3 is
signal di : std_logic_vector(7 downto 0);
signal sel : std_logic_vector(7 downto 0);
signal do : std_logic;
begin
dut: entity work.multiplexers_3
port map (di, sel, do);
process
begin
di <= b"1001_0011";
sel <= not b"0000_0000";
wait for 1 ns;
assert do = 'Z' severity failure;
di <= b"1001_0011";
sel <= not b"0000_0001";
wait for 1 ns;
assert do = '1' severity failure;
di <= b"1001_0011";
sel <= not b"0000_0001";
wait for 1 ns;
assert do = '1' severity failure;
di <= b"1001_0011";
sel <= not b"0001_0001";
wait for 1 ns;
assert do = '1' severity failure;
di <= b"1001_0011";
sel <= not b"0010_0000";
wait for 1 ns;
assert do = '0' severity failure;
di <= b"1001_0011";
sel <= not b"0110_1100";
wait for 1 ns;
assert do = '0' severity failure;
di <= b"1001_0011";
sel <= not b"0010_0001";
wait for 1 ns;
assert do = 'X' severity failure;
wait;
end process;
end behav;
|