# Regarding disable iff

**URL:** <https://verificationacademy.com/forums/t/regarding-disable-iff/50484>\
**Category:** SystemVerilog\
**Tags:** SVA, Dave-Rich, Ben-Cohen, property, assertion, disable-iff\
**Created:** [June 14, 2025, 5:24pm UTC](https://verificationacademy.com/forums/t/regarding-disable-iff/50484 "2025-06-14T17:24:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MICRO\_91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/5f9b8f/32.png) [@MICRO\_91](https://verificationacademy.com/forums/u/MICRO_91)\
**Post date:** [June 14, 2025, 5:24pm UTC](https://verificationacademy.com/forums/t/regarding-disable-iff/50484/1 "2025-06-14T17:24:48Z")

</div>

Hi Dave/Ben,

[1] Section 16.9.3 of the LRM mentions

> The use of $sampled in a **disable iff** clause is meaningful since the disable condition by default is not sampled (see 16.12).

Section 16.12 further mentions

> The disable condition is tested independently for different evaluation attempts of the _property\_spec_.  
> The values of variables used in the disable condition are those in the current simulation cycle, i.e., not sampled.

[Q1] **I am not clear on the above 3 lines**.

I am aware of the following ::  
(a) Expression within disable iff is evaluated asynchronous to the clocking event and when found true the evaluation is disabled i.e no property\_expr evaluation, no action block execution.  
(b) $sampled returns the pre-poned value of it’s argument.

[2] Syntax 16-16 of the LRM mentions

```auto
property_declaration ::=
property property_identifier [( [ property_port_list] ) ] ;
{ assertion_variable_declaration }
 property_spec [;]
endproperty [: property_identifier]

property_spec ::=
[clocking_event] [disable iff ( expression_or_dist )] property_expr

```

[Q2] Doesn’t this imply that the **clocking event ( when explicitly specified ) should precede the disable iff clause ?**

Surprisingly both of the following work

```auto
sva1:assert property( @(posedge clk) disable iff(!rst_n) property_expr1 );
sva2:assert property( disable iff(!rst_n) @(posedge clk) property_expr1 );

```

**I expected sva2 to throw a compilation error due to the compiler enforcing clocking\_event should precede disable iff ( expression\_or\_dist )**

Thanks in advance

---

<div class="post-metadata">

**Author:** ![user49](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/user49/32/4533_2.png) [@user49](https://verificationacademy.com/forums/u/user49)\
**Post date:** [June 15, 2025, 4:50am UTC](https://verificationacademy.com/forums/t/regarding-disable-iff/50484/2 "2025-06-15T04:50:18Z")

</div>

[Q2] Doesn’t this imply that the **clocking event ( when explicitly specified ) should precede the disable iff clause ?**  
[Ben] It does seem so. However, in the property\_spec the following are optional:  
[clocking\_event] [disable iff ( expression\_or\_dist )]  
Thus, I could write:

```auto
property p; @(posedge clk) a; endproperty // legal 
// Also legal
sva3: assert property (disable iff (rst_n) p);
// Now if I expand "p", SVA3 becomes
sva3: assert property (disable iff (rst_n) @(posedge clk) a;
// THUS, going back to your Q: 
sva1:assert property( @(posedge clk) disable iff(!rst_n) a );
// sva1 is per the definition nof the 
property_spec ::=
[clocking_event] [disable iff ( expression_or_dist )] property_expr
// sva2 is like my sva3 where property "p" is the (@(posedge clk) a) and the clocking event is optional. 
 sva2:assert property( disable iff(!rst_n) @(posedge clk) a );

https://www.edaplayground.com/x/EF2a
All vendors compile and simulate the code 

Q1 answer tomorrow
```

---

<div class="post-metadata">

**Author:** ![user49](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/user49/32/4533_2.png) [@user49](https://verificationacademy.com/forums/u/user49)\
**Post date:** [June 15, 2025, 11:51pm UTC](https://verificationacademy.com/forums/t/regarding-disable-iff/50484/3 "2025-06-15T23:51:18Z")

</div>

On the disable iff:  
From my new book:  
• **Asynchronous disable iff:** Uses an expression (e.g., 0 for no disable) or a module variable (e.g., reset). The variable’s value is NOT sampled and represents the **value in the Observed region** when the assertion is evaluated.  
• **Synchronous disable iff** : Two common techniques for synchronous reset implementation:  
o Explicit clock specification

```auto
     disable iff ($fell(reset_n, @(posedge clk))) // /ch3/3.8/reset2.sv
    // disable sampled at @ (posedge clk)  

```

o **$sampled function** : Sampling occurs in the time stamp that the assertion is evaluated.  
The time stamp is the event that triggered the assertion.

```auto
            		disable iff ( $sampled(!reset_n)) // resets when the sampled value of reset_n==0 

```

More questions?  
**“Fast-Tracking SVA through Exposure”**  
AMZN Paper copy: [LinkedIn](https://lnkd.in/g3Xue_qG)  
PDF: [Fast-Tracking SVA through Exposure: Core Usage, Concepts, AI Integration - Payhip](https://payhip.com/b/7HvMk)

---

<div class="post-metadata">

**Author:** ![Srini-VerifWorks](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@Srini-VerifWorks](https://verificationacademy.com/forums/u/Srini-VerifWorks)\
**Post date:** [June 20, 2025, 6:42pm UTC](https://verificationacademy.com/forums/t/regarding-disable-iff/50484/4 "2025-06-20T18:42:54Z")

</div>

Q2 - I would argue (agree with OP) that it seems illegal as per LRM (or atleast ambiguous). FWIW, Verible parser does fail on such usage.
