Coverage for an array

In reply to theketi:
The array reduction methods and() and or() perform bitwise operations between each element, and the result is the same type as each element, in your case
bit 7:0]
. Same as val[0] & val[1] & … & val[7].

If the array always contains the same number of bits, you can cast to a fixed size integral value. Then you can bin whatever ranges you want

typedef bit [255:0] uint256_t;

cp: coverpoint uint256_t'(val) {
   bins a[] = {[0:maxval/2], [maxval/2:maxval]};
}

If the array is not a fixed size, you will need to get more creative with your covergroup expressions to represent your ranges. Perhaps write a function that returns an encoded value of each range you want detected.