task monitorPush();
begin
bit [7:0] data = 0;
while (1) begin
@ (posedge intf.clk);
if (intf.cb.wr_cs== 1 && intf.cb.wr_en== 1) begin
// @ (posedge intf.clk);
data = intf.data_in;
sb.addItem(data);
$write("%dns : Write posting to scoreboard data = %x\n",$time, data);
end
end
end
endtask
上面的代码和下面的代码有什么不同?就像将 posedge 时钟从第 5 行移到第 7 行如何改变代码一样?提前致谢
task monitorPush();
begin
bit [7:0] data = 0;
while (1) begin
// @ (posedge intf.clk);
if (intf.cb.wr_cs== 1 && intf.cb.wr_en== 1) begin
@ (posedge intf.clk);
data = intf.data_in;
sb.addItem(data);
$write("%dns : Write posting to scoreboard data = %x\n",$time, data);
end
end
end
endtask