# Why the call back post\_predict is not call if you try to predict a register field with UVM\_PREDICT\_DIRECT?

**URL:** <https://verificationacademy.com/forums/t/why-the-call-back-post-predict-is-not-call-if-you-try-to-predict-a-register-field-with-uvm-predict-direct/30669>\
**Category:** UVM\
**Tags:** UVM, UVM-callback, RAL-register-UVM\
**Created:** [May 22, 2015, 3:03pm UTC](https://verificationacademy.com/forums/t/why-the-call-back-post-predict-is-not-call-if-you-try-to-predict-a-register-field-with-uvm-predict-direct/30669 "2015-05-22T15:03:37Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Tudor\_Timi](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/tudor_timi/32/1897_2.png) [@Tudor\_Timi](https://verificationacademy.com/forums/u/Tudor_Timi)\
**Post date:** [November 6, 2015, 9:19am UTC](https://verificationacademy.com/forums/t/why-the-call-back-post-predict-is-not-call-if-you-try-to-predict-a-register-field-with-uvm-predict-direct/30669/5 "2015-11-06T09:19:48Z")

</div>

_In reply to [richard\_lam](https://verificationacademy.com/forums/t/why-the-call-back-post-predict-is-not-call-if-you-try-to-predict-a-register-field-with-uvm-predict-direct/30669/4):_

You could extend _uvm\_reg\_field::do\_predict(…)_ in an own subclass of _uvm\_reg\_field_ and then set instance overrides on the appropriate fields. This will only work if you created your fields with the factory and with unique contexts, i.e. _some\_field = uvm\_reg\_field::type\_id::create(“some\_field”, null, get\_full\_name());_.

A pragmatic solution would be to attach the callback to your mask fields and to call its _post\_predict(…)_ manually wherever you predict the value of your int fields:

```verilog

some_int.predict(value);
reg_update_upper_interrupt_cb.post_predict(..., .kind(UVM_PREDICT_DIRECT), ...);

```

You’d need as many calls as you have calls to _predict(…)_. This is something you can wrap in a function:

```verilog

function void predict_interrupt(uvm_reg_field int_field, uvm_reg_data_t value);
  int_field.predict(value);
  reg_update_upper_interrupt_cb.post_predict(..., .kind(UVM_PREDICT_DIRECT), ...);
endfunction

```

---

_[View the full topic](https://verificationacademy.com/forums/t/why-the-call-back-post-predict-is-not-call-if-you-try-to-predict-a-register-field-with-uvm-predict-direct/30669)._
