Predict function

Hi All
Can anyone throw some light on the predict function?
here is the code snippet :

rg.predict(32’h1);
rg.read(status, rdata, UVM_FRONTDOOR);
`ovm_info(get_type_name(), $psprintf(“Data read from cmn_uc_dword10 is: %0x ***”, rdata), OVM_NONE)

  if(rdata !== 32'h1)
    `ovm_error(get_type_name(), $psprintf("Data read from cmn_uc_dword10 is: %0x ***", rdata))
  else
    `ovm_info(get_type_name(), $psprintf("Data read from cmn_uc_dword10 is: %0x ***", rdata), OVM_NONE)
end 

It is giving error saying data read from cmn_uc_dword10 is: 0 ***

In reply to nitin273:
I’m assuming you are using the UVM register package that was back ported to be used with the OVM. You can look at the UVM documentation for uvm_reg.

In your example, predict() updates the mirrored value of your register, and that should immediately get overwritten by the read() with the actual value of your register. So predict has no purpose here.