Hi everyone,
I’m trying to understand the design decision behind user-defined phases in UVM.
Most examples (and the built-in UVM phases) implement the custom phase class as a Singleton, for example by using a static get() method and a protected new() constructor.
My questions are:
-
Why does UVM recommend or require user-defined phase classes to be Singleton?
-
What would actually happen if I didn’t implement my custom phase as a Singleton and instead created phase objects using
new()? -
Is there any issue with the phase scheduler, phase state, objections, or schedule graph if multiple instances of the same custom phase exist?
-
Is the Singleton pattern a strict UVM requirement, or is it simply a recommended design pattern?
I’m looking for the reasoning from the UVM architecture and source code perspective (IEEE 1800.2-2020), rather than just “because all examples do it.”
I’d really appreciate explanations based on the UVM scheduler and uvm_domain/uvm_phase implementation.
Thanks!