In [0:$] how $ is decided by the tool? When will the $ actually occur for the tool?
If the req will occur and grnt will never occur till the $. What will happen?
If the req will never occur?
So basically, how can we generalize the situation that (a) the antecedent will be true, but the consequent will never occur & (b) the antecedent will never be true?
0:$ indicates that grnt can occur at any clock once req is true ( incl. same clk due to |-> ). Tool will essentially check for ‘grnt’ to occur till end of simulation
It’s an incomplete attempt with a non-vacuous pass ( as ‘req’ occurred )
It’s an incomplete attempt with a vacuous pass ( as ‘req’ never occurred )
For the case 2 why not it will fail because the Manager sent the ‘req’ and the subordinate is not able to fulfill the ‘ack’ till the end of simulation.
You want to say that incomplete attempt with a non-vacuous pass = Fail.
What you seem to be asking about is referred to as a liveness property: a scenario that is bound to eventually happen.
SystemVerilog has two types of assertions/properties/sequences: weak and strong. weak is considered a vacuous pass if there’s no match; it becomes true only after a match is found. On the other hand, a strong property fails if there’s no match, as it remains false even in the absence of a match.
The assertion you wrote is weak. If req never occurs or grnt never occurs, there is no failure; there is a vacuous pass. For a formal tool, [0:$] is unbounded; it searches indefinitely, limited only by the CPU resources you give it. But for dynamic simulation, [0:$] means until the end of the simulation.
If your requirement is: for each request, there must be a grant, you could write
Note that if you never receive a request, that shouldn’t be considered a failure. Not every test might trigger a request. When you compile and merge all your coverage data, you’ll find that this assertion never passed if there was never a request.
The LRM never formally defines an assertion as being complete or incomplete. Generally, an assertion is thought of as having an attempt, failure, vacuousness success, or non-vacuous success. A weak property that has been attempted but resulted in neither success nor failure may be considered incomplete. Strong properties, on the other hand, must either fail or pass, and there is no such thing as an incomplete strong property.
The LRM never mentions the fact that coverage is collected on the assert directive the same as a cover directive. Tools are required to record and report the number of attempts, vacuous, successes, and non-vacuous successes.