I would like to automate bin creation inside an embedded covergroup. I want one bin per value in a table.
covergroup cg_transition_table;
option.per_instance=1;
cp_mml_state_mode : coverpoint value {
bins hope_this_works[]=TEST_TABLE;
}
endgroup
If I define a dynamic test table, it creates 64 bins, values ranging from 0 to 2^32-1. DOH!
Note sure what’s going on there.
const uint32_t TEST_TABLE[]= {
1,2,3,4,5,6
};
If I give the table a static length, it creates exactly 6 bins, just what I need.
const uint32_t TEST_TABLE[6]= {
1,2,3,4,5,6
};
However, the real table is very long, and I don’t want to hard-code the length.
All table entries are non-zero. Also, I don’t believe the array locator methods work on my current simulator version. :p