Say I have a enum which contains a list of valid commands or opcodes. Is there a way to create a bin for each element of the enum?
class command_coverage;
enum {SEQ_WRITE_16_BIT = 32'hBEEFFOOD, SEQ_READ_16_BIT = 32'hFACEFACE,
... } my_valid_commands
covergroup cg();
command_cp : coverpoint cmd {
bins valid_commands[] = each element of enum;
}
endgroup
...
endclass
I tried something like:
bins valid_commands[] = my_valid_commands;
or
bins valid_commands[] = {[0:$] inside my_valid_commands};
But it didn't work as I wanted.