Covergroup in monitor

Hi all,how to write covergroup in monitor.i don’t have transaction file(write trans or read trans)so I can not use that handle. LIKE
write_trans t;
t.coverpoint
this thing I don’t want to use.

I want use my interface to write coverpoint in monitor.can any one tell me how to use interface in coverpoint .

function new…
super…
m = new();
endf…

task run_phase…
m.sample();
endtask

covergroup m(virtual m_intf vif) @(posedge vif.vdata_val);
option.per_instance = 1;

m_vdata_val : coverpoint vif.vdata_val
  {
   // bins val1  = {0};
    bins val2  = {1};
  }


endgroup

ERROR in m=new()
task/function call or property /sequence instance does not specify all required formal arguments
ERROR in covergroup
formal argument ‘vif is missing in the task /function call or sequence/property instance identified by the previous error message.’

In reply to NISHANG R KHAMAR:

In your covergroup declaration, it has vif as input argument, you need to provide it when create this covergroup in new function.

The interface seems to be a more proper place to implement this covergroup if it doesn’t need any data from monitor.


function new..................
super................... 
m = new(vif);
endf..............

In reply to Lina.Lin:

The virtual interface declared in the monitor can be used directly in covergroup, you don’t need to take it as covergroup’s argument.

In reply to Lina.Lin:
It is not recommended to use in a UVM monitor signals of the virtual interface for defining a covergroup, because it might deliver inaccurate coverage results due to the sampling point (clock). Working with transactions allows you to work with the sample method.