Hardware Reference
In-Depth Information
￿ The sampled value of a local variable (see Chaps. 15 and 16 ) is its current value.
￿ The sampled value of a free checker variable (see Sect. 23.1 ) is its current value.
If a free checker variable is referred to by a sampled value function (see Sect. 7.2 ),
then sampling takes place in the Postponed region of the corresponding clock tick.
Example A.6. Given the following declaration:
rand bit v;
$sampled(v) is the current value of v . In the expression $past(v) the value of
v is taken from the Postponed region of the previous clock tick. The rationale
of this definition for past or future sampled value functions is to take the final
value of the variable in the corresponding clock tick: the notion of the current
value makes sense for the current clock tick only.
t
￿ An input variable of a clocking block must be sampled by the clocking block with
#1step sampling. 1 This is the sampled value of a such variable (see Sect. 2.3 and
the LRM).
A.3
Sampled Value of Expression
Having defined the sampled value of a variable, we now can define the sampled
value of an expression recursively:
￿ The sampled value of an expression consisting of a single variable is the sampled
value of this variable.
￿ The sampled value of a const cast expression is the current value of its argument.
t
Example A.7. $sampled( const '(a)) is the current value of a .
￿ When a past or a future value of a const cast expression is referenced by a sampled
value function, the current value of this expression is taken instead.
t
Example A.8. $past( const '(a)) is the current value of a .
￿ The sampled value of the sequence methods triggered and matched is defined
as the current value returned by the sequence method.
￿ When a past or a future value of a sequence method is referenced by a sampled
value function, this value is sampled in the Postponed region of the corresponding
past or future clock tick
Example A.9. If s is a sequence then in $past(s.triggered) the value of
s.triggered is sampled in the Postponed region of the previous tick of the
corresponding clock. The rationale of this definition is to take the final value
1 The clocking block sampling may be defined other than #1step , but in this case the input
variable cannot be used in contexts requiring variable sampling in SVA sense, such as a body
of a concurrent assertion.
Search WWH ::




Custom Search