Does a class need to be registered with factory, for its build phase to be called?

If not, then how will it be called?

In reply to peaceos7:

The only class that is required to be registered with the factory are your test classes, since ‘run_test()’ uses the factory to create the required test.

When you create a component, you specify it’s location within the environment hierarchy using the ‘parent’ handle. The uvm scheduler traverses the environment’s hierarchy to call the appropriate phases of the component. If you specify ‘null’ as the parent, then the component will exist outside of the environment’s hierarchy, and none of the component phases will be called.

In reply to cgales:

If you specify ‘null’ as the parent, none of the component phases will be called.

I believe that is incorrect . Example : EDALink

In reply to ABD_91:

Your example uses the factory, so it doesn’t fully represent the question asked. However, if you remove the factory registration and use new() to create your top-level component, it still functions correctly. Not using the factory with your tests requires you to manually create your top-level component, so you lose the flexibility of selecting a test at runtime using the +UVM_TESTNAME option.

You are correct that if you create a component outside of the existing hierarchy (by using ‘null’ as a parent), then the scheduler will call the phases of that component. However, only the phases after the phase that the component was created will be called.

For example, if you create a component with a null parent in the build_phase(), you will need to manually that component’s build_phase(). All subsequent phases will be called by the UVM scheduler.

In reply to ABD_91:

An older discussion that could used as reference for this thread :: buildphase-doesnt-start