In reply to UVM Beginner:
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.
Solution provided by Neith works; but you may need to add a “#1” delay before “continue” statement.
You may like to make it simple with one line code
while (! (REGISTER.predict(<value>)));