# Using assertion to detect glitch?

**URL:** <https://verificationacademy.com/forums/t/using-assertion-to-detect-glitch/33268>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, assertion-systemverilog, glitch\
**Created:** [July 4, 2017, 12:57am UTC](https://verificationacademy.com/forums/t/using-assertion-to-detect-glitch/33268 "2017-07-04T00:57:47Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![javatea](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/j/3d9bf3/32.png) [@javatea](https://verificationacademy.com/forums/u/javatea)\
**Post date:** [July 5, 2017, 11:46pm UTC](https://verificationacademy.com/forums/t/using-assertion-to-detect-glitch/33268/3 "2017-07-05T23:46:01Z")

</div>

_In reply to [ben@SystemVerilog.us](https://verificationacademy.com/forums/t/using-assertion-to-detect-glitch/33268/2):_

Thanks, Ben.  
$time return as the integer.  
Using $realtime to have more accuracy.  
It depends on env’s timescale setting  
updated version, thanks for the feedback.

```verilog

property glitch_p;
  realtime first_change;
  realtime duration = 10;
  @(signal)
      // detecting every 2 changes duration
     (1, first_change = $realtime) |=> (($realtime - first_change) >= duration))[*1:$];
endproperty

```

---

_[View the full topic](https://verificationacademy.com/forums/t/using-assertion-to-detect-glitch/33268)._
