Hi All,
I have RAL model. As i need to create cross coverage between registers, i have created subscriber. what my doubt is how and where to connect this subscriber?. here i’m using APB VIP.
Please help me.
class subscriber extends uvm_subscriber#(apb_transaction);
`uvm_component_utils(subscriber)
ral_model ral_model_1;
covergroup coverage;
option.per_instance = 1;
Reg_1: coverpoint ral_model_1.Reg1_reg.Reg_Field1.value[3:0]
{
bins zero = {'h0};
bins one = {'h1};
}
endgroup // coverage
function new(string name = "subscriber", uvm_component parent = null);
super.new(name, parent);
coverage = new();
endfunction // new
function void build_phase(uvm_phase phase);
super.build_phase(phase);
endfunction:build_phase
function void write(apb_transaction t);
coverage.sample();
endfunction // write
endclass // subscriber