Jump to content

How to remove CBUNREG warning in UVM1.0p1


Recommended Posts

Hi,

When I try to use a parametered based callback class, IUS tool will report the following warning, seems it is the type mismatched, but I am confused that the callback task can still work, so does anyone tell me how to remove such warning?

UVM_WARNING @ 0.00 ns: reporter [CBUNREG] Callback tb_axi_mst_drv_cb cannot be registered with object uvm_test_top.tb_axi_ovc_self_loop_inst.axi_ovc_mst.master.driver because callback type uvm_callback is not registered with object type uvm_driver #(REQ,RSP)

I defined my callback class as follows:

typedef class axi_master_driver;

typedef class axi_master_driver_cb;

typedef uvm_callbacks #(axi_master_driver, axi_master_driver_cb) axi_master_driver_cbs_t;

virtual class axi_master_driver_cb #(axi_if_pkg::tIfParams IF_PARAMS = axi_if_pkg::AXI_DEFAULT) extends uvm_callback;

virtual task pre_process_trans(axi_master_driver #(IF_PARAMS) driver, ref axi_trans_item #(IF_PARAMS) tr);

endtask

function new(string name="axi_mst_drv_cb_inst");// will include scoreboard handler later??

super.new(name);

endfunction

endclass: axi_master_driver_cb

And declare my driver as follows:

class axi_master_driver #(axi_if_pkg::tIfParams IF_PARAMS = axi_if_pkg::AXI_DEFAULT) extends uvm_driver;

`uvm_component_param_utils(axi_master_driver #(IF_PARAMS))

......

`uvm_register_cb(axi_master_driver #(IF_PARAMS), axi_master_driver_cb)

......

endclass: axi_master_driver

BR

MEIXIAO

Link to comment
Share on other sites

Hi,

When I try to use a parametered based callback class, IUS tool will report the following warning, seems it is the type mismatched, but I am confused that the callback task can still work, so does anyone tell me how to remove such warning?

UVM_WARNING @ 0.00 ns: reporter [CBUNREG] Callback tb_axi_mst_drv_cb cannot be registered with object uvm_test_top.tb_axi_ovc_self_loop_inst.axi_ovc_mst.master.driver because callback type uvm_callback is not registered with object type uvm_driver #(REQ,RSP)

I defined my callback class as follows:

typedef class axi_master_driver;

typedef class axi_master_driver_cb;

typedef uvm_callbacks #(axi_master_driver, axi_master_driver_cb) axi_master_driver_cbs_t;

virtual class axi_master_driver_cb #(axi_if_pkg::tIfParams IF_PARAMS = axi_if_pkg::AXI_DEFAULT) extends uvm_callback;

virtual task pre_process_trans(axi_master_driver #(IF_PARAMS) driver, ref axi_trans_item #(IF_PARAMS) tr);

endtask

function new(string name="axi_mst_drv_cb_inst");// will include scoreboard handler later??

super.new(name);

endfunction

endclass: axi_master_driver_cb

And declare my driver as follows:

class axi_master_driver #(axi_if_pkg::tIfParams IF_PARAMS = axi_if_pkg::AXI_DEFAULT) extends uvm_driver;

`uvm_component_param_utils(axi_master_driver #(IF_PARAMS))

......

`uvm_register_cb(axi_master_driver #(IF_PARAMS), axi_master_driver_cb)

......

endclass: axi_master_driver

BR

MEIXIAO

Hi MEIXIAO ,

Do you define "typedef uvm_callbacks #(bus_driver,bus_driver_cb) bus_driver_cbs_t;"?

we need add the driver and cb in the pool at top module.

For example:

bus_driver_cbs_t::add(driver,cb);

Your UVM_WARNING @ 0.00 ns: reporter [CBUNREG] is from below.

// Function: add

//

// Registers the given callback object, ~cb~, with the given

// ~obj~ handle. The ~obj~ handle can be null, which allows

// registration of callbacks without an object context. If

// ~ordreing~ is UVM_APPEND (default), the callback will be executed

// after previously added callbacks, else the callback

// will be executed ahead of previously added callbacks. The ~cb~

// is the callback handle; it must be non-null, and if the callback

// has already been added to the object instance then a warning is

// issued. Note that the CB parameter is optional. For example, the

// following are equivalent:

//

//| uvm_callbacks#(my_comp)::add(comp_a, cb);

//| uvm_callbacks#(my_comp, my_callback)::add(comp_a,cb);

static function void add(T obj, uvm_callback cb, uvm_apprepend ordering=UVM_APPEND);

......

if(!m_base_inst.check_registration(obj,cb)) begin

if(obj==null) nm = "(*)"; else nm = obj.get_full_name();

if(m_base_inst.m_typename!="") tnm = m_base_inst.m_typename; else if(obj != null) tnm = obj.get_type_name(); else tnm = "uvm_object";

uvm_report_warning("CBUNREG", { "Callback ", cb.get_name(), " cannot be registered with object ",

nm, " because callback type ", cb.get_type_name(),

" is not registered with object type ", tnm }, UVM_NONE);

end

I think UVM lib dispaly this, not IUS tool.

Hope this to help you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...