Using the following example, I would like to understand how a singleton object is created.
class singleton;
int len;
static singleton objSingle;
local function new (int len=0);
this.len = len;
endfunction : new
function void print_len ();
$display("Len is = %d", len);
endfunction : print_len
static function singleton create (int len=0);
if (objSingle == null) begin
$display("Object is null creating new object \n");
objSingle = new(len);
end
return objSingle;
endfunction : create
endclass
In the above example, is singleton class created using user defined method like create and not using new?