在这个模块中,系统复位后需要拉高data_start信号,我们可以通过构造一个2位计数器pull_cnt,第三个时钟周期后pull_cnt高位为1,通过判断pull_cnt的高位拉高data_start.
module pull_test(
input sclk,
input rst_n,
input data_start
);
reg [1:0] pull_cnt;
wire data_start;
always @(posedge sclk or negedge rst_n)
if(rst_n == 1'b1)
pull_cnt <= 'd0;
else if(pull_cnt[1] == 1'b0)
pull_cnt <= pull_cnt + 1;
assign data_start = pull_cnt[1];
endmodule