# How to mask the write data and read data in a register in UVM sequence

**URL:** <https://verificationacademy.com/forums/t/how-to-mask-the-write-data-and-read-data-in-a-register-in-uvm-sequence/41297>\
**Category:** UVM\
**Tags:** UVM, registers, sequence, access-register-in-uvm-monitor, registers\_testing, register-masking\
**Created:** [February 20, 2023, 6:47am UTC](https://verificationacademy.com/forums/t/how-to-mask-the-write-data-and-read-data-in-a-register-in-uvm-sequence/41297 "2023-02-20T06:47:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harsha\_vardhan](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/h/dbc845/32.png) [@Harsha\_vardhan](https://verificationacademy.com/forums/u/Harsha_vardhan)\
**Post date:** [February 20, 2023, 6:47am UTC](https://verificationacademy.com/forums/t/how-to-mask-the-write-data-and-read-data-in-a-register-in-uvm-sequence/41297/1 "2023-02-20T06:47:33Z")

</div>

Hi,

I want to mask the write and read data for a register in a sequence  
Example :  
I have a control register (ctrl\_reg) with width of 32- bits  
The control register has 2 fields status[11:0]- R/W(read/write) and reserved [31:12]-RO(read only)  
while I am writing data the data is writing into 32-bits but while reading only the Read write is getting and my self checking is failing.  
can anyone please help me how to mask the register so that it can write to only R/W fields and read from that fields  
Please help me how to mask the register.

Thanks in advance,  
Harshavardhan

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [February 21, 2023, 5:51pm UTC](https://verificationacademy.com/forums/t/how-to-mask-the-write-data-and-read-data-in-a-register-in-uvm-sequence/41297/2 "2023-02-21T17:51:19Z")

</div>

_In reply to [Harsha vardhan](https://verificationacademy.com/forums/t/how-to-mask-the-write-data-and-read-data-in-a-register-in-uvm-sequence/41297):_

This is a bug that was fixed in UVM 1800.2.

If you are using UVM 1.2 or earlier, you can set the field’s volatile bit when configuring the field as a workaround.
