# How Can I Hold Off an Assertion Until Sync is Established Using a Local Variable?

**URL:** <https://verificationacademy.com/forums/t/how-can-i-hold-off-an-assertion-until-sync-is-established-using-a-local-variable/29489>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, local-variables, assertion\
**Created:** [May 21, 2014, 4:53pm UTC](https://verificationacademy.com/forums/t/how-can-i-hold-off-an-assertion-until-sync-is-established-using-a-local-variable/29489 "2014-05-21T16:53:19Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [May 22, 2014, 5:20pm UTC](https://verificationacademy.com/forums/t/how-can-i-hold-off-an-assertion-until-sync-is-established-using-a-local-variable/29489/6 "2014-05-22T17:20:44Z")

</div>

_In reply to [hal9e3](https://verificationacademy.com/forums/t/how-can-i-hold-off-an-assertion-until-sync-is-established-using-a-local-variable/29489/5):_

Did you use this?  
($rose(d == SYNC\_DATA), flag = 1) or flag |-\> ^d ^ available ^ parity;  
This states that a new d==SYNC\_DATA will set the flag.  
To get A part of the property fired one and ONLY ONCE, you could do this

```auto
property data_parity_prop (clk, rst, d, available, parity);
  bit flag = 0;
  bit done= 0;
  @(posedge clk) disable iff (rst !== 1)
((d == SYNC_DATA && !done), flag = 1, done=1) or flag |-> ^d ^ available ^ parity;
endproperty
// or more simply with one variable 
property data_parity_prop (clk, rst, d, available, parity);
  bit flag = 0;
  @(posedge clk) disable iff (rst !== 1)
((d == SYNC_DATA && !flag), flag = 1) or flag |-> ^d ^ available ^ parity;

```

---

_[View the full topic](https://verificationacademy.com/forums/t/how-can-i-hold-off-an-assertion-until-sync-is-established-using-a-local-variable/29489)._
