Tutorials

Protocols

Learn More

A transition bin measures how a coverpoint value changes across successive sampling events. It is useful when the order of values matters, not just whether each value occurred.

For example, ordinary value bins can tell us that values 2 and 5 were sampled. A transition bin can tell us whether 2 was followed by 5 in the required order.

 

The transition of coverpoint variables for a specified sequence of values can also be covered.

Transitions can be covered for the below legal coverpoint transitions.

  1. Single value transitions
  2. Sequence of transitions
  3. Set of transitions
  4. Consecutive repetition
  5. Range of repetition
  6. Goto repetition
  7. Non-consecutive repetition

How Transition Sampling Works

A transition is evaluated only when the covergroup is sampled. Signal changes between two calls to sample() are not visible to an eventless covergroup. In a clocked covergroup, each declared clocking event is one sample point.

The transition operator => in a covergroup means ‘followed by at the next required sample point.’ It belongs to transition-bin syntax and should not be confused with the implication operators used by SystemVerilog Assertions.

Single value transitions

A single transition checks two ordered values at successive sample points. The single value transition can be specified as <value1> => <value2>

Example:

module func_coverage;
  logic [3:0] data; 

  covergroup c_group; 
    cp1: coverpoint data {bins b1 = (2 => 5);
                          bins b2 = (2 => 10);
                          bins b3 = (3 => 8);
                         }
  endgroup

  c_group cg = new();
  ...
  ...
endmodule

Bin

Required samples

When the bin is hit

b1

2, 5

A sampled 2 is immediately followed by a sampled 5

b2

2, 10

A sampled 2 is immediately followed by a sampled 10

b3

3, 8

A sampled 3 is immediately followed by a sampled 8

The sample stream 2, 5, 2, 10, 3, 8 hits all three bins. The stream 2, 4, 5 does not hit b1 because 5 does not immediately follow 2.

Sequence of transitions

The sequence of transitions can be specified as <value1> => <value2> => <value3> => <value4>

Example:

module func_coverage;
  logic [3:0] data; 

  covergroup c_group; 
    cp1: coverpoint data {bins b1 = (2 => 5 => 6);
                          bins b2 = (2 => 10 => 12);
                          bins b3 = (3 => 8 => 9 => 10);
                         }
  endgroup

  c_group cg = new();
  ...
  ...
endmodule

Bin

Required sequence

Number of samples

b1

2, 5, 6

3

b2

2, 10, 12

3

b3

3, 8, 9, 10

4

For b1, the values must appear on three successive samples. The stream 2, 5, 7, 6 does not hit the bin because 7 breaks the required sequence.

Set of transitions

A value list on either side of => expands into every possible left-to-right combination. The set of transitions can be specified as <transition_set1> => <transition_set2>.

Example:

module func_coverage;
  logic [3:0] data; 

  covergroup c_group; 
    cp1: coverpoint data {bins b1[] = (2,3 => 4,5);
                         }
  endgroup

  c_group cg = new();
  ...
  ...
endmodule

It creates 4 bins: 2 => 4, 2 => 5, 3 => 4, 3 => 5.

Generated bin

Transition

b1[0]

2 => 4

b1[1]

2 => 5

b1[2]

3 => 4

b1[3]

3 => 5

The exact displayed array index can be tool-dependent, but four transition bins are created. The number of combinations is 2 left-side values x 2 right-side values = 4 bins.

Consecutive repetition

Consecutive repetition requires the same value at adjacent sample points. The syntax is value[*count]. The range of repetition can be specified as <transition_value> [*<repeat_value>]

Example:

module func_coverage;
  logic [3:0] data; 

  covergroup c_group; 
    cp1: coverpoint data {bins b1[] = (4[*3]);
                         }
  endgroup

  c_group cg = new();
  ...
  ...
endmodule

4[*3] is equivalent to 4=>4=>4

Sample

data

Status

1

4

First required occurrence

2

4

Second consecutive occurrence

3

4

Third occurrence; bin is hit

The stream 4, 2, 4, 4 does not hit the bin because the value 2 breaks the consecutive run.

Range of repetition

A repetition range accepts several consecutive run lengths. The syntax is value[*minimum:maximum].

The range of repetition can be specified as <transition_value> [*<repeat_range>]

Example:

module func_coverage;
  logic [3:0] data; 

  covergroup c_group; 
    cp1: coverpoint data {bins b1[] = (4[*2:4]);
                         }
  endgroup

  c_group cg = new();
  ...
  ...
endmodule

4[*2:4] is equivalent to 4=>4, 4=>4=>4, 4=>4=>4=>4

Generated sequence

Equivalent transition

Two repetitions

4 => 4

