Are class object handles always passed by reference when used are class method arguments?
Or does one need to qualify the formal argument as ref, or perhaps inout?
Concrete example I am working on: I have class function
function int to_gp(uvm_tlm_generic_payload gp)
which maps my (transaction) class attributes to generic payload.
I will generally want to call super.to_gp(gp) where my class extends from some base class that already implements to_gp for its base class attributes.
Let’s assume I do a gp = new in the to_gp function of that base class, then set the gp object’s data and data_length etc. I would now expect that in the derived class the new gp object survives the supr.to_gp call so that I can access its data and other contents. But I get a null object access.
I have tried with ref but run into some issues from which I have yet to conclude what;s going on, and I am just trying now inout but that seems counter intuitive.
I am firing off this question since I actually would like to know from an expert - I did not readily find an answer in the LRM.
Thanks - Hans