2017-11-15 00:12:52 +00:00
|
|
|
`include "hvsync_generator.v"
|
|
|
|
|
2018-02-07 00:07:40 +00:00
|
|
|
module test_hvsync_top(clk, reset, hsync, vsync, rgb);
|
|
|
|
|
|
|
|
input clk, reset;
|
|
|
|
output hsync, vsync;
|
|
|
|
output [2:0] rgb;
|
2017-11-17 21:01:07 +00:00
|
|
|
wire display_on;
|
|
|
|
wire [8:0] hpos;
|
|
|
|
wire [8:0] vpos;
|
2017-11-15 00:12:52 +00:00
|
|
|
|
|
|
|
hvsync_generator hvsync_gen(
|
|
|
|
.clk(clk),
|
2017-11-29 01:48:27 +00:00
|
|
|
.reset(0),
|
2017-11-15 00:12:52 +00:00
|
|
|
.hsync(hsync),
|
|
|
|
.vsync(vsync),
|
2017-11-17 21:01:07 +00:00
|
|
|
.display_on(display_on),
|
|
|
|
.hpos(hpos),
|
|
|
|
.vpos(vpos)
|
2017-11-15 00:12:52 +00:00
|
|
|
);
|
|
|
|
|
2017-11-17 21:01:07 +00:00
|
|
|
wire r = display_on && (((hpos&7)==0) || ((vpos&7)==0));
|
|
|
|
wire g = display_on && vpos[4];
|
|
|
|
wire b = display_on && hpos[4];
|
2017-11-15 00:12:52 +00:00
|
|
|
assign rgb = {b,g,r};
|
|
|
|
|
|
|
|
endmodule
|