Hardware Reference
In-Depth Information
also record how many attempts were started. What happens if either a is false at the
beginning of an attempt or b is false throughout the range? In that case, there is no
match and the coverage count is not incremented in the database. Thus, unlike those
of assert statements, failures of covers are ignored.
The body of cover sequence mayhavea disable iff ( expression ) at the
top. As with assert property statements, the evaluation of the expression is
asynchronous to the evaluation of the sequence and uses the current values of
the variables appearing in the expression . Whenever the expression is true, all the
evaluation attempts currently in flight or starting are disabled and record no match.
In other words, in cover statements, disable iff behaves similarly to reject_on
(Chap. 13 ), but unlike reject_on it does not use sampled values and a success is
reported as “disabled”.
In the above Example 18.1 , whenever the sequence a ##[1:100] b matches,
and provided that reset is false, the increment of my_count and the $display
statement are scheduled to execute in the Reactive region.
Despite its powerful expressive power, one has to be careful when writing
such cover sequence statements. This is because the total coverage count of the
matches includes multiple matches for a single attempt whenever they occur, and
thus get mixed with matches from other attempts in the total coverage count. In the
above example, consider a situation where a occurs at the first and then at every
fifth clock tick, and b at every tenth clock tick. Suppose that there are 101 clock
ticks. How many matches will be recorded? The attempts associated with the first
two occurrences of a will match each ten times, on all the occurrences of b .The
subsequent two occurrences of a will match nine times, etc. It can be easily seen
that the total number of matches will considerably exceed the number of attempts.
Furthermore, the same occurrence of b being true will account for several matches.
When looking at the final count in the coverage database, the result may be difficult
to interpret.
A more useful case of coverage determination is whether a wasfollowedbya b
within 100 clock ticks without any other intervening occurrence of a . The result of
the coverage in Example 18.1 does not provide this information.
The coverage database for coverage on a sequence contains the number of
evaluation attempts started and the total number of sequence matches. This total
number of matches does not distinguish among the attempts, hence even if the total
number of matches exceeds the total number of evaluation attempts, there could be
attempts that had no match. Simulation tools may optionally provide a count of first
matches, in which case it is possible to see whether there were evaluation attempts
that were disabled or had no match.
The question is then where is the cover sequence statement useful? Our
experience suggests that it is useful when an action needs to be taken for all the
matches. For example to trigger evaluation of some tasks or increment counts used
elsewhere in the test bench.
Search WWH ::




Custom Search