Reputation: 113
I have the following in Verilog:
reg a;
always @ (clk)
begin
a = 0;
a <= 1;
$display(a);
end
What value of literal 'a' would show me? Is that 0 or 1?
Upvotes: 2
Views: 1033
Reputation: 1639
Verilog simulation occurs in 5 queues as stated in IEEE 1364-1995 § 5.3, IEEE 1364-2001 § 5.3, and IEEE 1364-2005 § 11.3:
#0
)
$display
and $write
#0
)
#0
delay, otherwize same processes as Active Eventtf_synchronize()
(deprecated in IEEE 1364-2005) and vpi_register_cb(cbReadWriteSynch)
$monitor
and $strobe
reason_rosynchronize
(deprecated in IEEE 1364-2005)Since $display
occurs before the non-blocking assignment is assigned , the value will be 0. Note the order of execution may change in each queue.
Upvotes: 3