Hardware Reference
In-Depth Information
property p_ttype_vs_beats;
1
transType l_ttype;
2
int numBeats = 0;
3
(start, l_ttype = ttype) ##1
4
(
5
(dataValid[->1], numBeats++)[ * ]
6
##1 !dataValid[ * ]
7
intersect
8
complete[->1]
9
)
10
|-> numBeatsOK(l_ttype, numBeats);
11
endproperty
12
Fig. 16.6
Counting using a local variable assignment within a repetition
for each of these matches. The increment expression numBeats++ illustrates the
fact that local variable assignments may be specified by increment and decrement
expressions. They may also be specified by general operator assignments ( += , &= ,
etc.). The subsequence of Lines 6 and 7 is intersected with the goto complete[->1]
of Line 9 to ensure that only the relevant occurrences of dataValid are counted.
The zero repetition option for [ * ] in Line 7 allows the last dataValid to be
concurrent with complete . The zero repetition option for [ * ] in Line 6 allows for
the possibility that there is no occurrence of dataValid .
16.3.2
Sequence Match Items
A local variable assignment attached to a sequence is an example of a sequence
match item , i.e., an item to be performed upon match of the sequence. The other
kind of sequence match item is a subroutine call. A subroutine called as a sequence
match item can be a task, a task method, a void function, a void function method, or
a system task.
Sequence match items may be attached to any sequence that does not admit
empty match. The first match item is separated from the sequence by a comma, and
further match items may be written as a comma-separated list. The sequence and
list of match items are enclosed in parentheses. Whenever the sequence matches,
the match items are processed in the order of the list. Local variable assignments
are performed immediately in the Observed region. Subroutine calls are scheduled
for execution in the Reactive region in the order that they appear. The assertion
evaluation does not wait on or get information back from a subroutine.
Arguments passed to a subroutine call must be passed either by value as inputs or
by reference ( ref or const ref ). Local variables may be passed only by value and
must flow to the point of the subroutine call (see Sect. 16.4.1 ). Actual arguments
passed by value are evaluated in the Observed region like other expressions in
Search WWH ::




Custom Search