In reply to Shashank Gurijala:
Hi all! I created a memory for my mailbox mbx in the main module and it’s working fine.
But my mailbx is already in the class and i’ve created memory for my class. So my doubt is, why do we need to allocate memory separatey for both mailbox and the class??
This is the change i’ve made in the main module:
module mailbox_using_inheritance;
initial begin
data h_1 = new();
h_1.mbx = new(); //even though the class is instantiated, the mail box also needs memory.
h_1.op;
end
endmodule