# Factory registration

**URL:** <https://verificationacademy.com/forums/t/factory-registration/31855>\
**Category:** UVM\
**Tags:** UVM, factory-registration\
**Created:** [May 24, 2016, 10:39am UTC](https://verificationacademy.com/forums/t/factory-registration/31855 "2016-05-24T10:39:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ridip.mandal](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@ridip.mandal](https://verificationacademy.com/forums/u/ridip.mandal)\
**Post date:** [May 24, 2016, 10:39am UTC](https://verificationacademy.com/forums/t/factory-registration/31855/1 "2016-05-24T10:39:51Z")

</div>

1.I have learnt that it is not necessary to register all component class to factory only test is enough. What if I register all component during verification excution what are the consequence I can face?

1. When I run my verification without doing any optimization I am getting the signal as required but when I do optimization and run my DUT signal are not showing.What is the issue in that?

thanks  
Ridip

---

<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:** [May 24, 2016, 11:01am UTC](https://verificationacademy.com/forums/t/factory-registration/31855/2 "2016-05-24T11:01:57Z")

</div>

_In reply to [ridip.mandal](https://verificationacademy.com/forums/t/factory-registration/31855):_

All UVM components, i.e. units which are building your UVM environment should be registered with the factory and also all transient objects. There are 2 exceptions:  
(1) there is no need to register configuration objects with the factory.  
(2) Components like analysis\_ports, exports, tlm\_fifo need not be registered with the factory. These are components which are not intended to be replaced.

---

<div class="post-metadata">

**Author:** ![rohitk](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/a698b9/32.png) [@rohitk](https://verificationacademy.com/forums/u/rohitk)\
**Post date:** [May 29, 2016, 9:14am UTC](https://verificationacademy.com/forums/t/factory-registration/31855/3 "2016-05-29T09:14:28Z")

</div>

_In reply to [ridip.mandal](https://verificationacademy.com/forums/t/factory-registration/31855/2):_

All uvm objects and components should be registered with factory to get leverage of factory override features, which will help you in writing an reusable env.

Regarding your second point, I have never seen any difference in simulation behavior w.r.t. factory registration. It would help if you can post an example code or trying using same random seed for both runs to rule out any dut issue.

---

<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:** [May 29, 2016, 9:38am UTC](https://verificationacademy.com/forums/t/factory-registration/31855/4 "2016-05-29T09:38:27Z")

</div>

_In reply to [rohitk](https://verificationacademy.com/forums/t/factory-registration/31855/3):_

The second topic is a tool-related topic. Optimization means the simulator is removing all content which is not relevant for him, reducing the amount of code he has to process.  
All simulators allow you to remain the visibility of internal signals even in the optimization mode. Contact your simulator provider to get the right switch for the simulation command.

---

<div class="post-metadata">

**Author:** ![rohitk](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/a698b9/32.png) [@rohitk](https://verificationacademy.com/forums/u/rohitk)\
**Post date:** [May 29, 2016, 12:11pm UTC](https://verificationacademy.com/forums/t/factory-registration/31855/5 "2016-05-29T12:11:29Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/factory-registration/31855/4):_

Thanks for clarification, I was also confused on how factory registration is related to optimization. This needs to be taken up with tool vendor.

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [May 29, 2016, 3:53pm UTC](https://verificationacademy.com/forums/t/factory-registration/31855/6 "2016-05-29T15:53:05Z")

</div>

_In reply to [ridip.mandal](https://verificationacademy.com/forums/t/factory-registration/31855/5):_  
There are no consequences for _registering_ a class definition with the factory other than it limits your constructor to having one argument (name) for classes derived from uvm\_object, and two arguments (name, parent) for classes derived from uvm\_component. There can be performance consequences for _creating_ class objects with the factory if you are going to be creating a lot of objects over time.

You should get in the habit of _registering_ all classes with the factory. You may not have a reason for overriding it now, but at some point, someone will want to do it and they can’t because you did not register it with the factory. An exception to this might be automatically generated classes, like a register model where you know it will not use the factory. An there can be a slight time 0 performance penalty for registration once you start getting into the 10s of thousands of class registrations.

My other suggestion is to get in the habit of always using the factory create() method instead of new() to construct any class derived from uvm\_component or uvm\_sequence\_item that is not defined inside the UVM base class library(uvm\_tlm\_fifo).

---

<div class="post-metadata">

**Author:** ![muneebullashariff](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/d6d6ee/32.png) [@muneebullashariff](https://verificationacademy.com/forums/u/muneebullashariff)\
**Post date:** [May 2, 2020, 11:42pm UTC](https://verificationacademy.com/forums/t/factory-registration/31855/7 "2020-05-02T23:42:27Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/factory-registration/31855/6):_

Hi Dave,

When I checked for the uvm\_heartbeat class in the UVM library, it’s not registered with the factory (I don’t see uvm\_object\_utils). Now I need to extend this class to add custom features. How should I proceed further?

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [May 3, 2020, 2:59pm UTC](https://verificationacademy.com/forums/t/factory-registration/31855/8 "2020-05-03T14:59:01Z")

</div>

_In reply to [muneebullashariff](https://verificationacademy.com/forums/t/factory-registration/31855/7):_

As you noticed, uvm\_heartbeat is not registered with the factory. Also, none of its methods are virtual. So any use of your extended uvm\_heartbeat would have to know about it anyway. So using the factory does not make much sense.

---

<div class="post-metadata">

**Author:** ![muneebullashariff](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/d6d6ee/32.png) [@muneebullashariff](https://verificationacademy.com/forums/u/muneebullashariff)\
**Post date:** [May 4, 2020, 10:32am UTC](https://verificationacademy.com/forums/t/factory-registration/31855/9 "2020-05-04T10:32:34Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/factory-registration/31855/8):_

> _In reply to [muneebullashariff](https://verificationacademy.com/forums/t/factory-registration/31855/8):_  
> As you noticed, uvm\_heartbeat is not registered with the factory. Also, none of its methods are virtual. So any use of your extended uvm\_heartbeat would have to know about it anyway. So using the factory does not make much sense.

Hi Dave,  
Many thanks for your quick response.

Out-of-curiosity, is this the right way of coding? What benefits or drawbacks we would encounter with this?

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [May 4, 2020, 2:23pm UTC](https://verificationacademy.com/forums/t/factory-registration/31855/10 "2020-05-04T14:23:27Z")

</div>

_In reply to [muneebullashariff](https://verificationacademy.com/forums/t/factory-registration/31855/9):_

See [Heartbeat Monitor Vs Watchdog timer | Verification Academy](https://verificationacademy.com/forums/uvm/heartbeat-monitor-vs-watchdog-timer#reply-84799)
