I developed a simple coverage for D flip flop.
class coverage_c extends uvm_subscriber#(seq_items);
`uvm_component_utils(coverage_c)
function new(string name, uvm_component parent);
super.new(name, parent);
d_cg = new();
endfunction
seq_items collect;
covergroup d_cg;
option.per_instance = 1;
d_coverpoint: coverpoint collect.d { bins d0 = {0};
bins d1 = {1};}
q_coverpoint: coverpoint collect.q { bins q0 = {0};
bins q1 = {1};}
rst_coverpoint: coverpoint collect.rst {bins rst0 = {0};
bins rst1 = {1};}
endgroup
virtual function void build_phase(uvm_phase phase);
collect = seq_items::type_id::create("collect", this);
endfunction
//Error producing code
/* virtual function void write(seq_items tx);
collect.copy(tx);
this.d_cg.sample();
endfunction*/
//No error
virtual function void write(seq_items t);
collect.copy(t);
this.d_cg.sample();
endfunction
endclass
When I use some other handle name instead of t for seq_items in the write() parameter, the following error is produced.
ERROR VCP2932 “Invalid virtual method override, method is not identical with method from base class…” “coverage.sv” 25 31
Please help me in solving this issue.