ovm_object_wrapper

4 posts / 0 new
Last post
manishp.p18
Offline
Academy Forum User
Joined: 03/26/2012
Posts: 27
ovm_object_wrapper

Can someone tell me where exactly is ovm_object_wrapper defined.
I am seeing that it is being used to create factory objects in one of the code examples.

mperyer
Offline
Verification Forum Moderator
Joined: 07/24/2010
Posts: 146
Re: ovm_object_wrapper

It's in $OVM_HOME/src/base/ovm_factory.svh

It is also documented in the html documentation.

manishp.p18
Offline
Academy Forum User
Joined: 03/26/2012
Posts: 27
Re: ovm_object_wrapper

Few questions related to factory -

The override uses get_type in the wrapper class to replace one class with another.
For example -

Quote:
family_base::type_id::set_override(B::type_id::get_type());

What exactly does get_type do?
What does type here really mean?

I looked through the wrapper class in the cookbook and only thing I could make out is that this really returns the handle to the specialized wrapper class.

Can anyone kindly clarify?

Probably a very generic question. In the context of classes, is there a specific meaning one can attach to type of an object.
Does the language inherently support anything called class/object type?

Thanks in advance

dave_59
Offline
Verification Forum Moderator
Joined: 03/10/2010
Posts: 976
Re: ovm_object_wrapper

The ovm_object_wrapper is what's known as a proxy class. This is an object-oriented programming pattern and you use it to represent a class type without actually creating an object of that type. You can read more about it in a DVCon paper that I co-authored a few years ago.

__________________

Dave Rich
Mentor Graphics
http://go.mentor.com/drich