Sometimes it is required to have only one object of some classes like configuration classes. For this purpose we create singleton classes.
Only one object is created for a singleton class and whenever we try to create a new object, same object is returned.
System verilog does not provide construct to create a singleton class. But we can create it with some manipulation.
---------------------------------------------------------------------
---------------------------------------------------------------------
uvm_root class defined as a singleton class in UVM source code.
---------------------------------------------------------------------
---------------------------------------------------------------------
Only one object is created for a singleton class and whenever we try to create a new object, same object is returned.
System verilog does not provide construct to create a singleton class. But we can create it with some manipulation.
---------------------------------------------------------------------
---------------------------------------------------------------------
uvm_root class defined as a singleton class in UVM source code.
---------------------------------------------------------------------
---------------------------------------------------------------------
thanks
ReplyDeletethanks
ReplyDeletethank you for your efforts your faithful student
ReplyDeletethanks
ReplyDelete