Check a value for 'var' number of cycles in SVA

I provide 2 solutions in my SVA Handbook 4th Edition, 2016

*Simple repeat (e.g., a[v]]


ap_repeat_fix: assert property( $rose(a) |-> b[*v] ##1 c); //1800'2018 property 
// Above is illegal in 1800'2012

p_repeat_equivalent; // /11.4/m5067_gen_options.sv. works in 1800'2012
  int local_v; //  
      $rose(a) |-> 
    (1, local_v = v) ##0 first_match((b, local_v=local_v - 1)[*0:$] ##1 local_v<=0)
                                                                          ##0 c; // 
endproperty
ap_repeat_equivalent: assert property(p_repeat_equivalent); // with default clocking

generate option
If the variable used to define the repeat 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.

 
generate for (genvar g_i=0; g_i<8; g_i++) begin
  ap_repeat_gen: assert property (v==g_i && $rose(a) |-> b[*g_i] ##1 c);
end endgenerate  

The generate
Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact Home - My cvcblr