Jul 28, 2024
covergroup CG @(posedge clock);
coverpoint X;
coverpoint Y;
endgroup
option.auto_bin_max
.
covergroup CG;
coverpoint X {
bins b0 = 0;
bins b1 = 1;
bins b2 = 2;
bins b3 = 3;
}
coverpoint Y;
endgroup
bins b0 = {0};
bins b = {[0:3]};
// covers numbers from 0 to 3.$
symbol.bins b = {[0:$]}
Example module defining cover groups:
module example;
logic [3:0] X;
logic [1:0] Y;
covergroup CG @(posedge clock);
coverpoint X;
coverpoint Y;
endgroup
endmodule
This will automatically create bins as per the variable size.
Running the code produces:
Emoji: 📊