我遇到了一个测试台,它基本上可以归结为下面的例子:时钟和信号在同一时间步中通过阻塞分配进行更改。我相信这会导致时钟和两个 ctrlX 信号之间出现竞争状况,但我无法在 EDA 操场上证明(我知道这超出了我的控制范围)。我是否正确存在竞争条件?(EDA 游乐场链接:https ://www.edaplayground.com/x/5yDX#&togetherjs=gkG5xewfNN )
module tb_example;
reg clk = 1;
reg [3:0] dff1,dff2;
reg [3:0] ctrl1 = 'd0;
reg [3:0] ctrl2 = 'd0;
initial begin
#10 ctrl1 = 'd1;
#20 ctrl1 = 'd2;
#10 ctrl1 = 'd3;
#100 $finish;
end
always begin
#5 clk = !clk;
end
initial begin
$dumpfile("dump.vcd");
$dumpvars(0,tb_example);
end
initial begin
#10 ctrl2 = 'd1;
#20 ctrl2 = 'd2;
#10 ctrl2 = 'd3;
#100 $finish;
end
always @ (posedge(clk)) begin
dff1 <= ctrl1;
end
always @ (posedge(clk)) begin
dff2 <= ctrl2;
end
endmodule