module n;
reg [3:0] a,b;
integer i;
initial begin
$monitor("monitor a:%h b:%h @ %0t", a, b, $time);
for(i=0; i<4; i=i+1) begin
$strobe("strobe a:%h b:%h @ %0t", a, b, $time);
$display("display a:%h b:%h @ %0t", a, b, $time);
case(i)
0 : a = 4;
1 : b = 1;
2 : begin end // do nothing
3 : {a,b} = 9;
endcase
$display("display a:%b b:%b @ %0t", a, b, $time);
#1;//after delete this line,output changed
end
end
endmodule
Output of above verilog script is:
display a:x b:x @ 0
display a:0100 b:xxxx @ 0
monitor a:4 b:x @ 0
strobe a:4 b:x @ 0
display a:4 b:x @ 1000
display a:0100 b:0001 @ 1000
strobe a:4 b:1 @ 1000
monitor a:4 b:1 @ 1000
display a:4 b:1 @ 2000
display a:0100 b:0001 @ 2000
strobe a:4 b:1 @ 2000
display a:4 b:1 @ 3000
display a:0000 b:1001 @ 3000
strobe a:0 b:9 @ 3000
monitor a:0 b:9 @ 3000
When I delete #1,the output changed:
display a:x b:x @ 0
display a:0100 b:xxxx @ 0
display a:4 b:x @ 0
display a:0100 b:0001 @ 0
display a:4 b:1 @ 0
display a:0100 b:0001 @ 0
display a:4 b:1 @ 0
display a:0000 b:1001 @ 0
monitor a:0 b:9 @ 0
strobe a:0 b:9 @ 0
strobe a:0 b:9 @ 0
strobe a:0 b:9 @ 0
strobe a:0 b:9 @ 0
And the $time become 0.
What changed output display sequence?