Query regarding RAL

Hi,

 I'm working on RAL and I've got some doubts regarding RAL,can anyone help me with these?

1.give me a scenario in which only the mirrored value gets updated and the desired should not get updated.Actually I tried like this.
I used Backdoor write and Backdoor read so that there will be no data in the interface and since predictor converts the data in the interface in to reg_transaction,now it cannot update desired value.But what’s happening is both the desired and mirrored value are updating.

2.I’m using randomize() method to randomize a field,and while configuring I gave the argument .is_rand(1).But it’s not randomizing.Is there something else that I need to do?

3.By using get() - we can get the desired_value of the register
get_mirrored_value() - we can get the mirrored_value of the register
but how to get the value_field? Is there any scenario in which I can desired_value,mirrored_value,value fields each a different value?

Thank you
SATYA

In reply to SATYA369:

Hi,
I’m working on RAL and I’ve got some doubts regarding RAL,can anyone help me with these?
1.give me a scenario in which only the mirrored value gets updated and the desired should not get updated.Actually I tried like this.
I used Backdoor write and Backdoor read so that there will be no data in the interface and since predictor converts the data in the interface in to reg_transaction,now it cannot update desired value.But what’s happening is both the desired and mirrored value are updating.
2.I’m using randomize() method to randomize a field,and while configuring I gave the argument .is_rand(1).But it’s not randomizing.Is there something else that I need to do?
3.By using get() - we can get the desired_value of the register
get_mirrored_value() - we can get the mirrored_value of the register
but how to get the value_field? Is there any scenario in which I can desired_value,mirrored_value,value fields each a different value?
Thank you
SATYA

I’d recommend to check this link UVM Tutorial for Candy Lovers – 16. Register Access Methods – ClueLogic to understand better about the different attributes the uvm_reg and uvm_reg_field has.
1- For example imagine you have a RO or status register to which you are doing some checker or predictor using predict() method to set the mirror value, at some point you’ll need to do rg.mirror() to do some comparison between what you predicted and what the DUT actually has then after the check the 3 values (value, desired, and mirrored should be in sync)
2- Not sure what you mean by not randomising, can you show an example, I’d expect the .value member to be randomised according to its constraints
3- To get the value which is used for FCOV and randomisation you could do rg.field.value

Also the case of modelling status register is a case in which these 3 values can differ.

HTH,
-R

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

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

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

You cannot check if data are randomized or not. What you can check is if the randomization failed or not. This can be done by evaluation the return value of the randomize method… If data are staying on there initial values, i.e. 'bx for logix, 'b0 for bit they are not randomized.