basic Link to heading

enum {r,d} color,color1;
covergroup cg @(posedge clk);

cp : coverpoint color;
cp1 : coverpoint color1;
xp : cross cp, cp;
endgroup

cg cg_i = new;

embedded coverpoint Link to heading

class foo;
enum {r,d} color,color1;
covergroup cg @(posedge clk);

cp : coverpoint color;
cp1 : coverpoint color1;
xp : cross cp, cp;
endgroup

function new();
cg =new; // embedded cg above instance is created automatically as cg is defined in class
endfunction
endclass

implicit coverpoint Link to heading

color1 in cross create a coverpoint there.

enum {r,d} color,color1;
covergroup cg @(posedge clk);

cp : coverpoint color;
xp : cross cp, color1;
endgroup

cg cg_i = new;

disable iff Link to heading

enum {r,d} color,color1;
covergroup cg @(posedge clk);
cp : coverpoint color iff (!reset);

endgroup

cg cg_i = new;

user-defined bins Link to heading

logic [3:0] color;
covergroup cg @(posedge clk);
cp: coverpoint color {
    bins a = {1,2,3};
    bins b[] = {1,2,3};
    bins c[] = {[1:3]};
}
endgroup

default bins Link to heading

covergroup cg @(posedge clk);
cp: coverpoint color{
    bins a = {1,2,3};
    bins others[] = default;
}
endgroup

cross Link to heading

logic [3:0] color;
logic [3:0] color1;

covergroup cg @(posedge clk);
cp: coverpoint color{
    bins a[] = {1,2,3}; // 3 bins
}
cp1: cp, color1 ; // 3 * 16 bins
endgroup

cross bins Link to heading

logic [3:0] color;
logic [3:0] color1;

covergroup cg @(posedge clk);
cp: coverpoint color{
    bins a[] = {1,2,3};
}
cp1: cp, color1 ;
endgroup

cross bins intersect Link to heading

logic [3:0] color;
logic [3:0] color1;

covergroup cg @(posedge clk);
cp: coverpoint color{
    bins a[] = {1,2,3};
}
cp1: cp, color1
 {
     bins zeros: binsof(cp) intersect {1}; // <1,0> <1,1> ...
 }
endgroup