video timing controller和AXI4-stream to video out IP核生成视频协议数据

一、前言

计划使用VIVADO 2021.1中的video timing controller和AXI4-stream to video out IP核生成视频协议数据。

二、问题描述

调试过程中,出现LOCK信号无法锁定的问题,分析问题有以下两点:

  1. 需要保证video timing controller输出的时序与AXI stream的时序基本一致,主要是视频图像尺寸,比如图像大小为1024*600。
  2. 需要在AXI总线的ready信号有效时,让valid信号有效。以此保证AXI4-stream to video out IP核的underflow信号不拉高。

三、实现方案

各引脚的连接方式如RTL图。

四、IP核设置

video timing controller设置如下

 

 

AXI4-stream to video out IP设置如下

五、AXIS数据生成

module csi_to_axis(
        input zu4cg_csi_pclk,
//AXIS 接口,输出到video out IP核
    output reg [23 : 0] m_axis_video_tdata =0,
    output wire m_axis_video_tvalid,
    input wire m_axis_video_tready,
    output wire m_axis_video_tuser,
    output wire m_axis_video_tlast,
    output wire m_axis_video_clk
    );
    
    localparam X_NUM = 11'd1024;//屏幕X方向像素点数
    localparam Y_NUM = 10'd600;//屏幕Y方向像素点数
    reg [11:0] pixel_cnt =0;
    reg [11:0] line_cnt=0;
    
assign m_axis_video_clk =    zu4cg_csi_pclk;  
assign m_axis_video_tvalid = 1'b1;

always@(posedge zu4cg_csi_pclk)
begin
    if(m_axis_video_tvalid & m_axis_video_tready)
        m_axis_video_tdata <= m_axis_video_tdata + 1;
end

always@(posedge zu4cg_csi_pclk)   
begin
    if(m_axis_video_tvalid & m_axis_video_tready)begin
        if(pixel_cnt < X_NUM-1)   
              pixel_cnt <= pixel_cnt +1;
        else
            pixel_cnt <= 'b0;
    end
 end
 
 always@(posedge zu4cg_csi_pclk)   
begin
    if(m_axis_video_tvalid & m_axis_video_tready)begin
        if(pixel_cnt == X_NUM-1)begin
            if(line_cnt <Y_NUM -1)
                line_cnt <= line_cnt + 1;
            else
                line_cnt <= 0;
        end
    end
end
    
assign m_axis_video_tuser = (line_cnt == 'b0 && pixel_cnt == 'b0 
            &&m_axis_video_tvalid && m_axis_video_tready)
                            ?1'b1 :1'b0;
assign m_axis_video_tlast= (pixel_cnt == X_NUM-1)
                            ?1'b1 :1'b0;

endmodule

六、仿真结果

仿真结果显示,LOCK信号正常锁定,AXI4-stream to video out输出正常。

 

 完整工程下载链接:videotimingcontroller和AXI4-streamtovideooutIP核生成视频协议数据-嵌入式文档类资源-CSDN下载

  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Chapter 1: Introduction AXI4-Stream Signaling Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Chapter 2: System Design Guide Video Timing Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Propagating Video Timing Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Reset Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Input/Output Interfaces - Automatic Delay Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 External Frame Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Multipoint Interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Ancillary Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Interlaced Video Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Video Subsystem Software Guidelines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Video Subsystem Bandwidth Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Chapter 3: IP Development Guide IP Parameterization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 General IP Structure. . . . . . . . . . . . . . . . . . . . . . .

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值