Three repetitions

4 => 4 => 4

Four repetitions

4 => 4 => 4 => 4

Because the bin is declared as an unsized array, the repetition range expands into separate transition bins for the accepted lengths.

Goto repetition

Goto repetition counts a required number of non-consecutive occurrences. Other values may appear between those occurrences. After the final repeated value, the next sequence item must occur immediately at the next sample point.

Example:

module func_coverage;
  logic [3:0] data; 

  covergroup c_group; 
    cp1: coverpoint data {bins b1 = (2=>5[->3]=>7);
                         }
  endgroup

  c_group cg = new();
  ...
  ...
endmodule

2=>5[->3]=>7 is equivalent to 2…=>5…=>5…=>5=>7

Multiple transitions (represented as ) can happen before interested value transitions.

Sample

data

Meaning

1

2

Sequence starts

2

9

Allowed gap before the first 5

3

5

First occurrence of 5

4

1

Allowed non-5 gap

5

5

Second occurrence of 5

6

3

Allowed non-5 gap

7

5

Third occurrence of 5

8

7

Must immediately follow the final 5; bin is hit

If sample 8 were 6 and sample 9 were 7, this attempt would not match because goto repetition requires 7 immediately after the third 5.

Non-consecutive repetition

Non-consecutive repetition also counts separated occurrences, but it permits non-matching samples after the final repeated value before the next sequence item arrives.

The non-consecutive repetition can be specified as <transition_value> [= <repeat_range>]

Example:

module func_coverage;
  logic [3:0] data; 

  covergroup c_group; 
    cp1: coverpoint data {bins b1 = (2=>5[=3]=>7);
                         }
  endgroup

  c_group cg = new();
  ...
  ...
endmodule

2=>5[=3]=>7 is equivalent to 2…=>5…=>5…=>5=>7

Sample

data

Meaning

1

2

Sequence starts

2

9

Allowed gap

3

5

First occurrence of 5

4

1

Allowed non-5 gap

5

5

Second occurrence of 5

6

3

Allowed non-5 gap

7

5

Third occurrence of 5

8

4

Trailing non-5 gap is allowed

9

6

Another trailing non-5 gap

10

7

Final value arrives; bin is hit

Goto vs. Non-Consecutive Repetition

Feature

Goto [->3]

Non-consecutive [=3]

Gaps before/between repeated values

Allowed

Allowed

Gap after final repeated value

Not allowed

Allowed

Next sequence item

Must follow immediately

May arrive later

 

This trailing-gap rule is the key difference between the two forms.

Ignore bins

ignore_bins removes specified values or transitions from the coverage calculation. It should be used only when the verification plan clearly explains why those cases are excluded.

Example:

module func_coverage;
  logic [3:0] addr; 

  covergroup c_group; 
    cp1: coverpoint addr {ignore_bins b1 = {1, 10, 12};
                          ignore_bins b2 = {2=>3=>9};
                         }
  endgroup

  c_group cg = new();
  ...
  ...
endmodule

Ignore bin

Excluded item

Effect

b1

Values 1, 10, and 12

These sampled values do not count toward the coverage goal

b2

Transition 2 => 3 => 9

This ordered transition is excluded from the coverage goal

The transition form uses parentheses, while the ordinary value list uses braces.

illegal_bins

The illegal bins are used to specify a set of values or transitions that can be marked as illegal when the specification says must not occur.

For the occurrence of illegal values or transactions, a run-time error is reported.

Example:

module func_coverage;
  logic [3:0] addr; 

  covergroup c_group; 
    cp1: coverpoint addr {illegal_bins b1 = {1, 10, 12};
                          illegal_bins b2 = {2=>3=>9};
                         }
  endgroup

  c_group cg = new();
  ...
  ...
endmodule

Illegal bin

Forbidden item

Expected behavior

b1

Values 1, 10, and 12

A diagnostic is produced when one of these values is sampled

b2

Transition 2 => 3 => 9

A diagnostic is produced when this complete sequence is observed

Use an assertion or explicit checker when illegal behavior must reliably fail a test. An illegal bin is useful for coverage classification, but diagnostic severity can depend on simulator settings.

Common Mistakes

  • Assuming that every signal change is sampled. Only covergroup sampling events are visible.
  • Expecting 2 => 5 to match 2, 4, 5. The middle value breaks a single-step transition.
  • Confusing [*3] with three non-consecutive occurrences. [*3] requires three adjacent samples.
  • Treating [->3] and [=3] as identical. Only [=3] permits a gap after the final repeated value.
  • Using braces for a transition bin. Transition sequences use parentheses.
  • Using transition bins for complex timing protocols that are clearer as an SVA cover property.