Unresolved reference to 'build_phase'

this my class_code and i have the probleme when i compile my top_lebel,
Unresolved reference to ‘build_phase’**

class cov extends uvm_object ; 
    `uvm_object_utils(cov)
    
    spi2ahb_coverage spi2ahb_func_cov;

    function new(input string name = "uve_coverage" );
        super.new(name );
    endfunction : new 

    virtual function void build_phase(uvm_phase phase ); 
      super.build_phase(phase) ;
      spi2ahb_func_cov = spi2ahb_coverage :: type_id:: create("spi2ahb_func_cov") ; 
    endfunction : build_phase  

endclass : cov

Thanks in advance,

In reply to uvm_share:

The base class uvm_object does not have a build_phase function.

Thank you for your answer, what is the right extension class in order to coverage class ?

In reply to uvm_share:

You can use uvm_component, Then the coverage block belongs to the topology of your testbench.

Thank you Sir for your interaction

In reply to uvm_share:

Better yet, extend your coverage collector from uvm_subscriber. That extends uvm_component and has a TLM imp export called analysis_export that is constructed in new().

virtual class uvm_subscriber #(type T=int) extends uvm_component;
  typedef uvm_subscriber #(T) this_type;
  uvm_analysis_imp #(T, this_type) analysis_export;
  
  function new (string name, uvm_component parent);
    super.new(name, parent);
    analysis_export = new("analysis_imp", this);
  endfunction

  pure virtual function void write(T t);
endclass