# Randomizing data in different components and objects

**URL:** <https://verificationacademy.com/forums/t/randomizing-data-in-different-components-and-objects/39919>\
**Category:** UVM\
**Tags:** UVM, randomization, UVM-Component-UVMTemplates-ReferenceDesign-UVMF\
**Created:** [December 28, 2021, 5:13am UTC](https://verificationacademy.com/forums/t/randomizing-data-in-different-components-and-objects/39919 "2021-12-28T05:13:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bachan21](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/bachan21/32/1208_2.png) [@bachan21](https://verificationacademy.com/forums/u/bachan21)\
**Post date:** [December 28, 2021, 5:13am UTC](https://verificationacademy.com/forums/t/randomizing-data-in-different-components-and-objects/39919/1 "2021-12-28T05:13:06Z")

</div>

We usually randomize data in sequence.  
But if we are randomizing a data in multiple components and objects (like sequence, driver, agent, test), then which randomized value will be send to DUT?

---

<div class="post-metadata">

**Author:** ![cgales](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/c/ccd318/32.png) [@cgales](https://verificationacademy.com/forums/u/cgales)\
**Post date:** [December 28, 2021, 1:58pm UTC](https://verificationacademy.com/forums/t/randomizing-data-in-different-components-and-objects/39919/2 "2021-12-28T13:58:34Z")

</div>

_In reply to [bachan21](https://verificationacademy.com/forums/t/randomizing-data-in-different-components-and-objects/39919):_

I’m not sure what you are asking, but as a general rule, you should only be randomizing data in two locations:

- In your test, you should randomize the various configuration objects which control your design behavior. You should also randomize your top-level test sequences.
- In your sequences, you should randomize the various sequences/sequence\_items which generate stimulus

You shouldn’t be randomizing any data in a driver, agent or other components.

---

<div class="post-metadata">

**Author:** ![bachan21](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/bachan21/32/1208_2.png) [@bachan21](https://verificationacademy.com/forums/u/bachan21)\
**Post date:** [December 28, 2021, 2:11pm UTC](https://verificationacademy.com/forums/t/randomizing-data-in-different-components-and-objects/39919/3 "2021-12-28T14:11:46Z")

</div>

_In reply to [cgales](https://verificationacademy.com/forums/t/randomizing-data-in-different-components-and-objects/39919/2):_

Hi cgales,  
This is an experiment to understand the execution flow in UVM  
If I randomize same variable in a sequence item on multiple component which value will take most priority
