Rights in "add_reg" function

Hello all,

I’m confused about what to define as a rights in “add_reg” function if register fields have different rights.

For example, register has 3 fields A, B, C. Field A has rights “WO”, B - “RO”, C - “WR”. Which rights I have to use adding this register in register map?

my_reg_map.add_reg  ( my_reg, 32'h0, " ? "  );

In reply to Danil:

The access policy of a field is specified using the uvm_reg_field::configure() method, called
from the build() method of the register that instantiates it.
See more details in the UVM User Guide, chapter 5.5.1.3 Predefined Field Access Policies

In reply to chr_sue:

Yes, I know about register field access policy, but the question relates to register access policy using “add_reg” method. What for we use it? For instance,

my_reg_map.add_reg( my_reg, 32'h0, "RW" );

In reply to Danil:

In many cases the single reg_fields belonging to a certain functionality or containing one field only. In these cases all fields have the same access policy and you can set it with the add_reg command. If you face different access rights for single fields in a register you have to use uvm_reg_field::configure().
Hope this helps.