# Constrained input generation in increasing order

**URL:** <https://verificationacademy.com/forums/t/constrained-input-generation-in-increasing-order/36463>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, Constraint-random-verification\
**Created:** [August 27, 2019, 9:09pm UTC](https://verificationacademy.com/forums/t/constrained-input-generation-in-increasing-order/36463 "2019-08-27T21:09:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![geek\_vlsi](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@geek\_vlsi](https://verificationacademy.com/forums/u/geek_vlsi)\
**Post date:** [August 27, 2019, 9:09pm UTC](https://verificationacademy.com/forums/t/constrained-input-generation-in-increasing-order/36463/1 "2019-08-27T21:09:33Z")

</div>

I wish to generate an input in such a way that all possible cases are covered in the form of a ramp. So if it is a 4 bit data, the input to the DUT should be 0000, 0010, 0100, … 1111. Any idea how this can be done?

---

<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:** [August 27, 2019, 10:13pm UTC](https://verificationacademy.com/forums/t/constrained-input-generation-in-increasing-order/36463/2 "2019-08-27T22:13:44Z")

</div>

_In reply to [geek\_vlsi](https://verificationacademy.com/forums/t/constrained-input-generation-in-increasing-order/36463):_

I get that that the next number is 1000, but what comes after that?

---

<div class="post-metadata">

**Author:** ![geek\_vlsi](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@geek\_vlsi](https://verificationacademy.com/forums/u/geek_vlsi)\
**Post date:** [August 27, 2019, 10:20pm UTC](https://verificationacademy.com/forums/t/constrained-input-generation-in-increasing-order/36463/3 "2019-08-27T22:20:08Z")

</div>

It basically needs to cover all cases. In this case 2^4 cases in increasing order (ramp) in order to test the DUT for all possible inputs.

Like:  
0000  
0001  
0010  
0011  
0100  
0101  
0110  
0111  
1000  
1001  
.  
.  
.  
1111

---

<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:** [August 27, 2019, 10:41pm UTC](https://verificationacademy.com/forums/t/constrained-input-generation-in-increasing-order/36463/4 "2019-08-27T22:41:56Z")

</div>

_In reply to [geek\_vlsi](https://verificationacademy.com/forums/t/constrained-input-generation-in-increasing-order/36463/3):_

That’s a different series than in your first post. That’s just a for-loop with a delay (you didn’t specify how often the input should change.

---

<div class="post-metadata">

**Author:** ![geek\_vlsi](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@geek\_vlsi](https://verificationacademy.com/forums/u/geek_vlsi)\
**Post date:** [August 28, 2019, 6:16pm UTC](https://verificationacademy.com/forums/t/constrained-input-generation-in-increasing-order/36463/5 "2019-08-28T18:16:49Z")

</div>

Thank you for your reply. The difficulty is that my testbench is performing another operation ; something of error injection. This module repeats for a few cyles. I want the generator to be a separate module and for every input that is generated for the DUT, I want my error module to alter the data and send it to the DUT.

So basically, input needs to ramp up by 1 ; error module should use this data and iterate over a few cycles by adding errors in different positions; then the input needs to ramp up by 1 again and go back to error module and repeat the same process. I do not know how to implement this.
