-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtop.v
More file actions
29 lines (22 loc) · 935 Bytes
/
top.v
File metadata and controls
29 lines (22 loc) · 935 Bytes
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
`timescale 1ns / 1ps
module top(
input clk_100MHz, // from Basys 3
input reset, // btnC on Basys 3
input [3:0] sw,
output hsync, // VGA port on Basys 3
output vsync, // VGA port on Basys 3
output [11:0] rgb // to DAC, 3 bits to VGA port on Basys 3
);
wire w_video_on, w_p_tick;
wire [9:0] w_x, w_y;
reg [11:0] rgb_reg;
wire[11:0] rgb_next;
vga_controller vc(.clk_100MHz(clk_100MHz), .reset(reset), .video_on(w_video_on), .hsync(hsync),
.vsync(vsync), .p_tick(w_p_tick), .x(w_x), .y(w_y));
metronome m(.clk(clk_100MHz), .reset(reset), .tempo_switches(sw), .video_on(w_video_on),
.x(w_x), .y(w_y), .rgb(rgb_next));
always @(posedge clk_100MHz)
if(w_p_tick)
rgb_reg <= rgb_next;
assign rgb = rgb_reg;
endmodule