| Login | | Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name. | |
| Who's Online | There are currently, 59 guest(s) and 1 member(s) that are online.
You are Anonymous user. You can register for free by clicking here | |
 | |
|
Verification Guild: Forums |
|
| View previous topic :: View next topic |
| Author |
Message |
spartanthewarrior Senior


Joined: Aug 15, 2009 Posts: 32
|
Posted: Fri Mar 09, 2012 2:21 am Post subject: Application Of Virtual Functions |
|
|
Hi All,
Can anybody explain me practical application of Virtual Functions in (Functional Verification). |
|
| Back to top |
|
 |
Hans Senior


Joined: Dec 17, 2003 Posts: 50 Location: Ottawa, Ontario, Canada
|
Posted: Sun Mar 11, 2012 5:44 am Post subject: |
|
|
Hi "Warrior",
This is a loaded topic, including your related posting on polymorphism.
Virtual functions, or more generally virtual methods (including functions and tasks), are used in effect to enable polymorphism. This is the polymorphic (or "multiple forms" or varying) behavior you get when executing a task/function of some class (class A) when an object handle (or pointer) of that class has actually been assigned to an object of a derived class (class B extends A) which overrides the behavior of given task/function. And this is great for reuse, because now the context that executes the task/function does not need to know about the 'B' extension.
So in verification, picture a testbench that knows about class A and its methods, with certain 'default' behavior, and then various tests on top of that testbench that each override the behavior of the (virtual) methods of A to alter/customize/extend that behavior according to its specific needs. So one testbench that fits may different tests.
Now I realize this is a mouth full. There maybe some who can explain to you in a sentence or two in simpler terms what this is, and let's await their responses. Meanwhile I suggest you pick up a good introductory book on Object Oriented Programming, and there are even a few SystemVerilog books out there that cover this topic specifically in the context of Verification (Chris Spear's book comes to mind first).
Regards - Hans |
|
| Back to top |
|
 |
spartanthewarrior Senior


Joined: Aug 15, 2009 Posts: 32
|
Posted: Sun Mar 11, 2012 6:51 am Post subject: |
|
|
Thanks for the reply, I want to understand real-time practical scenarios in verifications, where we have declared functions virtual and have over-ride there functionality in Child-Class.
I have given example like (CRC) generation, I will be thankful if some-body can give few more examples. |
|
| Back to top |
|
 |
dave_59 Senior


Joined: Jun 22, 2004 Posts: 974 Location: Fremont, CA
|
Posted: Mon Mar 12, 2012 5:09 pm Post subject: |
|
|
| There are lots of examples. See the the copy, pack, unpack, compare methods from any verification methodology. |
|
| Back to top |
|
 |
pavanshanbhag Senior


Joined: Mar 25, 2009 Posts: 380 Location: Bangalore, India
|
Posted: Wed Mar 14, 2012 8:06 am Post subject: Re: Application Of Virtual Functions |
|
|
| spartanthewarrior wrote: | Hi All,
Can anybody explain me practical application of Virtual Functions in (Functional Verification). |
You can a lot of usefull information regarding your doubt on :
http://www.doulos.com/knowhow/sysverilog/tutorial/classes/ _________________ -Pavan K Shanbhag
“The difference between genius and stupidity, genius knows his limits.” - Albert Einstein |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|