'Interface object to covergroup

I want to tie my covergroup to the interface object. That`s why as a input to covergroup I specify the interface object:

interface fifoPorts #(parameter DSIZE = 8);
...
endinterface

covergroup write_cvr (fifoPorts itf) @(posedge itf.wclk);
coverpoint itf.winc iff (!itf.wrst_n);
coverpoint itf.wrst_n {
        bins actv =(1=>0);}
endgroup

However the simulator doesnt accept this, it raises an error in covergroup, saying that dentifier ('fifoPorts') found where a type or type identifier is required. My question is: can covergroup accept interface object? And if yes, than whats wrong with my case?

Thanks Hayk



Solution 1:[1]

You need to change your covergroup header to use a virtual interface variable:

covergroup write_cvr (virtual fifoPorts itf) @(posedge itf.wclk);

and then pass an instance of fifoports to the constructor of the covergroup.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 dave_59