# Combining illegal\_bins with default

**URL:** <https://verificationacademy.com/forums/t/combining-illegal-bins-with-default/50250>\
**Category:** SystemVerilog\
**Tags:** Coverage, Default-bin, illegal-bins\
**Created:** [May 12, 2025, 4:20pm UTC](https://verificationacademy.com/forums/t/combining-illegal-bins-with-default/50250 "2025-05-12T16:20:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arshi582](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/c77e96/32.png) [@arshi582](https://verificationacademy.com/forums/u/arshi582)\
**Post date:** [May 12, 2025, 4:20pm UTC](https://verificationacademy.com/forums/t/combining-illegal-bins-with-default/50250/1 "2025-05-12T16:20:58Z")

</div>

Hello All,  
I am trying to write explicit bins for IO commands with size as multiple of 512 ( upto 256K ). I am aware that with clause helps us define bins for such scenarios  
Other values of io\_size are illegal

```auto
// Asume 'io_size' is 19-bit
coverpoint tr.io_size {          
                    bins io_size[] = {[512:262144]} with ( item % 512 == 0 );
            // Non-multiple of 512 and all values greater than 256K are illegal
            illegal_bins io_size_ill = default ; }

```

As per LRM ::  
**“The default specification defines a bin that catches the values of the coverage point that do not lie within any of the defined bins. The default is useful for catching unplanned or invalid values.”**

(Q1) Would this mean that for io\_size values from **[0:511] , [513:255] , … [2,62,145:524287]** would fall under default ?

(Q2) Can illegal\_bins be combined with default bins ?

(Q3) Would this an alternative for **illegal\_bin ‘io\_size\_ill’**? ::

```auto
// Asume 'io_size' is 19-bit
coverpoint tr.io_size {          
                    bins io_size[] = {[512:262144]} with ( item % 512 == 0 );
            // Non-multiple of 512 and all values greater than 256K are illegal
            illegal_bins io_size_ill = {[0:$]} with ( item % 512 != 0 );                      
                      }

```

(Q4) For the explicit bins ‘io\_size’ what is the bit width used for the state values ?

```auto
// Asume 'io_size' is 19-bit
coverpoint tr.io_size {          
                  bins io_size[] = {[512:262144]} with ( item % 512 == 0 );
                      }

```

(a) Do the state values 512 , 262144 ( as well as value 512 within with\_clause ) use 19-bit width ( as 'io\_size is 19-bit ) ?

(b) Can user specify the values in non-decimal format eg: hexadecimal or octal

```auto
// Asume 'io_size' is 19-bit
coverpoint tr.io_size {          
                  bins io_size[] = {['h200:'h40000]} with ( item % 'h200 == 0 );
                      }

```

Would the hexadecimal values use 19-bit-width ?

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [May 12, 2025, 5:01pm UTC](https://verificationacademy.com/forums/t/combining-illegal-bins-with-default/50250/2 "2025-05-12T17:01:34Z")

</div>

A `default` bin expression means a coverpoint was sampled and no other explicit bin values match.

Q1: yes  
Q2: yes. (`ignore_bins` cannot be combined with `default`)  
Q3: not exactly. It does not catch values greater than 256K that are divisable by 512. You would need another `illegal_bin` to catch all numbers between 262145: **524287**.  
Q4: the coverpoint expression defines the size that all bin expressions get evaluated. See section _19.5.7 Value resolution_  
Literal numbers can be expressed in any radix.
