How to call the member of a coverpoint if the bin is an array?

I’m having the error saying an “Illegal expression within the binsof construct”. This error points to the ignore bins of my cross coverage
This is the code of the coverpoint.


cp_data : coverpoint tr.msg[26:12] {
            bins DATA_SEC[4] = {[8'h00:8'hFF]};
}

// This is the cross coverage
reply_addr_data_cross : cross cp_reply, cp_addr, cp_data {
            ignore_bins illegal_data = binsof(cp_reply.INVALID_READ) && (binsof(cp_data.DATA_SEC[1]));
}

The error says that binsof(cp_data.DATA_SEC[1]) is illegal.
What’s the right way of calling this memeber?

Hi guys. Any answer for this one?

You are not allowed to select bins with an index. SystemVerilog want you to be more explicit about the values you want to put in a cross bin.

You can make the coverpoint bin more explicit.


cp_data : coverpoint tr.msg[26:12] {
            bins DATA_SEC0 = {[8'h00:8'h3F]};
            bins DATA_SEC1 = {[8'h40:8'h7F]};
            bins DATA_SEC2 = {[8'h80:8'hBF]};
            bins DATA_SEC3 = {[8'hC0:8'hFF]};
}
 
// This is the cross coverage
reply_addr_data_cross : cross cp_reply, cp_addr, cp_data {
            ignore_bins illegal_data = binsof(cp_reply.INVALID_READ) && (binsof(cp_data.DATA_SEC1));
}

You can make the cross bin more explicit


cp_data : coverpoint tr.msg[26:12] {
            bins DATA_SEC = {[8'h00:8'hFF]};
}
 
// This is the cross coverage
reply_addr_data_cross : cross cp_reply, cp_addr, cp_data {
            ignore_bins illegal_data = binsof(cp_reply.INVALID_READ) && (binsof(cp_data.DATA_SEC) intersect { [8'h40:8'h7F] });
}

There is also the section 19.6.1.4 Cross bin set expression of the 1899-2012 LRM that has further choices.