2
ipv6_hdr__f_next_header_cp: coverpoint  this.ipv6_hdr.ipv6_f_next_header iff (this.has_ipv6_header){
    bins ipsec_33 = {'h33};
    bins tcp_06 = {'h06};
    bins udp_11 = {'h11};
    bins done_3b = {'h3b};
    bins ipv6_ext_any_other [3] = {[0:'h5], ['h7:'h10], ['h12:'h3a], ['h3c:$]};
}

ipv6_ext_any_other bin should collect all vals that are not collected by other bins.

default might be used, but the problem is that default is not an active bin, I mean, it is not a part of the func cov metrics.

Is there any other way of defining the ipv6_ext_any_other bin? Alternatively, is there a way of making the default an active bin?

pawello2222
  • 46,897
  • 22
  • 145
  • 209

1 Answers1

2

You can do

bins ipv6_ext_any_other [3] = {[0:$]} with (!(item inside {'h33,'h06,'h11,'h3b}));

Also see https://accellera.mantishub.io/view.php?id=4698

dave_59
  • 39,096
  • 3
  • 24
  • 63
  • I know that `bins ipv6_ext_any_other [3] = default;` is not the answer, because it will automatically be an `ignore_bins`. Do you know why? It seems crazy. – Matthew Taylor Jan 12 '21 at 17:14
  • 1
    Much of the covergroup functionality came from *Vera*, and some conceptual ideas were lost in the syntax transition to SystemVerilog. `ignore_bins` is for pulling out overlapping `bins` from coverage collection. `default` is a debugging aid to capture how many times a sample value did not fall into any prescribed bin. There is no way to capture how those values are distributed. – dave_59 Jan 12 '21 at 17:56
  • many thanks for this answer! I have also checked out the link, I didn't really understand, is the following syntax: bins ipv6_ext_any_other [3] = {default} equivalent to: bins ipv6_ext_any_other [3] = {[0:$]} with (!(item inside {'h33,'h06,'h11,'h3b})); cuz, actually I thought {default} should work... – Yakir Yehudai Jan 13 '21 at 21:30
  • Yes, they would be the same with my proposed syntax. The difference is whether there are `{}`'s around the `default` keyword. – dave_59 Jan 14 '21 at 01:35