Any one please resolve this code Error In UVM Subscriber write function

In reply to logie:

Hello,

I am also facing the same issue. Somebody please tell me where I am going wrong

Please refer the example below


class my_coverage extends uvm_subscriber #(my_cov_item);
  `uvm_component_utils(my_coverage)
  
  function new (string name, uvm_component parent);
    super.new(name, parent);
  endfunction : new

  function void write (my_cov_item t);
    $display("my_cov_item obtained by my_coverage");
  endfunction : new

endclass : my_coverage

I tried using this in my env as follows


my_coverage my_cov;

function void build_phase(uvm_phase phase);
  super.build_phase(phase);
  my_cov = my_coverage::type_id::create("my_cov",this);
endfunction : build_phase


The error appears as: formal arguements of write method do not match with that of uvm_subscriber base class.