# Factory override of uvm\_sequence(uvm\_object) in one of the interfaces (agents)

**URL:** <https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831>\
**Category:** UVM\
**Tags:** UVM, uvm-factory-override, uvm\_object\_override\
**Created:** [November 22, 2021, 8:26am UTC](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831 "2021-11-22T08:26:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichaelP](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@MichaelP](https://verificationacademy.com/forums/u/MichaelP)\
**Post date:** [November 22, 2021, 8:26am UTC](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/1 "2021-11-22T08:26:53Z")

</div>

Hi VA,

A DUT has similar 16 interfaces, meaning same uvm\_sequence\_item is wiggled on input pins.  
Is it possible to override and change the behavior of only one of the items?  
For example: I would like to set different delays for IF#0 than for the other IFs.  
Tried using next function: set\_type\_override  
But it override all the sequences.  
Since object does not have a parent, how can this be achieved?

Thanks,  
Michael

---

<div class="post-metadata">

**Author:** ![ABD\_91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/c77e96/32.png) [@ABD\_91](https://verificationacademy.com/forums/u/ABD_91)\
**Post date:** [November 22, 2021, 9:34am UTC](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/2 "2021-11-22T09:34:52Z")

</div>

_In reply to [Michael54](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831):_

Do you want to Override Request Item ( of type extended from uvm\_sequence\_item )  
OR user\_sequence ( of type extended from uvm\_sequence ) ?

If it’s user\_sequence , are these created from test Or as Sub-Sequence ?

It’s best if you could share a small code snippet along with the TB Topology .

Also using set\_inst\_override would be the preferred way .

---

<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 22, 2021, 9:59am UTC](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/3 "2021-11-22T09:59:07Z")

</div>

_In reply to [ABD\_91](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/2):_

Please not set\_inst\_override is restricted to uvm\_components and the sequence does not have a position in the topology of the testbench. You cpuld try to relate the sequence to the sequencer path.  
Why not reate a different test with the extended and the original sequences. Even using the override requires a new test.

---

<div class="post-metadata">

**Author:** ![ABD\_91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/c77e96/32.png) [@ABD\_91](https://verificationacademy.com/forums/u/ABD_91)\
**Post date:** [November 22, 2021, 10:43am UTC](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/4 "2021-11-22T10:43:55Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/3):_

I believe that’s incorrect .  
Here’s a [LINK](https://verificationacademy.com/forums/uvm/uvm-instance-override-not-happening.)

I don’t recollect reading anywhere ::  
**set\_inst\_override is restricted to uvm\_components**

**Could you please elaborate on it .**

I personally have practiced codes ,  
Overriding Sequences and Sequence\_Items using instance override .

---

<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 22, 2021, 11:19am UTC](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/5 "2021-11-22T11:19:16Z")

</div>

_In reply to [ABD\_91](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/4):_

I’m refering to  
A convenience function for uvm\_factory::set\_inst\_override\_by\_name, this method registers a factory override for components created at this level of hierarchy or below.  
In the UVM Reference Manual and the fact a sequence itself does not have position in the topology of the testbench.  
But I said also you might be able to refer to the sequencer the sequence will be executed.

---

<div class="post-metadata">

**Author:** ![MichaelP](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@MichaelP](https://verificationacademy.com/forums/u/MichaelP)\
**Post date:** [November 22, 2021, 11:22am UTC](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/6 "2021-11-22T11:22:58Z")

</div>

_In reply to [ABD\_91](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/5):_

It does not really matter if it is uvm\_sequence or uvm\_sequence\_item, as are both inherited from the uvm\_object.  
Look at the next link of inheritance:  
[https://verificationacademy.com/verification-methodology-reference/uvm/docs\_1.1c/html/files2/sequences-txt.html](https://verificationacademy.com/verification-methodology-reference/uvm/docs_1.1c/html/files2/sequences-txt.html)

I specifically asking how to override a uvm\_object which does not have a position in a testbench as it does not has a parent.

And the function set\_inst\_override is present only under the uvm\_component source code.  
Open the UVM uvm\_object file and look after set\_inst\_override, you won’t find it.

---

<div class="post-metadata">

**Author:** ![MichaelP](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@MichaelP](https://verificationacademy.com/forums/u/MichaelP)\
**Post date:** [November 22, 2021, 11:27am UTC](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/7 "2021-11-22T11:27:00Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/6):_

> _In reply to [ABD\_91](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/6):_  
> Please not set\_inst\_override is restricted to uvm\_components and the sequence does not have a position in the topology of the testbench. You cpuld try to relate the sequence to the sequencer path.  
> Why not reate a different test with the extended and the original sequences. Even using the override requires a new test.

I would like to create stimuli in the same test, in order to define different delays for sequences passing on IF#0, and different delays on other IFs for stress purposes.  
Which factory functions are advised to achieve override of uvm\_objects(and their children)? Since it does not have a test-bench topology path…

---

<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 22, 2021, 12:14pm UTC](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/8 "2021-11-22T12:14:25Z")

</div>

_In reply to [Michael54](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/7):_

Please look here:

> <https://stackoverflow.com/questions/26100386/uvm-set-inst-override-for-a-sequence>

But I did not check if this works.

---

<div class="post-metadata">

**Author:** ![MichaelP](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@MichaelP](https://verificationacademy.com/forums/u/MichaelP)\
**Post date:** [November 22, 2021, 12:45pm UTC](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/9 "2021-11-22T12:45:52Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/8):_

Thanks Christoph,  
I will try to go over the post and the paper Tudor added in the post.  
Will try update the post here with the findings.

---

<div class="post-metadata">

**Author:** ![ABD\_91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/c77e96/32.png) [@ABD\_91](https://verificationacademy.com/forums/u/ABD_91)\
**Post date:** [November 22, 2021, 1:01pm UTC](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/10 "2021-11-22T13:01:09Z")

</div>

_In reply to [Michael54](https://verificationacademy.com/forums/t/factory-override-of-uvm-sequence-uvm-object-in-one-of-the-interfaces-agents/39831/9):_

**class uvm\_object\_registry also defines function set\_inst\_override .**

Assuming that you use macro `uvm\_object\_utils for the Sequence and Sequence\_item  
you would be able to use set\_inst\_override for them .

```verilog

 base_type :: type_id :: set_inst_override ( ext_type :: get_type() , "<STRING_PATH>" ) ;

```

Objects like User\_sequences can be created and started from Test .  
**During create the parent argument can be used as ’ this ’**  
( referring to the test component ) and  
overridden from Test’s build\_phase() using set\_inst\_override with string\_path as

**“uvm\_test\_top.seq\_instance\_name”**
