-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_vga_control.vhd
143 lines (120 loc) · 3.97 KB
/
test_vga_control.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use std.textio.all;
use IEEE.STD_LOGIC_TEXTIO.ALL;
entity test_vga_control is
end test_vga_control;
architecture Behavioral of test_vga_control is
signal clk_in : std_logic;
signal rst : std_logic;
signal out_red : std_logic_vector(2 downto 0);
signal out_green : std_logic_vector(2 downto 0);
signal out_blue : std_logic_vector(2 downto 0);
signal hs : std_logic;
signal vs : std_logic;
signal romAddr : std_logic_vector(17 downto 0);
signal romData : std_logic_vector(15 downto 0);
signal vgaRead : std_logic;
signal vgaWrite : std_logic;
signal ramWriAddrIn : std_logic_vector(17 downto 0);
signal ramWriDataIn : std_logic_vector(15 downto 0);
signal ramWriAddrOut : std_logic_vector(17 downto 0);
signal ramWriDataOut : std_logic_vector(15 downto 0);
signal ramWrite : std_logic;
signal save : std_logic;
component vga_test is port(
clk_in : in std_logic;
rst : in std_logic;
ramWrite : in std_logic;
out_red : out std_logic_vector(2 downto 0);
out_green : out std_logic_vector(2 downto 0);
out_blue : out std_logic_vector(2 downto 0);
romAddr : out std_logic_vector(17 downto 0);
romData : in std_logic_vector(15 downto 0); --rgb that only 8 downto 0 is useful
vgaRead : out std_logic;
vgaWrite : out std_logic;
ramWriAddrIn : in std_logic_vector(17 downto 0);
ramWriDataIn : in std_logic_vector(15 downto 0);
ramWriAddrOut : out std_logic_vector(17 downto 0);
ramWriDataOut : out std_logic_vector(15 downto 0);
save : out std_logic;
hs : out std_logic;
vs : out std_logic
);
end component;
begin
vga_test_0: vga_test port map(clk_in, rst, ramWrite, out_red,
out_green, out_blue, romAddr, romData, vgaRead, vgaWrite,
ramWriAddrIn, ramWriDataIn, ramWriAddrOut, ramWriDataOut, save,
hs, vs);
process
variable l : line;
begin
rst <= '1';
clk_in <= '1';
ramWrite <= '0';
romData <= "0001000100010001";
ramWriAddrIn <= "101011000110101011";
ramWriDataIn <= "1001010011010101";
wait for 25 ps;
rst <= '1';
clk_in <= '0';
romData <= "0001000100010001";
wait for 25 ps;
rst <= '1';
clk_in <= '1';
ramWrite <= '0';
romData <= "0001000100010001";
ramWriAddrIn <= "101011000110101011";
ramWriDataIn <= "1001010011010101";
wait for 25 ps;
rst <= '1';
clk_in <= '0';
romData <= "0001000100010001";
wait for 25 ps;
rst <= '1';
clk_in <= '1';
ramWrite <= '1';
romData <= "0001000100010001";
ramWriAddrIn <= "101011000110101011";
ramWriDataIn <= "1001010011010101";
wait for 25 ps;
rst <= '1';
clk_in <= '0';
romData <= "0001000100010001";
wait for 25 ps;
rst <= '1';
clk_in <= '1';
romData <= "0001000100010001";
ramWriAddrIn <= "101011000010101011";
ramWriDataIn <= "1001010101010101";
ramWrite <= '1';
wait for 25 ps;
rst <= '1';
clk_in <= '0';
romData <= "0001000100010001";
wait for 25 ps;
rst <= '1';
clk_in <= '1';
romData <= "0001000100010001";
ramWriAddrIn <= "101011000100001011";
ramWriDataIn <= "1001001011010101";
ramWrite <= '0';
wait for 25 ps;
rst <= '1';
clk_in <= '0';
romData <= "0001000100010001";
wait for 25 ps;
rst <= '1';
clk_in <= '1';
romData <= "0001000100010001";
ramWriAddrIn <= "100001110110101011";
ramWriDataIn <= "1001001011010101";
ramWrite <= '1';
wait for 25 ps;
rst <= '1';
clk_in <= '0';
romData <= "0001000100010001";
wait for 25 ps;
end process;
end Behavioral;