# Cover data increment/decrement/doesn't changed with transition statement

**URL:** <https://verificationacademy.com/forums/t/cover-data-increment-decrement-doesnt-changed-with-transition-statement/41278>\
**Category:** Coverage\
**Tags:** System-Verilog, Coverage\
**Created:** [February 15, 2023, 12:50pm UTC](https://verificationacademy.com/forums/t/cover-data-increment-decrement-doesnt-changed-with-transition-statement/41278 "2023-02-15T12:50:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rraa](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/53a042/32.png) [@rraa](https://verificationacademy.com/forums/u/rraa)\
**Post date:** [February 15, 2023, 12:50pm UTC](https://verificationacademy.com/forums/t/cover-data-increment-decrement-doesnt-changed-with-transition-statement/41278/1 "2023-02-15T12:50:00Z")

</div>

Hello,

is there a way to cover signal value increment/decrement/doesn’t changed with no declaring of prev\_sig for each signal?

The simple way I know to cover data wasn’t changed is to save the data after sampling and to hit the coverpoint when current sample value is equal to previous data we saved.

Is there other way to do it?  
It is like transition coverage but with no fix value.

Thanks,

---

<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:** [February 16, 2023, 12:34am UTC](https://verificationacademy.com/forums/t/cover-data-increment-decrement-doesnt-changed-with-transition-statement/41278/2 "2023-02-16T00:34:53Z")

</div>

_In reply to [rraa](https://verificationacademy.com/forums/t/cover-data-increment-decrement-doesnt-changed-with-transition-statement/41278):_

Transitions in coverpoints is limited. You can use the $past() sampling function to make it a little easier so you don’t have to declare a separate variable.

```verilog
covergroup inc_cg @(posedge clk);
inc_cp: coverpoint signal==$past(signal,,,@(posedge clk)+1 {
   bins T = {1};
}

```

It’s slightly easier using a cover directive

```verilog
cover property (@(posedge clk) signal == $past(signal)+1;);

```

---

<div class="post-metadata">

**Author:** ![rraa](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/53a042/32.png) [@rraa](https://verificationacademy.com/forums/u/rraa)\
**Post date:** [February 16, 2023, 7:57am UTC](https://verificationacademy.com/forums/t/cover-data-increment-decrement-doesnt-changed-with-transition-statement/41278/3 "2023-02-16T07:57:48Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/cover-data-increment-decrement-doesnt-changed-with-transition-statement/41278/2):_

Thanks for the fast response.

cover directive is unable in my case.

Your answer directed me to the right solution for me.
