-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopmodule.v
85 lines (78 loc) · 1.57 KB
/
topmodule.v
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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 01:28:56 07/18/2015
// Design Name:
// Module Name: topmodule
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module topmodule( clk,
reset,
VGA_HSYNC,
VGA_VSYNC,
VGA_R,
VGA_G,
VGA_B
);
input clk;
input reset;
//vga side signal
output VGA_HSYNC;
output VGA_VSYNC;
output [3:0] VGA_R;
output [3:0] VGA_G;
output [3:0] VGA_B;
wire con;
wire[9:0]con_x,con_y;
wire[3:0]con_R,con_G,con_B;
wire[2:0]mem_con;
wire[7:0]mem_out;
clock25MHZ clk1 (
.CLKIN_IN(clk),
.RST_IN(reset),
.CLKFX_OUT(con),
.CLKIN_IBUFG_OUT(CLKIN_IBUFG_OUT),
.CLK0_OUT()
);
vga_display vga1(.clk(con),
.reset(reset),
.VGA_HSYNC(VGA_HSYNC),
.VGA_VSYNC(VGA_VSYNC),
.x_cor(con_x),
.y_cor(con_y),
.RED(VGA_R),
.GREEN(VGA_G),
.BLUE(VGA_B),
.iRED(con_R),
.iGREEN(con_G),
.iBLUE(con_B)
);
Pixel_data pix(
.clk(con),
.reset(reset),
.x_pos(con_x),
.y_pos(con_y),
.RED(con_R),
.GREEN(con_G),
.BLUE(con_B),
.data(mem_out),
.address(mem_con)
);
ROM rom(
.clka(con), // input clka
.addra(mem_con), // input [2 : 0] addra
.douta(mem_out) // output [7 : 0] douta
);
endmodule