Verification Guild
A Community of Verification Professionals

 Create an AccountHome | Calendar | Downloads | FAQ | Links | Site Admin | Your Account  

Login
Nickname

Password

Security Code: Security Code
Type Security Code
BACKWARD

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.

Modules
· Home
· Downloads
· FAQ
· Feedback
· Recommend Us
· Web Links
· Your Account

Advertising

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

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile  ProfileDigest    Log inLog in 

Application Of Virtual Functions

 
Post new topic   Reply to topic    Verification Guild Forum Index -> Main
View previous topic :: View next topic  
Author Message
spartanthewarrior
Senior
Senior


Joined: Aug 15, 2009
Posts: 32

PostPosted: Fri Mar 09, 2012 2:21 am    Post subject: Application Of Virtual Functions Reply with quote

Hi All,

Can anybody explain me practical application of Virtual Functions in (Functional Verification).
Back to top
View user's profile
Hans
Senior
Senior


Joined: Dec 17, 2003
Posts: 50
Location: Ottawa, Ontario, Canada

PostPosted: Sun Mar 11, 2012 5:44 am    Post subject: Reply with quote

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
View user's profile
spartanthewarrior
Senior
Senior


Joined: Aug 15, 2009
Posts: 32

PostPosted: Sun Mar 11, 2012 6:51 am    Post subject: Reply with quote

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
View user's profile
dave_59
Senior
Senior


Joined: Jun 22, 2004
Posts: 974
Location: Fremont, CA

PostPosted: Mon Mar 12, 2012 5:09 pm    Post subject: Reply with quote

There are lots of examples. See the the copy, pack, unpack, compare methods from any verification methodology.
Back to top
View user's profile Send e-mail Visit poster's website
pavanshanbhag
Senior
Senior


Joined: Mar 25, 2009
Posts: 380
Location: Bangalore, India

PostPosted: Wed Mar 14, 2012 8:06 am    Post subject: Re: Application Of Virtual Functions Reply with quote

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
View user's profile Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Verification Guild Forum Index -> Main All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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
Verification Guild © 2006 Janick Bergeron
Web site engine's code is Copyright © 2003 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.443 Seconds