task key1_press; //name
integer i; //变量
begin
for (i=0;i<5000000;i=i+1)begin
@(posedge clk);
if(i <100000)begin
key1 = {$random};
end
else if (i>5000000-100000) begin
key1 = {$random};
end
else begin
key1 = 1'b0;
end
end
@(posedge clk);
key1 = 1'b1;
end
endtask
模拟按键按下的代码
没有回复内容