In reply to sasi_8985:
The sequence operator and is used when both operands are expected to match, but the end times of the operand sequences can be different. Each of two sequences starts at the first clocking event of their respective sequence. The composite sequence completes and matches when there is a match in both subsequences, and the longer sequence completes. However, the composite sequence fails to match when any of the subsequences fail to match.
(te1 ##[1:5] te2) and (te3 ##2 te4 ##2 te5)
// Since you have ranges
(te1 ##[1:5] te2) // is equivalent to
(te1 ##1 t2) or (te1 ##2 t2) or (te1 ##3 t2) or (te1 ##4 t2) or (te1 ##5 t2)
te1==1 at cycle 8
te2==1 at cycles 9, 10, 11, 12, 13
//Thus, (te1 ##[1:5] te2) is true in cycles 8,9,10,11,12,13
// (te3 ##2 te4 ##2 te5)
te3==1 at cycle 8
(te3 ##2 te4 // true at cycle 10, 2 cycles later
(te3 ##2 te4 ##2 te5 // true at cycle 12
THUS, te3 ##2 te4 ##2 te5 is true at cycle 12
That satisfies that sequence of the ANding
The other sequence (te1 ##[1:5] te2)is is true in cycles 8 or 9, or 10, or 11, or 12, or 13
When you AND, the ending time is not important (unlike the intersect)
Thus, (te1 ##[1:5] te2) and (te3 ##2 te4 ##2 te5) is true
In cycle 12 or 13. Because of the “or”, you don’t have to wait till t5 to declare success.
However, there are 2 matches, and if used as a antecedent you would need a first_match() since all threads of an antecedent must be tested (see my paper “Understanding the SVA Engine”, link below
(te1 ##[1:5] te2) and (te3 ##2 te4 ##2 te5) |-> d; // 2 matches for waveform in 1800
first_match((te1 ##[1:5] te2) and (te3 ##2 te4 ##2 te5)) |-> d; // 1 match at cycle 12
Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact http://cvcblr.com/home.html
** SVA Handbook 4th Edition, 2016 ISBN 978-1518681448
…
- SVA Package: Dynamic and range delays and repeats SVA: Package for dynamic and range delays and repeats | Verification Academy
- Free books: Component Design by Example FREE BOOK: Component Design by Example … A Step-by-Step Process Using VHDL with UART as Vehicle | Verification Academy
Real Chip Design and Verification Using Verilog and VHDL($3) https://rb.gy/cwy7nb
- Papers: