实例介绍
【实例截图】
【文件目录】
new
├── dvi_encode.v
├── generate_image.v
├── image_data.v
├── lvds_out.v
├── parallrl_serial.v
└── test_hdmi.v
0 directories, 6 files
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 2020/07/16 14:49:05
// Design Name:
// Module Name: test_hdmi
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module test_hdmi(
input sclk,
//output [9:0] r_dout,
//output hs,
//output vs,
//output video_clk,
//output video_clk5x,
//output [9:0] r_dout,
//output [7:0] r_din,
output tmds_clkp,
output tmds_clkn,
output tmds_d0p,
output tmds_d0n,
output tmds_d1p,
output tmds_d1n,
output tmds_d2p,
output tmds_d2n
);
wire rst;
wire [7:0] b_din;
wire [7:0] g_din;
wire [7:0] r_din;
wire [9:0] b_dout;
wire [9:0] g_dout;
wire [9:0] r_dout;
wire hs;
wire vs;
wire de;
wire video_clk5x;
wire video_clk;
wire locked;
wire clkfb_in;
parameter rst_cnt_max = 8'd128;
reg [7:0] rst_cnt;
reg rst_n;
always @(posedge sclk)
begin
if(rst_cnt < rst_cnt_max)
rst_cnt <= rst_cnt 1'd1;
else if(rst_cnt == rst_cnt_max)
rst_cnt <= rst_cnt;
else
rst_cnt <=0;
end
always @(posedge sclk)
begin
if(rst_cnt == rst_cnt_max)
rst_n <= 1;
else
rst_n <= 0;
end
parameter rst_max = 8'd128;
reg [7:0] cnt;
reg rst_io;
always @(posedge video_clk)
begin
if(cnt < rst_max)
cnt <= cnt 1'd1;
else if(cnt == rst_cnt_max)
cnt <= cnt;
else
cnt <=0;
end
always @(posedge video_clk)
begin
if(cnt == rst_max)
rst_io <= 0;
else
rst_io <= 1;
end
assign rst = rst_io;
image_data image_data(
.clk(video_clk),
.rst_n(!rst),
.gen_image_hs (hs),
.gen_image_vs (vs),
.de(de),
.r_din(r_din),
.g_din(g_din),
.b_din(b_din)
);
clk_wiz_0 video_pll
(
.clk_in1(sclk),
.clk_out1(video_clk),
.clk_out2(video_clk5x),
.reset(!rst_n),
.clkfb_in(clkfb_in),
.clkfb_out(clkfb_in),
.locked(locked)
);
dvi_encode encb (
.clkin (video_clk),
.rstin (rst),
.din (b_din),//(8'd0),//
.c0 (hs),
.c1 (vs),
.de (de),
.dout (b_dout)
);
dvi_encode encg (
.clkin (video_clk),
.rstin (rst),
.din (g_din),//(8'd0),//
.c0 (1'b0),
.c1 (1'b0),
.de (de),
.dout (g_dout)
);
dvi_encode encr (
.clkin (video_clk),
.rstin (rst),
.din (r_din),//(8'd0),//
.c0 (hs),
.c1 (vs),
.de (de),
.dout (r_dout)
);
selectio_wiz_0 seria_10to1_b(
.clk_in(video_clk5x),
.clk_div_in(video_clk),
.io_reset(rst),
.data_out_from_device(b_dout),
.data_out_to_pins_p(tmds_d0p),
.data_out_to_pins_n(tmds_d0n)
);
selectio_wiz_0 seria_10to1_g(
.clk_in(video_clk5x),
.clk_div_in(video_clk),
.io_reset(rst),
.data_out_from_device(g_dout),
.data_out_to_pins_p(tmds_d1p),
.data_out_to_pins_n(tmds_d1n)
);
selectio_wiz_0 seria_10to1_r(
.clk_in(video_clk5x),
.clk_div_in(video_clk),
.io_reset(rst),
.data_out_from_device(r_dout),
.data_out_to_pins_p(tmds_d2p),
.data_out_to_pins_n(tmds_d2n)
);
selectio_wiz_0 seria_10to1_clk(
.clk_in(video_clk5x),
.clk_div_in(video_clk),
.io_reset(rst),
.data_out_from_device(10'b11111_00000),
.data_out_to_pins_p(tmds_clkp),
.data_out_to_pins_n(tmds_clkn)
);
/*OBUFDS #(
.IOSTANDARD("TMDS_33"),// Specify the output I/O standard
.SLEW("FAST") // Specify the output slew rate
) TMDS_CLK (
.O(tmds_clkp), // Diff_p output (connect directly to top-level port)
.OB(tmds_clkn), // Diff_n output (connect directly to top-level port)
.I(video_clk) // Buffer input
);
10'b11111_00000 */
endmodule
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论