# Checking clock period using system verilog assertion

**URL:** <https://verificationacademy.com/forums/t/checking-clock-period-using-system-verilog-assertion/30272>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, assertion\
**Created:** [January 7, 2015, 12:30pm UTC](https://verificationacademy.com/forums/t/checking-clock-period-using-system-verilog-assertion/30272 "2015-01-07T12:30:57Z")\
**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:** [January 7, 2015, 8:21pm UTC](https://verificationacademy.com/forums/t/checking-clock-period-using-system-verilog-assertion/30272/2 "2015-01-07T20:21:32Z")

</div>

The issue here is that the formal argument of the property is of type “int”, yet you’re passing as actual a realtime. Per 1800  
“integer\_atom\_type ::= byte | shortint | int | longint | integer | time  
non\_integer\_type ::= shortreal | real | realtime”  
The following code worked OK

```auto
module m2b; 
	time clk_period =20.0/1.0ns;
	bit clk, RESET_N, ENABLE;
	property T_clk(int clk_period);
		realtime current_time;
		// disable iff(!RESET_N || !ENABLE)
		(('1,current_time=$realtime) |=>(clk_period==$realtime-current_time));
    endproperty
 
    assert_period:assert property (@(posedge clk)T_clk(clk_period))
	   $display("%t TB_INFO : clk correct",$realtime); 
       else
	   $warning("%t TB_INFO : clk not correct",$realtime);
    initial forever #10 clk=!clk; 
    initial begin 
	  $display("START");
	  repeat(10) @(posedge clk); 
	  $finish; 
    end
endmodule : m2b

```

---

_[View the full topic](https://verificationacademy.com/forums/t/checking-clock-period-using-system-verilog-assertion/30272)._
