About $urandom_range random stability

Hello,

During a discussion with a colleague he mentioned that “$urandom_range() is generally fast but suffers from random stability (thread stability has been addressed by LRM but object stability is still an issue)”.

In the 1800-2017 I see “$urandom_range() is automatically thread stable (see 18.14.2).

Also in section 18.14 Random stability

“The RNG is localized to threads and objects. Because the sequence of random values returned by a thread or
object is independent of the RNG in other threads or objects, this property is called random stability.
Random stability applies to the following:
— The system randomization calls, $urandom() and $urandom_range()

So I’m a bit confused if the term object stability applies to a system call, as the LRM defines it as
“Object stability. Each class instance (object) has an independent RNG for all randomization methods in the class…”

So if this concept applies to system calls, then is the $urandom_range() object stable?

Any hints are really appreciated.

-R

In reply to rgarcia07:

All randomization in SystemVerilog happens as the as the result of executing a procedural construct. With the exception of the built-in randomize() method, the seed for all these constructs comes from the thread executing the construct. Thread stability comes from making sure the threads get started in the same order, and within a single thread, the randomization constructs get executed in the same order.

That one exception is where object stability comes in. When you construct a class object, that object gets seeded from the thread executing the constructor. After that, calls to randomize() use the object seed, not the thread seed.

In reply to dave_59:

Hi Dave,

Thank you very much for your response, it seems I need to study more about this since I still don’t get if the statement made by my colleague is true or not or if it make sense, based on your answer.

-R

In reply to rgarcia07:

Random stability is all a matter of relative degree. It would help to think of it in terms of what causes instability.

If it helps :

and

https://pdfs.semanticscholar.org/5613/bb8bdf74ba277ca026988c1816c0c23135d4.pdf
Original Source I believe is :
https://www.doulos.com/knowhow/sysverilog/SNUG13_random_stability/

In reply to KillSteal:

If it helps :
https://s3.amazonaws.com/verificationacademy-news/DVCon2012/Papers/MGC_DVCon_12_UVM_Random_Stability_Don’t_Leave_it_to_Chance.pdf
and
[PDF] Random Stability in SystemVerilog | Semantic Scholar
Original Source I believe is :
https://www.doulos.com/knowhow/sysverilog/SNUG13_random_stability/

Thank you very much this paper is really helpful.