mrforever Posted March 27, 2013 Report Share Posted March 27, 2013 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! Quote Link to comment Share on other sites More sharing options...
mrforever Posted March 28, 2013 Author Report Share Posted March 28, 2013 Oh, my god. It's right! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.