Using go-to v/s non-consecutive repetition within intersect operator

The p3 solution works on my licensed tools.
(changed(b)[=1], cntr++ ) )[*1:]
causes multiple threads, each with a different repeat. e.g.,
($changed(b)[=1], cntr++ ) )[*1] or
($changed(b)[=1], cntr++ ) )[*2] or …
The thread with [*2] is equivalent to
($changed(b)[=1], cntr++ ) ##1 ($changed(b)[=1], cntr++ )
SInce the cntr variable is increment on one side of the intersect (which is a form of “and”), that varible flows out of the intersect sequence and is evaluated after ##0 ( cntr == 5).

// When b changes, cntr increments
the

  property p3;
    int unsigned cntr;        
    ($fell(a),cntr = 0) |->  @(clk)(  ( ( $changed(b)[=1], cntr++ , $display("T:%3t Cntr incremented to %0d",$time,cntr) )[*1:$] ) 
           intersect $rose(a)[->1] ) ##0 ( cntr == 5 );
//                                                   ==== 
  endproperty  
  
  ap3:assert property( @(posedge clk) p3 ) $display("T:%0t ap3 Pass",$time); else $display("T:%0t ap3 Fails",$time);    
``
1 Like