Registers write access to part of the register

Hello all,

I would be glad to have your help with an issue i encountered.

My environment uses an APB protocol agent to drive registers configuration.

I’m using RAL write task to access the registers.

my question is - is there a way to do partial WRITE access ?

let’s assume I have a below register:

CONFIG_REGISTER - 16 bits register
which contains 2 fields:

  1. [9:0] - size
  2. [15:10] - pad_pattern

in my env I want to do 8 BIT access to write the register in 2 accesses.

so, in the first access only bits [7:0] of “size” field would be configured. and i want the mirrored values to have the correct value until the 2nd transaction is completed.

what would be the correct approach ?

I appreciate your inputs

thanks,
Guy

I assume you are using APB4, which has byte write strobes: PSTRB[3:0]. Perhaps the uvm_reg_bus_op class byte_en variable is meant for this purpose. You can try to use this in your reg_adapter class.