In reply to ben@SystemVerilog.us:
Thanks Ben, I agree with you that I have 2 follow up question:
ap: assert property(@ (posedge clk) a |=> b ##1 c );
a 0 1 1 0 0
b 0 0 1 0 0
c 0 0 0 1 0
Thread1 - S a P
Thread2 - - S F
S==Started, a==active, P==Pass, F==Fail
1, Let’s change the question a little bit. If a should be just 1 clock cycle. thread 2 will not be started. So in this case, using $rose and not will be the same, correct? If one day, someone told me, a is just one clock cycles, but there is a bug and it is actually 2 cycles. And if I use a |=> b ##1 c, it will fail by detecting as a by-product. Do you think it is a good idea? The only side effect is this way will make debug more confusing but it will save one assertion? I am a beginner, so do you think this is good? Or do you prefer keeping the $rose but adding another assertion to determine whether a is 1 clock or not?
2, Second question, you answer is exactly what I am looking for, but let’s get back to original assertion with some extension, now:
req1: | |____________________________________________
ack1:| || |______________
req2: ________________________________________| |
But actually what should happen is:
req1: | || |____________________________________________
ack1:| || |__________
req2: ________________________________________| || |
This time, I am trying to have an assertion where each ack1 will have its corresponding req1 and req2. My understanding is, if I use the exsiting solution: $first_match will look at the first pulse of req1, and first pulse of ack1(ignore second pulse ack1) in wave1. In wave2, assertion will look at (1st req1 & 1st ack1 -->1st_req2), then it will match (2nd req1 & 1st ack1–>1st req2)
I was wondering if there is a way to write an assertion based on the wave2 situation? which is where there is a ack1, there should be a dedicate req1 before and a req2 after, delay is still [1:$]?
1st req1 -->1st ack1–> 1st req2;
2nd req1 -->2nd ack1–> 2nd req2;
I just couldn’t find a good way to describe this situation. Is it possible/impractical to do that?
thanks in advance