新手入门
- 积分
- 16
- 金钱
- 16
- 注册时间
- 2020-7-21
- 在线时间
- 3 小时
|
1金钱
有没有该工程完整的testbench仿真代码
本人编写了摄像头采集模块cmos_capture_data的testbench,但是无法出现仿真结果,求指教
以下为仿真代码和仿真结果
`timescale 1ns / 1ps
module tb_cmos_capture_data(
);
reg rst_n ; //复位信号
//摄像头接口 ;
reg cam_pclk = 0 ; //cmos 数据像素时钟
reg cam_vsync ; //cmos 场同步信号
reg cam_href ; //cmos 行同步信号
reg [7:0] cam_data ;
//用户接口 ;
wire cmos_frame_vsync; //帧有效信号
wire cmos_frame_href ; //行有效信号
wire cmos_frame_valid; //数据有效使能信号
wire [15:0] cmos_frame_data ; //有效数据
cmos_capture_data uut_cmos_capture_data(
. rst_n (rst_n ) , //复位信号
//摄像头接口
. cam_pclk (cam_pclk ) , //cmos 数据像素时钟
. cam_vsync (cam_vsync ) , //cmos 场同步信号
. cam_href (cam_href ) , //cmos 行同步信号
. cam_data (cam_data ) ,
//用户接口
. cmos_frame_vsync(cmos_frame_vsync) , //帧有效信号
. cmos_frame_href (cmos_frame_href ) , //行有效信号
. cmos_frame_valid(cmos_frame_valid) , //数据有效使能信号
. cmos_frame_data (cmos_frame_data ) //有效数据
);
always #10 cam_pclk =~cam_pclk;
initial begin
rst_n = 0;
#1000 rst_n =1;
cam_vsync = 1;
cam_href = 0;
#1000 cam_vsync = 0;
#1000 cam_href = 1;
#2000 cam_href = 0;
#1000 cam_href = 1;
#2000 cam_href = 0;
#1000 cam_href = 1;
#2000 cam_href = 0;
#1000 cam_href = 1;
#2000 cam_href = 0;
#1000 cam_href = 1;
#2000 cam_href = 0;
#1000 cam_href = 1;
#2000 cam_href = 0; cam_vsync = 1;
end
always @(posedge cam_pclk)begin
if(!rst_n)cam_data <= 0;
else if(rst_n == 1&& cam_href == 1)cam_data <= cam_data +1;
else cam_data <= cam_data ;
end
endmodule
|
-
|