multiple instances of a covergroup inside a class

Status
Not open for further replies.

shashi003

Newbie level 2
Joined
Sep 2, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,302
Hi,

Can we create multiple instances of a covergroup defined inside a class? It's giving an error when I do that?

class test;
bit [2:0] a;
covergroup cg;
A: coverpoint a { bins a0={0}; bins a1={1}; bins a2={2}; }
endgroup
function new(bit[2:0] a);
this.a = a;
cg c1=new();
cg c2=new();

endfunction
endclass

How can I create multiple instances of a covergroup?

Thanks,
Shashi.
 

No you can't, and what would be the benefit of doing so? It would just be redundant.

The purpose of declaring a covergroup within a class is to calculate coverage of its members. And many times you want coverage merged across all objects of a particular type, not per instance coverage.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…