-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathencoder_tb.vhd
65 lines (47 loc) · 1.16 KB
/
encoder_tb.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY encoder_tb IS
END encoder_tb;
ARCHITECTURE behavior OF encoder_tb IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT encoder
PORT(
y0 : IN std_logic;
y1 : IN std_logic;
y2 : IN std_logic;
y3 : IN std_logic;
a0 : OUT std_logic;
a1 : OUT std_logic
);
END COMPONENT;
--Inputs
signal y0 : std_logic := '0';
signal y1 : std_logic := '0';
signal y2 : std_logic := '0';
signal y3 : std_logic := '0';
--Outputs
signal a0 : std_logic;
signal a1 : std_logic;
-- No clocks detected in port list. Replace <clock> below with
-- appropriate port name
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: encoder PORT MAP (
y0 => y0,
y1 => y1,
y2 => y2,
y3 => y3,
a0 => a0,
a1 => a1
);
-- Stimulus process
stim_proc: process
begin
y0 <= '0';
y1 <= '0';
y2 <= '0';
y3 <= '1';
wait for 100 ns;
wait;
end process;
END;