# How to cover these id bins

**URL:** <https://verificationacademy.com/forums/t/how-to-cover-these-id-bins/42688>\
**Category:** Coverage\
**Tags:** Coverage, Distribute-constraint-with-coverage\
**Created:** [November 14, 2023, 6:31pm UTC](https://verificationacademy.com/forums/t/how-to-cover-these-id-bins/42688 "2023-11-14T18:31:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![suvendrakumarsahoo](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/b3f665/32.png) [@suvendrakumarsahoo](https://verificationacademy.com/forums/u/suvendrakumarsahoo)\
**Post date:** [November 14, 2023, 6:31pm UTC](https://verificationacademy.com/forums/t/how-to-cover-these-id-bins/42688/1 "2023-11-14T18:31:10Z")

</div>

I have an coverage file with ID width 21 bit.  
I want to cover the complete ID functional coverage in 350 transactions.  
I wrote the distributed constraint for this to fully cover the ID

```verilog
covergroup cg @(posedge clk)
  coverpoint awid {
   bins awid_0 ={0};
   bins awid_1= {1};
   bins awid_2 = {[2:3]};
   bins awid_4 = { [8:15]};
   bins awid_5 = {[16;31]};
   bins awid_6 ={[32:63}};
   bins awid_7 = {[64:127]};
   ....
  ---
   bins awid_20 = {[2**20 : [2**21-1]};
  }
endcovergroup

```

In the sequence item i wrote the constraint like this

```verilog
  constraint c_aw_id {
   awid dist { 0:/3,
               1:/3
               [2:3]:/3,
               [4:7]:/3,
               [8:15]:/3,
               [16:31]:/3,
               [32:63]:/3,
               [64:127]:/3,
               [128:255]:/3
               -----
               ---
               [2 **20:2** 21]:/3
              };
             }

```

But still the bins are not covering , how to cover these bins ?

---

<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:** [November 15, 2023, 2:28am UTC](https://verificationacademy.com/forums/t/how-to-cover-these-id-bins/42688/2 "2023-11-15T02:28:31Z")

</div>

_In reply to [kulua](https://verificationacademy.com/forums/t/how-to-cover-these-id-bins/42688):_

Please show us the exact code and which bins are not being covered. There a lot of mistakes in the code too show. The range should be defined as:

```verilog
`define range(r) [2**(r-1) : 2**r-1]

```
