Verilog中的非阻塞分配
我正在为一个简单的XOR门创建一个测试台。我在测试台中使用了非阻塞语句。我本来希望并行执行,但最终得到了顺序执行。我在下面附加代码和输出。可能是什么问题Verilog中的非阻塞分配,verilog,nonblocking,Verilog,Nonblocking,我正在为一个简单的XOR门创建一个测试台。我在测试台中使用了非阻塞语句。我本来希望并行执行,但最终得到了顺序执行。我在下面附加代码和输出。可能是什么问题 module test_xor_tb; wire y; reg a,b; test_xor x1(y,a,b); initial begin a<=0;b<=0; #10 a<=1; #10 b<=1; #25 b<=0; #35 a<=0; end
module test_xor_tb;
wire y;
reg a,b;
test_xor x1(y,a,b);
initial begin
a<=0;b<=0;
#10 a<=1;
#10 b<=1;
#25 b<=0;
#35 a<=0;
end
initial
$monitor("AT TIME %t,a=%b,b=%b,Y=%b",$time,a,b,y);
endmodule
/////////////////////////////////////////////////////////////////////
module test_xor(y,a,b);
input a,b;
output y;
assign y=a^b;
endmodule
我的预期产出是
# AT TIME 0,a=0,b=0,Y=0
# AT TIME 10,a=1,b=0,Y=1
# AT TIME 10,a=1,b=1,Y=0
# AT TIME 25,a=1,b=0,Y=1
# AT TIME 35,a=0,b=0,Y=0
那么,为什么非阻塞分配是按顺序执行的呢
# AT TIME 0,a=0,b=0,Y=0
# AT TIME 10,a=1,b=0,Y=1
# AT TIME 10,a=1,b=1,Y=0
# AT TIME 25,a=1,b=0,Y=1
# AT TIME 35,a=0,b=0,Y=0
initial begin
a<=0;b<=0;
a<= #10 1;
b<= #10 1;
b<= #25 0;
a<= #35 0;
end
initial begin
fork
a<=0;b<=0;
#10 a<=1;
#10 b<=1;
#25 b<=0;
#35 a<=0;
join
end