Hardware Reference
In-Depth Information
of a . The sequence ends with !a[ * ] , which allows any number of cycles without
occurrences of a at the end. Within property p_num_dataValid_check , an instance
of s_cnt_occurrences , which binds dataValid to a and num_dataValid to
num_a , is intersected with the goto complete[->1] . The intersection ensures that
the instance of s_cnt_occurrences only counts those occurrences of dataValid
that occur after start and not later than complete .InLine 17 , a function (or
property) num_dataValid_OK is called to check that the number of occurrences
of dataValid is allowable for the given transaction type captured in l_ttype in
Line 9 .
The second mechanism for passing out values of local variables uses untyped
formal arguments. This mechanism is discouraged unless the flexibility of untyped
arguments is required. If an untyped formal argument of a named sequence is
used an l value in a local variable assignment, then that formal argument is
understood to represent a local variable. The entire actual argument passed to
such a formal argument must be a local variable (the receiver local variable). The
formal argument behaves like an untyped version of an argument local variable of
direction either output or inout . The following variant encoding of the sequence
s_cnt_occurrences exhibits this style and can be substituted in Fig. 16.18 to
achieve an equivalent effect:
sequence s_cnt_occurrences( bit a, untyped num_a);
1
(1'b1, num_a = a)
2
##1 (a[->1], num_a++)[ * 0:$]
3
##1 !a[ * 0:$];
4
endsequence
5
The value of a local variable can be output from an instance of a named sequence
to which a sequence method ( triggered or matched ) is applied. The rules above
apply, with the additional conditions that argument local variables of direction
input or inout cannot appear in the declaration of such a named sequence, and
the sequence instance must be a maximal expression (i.e., there is no negation or
other expression operator applied to it.)
Exercises
16.1. A default actual argument for an input argument local variable may refere-
nce preceding arguments in the port list of the sequence or property provided that
none of the arguments referenced is an output argument local variable. Explain the
rationale for this restriction.
16.2. For each of the following sequences, explain why the syntax is not legal and
give an example of a legal sequence that, arguably, captures the same intent as the
illegal one.
Search WWH ::




Custom Search