Assert signal is stable during certain duration

Hi , i want to assert using SVA that signal B is stable ( its value is unchanged whether it was 1 or 0 at the start of rise of signal A ) during the rise and fall of signal A how can i do that

stable

In reply to bassem yasser:

Assuming signals “a” and “b” are outputs of FFs, this will work:
http://systemverilog.us/vf/test_ab.sv // includes a simple testbench
http://systemverilog.us/vf/test_ab.png // results


    property p_ab; 
        bit v; 
        ($rose(a), v=b) |=> b==v[*0:$] ##1 $fell(a);        
    endproperty 
    ap_ab: assert property(@ (posedge clk) p_ab);   

// A variation 
   ap_ab2: assert property(@ (posedge clk)($rose(a), v=b) |=> $past(b)[*0:$] ##1 $fell(a);     

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


  1. VF Horizons:PAPER: SVA Alternative for Complex Assertions | Verification Academy
  2. http://systemverilog.us/vf/SolvingComplexUsersAssertions.pdf
  3. “Using SVA for scoreboarding and TB designs”
    http://systemverilog.us/papers/sva4scoreboarding.pdf
  4. “Assertions Instead of FSMs/logic for Scoreboarding and Verification”
    October 2013 | Volume 9, Issue 3 | Verification Academy
  5. SVA in a UVM Class-based Environment
    SVA in a UVM Class-based Environment | Verification Horizons | Verification Academy

In reply to ben@SystemVerilog.us:

Hi Ben,

Would it be okay to use until_with in this case?

($rose(a), v=b) |=> (b==v until_with $fell(a));

Complementarily,

($fell(a), v=b) |=> (b==v until_with $rose(a));

Thank you for your response.

In reply to kernalmode1:

In reply to ben@SystemVerilog.us:
Hi Ben,
Would it be okay to use until_with in this case?

($rose(a), v=b) |=> (b==v until_with $fell(a));

Complementarily,

($fell(a), v=b) |=> (b==v until_with $rose(a));

Absolutely yes. Actually, my response should have been

 
($rose(a), v=b) |=> b==v[*0:$] ##1 $fell(a) && b==v; // same as with the until_with

Ben SystemVerilog.us

In reply to ben@SystemVerilog.us:

In reply to kernalmode1:
Absolutely yes. Actually, my response should have been

 
($rose(a), v=b) |=> b==v[*0:$] ##1 $fell(a) && b==v; // same as with the until_with

Ben SystemVerilog.us

Hi Ben can i use $stable , and how ?

In reply to bassem yasser:

$rose(a) |-> $stable(b) until_with $fell(a));

It’s not clear what b can do on the fall of a.

In reply to dave_59:


// minor adjustments for the 1st cycld
##1 $rose(a) |-> $stable(b) until_with $fell(a));

// another option 
$rose(a) |=> $stable(b}[×1;$] ##0 $fell(a); 

 

Ben systemverilog.us

// All roads lead to Rome…