# Constraints

**URL:** <https://verificationacademy.com/forums/t/constraints/40310>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, uvm-sv-constraints, constraint-randomization, logic\
**Created:** [April 25, 2022, 5:21pm UTC](https://verificationacademy.com/forums/t/constraints/40310 "2022-04-25T17:21:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![yourcheers](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/y/5f9b8f/32.png) [@yourcheers](https://verificationacademy.com/forums/u/yourcheers)\
**Post date:** [April 25, 2022, 9:25pm UTC](https://verificationacademy.com/forums/t/constraints/40310/2 "2022-04-25T21:25:25Z")

</div>

_In reply to [Shashank Gurijala](https://verificationacademy.com/forums/t/constraints/40310):_

```auto
randc int size;

constraint size_array {array.size() <10;
	array.size == size;
}

```

Declare an integer randc variable and put the constraint to match the array size.

---

_[View the full topic](https://verificationacademy.com/forums/t/constraints/40310)._
