Cross coverage of two covergroups

In reply to dave_59:

Great Many Thanks Dave for your reply!!!

If that could be the issue let me elaborate the example further:


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 :)