# \#unique-array

**URL:** https://verificationacademy.com/forums/tag/unique-array/8086.md

[Latest](https://verificationacademy.com/forums/latest.md) · [Categories](https://verificationacademy.com/forums/categories.md) · [Tags](https://verificationacademy.com/forums/tags.md)

---

## [Write constraint for an integer array with 10 elements such that exactly 3 of them are same and rest are unique](https://verificationacademy.com/forums/t/write-constraint-for-an-integer-array-with-10-elements-such-that-exactly-3-of-them-are-same-and-rest-are-unique/40056)

<div class="topic-metadata">

**Author:** [@dve12](https://verificationacademy.com/forums/u/dve12)\
**Replies:** 9\
**Last updated:** [November 20, 2024, 11:35pm UTC](https://verificationacademy.com/forums/t/write-constraint-for-an-integer-array-with-10-elements-such-that-exactly-3-of-them-are-same-and-rest-are-unique/40056 "2024-11-20T23:35:33Z")

</div>

module abc; class aa; rand int unsigned val\[10\]; rand int unsigned r\_index1,r\_index2,r\_index3; constraint s1 { r\_index1 inside {\[0:9\]}; r\_index2 inside {\[0:9\]}; r\_index3 inside {\[0:9…

---

## [Generate unique elements without unique](https://verificationacademy.com/forums/t/generate-unique-elements-without-unique/42646)

<div class="topic-metadata">

**Author:** [@Mahesh\_6](https://verificationacademy.com/forums/u/Mahesh_6)\
**Replies:** 1\
**Last updated:** [November 4, 2023, 10:52am UTC](https://verificationacademy.com/forums/t/generate-unique-elements-without-unique/42646 "2023-11-04T10:52:27Z")

</div>

HI All, I went through paper “The Top Most Common SystemVerilog Constrained Random Gotchas”, (page 24) found the following code for unique numbers; module p1; class dummy\_c; randc bit \[31:0\] val; endclass class tran…
