Virtual method 'write' not implemented in class

587 Views Asked by At

Hello I am getting the above error for the subscriber class I created as following: The error seems in the write function of the class but I am not sure what I am missing in the function.

`uvm_analysis_imp_decl(_bfm2dut_change)
class checker_subscriber extends uvm_subscriber; 

uvm_analysis_imp_bfm2dut_change#(setup_pcie_pkg::dut2bfm_hdr_trans, checker_subscriber) bfm2dut_change_ap;
   
   `uvm_component_utils(checker_subscriber)
  
     extern function new(string name = "checker_subscriber", uvm_component parent = null);
     // BUILD,CONNECT and RUN Phase
     extern virtual function void build_phase(uvm_phase phase);
     extern virtual function void connect_phase(uvm_phase phase);
     extern virtual task run_phase(uvm_phase phase);
  
    // write function xal2fb
    virtual function void write_xal2fb_change(xal2fb_uvc::transaction tr);
        xal2fb_uvc::tx_default_data_obj obj;
        $cast(obj, tr.tx_data_obj);
        `uvm_info("xal2fb  PPMSU monitoring", $sformatf("%m"), UVM_LOW)
        monitor_xal2fb_pcie_order_check(obj);
    endfunction: write_xal2fb_change

endclass : checker_subscriber
2

There are 2 best solutions below

0
On

Please refer to verification-methodology-reference And assure your "write..." method's suffix matches the one you are using in macro declaration and then in the port declaration.

2
On

You should implement the pure virtual function void write(T t); which inherits from uvm_subscriber class in your checker_subscriber class.