iammilind
iammilind

Reputation: 69988

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

a = #5 b;
#5 a = b;

Is there any difference between above 2 statements?

Upvotes: 2

Views: 3248

Answers (2)

user597225
user597225

Reputation:

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.

Upvotes: 1

toolic
toolic

Reputation: 62037

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.

Upvotes: 5

Related Questions