mstarilov Posted January 20, 2014 Report Share Posted January 20, 2014 Hi all, There is problem with having callbacks with type parameterized classes: 1. Callback class: typedef class driver; virtual class driver_cb extends uvm_callback; virtual task drive( driver driver, ref transaction req, ref transaction rsp ); endtask function new(string name="driver_cb"); super.new(name); endfunction endclass 2. Class with type parameter: class driver #( type transaction_t = transaction_base ) extends uvm_driver #(transaction_t); `uvm_component_param_utils_begin(driver#(transaction_t)) `uvm_component_utils_end `uvm_register_cb(driver#(transaction_t), driver_cb) function new(string name, uvm_component parent); super.new(name, parent); endfunction virtual task drive(transaction_t req, transaction_t rsp); endtask task main_phase(uvm_phase phase); `uvm_do_callbacks(driver#(transaction_t), driver_cb, drive(this, req, rsp)); endtask endclass typedef uvm_callbacks #(driver, driver_cb) driver_cb_pool; Compiler claims about type incompatibility and expects that type parameter should be "transaction_base" only. Any help is welcome. 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.