Need to Use Variable in Assertions ## Delay

In reply to Elbosily:
Some comments


// 1) Following assertion can never fail because if the *0:$] and b==0
($rose(a), v=delay+1'b1) |-> (v>0, v=v-1'b1)[*0:$] ##1 v==0 ##0 b == 1;

// 2) Following assertion CAN fail because of the first_match() if b==0
($rose(a), v=delay+1'b1) |-> 
     first_match((v>0, v=v-1'b1)[*0:$] ##1 v==0) ##0 b == 1;

// 3) Consider the following example 
int v=5;
ap_1: assert property( x|-> ##2 b ##v c);  // illegal in 1800'2012

/* If the variable used to define the delay has values that are within a constraint
range, such as between 0 and 7 (or 15, or at most 32) one can use the generate statement, which appears much simpler than the use of local variables and the sequence_match_item. Example: */
generate for (genvar g_i=0; g_i<8; g_i++) begin
  ap_delay_gen: assert property (v==g_i && $rose(a) |-> ##g_i b);
end endgenerate 

// 4) When a parameter is used, the value is static (and does not change) after elaboration, prior to sim. 
                    

Ben SystemVerilog.us