Assertion is wrote is printing passing and failing log at same time stamp

I have wrote below assertions for practice example. What i found was Passing and Failing display statement is getting printed for the same time stamp. I would like to understand this behaviour.

module svafunc;
logic clk;
logic a,b,c,d,e;
logic result=0;
    
    initial
    begin
        clk=0;
        forever #5 clk=~clk;
    end
    
    initial
    begin
        a=0;b=0;c=0;d=0;e=0;
        #3 c=1;
        #7 a=1;c=0;d=1;
        #8 a=0;b=1;d=0; e=1;
        #15 b=0;e=0;
    end
    
    sequence ab;
        (a ##1 b);
    endsequence
    
    sequence cde;
        (c ##1 d ##1 e);
    endsequence
    
within_construct : assert property (@(posedge clk) ab within cde)
                   begin
                    result=1;
                    $display("time=%0d  assertion passed",$time);
                   end
                   else
                   begin
                    result=0;
                    $display("time=%0d  assertion failed",$time);
                   end
endmodule

Output Log:

time=15  assertion failed
# time=25  assertion passed
# time=25  assertion failed
# time=35  assertion failed
# time=45  assertion failed

In reply to meet81193:

You have a pass and a failure because you are showing at time 25 the results of
two attempts.
The assertion that was attempted at time 15 passed at time 25.
The assertion that was attempted at time 25 failed at time 25.
// Those are the sampled values
t= 15 a=1, b=0, c=0, d=1, e=0
t= 25 a=0, b=1, c=0, d=0, e=1
“testbench.sv”, 34: svafunc.within_construct: started at 25ns failed at 25ns
Offending ‘c’
time=25 assertion failed
time=25 assertion passed


 module svafunc;
    logic clk;
    logic a,b,c,d,e;
    logic result=0;
    
    initial
    begin
    clk=0;
    forever #5 clk=~clk;
    end
    
    initial
    begin
    a=0;b=0;c=0;d=0;e=0;
    #3 c=1;
    #7 a=1;c=0;d=1;
    #8 a=0;b=1;d=0; e=1;
    #15 b=0;e=0;
    end
  
  always @(posedge clk)begin 
    $display("t=%t a=%b, b=%b, c=%b, d=%b, e=%b",
             $realtime, $sampled(a), $sampled(b), $sampled(c), $sampled(d), $sampled(e));
  end
    
    sequence ab;
    (a ##1 b);
    endsequence
    
    sequence cde;
    (c ##1 d ##1 e);
    endsequence
    
   within_construct : assert property (@(posedge clk) 1|-> ab within cde)
    begin
    result=1;
    $display("time=%0d assertion passed",$time);
    end
    else
    begin
    result=0;
    $display("time=%0d assertion failed",$time);
    end
      
      initial #199 $finish; 
    endmodule

Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
** SVA Handbook 4th Edition, 2016 ISBN 978-1518681448

  1. SVA Package: Dynamic and range delays and repeats SVA: Package for dynamic and range delays and repeats - SystemVerilog - Verification Academy
  2. Free books:
  1. Papers:
    Understanding the SVA Engine,
    Verification Horizons
    Reflections on Users’ Experiences with SVA, part 1
    Reflections on Users’ Experiences with SVA
    Reflections on Users’ Experiences with SVA, part 2
    Reflections on Users’ Experiences with SVA - Part II
    SUPPORT LOGIC AND THE ALWAYS PROPERTY
    http://systemverilog.us/vf/support_logic_always.pdf
    SVA Alternative for Complex Assertions
    https://verificationacademy.com/news/verification-horizons-march-2018-issue
    SVA in a UVM Class-based Environment
    https://verificationacademy.com/verification-horizons/february-2013-volume-9-issue-1/SVA-in-a-UVM-Class-based-Environment
    SVA for statistical analysis of a weighted work-conserving prioritized round-robin arbiter.
    https://verificationacademy.com/forums/coverage/sva-statistical-analysis-weighted-work-conserving-prioritized-round-robin-arbiter.
    Udemy courses by Srinivasan Venkataramanan (http://cvcblr.com/home.html)
    https://www.udemy.com/course/sva-basic/
    https://www.udemy.com/course/sv-pre-uvm/