When you call Predict function, it calls do_predict(). Do predict checks if the register is busy. If the register is found to be busy, do_predict() will not perform the predict operation.
So, user has to check the return value of the predict() function to check if the operation was done successfully
Predict returns 1 for SUCCESS and 0 for UN_SUCCESSFUL operation
You may write something like the following, to make sure the predict operation is done
while (! (REGISTER.predict(<value>)));
OR
Declare a standard task something like the following, and call it whenever you need
task dac_reg_base_seq::predict_register(uvm_reg REGISTER, bit [31:0] predict_value );
uvm_reg register_temp;
predict_register = 0; //Unsuccessful
if (!$cast(register_temp, REGISTER))
begin
`uvm_fatal("NOT_UVM_REG_TYPE","Provided REGISTER is not of the correct type")
end
`uvm_info("PREDICT_REGISTER", $psprintf(" Starting the predict function setting register %s with value %h", register_temp.get_name(),predict_value), UVM_HIGH);
while(1) begin
if(register_temp.is_busy == 1) begin
`uvm_info("PREDICT_REGISTER", $psprintf(" register %s is busy ", register_temp.get_name()), UVM_HIGH);
// Adding Delay to avoid simulater gets locked up here
#1;
continue;
end
else begin
register_temp.predict(register_temp.get()| predict_value);
break;
end
end
`uvm_info("PREDICT_REGISTER", $psprintf(" Done with updating the predict value to the register %s", register_temp.get_name()), UVM_HIGH);
endtask : predict_register