Jump to content

how to override classes inside a specific class (not a specific instance)


Recommended Posts

Hey,

Is there a way to overide classes within another class?

e.g.

class a_driver extends uvm_driver

endclass

class a_agent extend uvm_agent

a_driver driver ;

endclass

class b_agent extend uvm_agent

a_driver driver ;

endclass

class b_driver extends a_driver

endclass

and I want to use b_driver instead of a_driver ONLY in b_agent classes.

Link to comment
Share on other sites

If you know the instance names of all b_agent classes, you can override it using the factory.

If you don't know the instance names, you need to create a new "bb_agent" that overrides its driver type to use b_driver using the factory before calling super.build_phase(), then do an override-by-type of b_agent with bb_agent.

Edited by janick
Link to comment
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.

×
×
  • Create New...