# Randomizing a dynamic array size

**URL:** <https://verificationacademy.com/forums/t/randomizing-a-dynamic-array-size/31103>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, system-verilog-constraints, rand\_mode-dynamic-array, Question\
**Created:** [October 7, 2015, 3:43pm UTC](https://verificationacademy.com/forums/t/randomizing-a-dynamic-array-size/31103 "2015-10-07T15:43:37Z")\
**Posts on this page:** 1\
**Showing post:** 11

<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:** [September 2, 2018, 4:21pm UTC](https://verificationacademy.com/forums/t/randomizing-a-dynamic-array-size/31103/11 "2018-09-02T16:21:56Z")

</div>

_In reply to [h\_g](https://verificationacademy.com/forums/t/randomizing-a-dynamic-array-size/31103/10):_

It wasn’t clear what the original poster wanted to do. You can do this all with one call to randomize() by pre constructing the array, and then the randomization will trim it down to the random array size.

---

_[View the full topic](https://verificationacademy.com/forums/t/randomizing-a-dynamic-array-size/31103)._
