# X in uvm\_reg transactions

**URL:** <https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204>\
**Category:** UVM\
**Tags:** UVM, uvm-ral, uvm\_reg\_adapter, uvm\_reg\
**Created:** [June 19, 2019, 6:11pm UTC](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204 "2019-06-19T18:11:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vigneshr95](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/v/dbc845/32.png) [@vigneshr95](https://verificationacademy.com/forums/u/vigneshr95)\
**Post date:** [June 19, 2019, 6:11pm UTC](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204/1 "2019-06-19T18:11:53Z")

</div>

Hi,

I have an issue where teh DUT returns an X for register read but the reg2bus still sees it as a 0.

When I was going over the uvm\_reg\_bus\_op struct the type for data is uvm\_reg\_data\_t which is only 2-state.

Is there a way to override this argument to support 3/4-state? Maybe uvm\_reg\_data\_logic\_t?

Please let me know.

Thanks in advance!

Vignesh

---

<div class="post-metadata">

**Author:** ![mitesh.patel](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@mitesh.patel](https://verificationacademy.com/forums/u/mitesh.patel)\
**Post date:** [June 20, 2019, 4:29am UTC](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204/2 "2019-06-20T04:29:33Z")

</div>

_In reply to [vigneshr](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204):_

I don’t see any support to override this struct uvm\_reg\_bus\_op. if this 'hX propogation is illegal then you can set the rw.status enum for invalid case. that’s how you can monitor such operation.

---

<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 20, 2019, 6:29am UTC](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204/3 "2019-06-20T06:29:34Z")

</div>

_In reply to [vigneshr](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204/2):_

> Hi,  
> I have an issue where teh DUT returns an X for register read but the reg2bus still sees it as a 0.  
> When I was going over the uvm\_reg\_bus\_op struct the type for data is uvm\_reg\_data\_t which is only 2-state.  
> Is there a way to override this argument to support 3/4-state? Maybe uvm\_reg\_data\_logic\_t?  
> Please let me know.  
> Thanks in advance!  
> Vignesh

I believe it is not a good idea to return a ‘x’ when reading a register. ‘x’ means it can be any value ('b0, 'b1, 'bz or something else or any combination of these values.  
Physically seen a register should never hold such a value. Your RTL model should take care of this.

---

<div class="post-metadata">

**Author:** ![vigneshr95](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/v/dbc845/32.png) [@vigneshr95](https://verificationacademy.com/forums/u/vigneshr95)\
**Post date:** [June 20, 2019, 2:18pm UTC](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204/4 "2019-06-20T14:18:37Z")

</div>

Yes, its not a good thing if the RTL returns a X and thats exactly the reason why I want to catch it. This could sometimes happen for RO registers as well.

So my problem is the even the status is UVM\_IS\_OK which I believe is because the data type is 2 state and I’m not sure how I can check within reg2bus that an X was seen at the interface if the data is gonna be 0 anyway. Any help is appreciated.

---

<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 20, 2019, 2:58pm UTC](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204/5 "2019-06-20T14:58:41Z")

</div>

_In reply to [vigneshr](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204/4):_

Unfortunately I do not get your point. If you want to read a X from a register you have to code this in your RTL. What is the synthesis tool doing with an x? It does not know it. I do not believe it has a prctical background what you are requesting.

Back to your original question. In your case I’d try to overwrite the struct uvm\_reg\_bus\_op with an entry uvm\_reg\_data\_logic\_t.

---

<div class="post-metadata">

**Author:** ![vigneshr95](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/v/dbc845/32.png) [@vigneshr95](https://verificationacademy.com/forums/u/vigneshr95)\
**Post date:** [June 20, 2019, 3:47pm UTC](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204/6 "2019-06-20T15:47:51Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204/5):_

How do I override a UVM struct? I’m not sure if this ones registered with the factory?

---

<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 20, 2019, 3:55pm UTC](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204/7 "2019-06-20T15:55:34Z")

</div>

_In reply to [vigneshr](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204/6):_

I’d make a copy of the base class library implementation, make the modifications with respect to the data type and put this to my register related database (where bus2reg and reg2bus are implemented).

---

<div class="post-metadata">

**Author:** ![gariks](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/g/85f322/32.png) [@gariks](https://verificationacademy.com/forums/u/gariks)\
**Post date:** [July 4, 2019, 5:06pm UTC](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204/8 "2019-07-04T17:06:47Z")

</div>

_In reply to [vigneshr](https://verificationacademy.com/forums/t/x-in-uvm-reg-transactions/36204/7):_  
Did you find any workaround to resolve the problem.one thing we can do is simply change the data type of uvm\_reg\_data\_t variable from bit to logic in src/reg/uvm\_reg\_model.svh file.I ran simple test case and I can see X propagation to top level sequence. I’m not sure how much it is correct doing this change in uvm library and other consequences but simply it worked.

I’m guessing this issue might have already addressed in UVM Accellera version.

code change  
//typedef bit unsigned [`UVM_REG_DATA_WIDTH-1:0] uvm_reg_data_t ; typedef logic unsigned [`UVM\_REG\_DATA\_WIDTH-1:0] uvm\_reg\_data\_t ;

Thanks,  
Siva Sankar
