Quantcast
Channel: UVM Forums RSS Feed
Viewing all articles
Browse latest Browse all 756

Cross coverage of two covergroups

$
0
0

Hi Everyone,

I am using the UVM env, in that I have two agents lets say agent1 and agen2, I want to get the cross coverage of input stimulus generated by both agents.

 

What I did till now , I have a shared seq_item.svh for both agents , so I did placed the

static cnt = 0;
class seq_item extends uvm_sequence_item;
  typedef {x,y,z} lmn_t;
  typedef {m,n,o} pqr_t;

  rand lmn_t lmn;
  rand pqr_t pqr;

covergroup cg_for_agent1:
  coverpoint a: lmn;
  coverpoint b: pqr;
end covergroup

covergroup cg_for_agent2:
  coverpoint a: lmn;
  coverpoint b: pqr;
end covergroup

covergroup cg_for_cross_ab;
  CROSS_cov: cg_for_agent1.a;cg_for_agent1.b;cg_for_agent2.a;cg_for_agent2.b
end covergroup

function post_randomise();
  if (this.get_name == pkt_for_agent1)begin
    cg_for_agent1.sample();
    cnt++;
  end

  if (this.get_name == pkt_for_agent2)begin
    cg_for_agent2.sample();
    cnt++;
  end
  
  if (cnt %2 == 0)begin
    cg_for_cross_ab.sample();
  end
endfunction

Now what I achieved cg_for_agent1 & cg_for_agent2 has bins covered but cg_for_cross_ab received zero bin covered.

Strange how static covergroups lost their value.

 

Apart from this, the seq_item object is created in both the agents at same time and randomized at the same time.

Please help me where I lost.

 

Thanks.

 

P.S: I am also wondering for functional coverage best technique, as per Mentor's guidelines i am doing this to achieve input test stimulus coverage , that i have sent all the vectors, please help me with any example to get it done in some other good way

 

Thanks again :)


Viewing all articles
Browse latest Browse all 756

Trending Articles