# Coverpoint bins with clause

**URL:** <https://verificationacademy.com/forums/t/coverpoint-bins-with-clause/46097>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, Coverage, SystemVerilog-FunctionalCoverage\
**Created:** [February 6, 2024, 7:33pm UTC](https://verificationacademy.com/forums/t/coverpoint-bins-with-clause/46097 "2024-02-06T19:33:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahantha\_Deeksha\_S\_B](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/mahantha_deeksha_s_b/32/1072_2.png) [@Mahantha\_Deeksha\_S\_B](https://verificationacademy.com/forums/u/Mahantha_Deeksha_S_B)\
**Post date:** [February 6, 2024, 7:33pm UTC](https://verificationacademy.com/forums/t/coverpoint-bins-with-clause/46097/1 "2024-02-06T19:33:22Z")

</div>

Hi i have created a covergroup as shown below,

```auto
mem_seq_item mem_item;
  
  ahb_m_seq_item ahb_item;
  
  apb_transfer apb_item;
  
  covergroup cg1;
    ahb_size: coverpoint ahb_item.hsize{bins word = {WORD} with (ahb_item.haddr[1 : 0] == 'b00);
                                        bins def = default;
    }
    ahb_addr : coverpoint ahb_item.haddr{bins incr4_trans = {(in_addr => in_addr + 4 => in_addr + 8 => in_addr +12 )} with (ahb_item.hburst == INCR4);
                                         bins def = default;
      
    }
    ahb_htrans : coverpoint ahb_item.htrans[0] {bins trans = {(NONSEQ => SEQ => SEQ => SEQ)} with ((ahb_item.hburst == INCR4)||(ahb_item.hburst == WRAP4));
                                                bins def = default;
    }
    apb_addr : coverpoint apb_item.paddr{bins start_reg = {0};
                                         bins end_reg = {4};
                                         bins ctrl_reg = {8};
                                         bins def = default;
    }
    apb_data : coverpoint apb_item.pwdata{bins ctrl[4] = {[0 : 3]} with (apb_item.paddr == 'h8);
                                          bins start_addr = {apb_item.pwdata} with (apb_item.paddr == 'h0);
                                          bins end_addr = {apb_item.pwdata} with (apb_item.paddr == 'h4);
    }
    filt_on : coverpoint l_ctrl_reg[0];
    filter : coverpoint ((mem_item.addr >= l_start_reg) && (mem_item.addr <= l_end_reg));
    ex_on : coverpoint l_ctrl_reg[1];
    filt_cross : cross filt_on,ex_on,filter,mem_item.addr;
  endgroup : cg1

```

have used with clause for bins filtering but simulator is throwing error and warnings,  
i am confused can anyone help,

```auto
Error: ** while parsing file included at testbench.sv(74)
** at coverage.sv(31): the specification of 'with' expr in bin 'incr4_trans' is not allowed.
**Error:** while parsing file included at testbench.sv(74)
** at coverage.sv(35): the specification of 'with' expr in bin 'trans' is not allowed.
**Warning:** while parsing file included at testbench.sv(74)
** at coverage.sv(43): (vlog-13185) Unexpected constant with_expr in bin 'ctrl' of Coverpoint apb_data.
**Warning:** while parsing file included at testbench.sv(74)
** at coverage.sv(44): (vlog-13185) Unexpected constant with_expr in bin 'start_addr' of Coverpoint apb_data.
**Warning:** while parsing file included at testbench.sv(74)
** at coverage.sv(45): (vlog-13185) Unexpected constant with_expr in bin 'end_addr' of Coverpoint apb_data.
**Warning:** while parsing file included at testbench.sv(74)
** at coverage.sv(28): (vlog-13185) Unexpected constant with_expr in bin 'word' of Coverpoint ahb_size.
End time: 14:28:29 on Feb 06,2024, Elapsed time: 0:00:00
Errors: 2, Warnings: 4

```

---

<div class="post-metadata">

**Author:** ![Mahantha\_Deeksha\_S\_B](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/mahantha_deeksha_s_b/32/1072_2.png) [@Mahantha\_Deeksha\_S\_B](https://verificationacademy.com/forums/u/Mahantha_Deeksha_S_B)\
**Post date:** [February 9, 2024, 8:16am UTC](https://verificationacademy.com/forums/t/coverpoint-bins-with-clause/46097/2 "2024-02-09T08:16:18Z")

</div>

might be because of older sv compilation in simulator

---

<div class="post-metadata">

**Author:** ![Have\_A\_Doubt](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@Have\_A\_Doubt](https://verificationacademy.com/forums/u/Have_A_Doubt)\
**Post date:** [February 10, 2024, 5:18pm UTC](https://verificationacademy.com/forums/t/coverpoint-bins-with-clause/46097/3 "2024-02-10T17:18:45Z")

</div>

> [@Mahantha\_Deeksha\_S\_B](#):
>
> might be because of older sv compilation in simulator

Another way would be to check the error message.

Here’s a hint **" Is with clause legal for transitional bins ? "**

---

<div class="post-metadata">

**Author:** ![Mahantha\_Deeksha\_S\_B](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/mahantha_deeksha_s_b/32/1072_2.png) [@Mahantha\_Deeksha\_S\_B](https://verificationacademy.com/forums/u/Mahantha_Deeksha_S_B)\
**Post date:** [February 13, 2024, 1:14pm UTC](https://verificationacademy.com/forums/t/coverpoint-bins-with-clause/46097/4 "2024-02-13T13:14:58Z")

</div>

Yeah got it,  
thanks,  
With clause is illegal for transition bins.
