Interview Questions on Assertions

In reply to vk7715:

You are referring to


// Note: (seq1 within seq2) is equivalent to: ((1[*0:$] ##1 seq1 ##1 1[*0:$]) intersect seq2 )

The expr[*0:m] repetition declares that the element in the SEQUENCE must repeat (i.e., can be skipped altogether 0 times ), or 1 times, or 2 times, or … m times.
The example, b[*0:3] means that b may either be skipped (i.e., no cycle spent on b), or b may be repeated once, twice, or three times.
In the sequence (b[*0:3] ##1 c), if c holds at the start of this sequence, then a check on b is skipped altogether, as if it were not there. However, if c does not hold at the start of the sequence, then b needs to hold a maximum of three cycles . As a result, this construct creates a set of different threads that can occur. The following describes the expected behavior for this assertion.


a |-> (b[*0:3] ##1  c);  // one thread at each attempt 
// equivalent to  
a |-> // (b[*0] ##1 c )  //is equivalent to  c 
       (          c )  or 
       (b[*1] ##1 c )  or  
       (b[*2] ##1 c )  or  
       (b[*3] ##1 c );    

// b is the expression, which can be 0 or 1
// b can be any expression, including the value of 1

Check out my papers in my signature below.
Also study the repetition operator, many books and sites cover this topic.
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:
  3. Papers:
    Understanding the SVA Engine,
    Verification Horizons
    Reflections on Users’ Experiences with SVA, part 1 and part 2
    Reflections on Users’ Experiences with SVA

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/