# How to pass delay through a variable in assertion

**URL:** <https://verificationacademy.com/forums/t/how-to-pass-delay-through-a-variable-in-assertion/30326>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog\
**Created:** [February 3, 2015, 4:21am UTC](https://verificationacademy.com/forums/t/how-to-pass-delay-through-a-variable-in-assertion/30326 "2015-02-03T04:21:13Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Dilip\_Bagadi](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dilip_bagadi/32/2350_2.png) [@Dilip\_Bagadi](https://verificationacademy.com/forums/u/Dilip_Bagadi)\
**Post date:** [February 3, 2015, 11:33am UTC](https://verificationacademy.com/forums/t/how-to-pass-delay-through-a-variable-in-assertion/30326/4 "2015-02-03T11:33:51Z")

</div>

Hi,

The below code worked:

property prop;  
int w\_delay;  
@(posedge clk)  
((w\_trig && req==1), w\_delay= delay+1’b1) |-\> (w\_delay\>0, w\_delay=w\_delay-1’b1, display("w\_delay=%0d",w\_delay))[\*0:] ##0 w\_delay==0 ##0 (ack == 1);  
endproperty

P1: assert property(prop) $info(“KING Assertion pass”);  
else $error(“KING Assertion fail”);

Regards,  
Dilip

---

_[View the full topic](https://verificationacademy.com/forums/t/how-to-pass-delay-through-a-variable-in-assertion/30326)._
