我正在尝试从 Modelsim 中的 chipverify 网站运行一些代码,但我的输出与网站上的不同。来自网站的示例是关于事件合并的。
module tb;
// Create event variables
event event_a, event_b;
initial begin
fork
// Thread1: waits for event_a to be triggered
begin
wait(event_a.triggered);
$display ("[%0t] Thread1: Wait for event_a is over", $time);
end
// Thread2: waits for event_b to be triggered
begin
wait(event_b.triggered);
$display ("[%0t] Thread2: Wait for event_b is over", $time);
end
// Thread3: triggers event_a at 20ns
#20 ->event_a;
// Thread4: triggers event_b at 30ns
#30 ->event_b;
// Thread5: Assigns event_b to event_a at 10ns
begin
#10 event_b = event_a;
end
join
end
endmodule
我希望网站上的输出是这样的:
[20] Thread1: Wait for event_a is over
[20] Thread2: Wait for event_b is over
但相反,我得到了这样的东西:
[20] Thread1: Wait for event_a is over
同样的结果是当我尝试在 edaplayground(aldec riviera pro 或 icarus verilog 模拟器)上运行此代码时。为什么 event_a 和 event_b 合并时没有触发 event_b?