# How to update the mirror value of register

**URL:** <https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242>\
**Category:** UVM\
**Tags:** UVM, Mirrored-values-and-desired-values-in-UVM-RAL, RAL, register-read-mirror-set\_check\_on\_read, mirrored-value\
**Created:** [June 23, 2017, 12:37pm UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242 "2017-06-23T12:37:19Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![murali405](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@murali405](https://verificationacademy.com/forums/u/murali405)\
**Post date:** [June 23, 2017, 12:37pm UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/1 "2017-06-23T12:37:19Z")

</div>

Hi,  
I got stuck with the updating mirrored value of RO register in RAL.  
I have a Read only register “status” in the RTL. and i have RAL integrated on to it.  
The “status” register is Readonly register. We do not write any thing from TB side. But iam seeing from error that Mirror value of register is not getting updated.

# Note: The register is Read only register.

# UVM\_ERROR reporter [RegModel] Field active\_cells (datapathregs.STATUS[23:0]) mismatch read=24’h3ffc mirrored=24’h0.

I have two questions here:

1. When the comparison of RTL and mirror value happens? because i do not see any compare() or mirror() method used in TB. But still this error comes as the comparison happens.Is there any other case that comparison happens other than mirror() and compare() methods?

I see only read operation from this register “status”.

How can i update the Mirrored value i.e RAL register value so that comparison RTL and mirror value will pass. I tried using predict() like predict(1) it worked. But here i want to pass the uvm\_reg\_type to predict. Because the value will be changed by DUT based on some internal operation.

1. Do i need to call predict() method before read of the register or later?  
does setting set\_auto\_predict() and set\_check\_on\_read() works in this case? I tried, but did not work.

Can some one help on this how to resolve issue?

Thanks,

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [June 25, 2017, 12:55pm UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/2 "2017-06-25T12:55:15Z")

</div>

_In reply to [murali405](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242):_

the mirror() method reads the Register in the RTL and is updating the value in the regmodel of the TB. IF you do not have a mirror command in your reg sequences you have to face compare errors.

---

<div class="post-metadata">

**Author:** ![murali405](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@murali405](https://verificationacademy.com/forums/u/murali405)\
**Post date:** [June 27, 2017, 8:25am UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/3 "2017-06-27T08:25:47Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/2):_

Hi,  
I tried using mirror() using front door access method in sequence before doing read() of the register and still i see that mirrored value of the read only register is “0”.  
Can you reply to my questions in the thread? that will be helpful to figure out the issue.

Thanks,

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [June 27, 2017, 9:03am UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/4 "2017-06-27T09:03:28Z")

</div>

_In reply to [murali405](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/3):_  
In your case I’d check the Integration of your Register model and the Connections, i.e. checking the Adapter and the predictor.

---

<div class="post-metadata">

**Author:** ![murali405](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@murali405](https://verificationacademy.com/forums/u/murali405)\
**Post date:** [June 27, 2017, 10:58am UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/5 "2017-06-27T10:58:23Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/4):_  
But i observed that value updated using predict method is reflected on mirrored value, but same is not updated when i am using ucm\_reg\_type.

ex:1 map1.status1.predict(20) // It worked and reflects on mirroe value in comparison.  
ex:2 uvm\_reg\_type rddata;  
map1.status1.predict(rddata) // did not work. still getting 0 on mirrored value.  
I can see that my register model and connections are correct.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [June 27, 2017, 11:58am UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/6 "2017-06-27T11:58:55Z")

</div>

_In reply to [murali405](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/5):_

You mean uvm\_reg\_data\_t? Correct?  
This is a 2 state data types. It Looks like the mirror does not work and Returns the default value of a 2 state data type.  
Could you please use uvm\_reg\_data\_logic\_t? If my guess is correct it should return ‘x’.

---

<div class="post-metadata">

**Author:** ![murali405](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@murali405](https://verificationacademy.com/forums/u/murali405)\
**Post date:** [June 27, 2017, 12:18pm UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/7 "2017-06-27T12:18:14Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/6):_

May i know the use of “uvm\_reg\_data\_logic\_t”? How it will resolve my problem? I will get “x” instead of 0 but how can i get the updated mirrored value?

I observed one more thing that if i use predict(rddata) after read() it will get the value because read() returns the output of type uvm\_reg\_data\_t. But i observed that at the same time o read operation the comparison of DUT and mirrored value happened.

May i know in which cases the DUT and mirrored value is compared.

I am not using compare() method and also auto\_predict is disabled. But any idea which enables this comparison at the same time when read happens?

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [June 27, 2017, 12:37pm UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/8 "2017-06-27T12:37:32Z")

</div>

_In reply to [murali405](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/7):_

To enable checking do : mirror(Status, UVM\_CHECK). The default is UVM\_NO\_CHECK

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [June 27, 2017, 1:07pm UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/9 "2017-06-27T13:07:52Z")

</div>

_In reply to [murali405](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/8):_

If “uvm\_reg\_data\_logic\_t” Returns ‘x’ here might be something wrong with the connection. This is only to debug your problem in some more detail.

---

<div class="post-metadata">

**Author:** ![murali405](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@murali405](https://verificationacademy.com/forums/u/murali405)\
**Post date:** [June 29, 2017, 11:12am UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/10 "2017-06-29T11:12:58Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/9):_

It is resolved . The mirrored value is getting updated using predict() method. In my environment the comparison happens whenever read from that register happens.  
So i updated the mirrored value before calling Read() method and it worked.

---

<div class="post-metadata">

**Author:** ![SAI\_BOOTHKURI](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/sai_boothkuri/32/1944_2.png) [@SAI\_BOOTHKURI](https://verificationacademy.com/forums/u/SAI_BOOTHKURI)\
**Post date:** [October 26, 2017, 2:28pm UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/11 "2017-10-26T14:28:27Z")

</div>

_In reply to [murali405](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/10):_

Can you tell me u on auto\_predict method or u manually updated using predict method.

---

<div class="post-metadata">

**Author:** ![naveen-y](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/n/3d9bf3/32.png) [@naveen-y](https://verificationacademy.com/forums/u/naveen-y)\
**Post date:** [February 8, 2018, 1:07pm UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/12 "2018-02-08T13:07:50Z")

</div>

hi all,  
I am getting both mirrored and desired values. But both are not getting at the same time(mirrored values are getting after some time) and am unable to figure it out. Can some one please help me in this issue.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![cuonghle](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/cuonghle/32/3231_2.png) [@cuonghle](https://verificationacademy.com/forums/u/cuonghle)\
**Post date:** [February 8, 2018, 5:58pm UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/13 "2018-02-08T17:58:14Z")

</div>

_In reply to [naveen-y](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/12):_

> hi all,  
> I am getting both mirrored and desired values. But both are not getting at the same time(mirrored values are getting after some time) and am unable to figure it out. Can some one please help me in this issue.  
> Thanks in advance.

Please tell me, how did you update mirrored and desired values? With less information you provided, I guess that the mirrored value is updated via bus monitor (explicited predict), then it will take a longer delay comparing to desired value.

---

<div class="post-metadata">

**Author:** ![naveen-y](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/n/3d9bf3/32.png) [@naveen-y](https://verificationacademy.com/forums/u/naveen-y)\
**Post date:** [February 9, 2018, 6:55am UTC](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/14 "2018-02-09T06:55:02Z")

</div>

_In reply to [cuonghl](https://verificationacademy.com/forums/t/how-to-update-the-mirror-value-of-register/33242/13):_

hi,  
Thank you for replying. I have connected monitor(with analysis port) to the predictor(bus-in, implementation port in predictor) and I have done the set\_auto\_predict(1), in the ‘env’, which updates the mirrored\_values automatically. And I have not used any explicit ‘predict’ method anywhere.  
And one more doubt I have is that, I am getting the desired and mirrored values of different registers at different times. For example, if am getting the  
desired value of ‘ctrl’ reg at time t, i get  
mirrored value of ‘ctrl’ reg at time t+20 and  
desired value of ‘div’ reg at time t+20, i get  
mirrored value of ‘div’ reg at time t+40 and so on for the other registers(in the order in which I have written in sequence by using ‘write’ and ‘read’ register access methods).  
Is it correct if we get the values of all the registers at different times?  
And is it correct if we get the desired and mirrored values at different times?  
Is it compulsory that we should get all the values at the same time?
