# Repetition multiplier when variable

**URL:** <https://verificationacademy.com/forums/t/repetition-multiplier-when-variable/38268>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, constraints\
**Created:** [October 27, 2020, 7:09am UTC](https://verificationacademy.com/forums/t/repetition-multiplier-when-variable/38268 "2020-10-27T07:09:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Verrockon](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/v/c5a1d2/32.png) [@Verrockon](https://verificationacademy.com/forums/u/Verrockon)\
**Post date:** [October 27, 2020, 7:09am UTC](https://verificationacademy.com/forums/t/repetition-multiplier-when-variable/38268/1 "2020-10-27T07:09:34Z")

</div>

Hello I have been trying to generate a concatenated arrays where the Repetition multiplier I take is also generated randomly, now using that randomly generated Repetition multiplier I want to generate another concatenated array. When I try doing that the error is thrown saying “Repetition multiplier must be a constant” .  
As in I generate a randomly and want to concatenate b , a times as follows  
(A (b))  
Is there a way through for this while we are generating something like this constraint.

---

<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:** [October 27, 2020, 2:45pm UTC](https://verificationacademy.com/forums/t/repetition-multiplier-when-variable/38268/2 "2020-10-27T14:45:02Z")

</div>

_In reply to [Ayush\_1](https://verificationacademy.com/forums/t/repetition-multiplier-when-variable/38268):_

Can you clarify your question with some declarations and some examples of results you would like to see? Are the arrays packed or unpacked?

---

<div class="post-metadata">

**Author:** ![Verrockon](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/v/c5a1d2/32.png) [@Verrockon](https://verificationacademy.com/forums/u/Verrockon)\
**Post date:** [November 6, 2020, 9:18am UTC](https://verificationacademy.com/forums/t/repetition-multiplier-when-variable/38268/3 "2020-11-06T09:18:21Z")

</div>

The array is packed as in wanted to generate constraints for  
[0:a-1][b-1:0]array\_1;  
Where a and b also have to be constrained to a value range.

---

<div class="post-metadata">

**Author:** ![shanthi](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/54ee81/32.png) [@shanthi](https://verificationacademy.com/forums/u/shanthi)\
**Post date:** [November 6, 2020, 10:28am UTC](https://verificationacademy.com/forums/t/repetition-multiplier-when-variable/38268/4 "2020-11-06T10:28:31Z")

</div>

The packed dimensions of array i.e., the width of the array should be fixed during compile time only.We can not randomize the packed dimension.

Thanks & Regards,  
Shanthi V A  
[www.maven-silicon.com](http://www.maven-silicon.com)

---

<div class="post-metadata">

**Author:** ![Verrockon](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/v/c5a1d2/32.png) [@Verrockon](https://verificationacademy.com/forums/u/Verrockon)\
**Post date:** [November 11, 2020, 8:48am UTC](https://verificationacademy.com/forums/t/repetition-multiplier-when-variable/38268/5 "2020-11-11T08:48:19Z")

</div>

_In reply to [shanthi](https://verificationacademy.com/forums/t/repetition-multiplier-when-variable/38268/4):_

So we can assume that there is no way to form a packed array whose dimensions are also constrained with a specific range…I doubt this might be possible as there should be a way us in foreach loop somehow we can constrain the dimensions of packed array also. As I have been trying to get to a solution to above problem.
