Tuesday 2 February 2016

create() vs new() in UVM



Create() is a factory method which construct an object. To override an object you need to construct it using create(). if you use set_type_override before run then,factory replaces constructed object with derived object( specified in override).
if you use new() then you can’t override. 

You should always use create() rather than using new() for classes registered with the factory.

Example:
Coming soon...

5 comments:

  1. sir send me assertion examples amank140893@gmail.com

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. Hi Roy can you please send me asseration examples subhan26@yahoo.com

      Delete
  2. Your website is really cool and this is a great inspiring article. Thank you so much. www.verifications.io

    ReplyDelete