-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathclock_tb.vhd
84 lines (43 loc) · 1.06 KB
/
clock_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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity clock_tb is
end clock_tb;
architecture behaviour of clock_tb is
--Period of 50 MHz master clock
constant c_CLOCK_PERIOD : time := 20 ns;
signal r_CLOCKIN : std_logic := '0';
signal r_MAN_CLK : std_logic := '1';
signal r_SELECT : std_logic := '1'; -- 1 means not active
signal r_HALT : std_logic := '1';
signal r_CLKOUT : std_logic;
component clock is
port(
i_clkin : in std_logic;
i_man_clk : in std_logic;
i_select : in std_logic;
i_halt : in std_logic;
o_clkout : out std_logic
);
end component clock;
begin
--Unit Under Test
UUT : clock
port map(
i_clkin => r_CLOCKIN,
i_man_clk => r_MAN_CLK,
i_select => r_SELECT,
i_halt => r_HALT,
o_clkout => r_CLKOUT
);
p_CLK_GEN : process is
begin
wait for c_CLOCK_PERIOD/2;
r_CLOCKIN <= not r_CLOCKIN;
end process p_CLK_GEN;
--Main testing section
process
begin
wait;
end process;
end behaviour;