开发者

What's the difference when time delay specified in LHS or RHS?

开发者 https://www.devze.com 2023-03-05 17:20 出处:网络
a = #5 b; #5 a = b; Is there any difference between above 2 开发者_运维技巧statements?The # on the RHS is known as an intra-assignment delay.Read about the distinction in the IEEE Std (1800-2009), s
a = #5 b;
#5 a = b;

Is there any difference between above 2 开发者_运维技巧statements?


The # on the RHS is known as an intra-assignment delay. Read about the distinction in the IEEE Std (1800-2009), section 9.4.5 "Intra-assignment timing controls".

An intra-assignment delay or event control shall delay the assignment of the new value to the left-hand side, but the right-hand expression shall be evaluated before the delay, instead of after the delay.

Run a simulation with both statements to see what difference (if any) you observe. Use $monitor and $time.


To be precise that second statement doesn't specify a timing delay on the LHS of the blocking assignment. It is prefixed by a procedural_timing_control construct which can used before any type of procedural statement, not just assignment statements.

0

精彩评论

暂无评论...
验证码 换一张
取 消