Jump to content

do_copy versus 'uvm_field* automation


AWhooley

Recommended Posts

Hi,

The UVM field automation provides an automated way of registering class properties for copying, printing etc. However I also note that there are do_* methods the user can also use to do this. What is the preferred method? Or does it just depend on environemnt complexity where the do_* methods would allow more flexability if/when needed?

Thanks

Alan

Edited by tzar
Correcting OOP terminology
Link to comment
Share on other sites

Hey Alan again,

The do_* methods are hooks that allow you to override the default behavior of basic object operations such as copy, print, etc. The field macros register a class's attributes with the factory to set up these operations. In general, it's easiest to use the field macros in a transaction class (i.e. one derived from uvm_sequence_item) to enable its attributes for copying, printing, comparing, etc. In the same transaction class, you can override any do_* method if you wish to define custom behavior for copying, printing, comparing, etc. I find that field automation for components is useless, since components are not manipulated in the same way transactions are.

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...