How to write a coverpoint on a data queue

I am trying to write a covergroup for various fields of a transaction. One of the fields in the transaction is a queue of data bytes with variable lengths. I want to write a coverpoint for data bytes taken together as a whole and also analyzed separately. How do I do this from within a covergroup definition?

You should explain a little more what you mean by covering the queue as a whole or analyzed separately. For example, you might want to cover that you have received particular data values in your bytes. You can loop through each byte in the queue

covergroup cg with function sample (byte x);
  coverpoint x  {
      bins b1 = {0};
      bins b2 = { [1:84] };
      bins b3 = { [85:169] };
      bins b4 = { [170:255] };
}
endgroup

Then inside the method that does the sampling

foreach(q[i]) cg.sample(q[i]);

In reply to dave_59:

Thanks Dave.
What I meant was that I want to write a coverpoint for each data member (of fixed number of bits) of the queue to check that every bit is set to one and zero. I want to do it for a queue of arbitrary size and the queue itself is a member of a transaction coming through the analysis port. How do I do this from within covergroup definition or otherwise.

In reply to mann:

This still does not make much sense. If every transaction has a queue of arbitrary size, how do you expect to get toggle coverage for the transaction with the largest queue size? Unless the queue size is not as arbitrary as you say it is. In that case you will have to create an array of covergroup instances to cover each bit as described in this post. You will need to iterate over each bit over each queue element. This will be a very expensive operation so consider if this is really necessary.

In reply to dave_59:

Thanks Dave. Actually, the queue size is not arbitrary and it has a upper limit, say 8. Howvever, for a given run of a test it is fixed. Since I have to design a covergroup which has to work for any length of the queue (but fixed for a given testcase), I am hoping for a general solution, based off of the queue length.
The other link you provided was very helpful. Thanks.