Backdoor access is not updating the register in the DUT

I setup a RAL in my testbench and I created a sequence to try the backdoor access.
The sequence goes like this,


virtual task body();
  super.body();

  if(!tb_reg_block.reg_0.randomize()) begin
    `uvm_fatal("RAND_FAILED", "Failed randomization of reg_0")
  end

  tb_reg_block.reg_0.update(status, .path(UVM_BACKDOOR), .parent(this));
  data = tb_reg_block.reg_0.get();
  $display("@%0t data = %0h", $time, data);
endtask : body

I noticed that the result of $display is giving a random value but when I check the content of the register in the DUT using a waveform viewer, its value is only stuck at 0.

Can you advise what’s wrong with what I’m doing? I’m trying to write a random 8-bit data to a register using backdoor access.

Regards,
Reuben

In reply to Reuben:

Okay I solved the problem now. I mistakenly put a wrong hdl path.
The register name is Q and it is 8 bits. My mistake is this,


// Inside the register block

reg_0.add_hdl_path_slice("data_reg.Q", 0, 8);
reg_0.add_hdl_path_slice("data_reg.Q", 1, 8);
reg_0.add_hdl_path_slice("data_reg.Q", 2, 8);
...
...
...
reg_0.add_hdl_path_slice("data_reg.Q", 7, 8);


The above code is incorrect. So to fix it I just put the hdl path on the configure() method of the register.


reg_0.configure(this, null, "data_reg.Q");