|HOME |ABOUT |ARTICLES |ACK |FEEDBACK |TOC |LINKS |BLOG |JOBS |


Tutorials



TRANSITION BINS



Transitional functional point bin is used to examine the legal transitions of a value. SystemVerilog allows to specifies one or more sets of ordered value transitions of the coverage point.

Type of Transitions:

Single Value Transition
Sequence Of Transitions
Set Of Transitions
Consecutive Repetitions
Range Of Repetition
Goto Repetition
Non Consecutive Repetition





Single Value Transition


Single value transition is specified as:
value1 => value2

program main;
bit [0:3] y;
bit [0:2] values[$]= '{3,5,6};

covergroup cg;
cover_point_y : coverpoint y {
bins tran_34 = (3=>4);
bins tran_56 = (5=>6);
}

endgroup

cg cg_inst = new();
initial
foreach(values[i])
begin
y = values[i];
cg_inst.sample();
end

endprogram



In the above example, 2 bins are created for covering the transition of point "y" from 3 to 4 and other for 5 to 6. The variable y is given the values and only the transition 5 to 6 is occurring.



Coverage report:
--------------------
VARIABLE : cover_point_y
Expected : 2
Covered : 1
Percent: 50.00

Uncovered bins
------------------
tran_34

Covered bins
----------------
tran_56



Sequence Of Transitions



A sequence of transitions is represented as:
value1 => value3 => value4 => value5

In this case, value1 is followed by value3, followed by value4 and followed by value5. A sequence can be
of any arbitrary length.



program main;
bit [0:3] y;
bit [0:2] values[$]= '{3,5,6};

covergroup cg;
cover_point_y : coverpoint y {
bins tran_345 = (3=>4>=5);
bins tran_356 = (3=>5=>6);
}

endgroup

cg cg_inst = new();
initial
foreach(values[i])
begin
y = values[i];
cg_inst.sample();
end

endprogram



In the above example, 2 bins re created for covering the transition of point "y" from 3 to 4 to 5 and other for 3 to 5 to 6. The variable y is given the values and only the transition 3 to 5 to 6 is occurring.



Coverage report:
--------------------
VARIABLE : cover_point_y
Expected : 2
Covered : 1
Percent: 50.00

Uncovered bins
------------------
tran_345

Covered bins
-----------------
tran_356



Set Of Transitions



A set of transitions can be specified as:
range_list1 => range_list2



program main;
bit [0:3] y;
bit [0:2] values[$]= '{3,5,6};

covergroup cg;
cover_point_y : coverpoint y {
bins trans[] = (3,4=>5,6);
}

endgroup

cg cg_inst = new();
initial
foreach(values[i])
begin
y = values[i];
cg_inst.sample();
end

endprogram



In the above example, bin trans creates 4 bin for covering 3=>5,4=>5,3=>6 and 4=>6.



Coverage report:
--------------------
VARIABLE : cover_point_y
Expected : 4
Covered : 1
Percent: 25.00

Uncovered bins
------------------
tran_34_to_56:3->6
tran_34_to_56:4->5
tran_34_to_56:4->6


Covered bins
----------------
tran_34_to_56:3->5


Consecutive Repetitions



Consecutive repetitions of transitions are specified using
trans_item [* repeat_range ]

Here, trans_item is repeated for repeat_range times. For example,
3 [* 5]
is the same as
3=>3=>3=>3=>3



program main;
bit [0:3] y;
bit [0:2] values[$]= '{3,3,3,4,4};

covergroup cg;
cover_point_y : coverpoint y {
bins trans_3 = (3[*5]);
bins trans_4 = (4[*2]);
}

endgroup

cg cg_inst = new();
initial
foreach(values[i])
begin
y = values[i];
cg_inst.sample();
end

endprogram


Coverage report:
--------------------
VARIABLE : cover_point_y
Expected : 2
Covered : 1
Percent: 50.00

Uncovered bins
------------------
trans_3


Covered bins
----------------
trans_4



Range Of Repetition



An example of a range of repetition is:
3 [* 3:5]
is the same as
3=>3=>3, 3=>3=>3=>3, 3=>3=>3=>3=>3



program main;
bit [0:3] y;
bit [0:2] values[$]= '{4,5,3,3,3,3,6,7};

covergroup cg;
cover_point_y : coverpoint y {
bins trans_3[] = (3[*3:5]);
}

endgroup

cg cg_inst = new();
initial
foreach(values[i])
begin
y = values[i];
cg_inst.sample();
end

endprogram



In the above example, only the sequence 3=>3=>3=>3 is generated. Other expected sequences 3=>3=>3 and 3=>3=>3=>3=>3 are not generated.



Coverage report:
--------------------
VARIABLE : cover_point_y
Expected : 3
Covered : 1
Percent: 33.33

Uncovered bins
------------------
tran_3:3[*3]
tran_3:3[*5]

Covered bins
----------------
tran_3:3[*4]


Goto Repetition



The goto repetition is specified using: trans_item [-> repeat_range]. The required number of occurrences of a particular value is specified by the repeat_range. Any number of sample points can occur before the first occurrence of the specified value and any number of sample points can occur between each occurrence of the specified value. The transition following the goto repetition must immediately follow the last occurrence of the repetition.
For example:
3 [-> 3]
is the same as
...=>3...=>3...=>3

where the dots (...) represent any transition that does not contain the value 3.

A goto repetition followed by an additional value is represented as follows:
1 => 3 [ -> 3] => 5
is the same as
1...=>3...=>3...=>3 =>5




program main;
bit [0:3] y;
bit [0:2] values[$]= '{1,6,3,6,3,6,3,5};

covergroup cg;
cover_point_y : coverpoint y {
bins trans_3 = (1=>3[->3]=>5);
}

endgroup

cg cg_inst = new();
initial
foreach(values[i])
begin
y = values[i];
cg_inst.sample();
end

endprogram

Coverage report:
--------------------
VARIABLE : cover_point_y
Expected : 1
Covered : 1
Percent: 100.00


Non Consecutive Repetition



The nonconsecutive repetition is specified using: trans_item [= repeat_range]. The required number of occurrences of a particular value is specified by the repeat_range. Any number of sample points can occur before the first occurrence of the specified value and any number of sample points can occur between each occurrence of the specified value. The transition following the nonconsecutive repetition may occur after any number of sample points so long as the repetition value does not occur again.

For example:
3 [= 2]
is same as
...=>3...=>3

A nonconsecutive repetition followed by an additional value is represented as follows:
1 => 3 [=2] => 5
is the same as
1...=>3...=>3...=>5



program main;
bit [0:3] y;
bit [0:2] values[$]= '{1,6,3,6,3,6,5};

covergroup cg;
cover_point_y : coverpoint y {
bins trans_3 = (1=>3[=2]=>5);
}

endgroup

cg cg_inst = new();
initial
foreach(values[i])
begin
y = values[i];
cg_inst.sample();
end

endprogram


Coverage report:
--------------------
VARIABLE : cover_point_y
Expected : 1
Covered : 1
Percent: 100.00

Index
Introduction
Cover Group
Sample
Cover Points
Coverpoint Expression
Generic Coverage Groups
Coverage Bins
Explicit Bin Creation
Transition Bins
Wildcard Bins
Ignore Bins
Illegal Bins
Cross Coverage
Coverage Options
Coverage Methods
System Tasks
Cover Property

Report a Bug or Comment on This section - Your input is what keeps Testbench.in improving with time!





<< PREVIOUS PAGE

TOP

NEXT PAGE >>

copyright © 2007-2017 :: all rights reserved www.testbench.in::Disclaimer