Assertions how to solve it?

Question is

Signal A must nor be asserted until the first signal of B(it can be asserted on the same cycle of B).
how can we write an assertion for this ??

Signal A must nor be asserted until the first signal of B(it can be asserted on the same cycle of B).

The way you write this assertion is by first clearly define the requirements.
The way you stated, it sounds like the requirements are:
[*] At every clocking event either signal A==1’b0 or B==1’b1.
Thus, one can expect a sequence such as !A ##1 !A ##1 !A ##1 B
Such an assertion can be expressed as:

 
 ap_AB: assert property(@ (posedge clk)!A or B );  

If on the other hand, you meant to say:
[*] Following the rice of C, signal A==1’b0 until B

 
     ap_CAB: assert property(@ (posedge clk) %rose(C) |-> 
                     !B[*0:$] ##1 C );  

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


  1. Verification Horizons - March 2018 Issue | Verification Academy
  2. SVA: Package for dynamic and range delays and repeats | Verification Academy
  3. SVA in a UVM Class-based Environment
    SVA in a UVM Class-based Environment | Verification Horizons | Verification Academy
    FREE BOOK: Component Design by Example
    … A Step-by-Step Process Using VHDL with UART as Vehicle

    http://systemverilog.us/cmpts_free.pdf

In reply to ben@SystemVerilog.us:

“Signal A must not be asserted until the first signal of B(it can be asserted on the same cycle of B).”

1)assert property(@ (posedge clk) $rose(B) |-> $rose(A); //in case A needs to fire in same clock, 2 would also work for same.
2)assert property(@ (posedge clk) rose(B) |-> ##[0:] ($rose(A));

This also checks if B is still held high when A goes high.
3)assert property(@ (posedge clk) rose(B) |-> ##[0:] ($rose(A)) ##0 B;

In reply to kushagar:

In case you have a requirement that B should be held high till A asserts… This can be used.

  1. assert property(@ (posedge clk) rose(B) |-> B ##[0:] $rose(A);

In reply to kushagar:



assert property (@(posedge clk) !A until B);