Merge event

Hi,

I tried to merge event, reading through LRM:“15.5.5.1 Merging events”.
With following source code, my expectation is when tb.trig is triggered,
vif.trig is also triggered and message is printed out.
Am I correct?

When I run the code, no message in vif seen(both VCS and Incisive).
But when I see the waveform, vif.trig is triggered…
I am confusing…

interface vif();  //
   
   event                trig;
   initial begin
      forever begin
         $display("*** initial ***");
         @(trig);
         $display("[%m] Triggered @%t", $time);
      end
   end
endinterface // 


module tb();
   vif vif();
   event trig;

   initial begin
      vif.trig = trig;
      $display("issue event");
      -> trig;
      #10ns;
      $display("issie event");
      -> trig;
      #10ns;
      $finish();
   end
endmodule

Thanks

In reply to tsb_matumoto:
Hi,

With below change :
interface vif(); //

event trig;
initial begin
forever begin
$display(“*** initial ***”);
@(trig.triggered);
$display(“[%m] Triggered @%t”, $time);
end
end
endinterface //

I am able to see display statement.Don’t know the exact reason.

In reply to msshah:

The first ->trig is definitely a race condition between the two initial blocks.

In reply to dave_59:

I mada a mistake to put “#10ns” :-(
Thank you for pointing out this!

Why it is not printing display statement with only “@(trig);” in interface?