Hardware Reference
In-Depth Information
covergroup cg_SEC_type
1
with function sample(startType startCode, endType endCode);
2
SC: coverpoint startCode;
3
EC: coverpoint endCode;
4
SEC: cross SC, EC;
5
endgroup
6
cg_SEC_type cg_SEC = new ();
7
sequence s_SEC;
8
startType l_startCode;
9
(start, l_startCode = startCode)
10
##1
11
(
12
complete[->1],
13
cg_SEC.sample(l_startCode, endCode)
14
);
15
endsequence
16
c_SEC: cover property (s_SEC);
17
Fig. 16.8
Collecting coverage using a local variable and a subroutine call
16.4
Referencing Local Variables
A local variable that is assigned a value may be referenced within the same named
sequence or property. Local variables can be referenced in expressions such as:
￿ Boolean expressions.
￿ Bit-select and part-select expressions.
￿ Array indices.
￿ Arguments of task and function calls.
￿ Arguments of sequence and property instances.
￿ Expressions assigned to local variables.
Local variables cannot be referenced in the following kinds of expressions:
￿ Expressions that are required to be compile-time constants, such as n in each of
the following operators: ## n, [ * n ] , [-> n ] , [= n ] . Local variables also may not
be referenced in the constant expressions of ranged forms of these operators and
bounded property operators.
￿ Clocking event expressions.
￿ The reset expression of a disable iff .
￿ The abort condition of a reset operator ( accept_on , sync_accept_on , and the
reject forms of these operators).
￿ An
argument
expression
to
a
sampled
value
function
( $rose , $fell ,
$past , etc.).
A local variable that is unassigned may not be referenced.
Each evaluation attempt of a sequence or property has its own, private copies of
the local variables declared in that sequence or property. Further copies of the local
variables may be created as the evaluation evolves, branching into subevaluation
Search WWH ::




Custom Search