Hello,
I was going through the difference between obj.randmize() and std::randomize and i found this article
(std::randomize( vs. randomize( vs. this.randomize( and scope - UVM SystemVerilog Discussions - Accellera Systems Initiative Forums) and i tried following example from the same blog.
class test;
rand int count;
constraint c1 { count >= 2; count <= 9; }
function new();
if (std::randomize(this)) // In the blog count is passed instead of this(I am checking if passing this will take constraint into account)
$display("Count %d",count);
if (randomize(count))
$display("Count %d",count);
if (this.randomize())
$display("Count %d",count);
endfunction
endclass
I am getting following error when in try this
The argument to class or scope randomize must be a simple identifier of integral type
But I was not able to find anything related to this error in LRM.
Regards,
Saket