# Application of Factory Overrides

**URL:** <https://verificationacademy.com/forums/t/application-of-factory-overrides/38928>\
**Category:** UVM\
**Tags:** UVM, Application-of-Factory-Overrides\
**Created:** [April 1, 2021, 6:14pm UTC](https://verificationacademy.com/forums/t/application-of-factory-overrides/38928 "2021-04-01T18:14:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Have\_A\_Doubt](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@Have\_A\_Doubt](https://verificationacademy.com/forums/u/Have_A_Doubt)\
**Post date:** [April 1, 2021, 6:14pm UTC](https://verificationacademy.com/forums/t/application-of-factory-overrides/38928/1 "2021-04-01T18:14:27Z")

</div>

Recently I have been referring to Cookbook and other websites for Factory Override

Although they all explain the syntax and various ways to Override , I am not sure when should I actually be using it in a real world project .

I have thought of a few application of Sequence N Sequence Item Overrides .

(1) Consider the Top - Level Sequence started from a test . It would contain many sub-sequences .  
So via Sequence Override I could override any of the sub-sequence for error injection scenarios

```
   This is one application of Sequence Override .

```

(2) Although Overriding sequence item would Need $cast in driver , this can be bypassed by calling methods on the item fetched  
The Overridden sequence item would override the methods of base class , so I can get away without modifying the driver .

```
   This is an application of Sequence Item .

```

\*\*However I am confused when would I need to override a Component ?

Can it ever have an application for coverage component ?

Any more practical application of Sequence / Sequence Item / Component Override ?\*\*

---

<div class="post-metadata">

**Author:** ![tfitz](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/tfitz/32/3025_2.png) [@tfitz](https://verificationacademy.com/forums/u/tfitz)\
**Post date:** [April 1, 2021, 6:28pm UTC](https://verificationacademy.com/forums/t/application-of-factory-overrides/38928/2 "2021-04-01T18:28:00Z")

</div>

_In reply to [Have\_A\_Doubt](https://verificationacademy.com/forums/t/application-of-factory-overrides/38928):_

You are correct that you might override a component to replace one coverage collector with another. Usually this will be done in conjunction with overriding a sequence so that you collect coverage appropriate for the sequence(s) you’re now running. You might also override your scoreboard for similar reasons.

Overriding a driver to match an overridden sequence\_item type is also a good idea.

You may also find it easier to override a uvm\_env, which would allow you to make multiple changes without having to override multiple types via the factory.
