module bt1120_gen #(
parameter H_SYNC = ,
parameter H_FRONT_PORCH = ,
parameter H_BACK_PORCH = ,
parameter V_SYNC = ,
parameter V_FRONT_PORCH = ,
parameter V_BACK_PORCH = )(
input clk,
input rst_p,
// input [5:0] h_sync_pixcels,
// input [5:0] h_front_porch_pixcels,
// input [5:0] h_back_porch_pixcels,
// input [5:0] v_sync_lines,
// input [5:0] v_front_porch_lines,
// input [5:0] v_back_porch_lines, input [:] col,
input [:] row, output reg[:] odata,
output reg v_sync,
output reg h_sync,
output reg de ); parameter S_H_SYNC = 'b00;
parameter S_H_BACK_PORCH = 'b01;
parameter S_H_ACTIVE = 'b10;
parameter S_H_FRONT_PORCH = 'b11;
parameter S_V_SYNC = 'b00;
parameter S_V_BACK_PORCH = 'b01;
parameter S_V_ACTIVE = 'b10;
parameter S_V_FRONT_PORCH = 'b11; reg [:] h_pre_state = S_H_FRONT_PORCH;
reg [:] h_nx_state = S_H_FRONT_PORCH;
reg [:] v_pre_state = S_V_SYNC;
reg [:] v_nx_state = S_V_SYNC; reg [:] h_cnt = ;
reg [:] v_cnt = ;
reg [:] sync_code = ;
reg de_r = 'b0;
reg vid_sop_r = 'b0;
wire pos_vid_sop;
reg fifo_rd_valid = 'b0;
reg [:] fifo_rd_data_r = 'd0;
reg [:] sync_code_r = 'd0;
reg [:] sync_code_r1 = 'd0;
reg de_r1 = 'b0;
reg de_r2 = 'b0;
reg h_sync_r = 'b0;
reg h_sync_r1 = 'b0;
reg h_sync_r2 = 'b0;
reg v_sync_r = 'b0;
reg v_sync_r1 = 'b0;
reg v_sync_r2 = 'b0; reg data_en = 'b0;
reg data_en_dly = 'b0;
always @( posedge clk )
begin
if( h_nx_state == S_H_ACTIVE && v_nx_state == S_V_ACTIVE )
data_en <= 'b1;
else
data_en <= 'b0;
end always @( posedge clk )
begin
data_en_dly <= data_en;
end always @( posedge clk )
begin
if( data_en_dly )
fifo_rd_data_r <= fifo_rd_data_r + 'b1;
else
fifo_rd_data_r <= 'd0;
end /*********************************************************************** ***********************************************************************/ always @( posedge clk )//or posedge rst_p
begin
if( rst_p ) begin
h_pre_state <= S_H_FRONT_PORCH;
v_pre_state <= S_V_SYNC; end else begin
h_pre_state <= h_nx_state;
v_pre_state <= v_nx_state;
end
end always @( * )
begin
case( h_pre_state )
S_H_SYNC :
if( h_cnt == H_SYNC - )
h_nx_state <= S_H_BACK_PORCH;
else
h_nx_state <= S_H_SYNC; S_H_BACK_PORCH :
begin
if( h_cnt == H_BACK_PORCH - )
h_nx_state <= S_H_ACTIVE;
else
h_nx_state <= S_H_BACK_PORCH;
end
S_H_ACTIVE :
begin
if( h_cnt == col - )
h_nx_state <= S_H_FRONT_PORCH;
else
h_nx_state <= S_H_ACTIVE; end
S_H_FRONT_PORCH :
begin
if( h_cnt == H_FRONT_PORCH - )
h_nx_state <= S_H_SYNC;
else
h_nx_state <= S_H_FRONT_PORCH; end
default:;
endcase end always @( * )
begin
case( v_pre_state )
S_V_SYNC :
begin
if( h_nx_state == S_H_FRONT_PORCH && h_pre_state == S_H_ACTIVE ) begin
if( v_cnt == V_SYNC - )
v_nx_state = S_V_BACK_PORCH;
else
v_nx_state = S_V_SYNC;
end else begin
v_nx_state = S_V_SYNC;
end
end
S_V_BACK_PORCH :
begin
if( h_nx_state == S_H_FRONT_PORCH && h_pre_state == S_H_ACTIVE ) begin
if( v_cnt == V_BACK_PORCH - )
v_nx_state = S_V_ACTIVE;
else
v_nx_state = S_V_BACK_PORCH;
end else begin
v_nx_state = S_V_BACK_PORCH;
end
end
S_V_ACTIVE :
begin
if( h_nx_state == S_H_FRONT_PORCH && h_pre_state == S_H_ACTIVE ) begin
if( v_cnt == row - )
v_nx_state = S_V_FRONT_PORCH;
else
v_nx_state = S_V_ACTIVE;
end else begin
v_nx_state = S_V_ACTIVE;
end end
S_V_FRONT_PORCH :
begin
if( h_nx_state == S_H_FRONT_PORCH && h_pre_state == S_H_ACTIVE ) begin
if( v_cnt == V_FRONT_PORCH -'b1 )
v_nx_state = S_V_SYNC;
else
v_nx_state = S_V_FRONT_PORCH;
end else begin
v_nx_state = S_V_FRONT_PORCH;
end
end
default:;
endcase
// end else begin
// v_nx_state = v_nx_state;
// end
//
end
/***********************************************************************
cnt
***********************************************************************/
always @( posedge clk )
begin
if( rst_p ) begin
h_cnt <= ;
end else begin
case( h_nx_state )
S_H_SYNC :
begin
if( h_pre_state == S_H_FRONT_PORCH ) //&& h_cnt == H_FRONT_PORCH -1
h_cnt <= ;
else
h_cnt <= h_cnt + 'b1;
end
S_H_BACK_PORCH :
begin
if( h_pre_state == S_H_SYNC )//&& h_cnt == H_SYNC -1)
h_cnt <= ;
else
h_cnt <= h_cnt + 'b1;
end
S_H_ACTIVE :
begin
if( h_pre_state == S_H_BACK_PORCH)// && h_cnt == H_BACK_PORCH -1)
h_cnt <= ;
else
h_cnt <= h_cnt + 'b1;
end
S_H_FRONT_PORCH :
begin
if( h_pre_state == S_H_ACTIVE )//&& h_cnt == col -1)
h_cnt <= ;
else
h_cnt <= h_cnt + 'b1;
end
default:;
endcase
end
end always @( posedge clk or posedge rst_p )
begin
if( rst_p)
v_cnt <= ;
else begin
if( h_nx_state == S_H_FRONT_PORCH && h_pre_state == S_H_ACTIVE )
begin
case( v_nx_state )
S_V_SYNC :
begin
if( v_pre_state == S_V_FRONT_PORCH )
v_cnt <= ;
else
v_cnt <= v_cnt + 'b1;
end S_V_BACK_PORCH :
begin
if( v_pre_state == S_V_SYNC )
v_cnt <= ;
else
v_cnt <= v_cnt + 'b1;
end
S_V_ACTIVE :
begin
if( v_pre_state == S_V_BACK_PORCH )
v_cnt <= ;
else
v_cnt <= v_cnt + 'b1; end
S_V_FRONT_PORCH :
begin
if( v_pre_state == S_V_ACTIVE )
v_cnt <= ;
else
v_cnt <= v_cnt + 'b1; end
default:;
endcase
end
end
end /***********************************************************************
h_sync v_sync de
***********************************************************************/
always @( posedge clk )
begin
if( h_nx_state == S_H_SYNC )
h_sync_r <= 'b1;
else
h_sync_r <= 'b0;
end always @( posedge clk )
begin
if( v_nx_state == S_V_SYNC )
v_sync_r <= 'b1;
else
v_sync_r <= 'b0;
end always @( posedge clk )
begin
if( h_nx_state == S_H_ACTIVE && v_nx_state == S_V_ACTIVE )
de_r <= 'b1;
else
de_r <= 'b0;
end
/*********************************************************************** ***********************************************************************/ always @( posedge clk )
begin
if( h_nx_state == S_H_ACTIVE && v_nx_state == S_V_ACTIVE )
sync_code <= 'd0;
else if(( h_nx_state == S_H_BACK_PORCH) && ( v_nx_state == S_V_SYNC || v_nx_state == S_V_BACK_PORCH || v_nx_state == S_V_FRONT_PORCH))
case( h_cnt )
H_BACK_PORCH - : sync_code <= 'habab;//16'hab00;//
H_BACK_PORCH - : sync_code <= 'h0000;//16'h00ff;//
H_BACK_PORCH - : sync_code <= 'h0000;//16'h8010;//
H_BACK_PORCH - : sync_code <= 'hffff;//16'h8010;//
default:sync_code <= 'h1080;
endcase
else if(( h_nx_state == S_H_FRONT_PORCH) && ( v_nx_state == S_V_SYNC || v_nx_state == S_V_BACK_PORCH || v_nx_state == S_V_FRONT_PORCH))
if( h_pre_state == S_H_ACTIVE)
sync_code <= 'hffff;//16'h00ff;//
else begin
case(h_cnt )
: sync_code <= 'h0000;//16'hb600;//
: sync_code <= 'h0000;//16'h8010;//
: sync_code <= 'hb6b6;//16'h8010;//
default:sync_code <= 'h1080;
endcase
end
else if(( h_nx_state == S_H_BACK_PORCH)) begin // && ( v_nx_state == S_V_ACTIVE)
case(h_cnt )
H_BACK_PORCH - : sync_code <= 'h8080;//16'h8000;//
H_BACK_PORCH - : sync_code <= 'h0000;//16'h00ff;//
H_BACK_PORCH - : sync_code <= 'h0000;//16'h8010;//
H_BACK_PORCH - : sync_code <= 'hffff;//16'h8010;//
default:sync_code <= 'h1080;
endcase
end
else if(( h_nx_state == S_H_FRONT_PORCH)) begin// && ( v_nx_state == S_V_ACTIVE)
if( h_pre_state == S_H_ACTIVE)
sync_code <= 'hffff;//16'h00ff;//
else begin
case(h_cnt )
: sync_code <= 'h0000;//16'h9d00;//
: sync_code <= 'h0000;//16'h8010;//
: sync_code <= 'h9d9d;//16'h8010;//
default:sync_code <= 'h1080;
endcase
end
end
else begin
sync_code <= 'h1080;
end end
/***********************************************************************
sync
***********************************************************************/ always @( posedge clk )
begin
sync_code_r <= sync_code;
sync_code_r1<= sync_code_r;
de_r1 <= de_r;
de_r2 <= de_r1;
h_sync_r1 <= h_sync_r;
h_sync_r2 <= h_sync_r1;
v_sync_r1 <= v_sync_r;
v_sync_r2 <= v_sync_r1; end
always @( posedge clk )
begin
odata <= sync_code_r1 + fifo_rd_data_r;
h_sync <= h_sync_r2;
v_sync <= v_sync_r2;
de <= de_r2;
end endmodule

BT1120时序,可以用于自测用的更多相关文章

  1. VESA时序与BT1120的区别

    在实现内嵌传输的过程中,笔者参考VESA的时序,也就是下图,实现了一个内嵌同步的程序,同步码放在H Back Porch与H Front Porch的后端与前端,但是在传输过程中发现接收端画面不正常. ...

  2. Zynq-PL中创建AXI Master接口IP及AXI4-Lite总线主从读写时序测试(转)

    转载:原文  http://www.eefocus.com/antaur/blog/17-08/423751_6cc0d.html 0. 引言 通过之前的学习,可以在PL端创建从机模式的AXI接口IP ...

  3. Java压测之四两拨千斤

    压测之四两拨千斤核心观念: 1.传统的http请求肯定不能用于压测,原因是请求一次,响应一次,而响应数据同时占用了客户端的带宽,故此,客户端请求后,不需要接受响应,让服务器单相思去. 2.寻找可以令服 ...

  4. 全链路压测平台(Quake)在美团中的实践

    背景 在美团的价值观中,以“客户为中心”被放在一个非常重要的位置,所以我们对服务出现故障越来越不能容忍.特别是目前公司业务正在高速增长阶段,每一次故障对公司来说都是一笔非常不小的损失.而整个IT基础设 ...

  5. <十七>UML核心视图动态视图之时序图

    一:时序图 --->时序图是用于描述按时间顺序排列的对象之间的交互模式. --->它按照参与交互的对象所具有的“生命线”和他们相互发送的消息来显示这些对象. --->时序图包含对象和 ...

  6. jmeter压测学习8-压测带token的接口

    前言 工作中我们需要压测的接口大部分都是需要先登陆后,带着token的接口(或者带着cookies),我们可以先登陆获取token再关联到下个接口. 比如我现在要压测一个修改用户的个人信息接口,每个用 ...

  7. 在Linux CentOS上搭建Jmeter压测环境

    本文的主要内容是介绍如何在Linux CentOS 服务器上面搭建Jmeter的压测环境整个详细的流程,来满足我们日常工作中对于压力测试环境搭建.压力测试执行过程的需求. 一.首先我们要准备四个东西, ...

  8. 让全链路压测变得更简单!Takin2.0重磅来袭!

    自Takin社区版1.0发布两个多月以来,有很多测试同学陆续在各自的工作中运用了起来,其中包括金融.电商.物流.出行服务等行业.这个过程中我们收到了很多同学的反馈建议,同时也了解到很多同学在落地全链路 ...

  9. UML图 | 时序图(顺序、序列图)绘制

    上一次写过一篇 UML | 类图 相关的文章,平时规范开发会用的上,或者是写什么文档,就还是需要画图,就像毕业设计就是如此.希望能够帮助到大家. 注:本文中所用画图软件为 Microsoft Visi ...

随机推荐

  1. 浅谈Session与Cookie的区别与联系

    一.Session的概念 Session 是存放在服务器端的,类似于Session结构来存放用户数据,当浏览器 第一次发送请求时,服务器自动生成了一个Session和一个Session ID用来唯一标 ...

  2. 读取properties文件的信息

    1.properties配置文件的信息 fcsimage_path=C://FCSImage 2.Java代码 public final class Config { private static f ...

  3. linux下安装以及升级npm,node的方法

    1.最开始使用阿里云文档提供的安装方法一直都是失败的状态,后来找到了新的方法重新安装,按照以下操作一步一步的走即可实现,亲测可用 2.安装完之后,会发现npm和node的版本都偏低,需要重新升级以下, ...

  4. 9.10 h5日记

    9.10 1.什么是属性 属性是表示某些事物的一些特征 2.属性分为标签属性和样式属性,二者的区别在于哪里 标签属性:<img src="01.jpg" width=&quo ...

  5. selenium无界面chromedriver

    chromeDriver下载地址:http://chromedriver.storage.googleapis.com/index.html 谷歌浏览器Chrome和驱动程序的对照表https://b ...

  6. c# 使用ssh.net 上传文件

    在ssh.net 客户端实例下无法普通用户切换到su root  超级用户,原因是tty 的不支持,具体原因未查, 连接时用超级用户,问题解决 使用ssh.net  能实现远程命令,  使用其中的sf ...

  7. Android开发之利用ViewPager实现页面的切换(仿微信、QQ)

    这里利用ViewPager实现页面的滑动,下面直接上代码: 1.首先写一个Activity,然后将要滑动的Fragment镶嵌到写好的Activity中. Activity的布局文件:activity ...

  8. andorid 对话框

    activity_ui2.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout x ...

  9. RoCE vs iWARP

    两种以太网 RDMA 协议: iWARP 和 RoCE 转载 2017年03月08日 16:10:09 1510 http://weibo.com/p/1001603936363903889917?m ...

  10. BZOJ1084或洛谷2331 [SCOI2005]最大子矩阵

    BZOJ原题链接 洛谷原题链接 注意该题的子矩阵可以是空矩阵,即可以不选,答案的下界为\(0\). 设\(f[i][j][k]\)表示前\(i\)行选择了\(j\)个子矩阵,选择的方式为\(k\)时的 ...