Clock period checker with SVA

In reply to vineet:
Use the $rose ( expression [, [clocking_event] ] )
The clocking event is needed here.


 // $rose ( expression [, [clocking_event] ] )
  property p_period ( int clk_period);
    time current_time; 
    disable iff ($rose(rst, @(posedge clk)))
     ('1, current_time = $time) |=> (clk_period == ($time - current_time) );
   endproperty : p_period
  ap_period: assert property(@ (posedge clk) p_period(clk_period)) 
  	  $display("pass at time %t", $time); else 
  	  $display("fail at time %t", $time); 

Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact Home - My cvcblr


See Paper: https://verificationacademy.com/forums/systemverilog/vf-horizonspaper-sva-alternative-complex-assertions