# How to extend agent with interface with additional signals?

**URL:** <https://verificationacademy.com/forums/t/how-to-extend-agent-with-interface-with-additional-signals/32469>\
**Category:** UVM\
**Tags:** Bus-interface, UVM, agent, extend-agent\
**Created:** [October 30, 2016, 5:48pm UTC](https://verificationacademy.com/forums/t/how-to-extend-agent-with-interface-with-additional-signals/32469 "2016-10-30T17:48:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![drogoff](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/d/edb3f5/32.png) [@drogoff](https://verificationacademy.com/forums/u/drogoff)\
**Post date:** [October 30, 2016, 5:48pm UTC](https://verificationacademy.com/forums/t/how-to-extend-agent-with-interface-with-additional-signals/32469/1 "2016-10-30T17:48:32Z")

</div>

Hi all.

I’m not sure how to use the OOP/UVM methodology of extending classes to extend an agent when adding additional signals to the interface. It’s no problem extending all the agent classes but the SV Interface is not a class so it can’t be extended. I need an enhanced version of an existing interface/agent that has additional sideband signals for higher level handshaking. Is there a clean way to do this? Use generate to switch on and off the additional pins?

Thanks for any suggestions.

David

---

<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:** [October 30, 2016, 6:55pm UTC](https://verificationacademy.com/forums/t/how-to-extend-agent-with-interface-with-additional-signals/32469/2 "2016-10-30T18:55:27Z")

</div>

_In reply to [drogoff](https://verificationacademy.com/forums/t/how-to-extend-agent-with-interface-with-additional-signals/32469):_

If you have a different interface it has to have a different name to differentiate between the 2 interfaces.  
Each agent is related to a certain interface. You have to compile the extended agent with the new interface. It is simply straightforward.

---

<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:** [October 31, 2016, 3:55am UTC](https://verificationacademy.com/forums/t/how-to-extend-agent-with-interface-with-additional-signals/32469/3 "2016-10-31T03:55:28Z")

</div>

_In reply to [drogoff](https://verificationacademy.com/forums/t/how-to-extend-agent-with-interface-with-additional-signals/32469/2):_

The clean way is not to use virtual interfaces and instead use interface or abstract classes to access your interface. See [Is interface mandatory to use? | Verification Academy](https://verificationacademy.com/forums/systemverilog/interface-mandatory-use#reply-44144)

---

<div class="post-metadata">

**Author:** ![drogoff](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/d/edb3f5/32.png) [@drogoff](https://verificationacademy.com/forums/u/drogoff)\
**Post date:** [November 1, 2016, 1:06am UTC](https://verificationacademy.com/forums/t/how-to-extend-agent-with-interface-with-additional-signals/32469/4 "2016-11-01T01:06:23Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/how-to-extend-agent-with-interface-with-additional-signals/32469/3):_

> _In reply to [drogoff](https://verificationacademy.com/forums/t/how-to-extend-agent-with-interface-with-additional-signals/32469/3):_  
> The clean way is not to use virtual interfaces and instead use interface or abstract classes to access your interface. See [Is interface mandatory to use? - SystemVerilog - Verification Academy](https://verificationacademy.com/forums/systemverilog/interface-mandatory-use#reply-44144)

Thanks Dave. I’ve found some online articles that describe this including John Aynsley’s great video ( [https://www.youtube.com/watch?v=etmxjI2GTYA](https://www.youtube.com/watch?v=etmxjI2GTYA) ) - where he credits you with helping come up with this. I’ve only been doing UVM for a few months so this is on the bleeding edge of my understanding. I’ll have to play with the code examples to really see what’s going on. It would be nice not to go through all the headaches of matching the set and gets of parameterized interfaces to include the parameter overrides. As the video points out, it can require modifying many files and tying the environment to particular instances.

David
