Register callback to uvm_reg_block model

Hello all,

I am trying to implement a register call back class to call the post_write hook from the uvm_reg_cbs class.

Here is my call back class
class aiop_register_call_back extends uvm_reg_cbs;

`uvm_object_utils(aiop_register_call_back);

// Set the Function Name
function new(string name = “aiop_register_call_back”);
super.new(name);
//this.set_response_queue_error_report_disabled(1’b1);
endfunction

uvm_elem_kind_e element_kind;
uvm_object element;
uvm_access_e kind;
uvm_reg_data_t value;
uvm_reg_addr_t offset;
uvm_status_e status;
uvm_path_e path;
uvm_sequence_base parent;

virtual task post_write(uvm_reg_item rw);
element_kind = rw.element_kind;
element = rw.element;
value = rw.value;
offset = rw.offset;
status = rw.status;
path = rw.path;
parent = rw.parent;
`uvm_info(“AIOP REGISTER CALL BACK”, $sformatf(“%0s,%0s,%0h,%0h,%0s,%0s,%0s”,element_kind,element,value,offset,status,path,parent), UVM_NONE);
endtask

endclass : aiop_register_call_back

My Question is how would you register this to the uvm_reg_block register model. It seems that you can only register individual registers because when I try using uvm_callbacks::add(T obj, callback obj) where the type object for registering the call back is the reg_map extension of the uvm_reg_block class, it says I cant add this type to this call back because it is not registered.

So do I have to register the register call back all the way through the higherarchy of the reg_block register model.

so Something like.

uvm_register_cb(uvm_reg_block,uvm_reg_cbs) uvm_register_cb(reg_model,callback)
uvm_callbacks::add(reg_block obj,callback obj)

Any help is appreciated.

Best,
Jon