# Working of disable iff

**URL:** <https://verificationacademy.com/forums/t/working-of-disable-iff/49307>\
**Category:** SystemVerilog\
**Tags:** SVA-Assertion, SVA, assertion\
**Created:** [December 31, 2024, 7:50am UTC](https://verificationacademy.com/forums/t/working-of-disable-iff/49307 "2024-12-31T07:50:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LFT](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/l/34f0e0/32.png) [@LFT](https://verificationacademy.com/forums/u/LFT)\
**Post date:** [December 31, 2024, 7:50am UTC](https://verificationacademy.com/forums/t/working-of-disable-iff/49307/1 "2024-12-31T07:50:41Z")

</div>

Hi All,  
For the following example ::

```auto
  bit clk , a , b , dis ;
  
  always #5 clk = !clk;
  
  initial begin
  `ifdef NBA 
    #05; dis <= 1; // T:5 overlaps with posedge of clock
    #10; dis <= 0;
    #05; dis <= 1; // T:20
    #10; dis <= 0; // T:30
  `else
    #05; dis = 1; // T:5 overlaps with posedge of clock
    #10; dis = 0;
    #05; dis = 1; // T:20
    #10; dis = 0; // T:30
  `endif   
  end  
  
  assert property( @(posedge clk) disable iff(dis) a == b ) $display("T:%0t Pass",$time); 
                                                        else $display("T:%0t Fails",$time);
    
 initial begin
   #04; a = 1 ; b = 1; 
   #10; a = 0 ; b = 1; 
   #10; a = 1 ; b = 0; 
   #10; a = 1 ; b = 1; 
   #2; $finish(); 
 end

```

**At time:5 units there is posedge of clock as well as dis is assigned 1 (either in NBA or active region)**  
**At time:15 units there is posedge of clock as well as dis is assigned 0 (either in NBA or active region)**

I am aware that **the expression within disable iff is asynchronously checked,**

(1) So when dis is 1 at T:5 , will the assertion be disabled OR would it evaluate ( a == b ) ?

(2) So when dis is 0 at T:15 , will the assertion be active / re-enabled and evaluate ( a == b ) ?

---

<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:** [December 31, 2024, 9:32pm UTC](https://verificationacademy.com/forums/t/working-of-disable-iff/49307/2 "2024-12-31T21:32:24Z")

</div>

See discussion at

> **[Ben Cohen on LinkedIn: SVA: disable iff(signal)
Assertion is disabled if...](https://www.linkedin.com/feed/update/activity:7277059075773710336?trk=viral_reaction)**
>
> SVA: disable iff(signal)
> Assertion is disabled if ‘signal’ was true before it entered the Observed evaluation region.  
> • Disabling conditions set in the…

---

<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:** [December 31, 2024, 9:36pm UTC](https://verificationacademy.com/forums/t/working-of-disable-iff/49307/3 "2024-12-31T21:36:35Z")

</div>

Also see

> **[Ben Cohen on LinkedIn: SVA: SVA From papers Time Step + Immediate Assertions](https://www.linkedin.com/posts/ben-cohen-1172a0_sva-sva-from-papers-time-step-immediate-activity-7279577649117585408-qHoR?utm_source=share&utm_medium=member_android)**
>
> These are small slides from my papers; they include guidelines 
> 1. Understanding Assertion Processing Within a Time Step (Horizons Feb 27, 2023…

---

<div class="post-metadata">

**Author:** ![LFT](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/l/34f0e0/32.png) [@LFT](https://verificationacademy.com/forums/u/LFT)\
**Post date:** [January 4, 2025, 9:39am UTC](https://verificationacademy.com/forums/t/working-of-disable-iff/49307/4 "2025-01-04T09:39:07Z")

</div>

Thanks Ben.  
Via both (1) & (2) assignment to ‘dis’ is done before the observed region starts at T:5 & T:15.  
Hence **the assertion attempt is disabled at T:5 ( as ‘dis’ is 1 ) whereas evaluation takes place at T:15 ( as ‘dis’ is 0 )**

---

<div class="post-metadata">

**Author:** ![LFT](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/l/34f0e0/32.png) [@LFT](https://verificationacademy.com/forums/u/LFT)\
**Post date:** [January 4, 2025, 4:51pm UTC](https://verificationacademy.com/forums/t/working-of-disable-iff/49307/5 "2025-01-04T16:51:00Z")

</div>

I also tried examples with the expression within disable iff being true in ::  
(a) observed region ( [x\_edalink](https://www.edaplayground.com/x/V5__) )  
(b) reactive region ( [x\_edalink](https://www.edaplayground.com/x/V5__) using +define+REACTIVE )

For (a) at 1st attempt at T:5 the expression is true in observed region,  
hence the SVA is active at T:5.  
There are no attempts at following posedge of clock at T:15 , 25 ,35 as the disable iff expression is true

For (b) during the 2nd attempt at T:15 the expression is true in reactive region,  
hence the SVA is active at T:15.  
There are no attempts at following posedge of clock at T: 25 ,35 as the disable iff expression is true
