In reply to hisingh:
Added another assertion as per Ack_should_be_preceded_with_request to throw errors for extra ’ ack ’ violations .
Have a few follow up questions ::
(1) The reason I added cover property is to ensure vacuous pass reports are not shown via assert property
There are switches in tools to determine the information to be reported. Genratlly, tools report real pass/failures and vacuous passes.
[Q1] How is that if $rose( rdy ) is False there is No Vacuous pass report via ’ assert property ’ ?
Also will the assignment N subroutine call occur ONLY when $rose( rdy ) has Non - vacuous pass ?
(2) I was referring to SV LRM 2017 , Section 16.11 , Syntax 16-15
sequence_expr ::= // from A.2.10
...
| ( sequence_expr {, sequence_match_item} ) [ sequence_abbrev ]
...
sequence_match_item ::=
operator_assignment
| inc_or_dec_expression
| subroutine_call
The antecedent has 3 parts in your solution .
(a) Sequence Expression :: $rose( rdy )
(b) Assignment
(c) Subroutine call .
I also notice that instead of the subroutine call , if I were to write the increment as 3rd part I get compilation error .
You are correct.
sequence_expr ::= …
( sequence_expr {, sequence_match_item } ) [ sequence_abbrev ]
The sequence_match_item is only executed if the sequence_expr is a match colloquially called true, but sequences match or do not match. See my paper - Reflections on Users’ Experiences with SVA
Reflections on Users’ Experiences with SVA
As you stated, the following in a sequence_match_item:
sequence_match_item ::=
operator_assignment // example ($rose(a), local_variable1=sig1, local_variable2=sig2)
// ILLEGAL: ($rose(a), sig1=1'b1)
| inc_or_dec_expression // ($rose(a), local_variable1++)
| subroutine_call // ($rose(a), my_function(sig1), $display("%t sig1=%b, ...)
[Q2] Is the order fixed i.e assignment should be written before subroutine call ? . Can we have more than 3 parts too ?
I have seen codes with multiple assignments ::
sequence dataCheck ;
int ldata1 , ldata2 ;
( rdc , ldata1 = rData , ldata2 = retryData ) ##5 ....
// ' rdc ' is another sequence .
endsequence
( sequence_expr {, sequence_match_item } )
After the sequence_expr and if that matches then you can have multiple sequence_match_items
separated by a comma. The {} in the definition mean a repeat of what is in it.
NO order is specified, meaning you can have a local variable assignment followed by a function call, or vice versa. However, the items within the sequence_match_item are executed in order from left to right. Thus, in ($rose(a), v1=3, v2=4, v3=v1+v2) v3==7.
[Q3] This was an application of a subroutine call from an expression .
What other cases can we use the subroutine for ?
The book I am currently referring ( by Ashok Mehta ) has codes using it for debugging purposes ( To display reports )
and also hints that it could be used to collect coverage information too .
Subroutine calls are used in support logic and demonstrated by this example (e.g., increment the counters. Note that module variables can be directly modified in the action blocks.