Will a UVM class be registered in factory in such scenario?

Hi,

If a UVM class (eg: uvm_sequence) invokes uvm_object_utils and is included in a package. this package is compiled but not imported by any other package. In such scenario, will this UVM class be registered into the factory? why? thanks!

In reply to Frank.Wang:

If a package is not imported anywhere, then the answer should be no. However, there might be differences in behavior by the various simulators.

In reply to Frank.Wang:

It will help to run a quick test in your system to confirm what cgales said: I covered this in our DVCon US advanced UVM Debug tutorial (Slides at: http://www.go2uvm.org/2016/07/advanced-uvm-tutorial-from-dvcon-us-2016-slides-now-available/ See #12 onwards). In your case I would suggest using f.print(.all_types(2)) to ensure you don’t miss any.

Will appreciate if you share your findings here (perhaps without the tool name if you care to suppress that information).

Regards
Srini
www.go2uvm.org

In reply to cgales:

I am meeting the issue that the class is not registered into the library. As I described before, it is compiled but not imported anywhere. Is this behavior defined in LRM or just tool depended behavior? thanks!

In reply to Frank.Wang:

The factory relies on static variable declaration initialization inside your class to populate an array in the UVM package. This static variable is inside the uvm_object_registry class, which gets added by the `uvm_object_utils macro.

The question becomes: ‘If I compile a package, but never import it, does it exist?’ There is a similar question with compiling libraries of modules and only some of them are instantiated. The LRM does not address these issues See 0002511: what constitutes a sufficient reference to a package to cause it to be elaborated into a design? - Accellera Mantis.

Fortunately, most tools have fairly consistent ways of dealing with this.

At one extreme there is the single step compile everything and simulate everything I compiled. At the other extreme there is the separate compile where every file is compiled in separate steps into a work library. Then in simulation, you provide the top level modules and packages you want, then the tools brings in (elaborates) only the design units it needs to run the simulation.

In reply to dave_59:

Thanks Dave for the elaboration!