-
Notifications
You must be signed in to change notification settings - Fork 2
/
cpu_tb.vhd
64 lines (47 loc) · 1.33 KB
/
cpu_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
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
library UNISIM;
use UNISIM.VComponents.all;
use work.system_comp.all;
use work.clockgen_comp.all;
use work.cpu_comp.all;
use work.video_comp.all;
use work.driver_comp.all;
ENTITY cpu_tb IS
END cpu_tb;
ARCHITECTURE behavior OF cpu_tb IS
constant clk_period : time := 10 ns;
signal CLK : STD_LOGIC;
signal RST : STD_LOGIC;
signal VSYNC, HSYNC : std_logic;
signal RED, GREEN : std_logic_vector(2 downto 0);
signal BLUE : std_logic_vector(1 downto 0);
signal read, write : io_list;
signal TDO : std_logic;
signal LED : std_logic_vector(7 downto 0);
BEGIN
usys : system port map( RST, CLK, LED, read, write, '0', TDO, '0', '0', VSYNC, HSYNC, RED, GREEN, BLUE );
-- Clock process definitions
clk_process : process
begin
CLK <= '0';
wait for clk_period/2;
CLK <= '1';
wait for clk_period/2;
end process;
-- Test Bench Statements
tb : PROCESS
BEGIN
rst <= '1';
wait for clk_period * 9; -- wait until global set/reset completes
wait for clk_period * 0.9;
rst <= '0';
wait for 15 us;
rst <= '1';
wait for clk_period * 10;
rst <= '0';
wait; -- will wait forever
END PROCESS tb;
-- End Test Bench
END;