Jump to content
Sign in to follow this  
mramdas

config_db usage: base class versus derived class objects

Recommended Posts

Is it possible to  do a  uvm_config_db::set()  for an  object of derived class type  using the base class handle  and  later do a   uvm_config_db::get()  of same object  using  the derived class handle

 

Since  a base class handle can be used to point to a derived class object and later typecase, I thought this would work, but doesn't seem to be so.

 

Any  help will be appreciated?

 

 

Here is an example

 

class  BaseA ;

endclass

 

class DerivedA extends BaseA

endclass

 

1) Set config_db

DerivedA a1;

a1 =  DerivedA::create()

uvm_config_db#(DerivedA)::set(this, "" ,  "myobj",  a1);

 

 

2) Get config_db

BaseA  a1;

DerivedA a2;

uvm_config_db#(BaseA)::get(this, "" ,  "myobj", a1);

$cast(a2, a1);

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...