Tutorials

Learn More

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

Single value transitions

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

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

Set of transitions

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.

Consecutive repetition

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

Range of repetition

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

Goto repetition

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.

Non-consecutive repetition

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

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

Note: It is similar to goto repetition except that non-consecutive repetition may happen after any number of sample points without the occurrence of repetition value. Whereas in the case of goto repetition transition must follow the last repetition occurrence immediately.

Ignore bins

The ignore bins are used to specify a set of values or transitions that can be excluded from coverage.

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

illegal_bins

The illegal bins are used to specify a set of values or transitions that can be marked as illegal.

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