initial begin
#100;
reset=0;
end
always # 10 video_clk = ~video_clk;
always # 5 axis_clk = ~axis_clk;
always # 2 axi_clk = ~axi_clk;
sensor u_sensor
(
.rst (reset),
.clk (video_clk),
.vsync (sensor_vsync),
.hsync (sensor_hsync),
.de (sensor_de),
.vblank (sensor_vblank),
.pix_out (sensor_data)
);
video2axis u_video2axis
(
.axis_clk (axis_clk),
.axis_aresetn (!reset),
.reg_axis_start (1'b1),
.m_axis_tdata (axis_s2mm_tdata ),
.m_axis_tkeep (axis_s2mm_tkeep ),
.m_axis_tvalid (axis_s2mm_tvalid),
.m_axis_tlast (axis_s2mm_tlast ),
.m_axis_tuser (axis_s2mm_tuser ),
.m_axis_tready (axis_s2mm_tready),
.video_clk (video_clk),
.video_rst (reset),
.video_hsync (sensor_hsync),
.video_vsync (sensor_vsync),
.video_hblank (1'b0),
.video_vblank (sensor_vblank),
.video_de (sensor_de),
.video_data (sensor_data)
);
wire vid_hsync_i;
wire vid_vsync_i;
wire vid_hblank_i;
wire vid_vblank_i;
wire vid_de_i;
wire vid_hsync_o;
wire vid_vsync_o;
wire vid_hblank_o;
wire vid_vblank_o;
wire vid_de_o;
wire [31:0] vid_video_o;
video_timing_gen
#(
.SENSOR_ACT_W (640),
.SENSOR_ACT_H (480),
.SENSOR_WIDTH (800),
.SENSOR_HEIGHT (600),
.SENSOR_HSYNC_START (0 ),
.SENSOR_HSYNC_STOP (40),
.SENSOR_VSYNC_START (0 ),
.SENSOR_VSYNC_STOP (4 )
)
u_video_timing_gen
(
.rst_n (!reset),
.video_clk (video_clk),
.reg_h_start (80),
.reg_v_start (60),
.vsync (vid_vsync_i),
.hsync (vid_hsync_i),
.de (vid_de_i),
.vblank (vid_vblank_i),
.hblank (vid_hblank_i)
);
axis2video u_axis2video
(
.axis_clk (axis_clk),
.axis_aresetn (!reset),
.reg_axis_mm2s_start (1'b1),
.s_axis_tdata (axis_mm2s_tdata),
.s_axis_tvalid (axis_mm2s_tvalid),
.s_axis_tlast (axis_mm2s_tlast),
.s_axis_tuser (axis_mm2s_tuser),
.s_axis_tready (axis_mm2s_tready),
.video_clk (video_clk),
.video_rst (reset),
.video_hsync_i (vid_hsync_i),
.video_vsync_i (vid_vsync_i),
.video_hblank_i (vid_hblank_i),
.video_vblank_i (vid_vblank_i),
.video_de_i (vid_de_i),
.video_hsync_o (vid_hsync_o),
.video_vsync_o (vid_vsync_o),
.video_hblank_o (vid_hblank_o),
.video_vblank_o (vid_vblank_o),
.video_de_o (vid_de_o),
.video_data (vid_video_o)
);
axi_lite_master u_axi_lite_master
(
.M_AXI_ACLK (axi_lite_clk ),
.M_AXI_ARESETN (!reset ),
.M_AXI_AWADDR (axi_lite_master_awaddr ), //[8:0]
.M_AXI_AWPROT ( ),
.M_AXI_AWVALID (axi_lite_master_awvalid ),
.M_AXI_AWREADY (axi_lite_master_awready ),
.M_AXI_WDATA (axi_lite_master_wdata ),
.M_AXI_WSTRB ( ),
.M_AXI_WVALID (axi_lite_master_wvalid ),
.M_AXI_WREADY (axi_lite_master_wready ),
.M_AXI_BRESP (axi_lite_master_bresp ),
.M_AXI_BVALID (axi_lite_master_bvalid ),
.M_AXI_BREADY (axi_lite_master_bready ),
.M_AXI_ARADDR (axi_lite_master_araddr ), //[8:0]
.M_AXI_ARPROT ( ),
.M_AXI_ARVALID (axi_lite_master_arvalid ),
.M_AXI_ARREADY (axi_lite_master_arready ),
.M_AXI_RDATA (axi_lite_master_rdata ),
.M_AXI_RRESP (axi_lite_master_rresp ),
.M_AXI_RVALID (axi_lite_master_rvalid ),
.M_AXI_RREADY (axi_lite_master_rready ),
.DDRX_PHY_INIT_DONE(1'b1),
.DONE_SUCCESS ( )
);
axi_vdma_test u_axi_vdma_test (
.s_axi_lite_aclk(axi_lite_clk),
.m_axi_mm2s_aclk(axi_clk),
.m_axis_mm2s_aclk(axis_clk),
.m_axi_s2mm_aclk(axi_clk),
.s_axis_s2mm_aclk(axis_clk),
.axi_resetn(!reset),
.s_axi_lite_awvalid(axi_lite_master_awvalid),
.s_axi_lite_awready(axi_lite_master_awready),
.s_axi_lite_awaddr (axi_lite_master_awaddr[8:0]),
.s_axi_lite_wvalid (axi_lite_master_wvalid),
.s_axi_lite_wready (axi_lite_master_wready),
.s_axi_lite_wdata (axi_lite_master_wdata),
.s_axi_lite_bresp (axi_lite_master_bresp),
.s_axi_lite_bvalid (axi_lite_master_bvalid),
.s_axi_lite_bready (axi_lite_master_bready),
.s_axi_lite_arvalid(axi_lite_master_arvalid),
.s_axi_lite_arready(axi_lite_master_arready),
.s_axi_lite_araddr (axi_lite_master_araddr[8:0]),
.s_axi_lite_rvalid (axi_lite_master_rvalid),
.s_axi_lite_rready (axi_lite_master_rready),
.s_axi_lite_rdata (axi_lite_master_rdata),
.s_axi_lite_rresp (axi_lite_master_rresp),
//.s2mm_frame_ptr_in(),
//.s2mm_frame_ptr_out(),
.m_axi_s2mm_awaddr (S_AXI_awaddr),
.m_axi_s2mm_awlen (S_AXI_awlen),
.m_axi_s2mm_awsize (S_AXI_awsize),
.m_axi_s2mm_awburst(S_AXI_awburst),
.m_axi_s2mm_awprot (S_AXI_awprot),
.m_axi_s2mm_awcache(S_AXI_awcache),
.m_axi_s2mm_awvalid(S_AXI_awvalid),
.m_axi_s2mm_awready(S_AXI_awready),
.m_axi_s2mm_wdata (S_AXI_wdata),
.m_axi_s2mm_wstrb (S_AXI_wstrb),
.m_axi_s2mm_wlast (S_AXI_wlast),
.m_axi_s2mm_wvalid (S_AXI_wvalid),
.m_axi_s2mm_wready (S_AXI_wready),
.m_axi_s2mm_bresp (S_AXI_bresp),
.m_axi_s2mm_bvalid (S_AXI_bvalid),
.m_axi_s2mm_bready (S_AXI_bready),
评论
查看更多