In reply to dave_59:
Okay…
I just modified the same code and I am inserting a seed manually.
module temp;
class rand_class;
rand int unsigned data;
function new(int seed);
srandom(seed);
endfunction
endclass
rand_class obj;
initial
begin
obj = new(10);
$display("SEED = %d",obj.get_randstate());
repeat(5) begin
obj.randomize();
$display("Data = %d, seed = %d",obj.data,obj.get_randstate()); end
end
endmodule
So, here on which RNG will the seed 10 be loaded? If it is for object thread, then through first $display for obj.get_randstate() I should be getting 10.
Here is the output,
SEED = 4627009825161508818790549032975409576912747608007613670663354967688005127426567537619378540336574321059771681060756351887347663700834624509726131308091994
Data = 1259199836, seed = 2532006271069517679567699893160377841590441643497274272351457228610612951981757327074417830179063467247960281449516660673757496792152083733712046514526810
Data = 1918125812, seed = 4626976265854281180514947197437822078477535798474982797456824333358331421334425210844417182152310342353194914306311223319518503703649396910909870961220184
Data = 2263373791, seed = 2576402305486693448314360481394217134024106353880668131339340534213604682159408462868979423471588136234311296067687617247286999169849357467176591408257114
Data = 1160894215, seed = 4627009824649339133011204972591200958016150187620687913580408860257674102029464678299947477957044723251536943865625013119475372925999534663865015276690008
Data = 2156368458, seed = 4618826223773684211888993272211760420365008116347779968445576592813163782487979542097848440530407180683387174999129698488042551378273532800632930399050330
I am unable to figure out where my seed 10 is initiating…