I am setting values to sequence_item before I call start_item(seq_item) any different from setting values after calling start_item(seq_item)?
UVM: Does setting values to sequence_item before I call start_item(seq_item) cause any issue?
395 views Asked by shicky At
2
There are 2 answers
0
On
The main reason for randomizing a seq_item after start_item returns is to enable the transaction to be randomized based on the current state of the machine. If you don't have a dependency on the testbench state, then there is no functional difference.
I think the bigger issue is to use the established pattern of deferred randomization so that all of your code looks the same and so that anyone copying your code as a template (including you) follows the pattern just in case the order does matter.
Consistency in your code will help prevent bugs.
Yes, you can do this, but realize that start_item() is a blocking task, so the state of your design and testbench may be different before versus after.