Query regarding RAL

In reply to SATYA369:

In reply to rgarcia07:
Hi rgarcia07
In the link you have provided,there is a method called randomize() and I just want to check how it works.
Yes,I was expecting that the value field of the reg field to be randomized but it’s not.
Even if the value field is randomized,how to check whether it is randomized or not?
Thanks
SATYA

Maybe you missed the part assert( rg.randomize() ); if randomisation failed you will get an assertion, also you could do if (!RG.randomize()) `uvm_error()… If this fails then you have something wrong somewhere else in your code maybe some constraints, but without looking at some code is hard to help.

Also is your register/field RO, or RW? etc I believe depending on the type you won’t be able to randomise it.

Also from where are you randomising the register, is it in a test, sequence, and are you randomising the entire model or only the register?
-R