# System verilog assertion

**URL:** <https://verificationacademy.com/forums/t/system-verilog-assertion/42741>\
**Category:** SystemVerilog\
**Tags:** systemverilogassertionSVA, SystemVerilog\
**Created:** [November 23, 2023, 9:19am UTC](https://verificationacademy.com/forums/t/system-verilog-assertion/42741 "2023-11-23T09:19:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Have\_A\_Doubt](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@Have\_A\_Doubt](https://verificationacademy.com/forums/u/Have_A_Doubt)\
**Post date:** [November 23, 2023, 9:39am UTC](https://verificationacademy.com/forums/t/system-verilog-assertion/42741/2 "2023-11-23T09:39:17Z")

</div>

_In reply to [Madhu C](https://verificationacademy.com/forums/t/system-verilog-assertion/42741):_

I am assuming the starting point of the check would be when ‘valid’ goes high-\>low i.e $fell(valid)  
Now once ‘valid’ is low , signal ‘error’ shouldn’t be high till the time ‘valid’ goes low-\>high  
i.e we need to check that ‘error’ is low **throughout** when ‘valid’ is low

```verilog

 property p1;
   $fell(valid) |=> ( !error ) throughout $rose(valid)[->1]; 
 endproperty

 assert property( p1 ) $display("T:%0t Pass",$time); else $display("T:%0t Fails",$time);

```

Note that if error is high on the same clock that valid is re-asserted then the assertion fails !!

```verilog

// Eg:
bit valid = 1;
bit clk , error ;
always #5 clk = !clk;
initial begin    
    #14; valid = 0;    
    #50 ; valid = 1; error = 1; // Both are asserted at T:65 so SVA fails at T:65
    #2 ; $finish();
  end

```

If the requirement is that ‘error’ is don’t care ( 0/1 ) on the clock that ‘valid’ is re-asserted (0-\>1) , the solution would be to use **until** / **s\_until** :

```verilog

 property p2;
   $fell(valid) |=> ( !error ) until $rose(valid); // Goto repetition removed from RHS sequence 
 endproperty

 assert property( p2 ) $display("T:%0t Pass",$time); else $display("T:%0t Fails",$time);

```

---

_[View the full topic](https://verificationacademy.com/forums/t/system-verilog-assertion/42741)._
