Randomize

void'(seq.randomize());

please anyone tell me why do we need to put randomiztion within void function

In reply to harshit2015:

If you have a look at the LRM section 18.6.1 Randomize()
“The randomize() method returns 1 if it successfully sets all the random variables and objects to valid values; otherwise, it returns 0.”

So by doing void’(seq.randomize()) you are doing a static cast (LRM section 6.24.1 Cast operator)to discard the value of the randomize call (sometimes to avoid warnings), normally this is not recommended as common practice you should check the value i.e

if(!seq.randomize()) `uvm_fatal(get_name(), "Randomize Failed")

HTH,
-R