Hash Posted March 6, 2013 Report Share Posted March 6, 2013 Hi, Iam new to UVM and trying to understand the concepts. Iam not very sure why we use "create " in UVM when we have the "new" already? Can anyone help me understand the basic difference between the two & why we need "Create" in UVM? -Thanks in advance Hash Quote Link to comment Share on other sites More sharing options...
dave_345 Posted March 7, 2013 Report Share Posted March 7, 2013 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 then before run ,factory replaces constructed object with derived object( specified in override). if you use new() then you cant override. Quote Link to comment Share on other sites More sharing options...
Hash Posted March 7, 2013 Author Report Share Posted March 7, 2013 Thanks Dave_345. If i got it right, the difference between new() & create() is object over riding? Can anyone please help with an example or point to any reference? -Thanks in advance Hash Quote Link to comment Share on other sites More sharing options...
dave_59 Posted March 8, 2013 Report Share Posted March 8, 2013 Here are some UVM examples. https://verificationacademy.com/cookbook/Factory The factory pattern is a common Object-Oriented coding pattern. Do a search for it. Quote Link to comment Share on other sites More sharing options...
Hash Posted March 11, 2013 Author Report Share Posted March 11, 2013 Thanks Dave_59. Got it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.