Update problem

Hi All,
I have a register, and I want to write same value to a field for few times by using update and set method. But I write same value,it should
write register for once. How can let it to write few times? I don’t want to use xxx_reg.write() method.
Thank you!

In reply to peter:

UVM reg only has one place to store a desired value. update() only does a write if the desired value does not match the mirrored value.

You need to explain why the write() method will not work for you.

In reply to dave_59:

Hi Dave,
I have 4 bits field A in the register(reg[8:5] = A). I want to write field A for few time only. And If i use xxx_reg.write(32’xxxx), i need to fill whole 32bits value. It is not convenient for me. Therefore, I want to use xxx_reg.A.set() and update . So I don’t need to fill 32 bits data
Thank you

In reply to peter:

You can never write to a just the field of a register, It always writes the full register using the mirrored values filling in the rest of the register. You can do xxx_reg.A.write();