Adding uvm callback in derived environment

Hi,

A callback class is defined and registered inside a VIP environment.
I have created a derived environment from the same.
I don’t see the callback getting triggered. I understand that I need to “add” it. How do I do that if I’m not extending the callback class as the required functionality is already implemented in the VIP. Do I use hierarchical paths?

Please help me out here.

Thanks!

For callbacks it usually has these steps:
1- Callback registration
2- Callback implementation
3- Callback creation and binding

As you mentioned you have 1 and 2 and missing 3 to do that usually, it’s done in the build phase of your test class, something like

function void build_phase(uvm_phase phase);
    super.build_phase(phase);
    cb_inst = user_callback::type_id::create("cb_inst", this);
    uvm_callbacks#(VIP_DRIVER_CLASS_NAME, VIP_BASE_CALLBACK_CLASS_NAME)::add(HIERARICHAL_PATH_DRIVER, cb_inst);
endfunction

Here’s a good example from Verification Guide uvm_callback_example and its EDA_link

Gotcha. Thanks!