# Disable SVA on a Fail

**URL:** <https://verificationacademy.com/forums/t/disable-sva-on-a-fail/33258>\
**Category:** SystemVerilog\
**Tags:** SVA-Assertion, SystemVerilog\
**Created:** [June 29, 2017, 3:28pm UTC](https://verificationacademy.com/forums/t/disable-sva-on-a-fail/33258 "2017-06-29T15:28:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sharvil111](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/sharvil111/32/3790_2.png) [@sharvil111](https://verificationacademy.com/forums/u/sharvil111)\
**Post date:** [June 29, 2017, 4:37pm UTC](https://verificationacademy.com/forums/t/disable-sva-on-a-fail/33258/2 "2017-06-29T16:37:52Z")

</div>

You can use **$assertoff** or **$assertkill** in the **else** part of the assertion. The following code works for me.

```verilog
DETECT_GLITCH : assert property (detect_glitch)
else
  $assertoff(0,DETECT_GLITCH);

// Output
"testbench.sv", 21: top.DETECT_GLITCH: started at 3ns failed at 3ns
	Offending 'top.my_func()'
Stopping new assertion attempts at time 3ns: level = 0 arg = DETECT_GLITCH (from inst top (testbench.sv:23))

```

Refer [here](https://verificationacademy.com/forums/systemverilog/assertoff-scope-specific-immediate-assertion) for a similar question. Refer [IEEE 1800-2012 Section 20.12](https://standards.ieee.org/findstds/standard/1800-2012.html) for system tasks of assertions.

---

_[View the full topic](https://verificationacademy.com/forums/t/disable-sva-on-a-fail/33258)._
