Ex:
clk : 1 2 3 4 5 6 7 8 9 10 11 12 13
A : 0 0 1 1 1 1 1 1 1 1 1 1 1
B :our issue is tah 0 0 0 0 0 1 1 1 1 0 0 0
mean I wan to check 5 clk cycle past value of ‘B’ on 10th consucatave true of A.
I am doing like below:
A[*10] → $past(B,5)
But it’s not working as expected ., can anyone pls suggest correct one?
Your issue is that at every successful attempt of A you start a new assertion thread. You need to restrict the first successful attempt. Thus,
You need to define your requirements for things like "what happens if A[*10] fails? At what point do you start counting the sequence and exclude the other sequences. An English definition would help you write the assertions. I made some assumptions about your intent, and wrote the following, but you need to refine this code to meet your requirements.
module tenclk;
// $rose(A) ##0 A[*10] |-> $past(B,5)
// But I wan also to slide that window for next subsequent 10
// repeatative match for A without any $rose of A.
bit clk, go=1'b1, A, B;
function void set_go(); go=1'b1; endfunction
function void reset_go(); go=1'b0; endfunction
sequence q_ten; @ (posedge clk) (A && go, reset_go()) ##0 (A)[*10]; endsequence
ap_set_go_if_not_10: assert property(@ (posedge clk) A && go |->
A[*10]) else set_go();
ap_AB: assert property(@ (posedge clk) q_10.triggered |-> ($past(B, 5), set_go()));
endmodule
Signal A can be high n clk cycles (n :0,1,2…1000000000000000)
after each 10clk cycle A remains high , I wan to check 5 clk cycle past value of B at end of that sequence.
For example :
A is high from 3rd clk to 19 clk
So I wan to check value of B at clk ---- 8th -----------------------after end of 12th clk cycle
Similarly : B at clk -----9th ------------------------------after 13th clk cycle
B at clk -----10th ------------------------------after 14th clk cycle
B at clk -----11th ------------------------------after 15th clk cycle
B at clk -----12th ------------------------------after 16th clk cycle
B at clk -----13th ------------------------------after 17th clk cycle
B at clk -----14th ------------------------------after 18th clk cycle
B at clk -----15th ------------------------------after 19th clk cycle
No check at 16th ------------------------------after 20th clk cycle