Jump to content

Recommended Posts

Hi, experts,

I met one problem when i use the `uvm_do_callbacks macro.

The way of using `uvm_do_callbacks macro:

 

 

•class  A extends uvm_callback;
•    virtual task pre_tran(mac_driver  mac_drv, ref mac_transaction tr);
•    endtask
•endclass //A
•typedef uvm_callbacks#(mac_driver, A) A_pool;
•class mac_driver extends uvm_driver#(mac_transaction);
•    ···
•    `uvm_register_cb(mac_driver, A);
•endclass //mac_driver
•task mac_driver ::main_phase();
•    ···
•    while(1)  begin
•       ···
•       `uvm_do_callbacks(mac_driver, A, pre_tran());
•       ···
•end
•    ···
•endtask //main_phase
 
•class  mac_callback extends A;
•    virtual task pre_tran(mac_driver  mac_drv, ref mac_transaction tr);
•        $display(“pre_tran, the transaction is:”);
•        tr.print();
•    endtask
•    `uvm_object_utils(mac_callback);
•endclass
•class base_test extends uvm_test;
•    ···
•    mac_callback mac_cb;
•    ···
•    function void connect_phase ()
•        mac_cb = mac_callback::type_id::create(“mac_cb”);
•        A_pool::add(mac_env.agt.drv, mac_cb);
•        ···
•    endfunction
•endclass //mac_driver
 
VCS error information:
  Could not find member 'pre_tran' in class 'mac_driver', at 
  "../sv/04_driver/430_mac_driver.sv", 56. Instance stack trace:
      mac_pkg  ../sv/mac_pkg.sv, 2
 
Could anybody tell me why? Thanks in advance!

 

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...