$display getting executed twice at the same timestamp

hi I have monitor class and based on some condition I am printing out the message.

But this $display statement is getting executed twice with the same timestamp.
Due to this bug, the monitoring will go wrong if the task logs the data twice at the same timestamp.

here is the snippet of the code
//*************************
class monitor_signals extends ovm_monitor;
protected virtual interface mem_resp_if resp_if; // interface
mem_resp_if_wrapper mem_resp_wrapper ; // interface wrapper object

`ovm_component_utils_begin(monitor_signals)
`ovm_field_object(mem_resp_wrapper,OVM_ALL_ON)
`ovm_component_utils_end

function new (string name="", ovm_component parent=null);
    super.new(name, parent);
 endfunction : new

function void build();
super.build();
resp_if = mem_resp_wrapper.rgen_if;
endfunction

virtual task run();

forever begin
check_svalid();
end
endtask

virtual task check_svalid();

@(posedge resp_if.clk iff resp_if.svalid==1); begin
	$display("\n Data SNIFF at TIME===%d ",$time);

end

endtask

endclass
//*************************

Why the statement will execute twice ?

Is this bug and how to fix it?

Hi,

are sure you are using only one instance of this monitor in your environment?
Try

ovm_report_info( "", $psprintf( "\n Data SNIFF at TIME===%t",$time ) );

instead of the $display statement. This will print the message and the instance path the message is coming from.

regards

Hey thanks for the input.
I tried that and there was diff in the path.

Thanks a ton. IT solved my problem