# Clock period assertion check

**URL:** <https://verificationacademy.com/forums/t/clock-period-assertion-check/38671>\
**Category:** SystemVerilog\
**Tags:** Assertion-How-to-handle-when-delay-in-the-signal, SystemVerilog, assertion, Assertion-property\
**Created:** [February 3, 2021, 1:34am UTC](https://verificationacademy.com/forums/t/clock-period-assertion-check/38671 "2021-02-03T01:34:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![user49](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/user49/32/1084_2.png) [@user49](https://verificationacademy.com/forums/u/user49)\
**Post date:** [February 3, 2021, 4:21am UTC](https://verificationacademy.com/forums/t/clock-period-assertion-check/38671/2 "2021-02-03T04:21:55Z")

</div>

_In reply to [lisa.lalice](https://verificationacademy.com/forums/t/clock-period-assertion-check/38671):_  
Your question is ambiguous, but let me explain what your code actually says.

```verilog

@(negedge clk) // At this event 
if ((clk_dis ==1) && (cmd_debug == 'h535245)) // if that is true then 
    ##27 // I wait for 27 @(negedge clk) clocking events 
@(negedge clk) (1, start=$realtime) // and then at the same @(negedge clk) clocking event  
               // I save the current time 
 |-> @(posedge clk) $realtime-start>= 60000; // and at the next poaedge clk, 
    // now - what I measured at the preceding negedge >= 60000; 

// You may want this instead
property srf_clk_en_check_p;
  realtime start;
  @(negedge clk)
  if ((clk_dis ==1) && (cmd_debug == 'h535245)) (1, start=$realtime)
    ##27 @(negedge clk) |-> @(posedge clk) $realtime-start>= 60000;
// Question: Is clock gated off here? 
endproperty

// or 
property srf_clk_en_check_p;
  realtime start;
  @(negedge clk)
  (clk_dis==1 && cmd_debug==h535245, start=$realtime) ##27 1'b1 // do you have clocks? 
       // Are they gated here? If gated off then you do not need the ##27 ?? 
             |-> @(posedge clk) $realtime-start>= 60000;
endproperty
// Clarify the requirements

```

Ben Cohen  
[http://www.systemverilog.us/](http://www.systemverilog.us/) [ben@systemverilog.us](mailto:ben@systemverilog.us)  
For training, consulting, services: contact [http://cvcblr.com/home.html](http://cvcblr.com/home.html)  
\*\* SVA Handbook 4th Edition, 2016 ISBN 978-1518681448  
…

1. SVA Package: Dynamic and range delays and repeats [SVA: Package for dynamic and range delays and repeats | Verification Academy](https://rb.gy/a89jlh)
2. Free books: Component Design by Example [FREE BOOK: Component Design by Example … A Step-by-Step Process Using VHDL with UART as Vehicle | Verification Academy](https://rb.gy/9tcbhl)  
Real Chip Design and Verification Using Verilog and VHDL($3) [Amazon.com](https://rb.gy/cwy7nb)
3. Papers:

- Understanding the SVA Engine,  
[Verification Horizons - July 2020 | Verification Academy](https://verificationacademy.com/verification-horizons/july-2020-volume-16-issue-2)
- SVA Alternative for Complex Assertions  
[Verification Horizons - March 2018 Issue | Verification Academy](https://verificationacademy.com/news/verification-horizons-march-2018-issue)
- SVA in a UVM Class-based Environment  
[SVA in a UVM Class-based Environment | Verification Horizons | Verification Academy](https://verificationacademy.com/verification-horizons/february-2013-volume-9-issue-1/SVA-in-a-UVM-Class-based-Environment)

---

_[View the full topic](https://verificationacademy.com/forums/t/clock-period-assertion-check/38671)._
