I’m covering values defined as ‘typedef enum’. Some of them have dozens of
members (enum values), but i only want to cover a few of them in most
contexts.
I usually want the majority of the values to be in ignore_bins and/or
illegal_bins. So what i’d like to do would look something like this:
----------------------------------------------
typedef enum { A, B, C, …, P } color_t;
color_t sampledColor;
covergroup aardvark_cg;
color_cp : coverpoint sampledColor {
bins A_cp = { A };
bins B_cp = { B };
bins C_cp = { C };
ignore_bins = ;
}
endgroup
----------------------------------------------
I’m going to need to do a lot of this type of thing, so want to avoid
having to specify everything like this:
ignore_bins = { D, E, F, G, H, I, J, K, L, M, N, O, P };
Harder to read (with the actual enum names), and much harder to maintain.
I’ve tried a variety of syntaxes to simplify this, but can’t find anything
that works.
I’ve also tried creating sets of things i want to be ignored or illegal in
various places, then using that in my ignore_bins/illegal_bins statements:
// Tried both with/without the "`".
color_t IgnoredColors[13] = '{ D, E, F, ..., P };
...
ignore_bins = IgnoredColors;
This doesn’t work.
The only thing that i’ve found to work so far is using macros. Want to get
away from that for reasons beyond my control.
It seems like this must be something provided for in the standard, but i
can’t figure out how to do it. Any suggestions?
Thanks in advance.