What is the use of super.build() instance in all the blocks? Need a clear answer!

Hi all…
Why is the super.build() is been called in all the blocks, what is the necessity, Can any one please explain it clearly !! Got so much confused!!

Need in help…

Thanks,
Wafer!!!

Hi Wafer,

An OVM component hierarchy is built by components calling the OVM factory (or sometimes just new) to create their child components/ports/etc. This is expected to happen in their build functions.

When you declare a new component by inheriting an existing component, you usually want all of its child components to still get built. To do this, you MUST call super.build(). This call should be in the build function of the derived component, to make sure the hierarchy still gets built at the right point in the simulation.

I usually advise calling super.build() for every component, even if you don’t think its base class contains any child components. If you get into the habit of doing this, it won’t make much difference to the run time of a simulation but it can save a lot of debug time in trying to work out why your environment suddenly stops working when you start modifying components.

Hope that answers your question.

Regards,
Dave

Of course, if the purpose of deriving from an existing component is to define a new hierarchy, then you should not call super.build().

The purpose of having the build() methods in the first place was because you can never override the new() constructor; you can only append to it.

If there is something that you think should never be overridden, I am almost to the point of recommending that you should place it in new() instead of build(). However, I have yet to find a case for that.

Dave Rich

Hello Dave,

When you declare a new component by inheriting an existing component, you usually want all of its child components to still get built. To do this, you MUST call super.build(). This call should be in the build function of the derived component, to make sure the hierarchy still gets built at the right point in the simulation.

So since to get the child component i.e. the components getting extended from the base class should be build properly, so only for that reason we call up the “super.build();” function is it???

Can you still explain me the essence in it deeply, like what actually happens if we call the super.build(); does it help in over-riding any variables or just for properly building of the hierarchy we are calling is it ???

And if we dont call what happens, does OVM by default call the same even if the user doesn’t call it!!!

Thanks for your timely replies!!

if we dont call what happens, does OVM by default call the same even if the user doesn’t call it!!!

Hi wafer,
OVM wont call the super.build() within the build function by itself.

thanks and regards,
Shishira