# \#randomization-constraints

**URL:** https://verificationacademy.com/forums/tag/randomization-constraints/4367.md

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

---

## [How constraint solver resolves conflicting constraints in dist?](https://verificationacademy.com/forums/t/how-constraint-solver-resolves-conflicting-constraints-in-dist/33578)

<div class="topic-metadata">

**Author:** [@smukerji](https://verificationacademy.com/forums/u/smukerji)\
**Replies:** 3\
**Last updated:** [August 1, 2020, 3:47am UTC](https://verificationacademy.com/forums/t/how-constraint-solver-resolves-conflicting-constraints-in-dist/33578 "2020-08-01T03:47:45Z")

</div>

class Transaction; rand bit read\_write; constraint c1 { read\_write dist {0:= 25, 1:= 75}; } constraint c2 { read\_write dist {0:= 50, 1:= 2}; } function void pre\_randomize(); $display("Entering randomizati…

---

## [Declaring class handle as rand](https://verificationacademy.com/forums/t/declaring-class-handle-as-rand/36599)

<div class="topic-metadata">

**Author:** [@aneels3](https://verificationacademy.com/forums/u/aneels3)\
**Replies:** 7\
**Last updated:** [September 29, 2019, 4:31pm UTC](https://verificationacademy.com/forums/t/declaring-class-handle-as-rand/36599 "2019-09-29T16:31:48Z")

</div>

What happens when we declare class handle as rand type? will it affects the randomization?? I am trying to do sorting using constraint guards. Thanks in Advance!!

---

## [Abstract Classes and constraints?](https://verificationacademy.com/forums/t/abstract-classes-and-constraints/34987)

<div class="topic-metadata">

**Author:** [@Mark\_Curry](https://verificationacademy.com/forums/u/Mark_Curry)\
**Replies:** 9\
**Last updated:** [September 11, 2018, 11:56pm UTC](https://verificationacademy.com/forums/t/abstract-classes-and-constraints/34987 "2018-09-11T23:56:57Z")

</div>

We’ve setup a handy testbench environment based on abstract classes (specifically interface classes). The environment works well - we define our pure abstract class “API”, if you will, with an interface class, then have…

---

## [Randomly distribute ones in a n bit vector](https://verificationacademy.com/forums/t/randomly-distribute-ones-in-a-n-bit-vector/29046)

<div class="topic-metadata">

**Author:** [@sebastian.schmutz](https://verificationacademy.com/forums/u/sebastian.schmutz)\
**Replies:** 8\
**Last updated:** [March 9, 2018, 8:41am UTC](https://verificationacademy.com/forums/t/randomly-distribute-ones-in-a-n-bit-vector/29046 "2018-03-09T08:41:20Z")

</div>

How can I effectively disitribute ones in a n bit vector so that its cross sum matches a given value by using Systemverilog randomization constraints? My current solution is: int temp\_value, temp\_array\[$\]; bit \[n-1…

---

## [Randomization based on seed value](https://verificationacademy.com/forums/t/randomization-based-on-seed-value/32798)

<div class="topic-metadata">

**Author:** [@RajGopal](https://verificationacademy.com/forums/u/RajGopal)\
**Replies:** 1\
**Last updated:** [February 2, 2017, 12:30pm UTC](https://verificationacademy.com/forums/t/randomization-based-on-seed-value/32798 "2017-02-02T12:30:51Z")

</div>

Hello i have a class with random variable which can range between \[1:100\] I have a test-case which when I simulate with seed = 1 randomizes my class properties twice (meaning generating 2 random values for the variable…

---

## [Not able to add constraints from testcase for uvm\_object class](https://verificationacademy.com/forums/t/not-able-to-add-constraints-from-testcase-for-uvm-object-class/31057)

<div class="topic-metadata">

**Author:** [@yashwanth\_madisetty](https://verificationacademy.com/forums/u/yashwanth_madisetty)\
**Replies:** 1\
**Last updated:** [September 23, 2015, 2:17pm UTC](https://verificationacademy.com/forums/t/not-able-to-add-constraints-from-testcase-for-uvm-object-class/31057 "2015-09-23T14:17:54Z")

</div>

Hi All, I have a config class… class config extends uvm\_object; rand int rate; endclass class my\_test extends uvm\_test; config cfg; cfg=new(); constraint bit\_rate\_1{cfg.rate==1;} //This constraint is not working …

---

## [Randomization control](https://verificationacademy.com/forums/t/randomization-control/29067)

<div class="topic-metadata">

**Author:** [@Tudor\_Timi](https://verificationacademy.com/forums/u/Tudor_Timi)\
**Replies:** 5\
**Last updated:** [June 15, 2015, 8:17am UTC](https://verificationacademy.com/forums/t/randomization-control/29067 "2015-06-15T08:17:28Z")

</div>

Hi everyone, I would like to condition the randomization control of a specific field in an SV class based on the value of another field of that class during randomization. Here is a quick example of what I mean: enum {…

---

## [Constraining an array of boolean values](https://verificationacademy.com/forums/t/constraining-an-array-of-boolean-values/29975)

<div class="topic-metadata">

**Author:** [@new\_to\_uvm](https://verificationacademy.com/forums/u/new_to_uvm)\
**Replies:** 2\
**Last updated:** [September 25, 2014, 7:40pm UTC](https://verificationacademy.com/forums/t/constraining-an-array-of-boolean-values/29975 "2014-09-25T19:40:03Z")

</div>

The base class contains the following:- rand boolean\_e foo\[8\]; constraint good\_foo\_c { soft (foreach\[i\]) { foo\[i\] == TRUE; } } The default constraint is that every element of foo is TRUE. How do I relax this cons…

---

## [Best way to randomize from virtual sequence](https://verificationacademy.com/forums/t/best-way-to-randomize-from-virtual-sequence/29553)

<div class="topic-metadata">

**Author:** [@gaurav\_brcm](https://verificationacademy.com/forums/u/gaurav_brcm)\
**Replies:** 8\
**Last updated:** [June 10, 2014, 7:31am UTC](https://verificationacademy.com/forums/t/best-way-to-randomize-from-virtual-sequence/29553 "2014-06-10T07:31:37Z")

</div>

Hi All, I have a basic question related to UVM methodology. I have a virtual sequence , in which there are three child sequences . Child sequences initially has some constraints , but now I want to change it from top …

---

## [Constraints for unique value in registers](https://verificationacademy.com/forums/t/constraints-for-unique-value-in-registers/29174)

<div class="topic-metadata">

**Author:** [@mauliksuthar123](https://verificationacademy.com/forums/u/mauliksuthar123)\
**Replies:** 1\
**Last updated:** [February 19, 2014, 7:44am UTC](https://verificationacademy.com/forums/t/constraints-for-unique-value-in-registers/29174 "2014-02-19T07:44:49Z")

</div>

Hello, I have a situation in which i am having 16 4-bit registers, each registers are randomized on the same time but they shouldnt have the same value all 16 should be different. the constraints which i think should wo…
