In reply to cuonghl:
Hi cuonghl,
You’re correct, the correct implementation is
this.field1.add_hdl_path_slice("abc");
The usage you said,
function void uvm_reg::add_hdl_path(uvm_hdl_path_slice slices[],
string kind = "RTL");
is used within the register implementation, outside the implementation for example inside a register block we can do the same as below
this.reg1.add_hdl_path("xyz");
P.S. Please do not consider the code completely, its just for the concept, the real code is very complex and huge.