Where to place sample_values() for getting coverage in UVM RAL?

As a brute force method, I can call sample_values() inside an always block @(posedge clk). However, this is not very performance efficient. I’m not quite clear on how a RAL’s built in write()/read() API call goes through, but I imagine you could send the handle of the register model to the uvm_driver since before the transaction is over we could call sample_values() then. Is this recommended, or are there other methods users have had success with?

In reply to Keiichi McGuire:

User need not to call sample_values() explicitly. User can configure Auto prediction (set_auto_predict(1) to default map), then at the end of every front door (write or read) operation, sample_values() will be called.

how would it work in case if the set_auto_predict(0) and we have our own predictor. in that case how/where should the call to sample_values be made?

In reply to shahparth08:

i tried adding sample_values() inside custom sample function which is used to collect coverage on bits and seemed to be the best option so far.