blob: 63d42bc12ff6ea8bf974f232b7617f55442e20b4 (
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
|
entity tb_var05 is
end tb_var05;
library ieee;
use ieee.std_logic_1164.all;
architecture behav of tb_var05 is
signal clk : std_logic;
signal sel : std_logic;
signal a, b : std_logic_vector (1 downto 0);
signal res : std_logic_vector (1 downto 0);
begin
dut: entity work.var05
port map (
sel => sel,
a => a,
b => b,
res => res);
process
begin
sel <= '1';
a <= "00";
b <= "11";
wait for 1 ns;
assert res = "11" severity failure;
sel <= '0';
a <= "00";
b <= "11";
wait for 1 ns;
assert res = "00" severity failure;
sel <= '0';
a <= "10";
b <= "01";
wait for 1 ns;
assert res = "10" severity failure;
sel <= '1';
a <= "10";
b <= "01";
wait for 1 ns;
assert res = "01" severity failure;
wait;
end process;
end behav;
|