Hardware Reference
In-Depth Information
numBeats does flow into Line 4 .If start evaluates to true in Line 4 , though, then
l_ttype is assigned the value of ttype . Therefore, both l_ttype and numBeats
flow into Line 5 . The subsequence of Lines 5 - 10 makes no reference to and no
reassignment of l_ttype . Therefore, l_ttype flows with value unchanged into
Line 11 , where it is referenced as an argument to the call to function numBeatsOK .
In contrast, the subsequence on Line 6 makes reference to and reassigns numBeats
for each consecutive match of dataValid[->1] in the repetition. The reference to
numBeats is implicit in the increment operator ++ . As a result, numBeats flows out
of the subsequence of Lines 6 and 7 . Because numBeats is reassigned in only one of
the operands of the intersect operator appearing on Line 8 , numBeats also flows
out of the entire subsequence of Lines 5 - 10 . Therefore, numBeats flows with its last
reassigned value into Line 11 , where it is also referenced as an argument to the call
to function numBeatsOK .
The rules of local variable flow have been designed to be intuitively reasonable
and also computable at compile time, rather than varying dynamically with the
course of evaluation. The rules do not depend on the specific value stored in a local
variable at a particular point, only on whether the local variable is guaranteed to be
assigned some value at that point. Because the rules depend only on the structure of
the sequences and properties and where the assignments to the local variables occur,
they can be checked at compile time.
Below are the rules of local variable flow for declaration, instance, sequence,
and property forms. In these rules, v , w stand for local variables; r , s stand for
sequences; p, q stand for properties; e stands for an expression; and b stands for a
Boolean expression.
DF A local variable declared in a named sequence or property flows into the body
sequence or property expression of that declaration iff it is assigned in an
initialization assignment.
IF1 A local variable that flows into an instance of a named sequence or property
does not flow into the body sequence or property expression in the declaration
of that instance. The value of the local variable may be passed into the instance
through an argument (see Sect. 16.5.1 ).
IF2 A local variable that flows out of the body sequence expression of the
declaration of a named sequence 7 does not flow out of an instance of the
named sequence. If the local variable is an untyped formal argument or an
argument local variable of direction output or inout , then its value may be
passed out of the instance (see Sect. 16.5.2 ).
IF3 v flows out of b iff v flows into b. Analogous rules apply when b is replaced
by Boolean repetitions b [-> n ] , b [= n ] ,etc.
7 More precisely, that flows out of the sequence expression that results from the body sequence
expression of the declaration by substituting actual arguments from an instance for formal
arguments, as described in the rewriting algorithms of Annex F.4 of the LRM [ 8 ].
Search WWH ::




Custom Search