# Passing TB/RTL parameters to sequences

**URL:** <https://verificationacademy.com/forums/t/passing-tb-rtl-parameters-to-sequences/38322>\
**Category:** UVM\
**Tags:** UVM, ParameterizedClass, DUT-parameters\
**Created:** [November 9, 2020, 8:42am UTC](https://verificationacademy.com/forums/t/passing-tb-rtl-parameters-to-sequences/38322 "2020-11-09T08:42:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SumanPatra](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@SumanPatra](https://verificationacademy.com/forums/u/SumanPatra)\
**Post date:** [November 9, 2020, 8:42am UTC](https://verificationacademy.com/forums/t/passing-tb-rtl-parameters-to-sequences/38322/1 "2020-11-09T08:42:16Z")

</div>

If the design has N ports and N can be changed as per the product requirement, then how do we get this port information N in the generic sequences that we code to validate such a design. The design uses parameters, which I have in the TB and interface also. In the sequences and other TB components, we need a lot of port-based variable declaration. How do we achieve this passing of a parameter? Or is there any other way to accomplish this?

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [November 9, 2020, 4:39pm UTC](https://verificationacademy.com/forums/t/passing-tb-rtl-parameters-to-sequences/38322/2 "2020-11-09T16:39:15Z")

</div>

_In reply to [Suman Patra](https://verificationacademy.com/forums/t/passing-tb-rtl-parameters-to-sequences/38322):_

If you have a SV design and a SV/UVM testbench it is just easy to solve this problem. You can these parameters to a SV package and import it in the design as well as the testbench. In the testbench you can pass the parameters to the config\_db and retrieve them in any place you need them.  
If you have mixed language situation, i.e. VHDL design and a SV/UVM environment it becomes complicated . Simulators might offer packages to be used in both language worlds.

---

<div class="post-metadata">

**Author:** ![SumanPatra](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@SumanPatra](https://verificationacademy.com/forums/u/SumanPatra)\
**Post date:** [November 13, 2020, 4:33am UTC](https://verificationacademy.com/forums/t/passing-tb-rtl-parameters-to-sequences/38322/3 "2020-11-13T04:33:27Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/passing-tb-rtl-parameters-to-sequences/38322/2):_

I need these parameters to create class variables with array index of N(number of ports). So, the information has to be passed to the class using parameters. How do I use config\_db to serve this purpose?

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [November 14, 2020, 5:39pm UTC](https://verificationacademy.com/forums/t/passing-tb-rtl-parameters-to-sequences/38322/4 "2020-11-14T17:39:39Z")

</div>

_In reply to [Suman Patra](https://verificationacademy.com/forums/t/passing-tb-rtl-parameters-to-sequences/38322/3):_

You could store the parameters in a package and import the package in any place where you need these parameters. This would be the most simple solution.
