# False assertion failure due to incorrect sampling

**URL:** <https://verificationacademy.com/forums/t/false-assertion-failure-due-to-incorrect-sampling/30869>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, assertion-systemverilog\
**Created:** [July 14, 2015, 7:28am UTC](https://verificationacademy.com/forums/t/false-assertion-failure-due-to-incorrect-sampling/30869 "2015-07-14T07:28:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pRoSpEr](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/p/7c8e57/32.png) [@pRoSpEr](https://verificationacademy.com/forums/u/pRoSpEr)\
**Post date:** [July 14, 2015, 7:28am UTC](https://verificationacademy.com/forums/t/false-assertion-failure-due-to-incorrect-sampling/30869/1 "2015-07-14T07:28:41Z")

</div>

I have written the following property/assertion to check stability of 2 signals:

property ref\_clk\_stable;  
@(posedge clk) ($stable(tb.top.REF\_CLK2\_P) & $stable(tb.top.REF\_CLK2\_N));  
endproperty

assert\_ref\_clk2\_stable: assert property (ref\_clk2\_stable)  
else $error(“assert\_ref\_clk2\_stable failed.”);

In initial block I am forcing both the signals to create a true case. However the assertion is failing at first posedge of clk.

Please help me to find a solution.

---

<div class="post-metadata">

**Author:** ![Tudor\_Timi](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/tudor_timi/32/1897_2.png) [@Tudor\_Timi](https://verificationacademy.com/forums/u/Tudor_Timi)\
**Post date:** [July 14, 2015, 7:40am UTC](https://verificationacademy.com/forums/t/false-assertion-failure-due-to-incorrect-sampling/30869/2 "2015-07-14T07:40:00Z")

</div>

_In reply to [pRoSpEr](https://verificationacademy.com/forums/t/false-assertion-failure-due-to-incorrect-sampling/30869):_

_$stable(…)_ only makes sense if you’ve already sampled a past value (i.e. start checking on the second clock edge). At the first sampling event, the past value of a signal will be the default value of its type (0 for bit, X for logic, leftmost literal for enum, etc.). You could rewrite it to:

```verilog

property ref_clk_stable;
@(posedge clk) ##1 ($stable(tb.top.REF_CLK2_P) & $stable(tb.top.REF_CLK2_N));
endproperty

```

This way you delay your comparison by a clock cycle.

P.S. It’s also nicer to use logical AND (_&&_) instead of bitwise AND (_&_).
