# How do I use set\_inst\_override\_by\_type to an instance whose class has many children?

**URL:** <https://verificationacademy.com/forums/t/how-do-i-use-set-inst-override-by-type-to-an-instance-whose-class-has-many-children/32774>\
**Category:** UVM\
**Tags:** uvm\_set\_inst\_override, UVM, child-class, systemverilog-Arrays\
**Created:** [January 24, 2017, 1:36am UTC](https://verificationacademy.com/forums/t/how-do-i-use-set-inst-override-by-type-to-an-instance-whose-class-has-many-children/32774 "2017-01-24T01:36:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [January 24, 2017, 7:23pm UTC](https://verificationacademy.com/forums/t/how-do-i-use-set-inst-override-by-type-to-an-instance-whose-class-has-many-children/32774/4 "2017-01-24T19:23:24Z")

</div>

_In reply to [Varunshivashankar](https://verificationacademy.com/forums/t/how-do-i-use-set-inst-override-by-type-to-an-instance-whose-class-has-many-children/32774/3):_

Several things to help:

1. You should make use of configuration objects and the build\_phase to be more suitable for UVM. This precludes the need to create specialized setup and initialization functions and is more in line with UVM recommendations. All components should be created and configured in the build\_phase.

2. The initialize\_setup() functions don’t have a return type. The function should be declared as void if you don’t need a return value.

3. The initialize\_setup() function needs to be declared as virtual. This will allow the proper use of the override functionality.

---

_[View the full topic](https://verificationacademy.com/forums/t/how-do-i-use-set-inst-override-by-type-to-an-instance-whose-class-has-many-children/32774)._
