# Exact use case of SystemVerilog virtual functions

**URL:** <https://verificationacademy.com/forums/t/exact-use-case-of-systemverilog-virtual-functions/30401>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, System-Verilog-Virtual-Functions\
**Created:** [February 25, 2015, 1:04pm UTC](https://verificationacademy.com/forums/t/exact-use-case-of-systemverilog-virtual-functions/30401 "2015-02-25T13:04:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Udhayakumar\_Jayavelu](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/u/258eb7/32.png) [@Udhayakumar\_Jayavelu](https://verificationacademy.com/forums/u/Udhayakumar_Jayavelu)\
**Post date:** [February 25, 2015, 1:04pm UTC](https://verificationacademy.com/forums/t/exact-use-case-of-systemverilog-virtual-functions/30401/1 "2015-02-25T13:04:17Z")

</div>

Hi,

I have been able to grasp to an extent the concept of virtual functions in SystemVerilog. It says “If a function is defined virtual, then the run-time decides the function to be called based on the object type referred / pointed to”. But what is the exact use-case or scenario where it will be required in verification? Please do provide me some practical examples that we encounter in our day-to-day work.

Thanks.

---

<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:** [February 25, 2015, 5:56pm UTC](https://verificationacademy.com/forums/t/exact-use-case-of-systemverilog-virtual-functions/30401/2 "2015-02-25T17:56:25Z")

</div>

This is a very basic principle of object oriented programming and there are many online resources available to help you. Try [https://verificationacademy.com/courses/introduction-to-the-uvm](https://verificationacademy.com/courses/introduction-to-the-uvm), specifically the section on object oriented programming.

---

<div class="post-metadata">

**Author:** ![Udhayakumar\_Jayavelu](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/u/258eb7/32.png) [@Udhayakumar\_Jayavelu](https://verificationacademy.com/forums/u/Udhayakumar_Jayavelu)\
**Post date:** [March 6, 2015, 3:47am UTC](https://verificationacademy.com/forums/t/exact-use-case-of-systemverilog-virtual-functions/30401/3 "2015-03-06T03:47:06Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/exact-use-case-of-systemverilog-virtual-functions/30401/2):_

Hello Dave,

Thanks for your help.
