How and where to connect subscriber for register coverage?

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



In reply to amsaveni.c:

A cross between two registers is a little bit more involved because you need to coordinate when the sampling occurs. You might just connect to the APB monitor can check both registers at every transaction.