# SVA: throughout vs until

**URL:** <https://verificationacademy.com/forums/t/sva-throughout-vs-until/32710>\
**Category:** SystemVerilog\
**Tags:** SVA, througout, SystemVerilog\
**Created:** [January 2, 2017, 9:57am UTC](https://verificationacademy.com/forums/t/sva-throughout-vs-until/32710 "2017-01-02T09:57:01Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![user49](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/user49/32/4533_2.png) [@user49](https://verificationacademy.com/forums/u/user49)\
**Post date:** [January 3, 2017, 5:04pm UTC](https://verificationacademy.com/forums/t/sva-throughout-vs-until/32710/4 "2017-01-03T17:04:13Z")

</div>

_In reply to [moogyd](https://verificationacademy.com/forums/t/sva-throughout-vs-until/32710/3):_

> _In reply to [ben@SystemVerilog.us](https://verificationacademy.com/forums/t/sva-throughout-vs-until/32710/3):_  
> Actually, the throughout version behaves as I expect (and wanted).  
> For the throughout property example, I explicitely added the parentheses to ensure the correct behaviour - I already came across this “gotcha”

```verilog

// Need to be careful with () here. It seems that the "##1" may have higher precedence than the "throughout"
property AP_req_ack0 ;
$rose(req_i) |-> (req_i throughout ack_o[->1]) ##1 !req_i ;      
endproperty : AP_req_ack0

```

So the req\_i througout only applies to ack\_o[-\>1]

You are correct about the precedence rules. From my book, I am showing below those rules:

 ![](https://verificationacademy.com/forums/uploads/default/original/1X/a5a7951170d8b929d893d90326065d8794b63cb2.png)

> I am still not sure about the until\_with version.  
> Basically, it works (i.e reports a failure) if the req\_i becomes inactive before the ack\_o becomes active (the until\_with part).  
> However, if I change the stimulus such that the req\_i stays high after ack\_o, the “throughout” version correctly reports a failure, but the “until\_with” version does not, which implies it is not “moving on” to the !req\_i check.

1800 says: _An until property of one of the overlapping forms (i.e., until\_with, s\_until\_with) evaluates to true if property\_expr1 evaluates to true at every clock tick beginning with the starting clock tick of the evaluation attempt and continuing until, and including a clock tick at which property\_expr2 evaluates to true._  
Thus, if _property\_expr1_ evaluates to false (your req\_i) then the property expression with the until\_with fails. However, if req\_i stays high after ack\_o, I would have expected a failure. Can you share the test code?

> At some point in your email, you state that:  
> Is the converse true? i.e. is it correct to treat

```verilog
req_i until_with ack_o

```

as a sequence? If not, I guess using the ##1 is invalid in this case?

The converse is NOT true. If you look at the BNF for a property you’ll see

```auto
property_expr ::=
     sequence_expr
  | strong ( sequence_expr )
  | weak ( sequence_expr )
  | ( property_expr )....

```

But the BNF for a sequence does NOT show a sequence as a property as a possibility.  
Actually, that makes sense because of the hierarchy of operators: sequences are built out of expressions (a sequence of 1 terms is the expression). Properties are built out of sequences. Concurrent assertions are built out of properties.

> One interesting thing I noticed is that if I try to add parentheses to the property

```verilog
   property AP_req_ack1 ;
$rose(req_i) |-> (req_i until_with ack_o) ##1 !req_i ;
endproperty : AP_req_ack1

```

I get complilation error. With Aldex Riviera Pro (EDA playground)

The simulation tools are correct, you cannot concatenate a property with a sequence. The (req\_i until\_with ack\_o) is a property. However, you can concatenate a sequence with a property with the followed-by operators

```verilog
 property_expr ::= // among other things 
  sequence_expr #-# property_expr
| sequence_expr #=# property_expr

```

Ben Cohen  
[http://www.systemverilog.us/](http://www.systemverilog.us/) [ben@systemverilog.us](mailto:ben@systemverilog.us)

- [SVA Handbook 4th Edition, 2016 ISBN 978-1518681448](http://goo.gl/JOfuEB)
- A Pragmatic Approach to VMM Adoption 2006 ISBN 0-9705394-9-5
- Using PSL/SUGAR for Formal and Dynamic Verification 2nd Edition, 2004, ISBN 0-9705394-6-0
- [Real Chip Design and Verification Using Verilog and VHDL, 2002 isbn 978-1539769712](https://goo.gl/d10QHh)
- Component Design by Example ", 2001 ISBN 0-9705394-0-1
- VHDL Coding Styles and Methodologies, 2nd Edition, 1999 ISBN 0-7923-8474-1
- VHDL Answers to Frequently Asked Questions, 2nd Edition ISBN 0-7923-8115

* * *

---

_[View the full topic](https://verificationacademy.com/forums/t/sva-throughout-vs-until/32710)._
