# Cross\_Coverage\_Related\_Doubts

**URL:** <https://verificationacademy.com/forums/t/cross-coverage-related-doubts/40992>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, System-Verilog, cross-coverage-bins, cross-coverage-bins-constraints, SystemVerilog-FunctionalCoverage\
**Created:** [November 9, 2022, 2:10pm UTC](https://verificationacademy.com/forums/t/cross-coverage-related-doubts/40992 "2022-11-09T14:10:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shubhabrata](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/shubhabrata/32/1644_2.png) [@Shubhabrata](https://verificationacademy.com/forums/u/Shubhabrata)\
**Post date:** [November 9, 2022, 2:10pm UTC](https://verificationacademy.com/forums/t/cross-coverage-related-doubts/40992/1 "2022-11-09T14:10:29Z")

</div>

```verilog

cross a,b {
ignore_bins ignore = binsof(a) intersect{5,[1:3]};
}

```

Do this above code and the following one have any similarities?

```verilog

cross a,b {
bins ignore = ! binsof(a) intersect{5,[1:3]};
}

```

Another doubt is related to the usage of with inside cross coverpoint.

```verilog

cross a,b {
ignore_bins ignore = binsof(a) with (item inside {5,[1:3]});
}

```

Is it valid way of writing the code ?

---

<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 10, 2022, 9:24pm UTC](https://verificationacademy.com/forums/t/cross-coverage-related-doubts/40992/2 "2022-11-10T21:24:54Z")

</div>

_In reply to [Shubhabrata](https://verificationacademy.com/forums/t/cross-coverage-related-doubts/40992):_

It always helps to show the declarations of all identifiers. Assuming:

```verilog
bit [2:0] a,b;
covergroup cg;
  cross a,b;
endmgroup

```

This cross automatically generates 64 bins: \<0,0\>, \<0,1\>, …, \<7,6\>, \<7,7\>

Then each explicit bin either ignores or merges bins from the 64 automatically generated cross nins.

The first code ignores 32 bins: \<5,0\>…\<5,7\>, \<1,0\>…\<3,7\>. That leaves 32 remaining bins

The second code merges the same bins from the first code into a single bin. That leaves 33 remaining bins.

The third code does the same thing as the first code. Both the **with** clause and **inside** operator are later additions to the language and overlaps the functionality of **intersecs**.

---

<div class="post-metadata">

**Author:** ![Shubhabrata](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/shubhabrata/32/1644_2.png) [@Shubhabrata](https://verificationacademy.com/forums/u/Shubhabrata)\
**Post date:** [November 11, 2022, 9:23am UTC](https://verificationacademy.com/forums/t/cross-coverage-related-doubts/40992/3 "2022-11-11T09:23:11Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/cross-coverage-related-doubts/40992/2):_

I am sorry, couldn’t understand one thing.

You said that 2nd one merges the same bins from the first code into a single bin. In that case,  
32 bins should have been left remaining. But you said 33 bins.Could you explain it more, please?

---

<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 11, 2022, 4:20pm UTC](https://verificationacademy.com/forums/t/cross-coverage-related-doubts/40992/4 "2022-11-11T16:20:59Z")

</div>

_In reply to [Shubhabrata](https://verificationacademy.com/forums/t/cross-coverage-related-doubts/40992/3):_

There are 64 automatically bins. 32 are merged into 1 bin, the other 32 are not merged. 1 + 32 = 33.
