Hardware Reference
In-Depth Information
sequence
s1;
s ##1 1;
endsequence
Internally,
matched
stores the result of its source sequence match until the arrival
of the
next
destination clock tick after the match. There are no limitations imposed
on the last clocking event of sequence
s
.
There is not much sense in using
matched
in singly clocked assertions, but it is
helpful in multiply clocked assertions where
triggered
might not be directly used.
We explore this topic in depth in Chap.
12
.
Unlike
s.triggered
,
s.matched
cannot be used outside sequences.
11.3
Sequence as Events
Sequences may be used as events, both edge sensitive and level sensitive.
11.3.1
Sequence Event Control
The syntax of the sequence event control is
@sequence_instance
; where
@sequence_instance
is an instance of a named sequence. Arbitrary sequence
expressions cannot be specified with the event control. For example,
@(@(
posedge
clk)a ##1 b)
is illegal, as
@(
posedge
clk)a ##1 b
is a sequence expression,
but not an instance.
Sequence event control is especially convenient in programs (see Sect.
2.5
)
to specify starting points of testbench execution. For example, we may wish
to start some testbench activity when the initialization of the subsystem is com-
plete (
ready
is asserted), and when the system has entered the normal power
mode (
pmode == normal
when the last power mode switch
pswitch
occurred).
The resulting code is shown in Fig.
11.14
.
When program
test
starts executing, it immediately blocks until sequence
operational
matches. At that point, the program execution is resumed, task
run_test
is called, followed by
Test started
message display.
Note the following:
Since sequence
operational
is stand-alone, and not part of a property or of
an assertion, it cannot infer its clocking event from an enclosing property or
assertion. Therefore, the sequence clocking event
@(
posedge
clk)
must be
explicitly specified unless the sequence belongs to the scope of a clocking block,
or default clocking is specified.
The sequence
event
occurs
if
any
attempt
of
the sequence
has
a match.
This
is
why
the
sequence
matching
starts
only
from
moments
when
pswitch && pmode == normal
is true, and not from the first clock tick.
Search WWH ::
Custom Search