# Function Coverage: default bins

**URL:** <https://verificationacademy.com/forums/t/function-coverage-default-bins/31730>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, Default-bin, illegal-bins\
**Created:** [April 19, 2016, 9:48am UTC](https://verificationacademy.com/forums/t/function-coverage-default-bins/31730 "2016-04-19T09:48:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prashant.kaushik](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/prashant.kaushik/32/3007_2.png) [@prashant.kaushik](https://verificationacademy.com/forums/u/prashant.kaushik)\
**Post date:** [April 19, 2016, 9:48am UTC](https://verificationacademy.com/forums/t/function-coverage-default-bins/31730/1 "2016-04-19T09:48:03Z")

</div>

Per 1800-1200 SV LRM, page 525 “The default is useful for catching unplanned or invalid values”.

It seems me that as a user whether _values for default bins_ is generated or not, it can be know only after looking coverage report.

Is there any alternate to know about it, i.e could a Error or Warring be reported in log?

[I am aware of that when value defined as \*illegal bins\* is sampled it reports a run time error. Thing is that for illegal bins, need to explicit define value, while for \*default bins\* tool make list of value which are not defined in coverpoint. I see advantage of default over illegal when there are large set of values which should not be generated.]

---

<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:** [April 19, 2016, 3:10pm UTC](https://verificationacademy.com/forums/t/function-coverage-default-bins/31730/2 "2016-04-19T15:10:34Z")

</div>

_In reply to [prashant.kaushik](https://verificationacademy.com/forums/t/function-coverage-default-bins/31730):_

The default bins and illegal bins are meant as debugging aids for the person developing the coverage model. They should not be used as a model checker. You have no control over how the messages get reported or suppressed that you would have with an assertion or a simple if-statement with a uvm\_error message.

That being said, you could use bin expressions to make it easier to express your bin set values.

```verilog
module top;

   bit [2:0] a,b[],c[];
 
   covergroup cg;
      coverpoint a {
	 bins mode1 = {3'b001};
	 bins mode2 = {3'b010};
	 illegal_bins no_b = b;
	 illegal_bins not_c = a with (!(item inside {c}));
      }
   endgroup : cg
   cg cg_h;
   
   initial begin
      b = {3,4};
      c = {1,2,3,4,5,6};
      cg_h = new;
      repeat(8) begin
      	 cg_h.sample();
	 a++;
      end
   end
endmodule : top

```
