In reply to Manoj J:
I’m assuming MONITOR is the name of a modport. You do not put that in your references.
When using a clocking block name
cb_monitor, the clocking event
@(posedge clk) triggers the sampling and driving of clocking block variable. When you the name, it’s essentially the same and the triggering event with one exception: The clocking block inputs are guaranteed to be updated before the clocking name triggers. So you should only be using your clocking block name in your run_phase task.
virtual task run_phase(uvm_phase phase);
forever begin
@(vif.cb_monitor);
tr_collected.d = vif.cb_monitor.d;
tr_collected.rst=vif.rst;
@(vif.MONITOR.cb_monitor);
tr_collected.q = vif.cb_monitor.q;
item_collector.write(tr_collected);
end
endtask