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

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,

In reply to rraa:

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.

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

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

In reply to dave_59:

Thanks for the fast response.

cover directive is unable in my case.

Your answer directed me to the right solution for me.