# How do I constrain data within hierarchy at test level?

**URL:** <https://verificationacademy.com/forums/t/how-do-i-constrain-data-within-hierarchy-at-test-level/38937>\
**Category:** UVM\
**Tags:** UVM, constraints\
**Created:** [April 4, 2021, 3:29am UTC](https://verificationacademy.com/forums/t/how-do-i-constrain-data-within-hierarchy-at-test-level/38937 "2021-04-04T03:29:22Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Dragewood](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/d/dbc845/32.png) [@Dragewood](https://verificationacademy.com/forums/u/Dragewood)\
**Post date:** [April 6, 2021, 3:42am UTC](https://verificationacademy.com/forums/t/how-do-i-constrain-data-within-hierarchy-at-test-level/38937/6 "2021-04-06T03:42:37Z")

</div>

_In reply to [tfitz](https://verificationacademy.com/forums/t/how-do-i-constrain-data-within-hierarchy-at-test-level/38937/5):_

Thanks for the suggestions. I went with the “my\_tr.randomize() with { [list all the constraints] }” approach, such that I can extend a sequence/test pair each time I add a test. This worked. One drawback of this approach is, in the future if I add several tests, and then need to add/modify a constraint in the base sequence, I’ll need to make that same change in every extended sequence.

---

_[View the full topic](https://verificationacademy.com/forums/t/how-do-i-constrain-data-within-hierarchy-at-test-level/38937)._
