Hello Good morning.
I have a class PACKET, defined all fields in it, randomizing the fields.
But I have to pass the object of packet class to another “driver class”.
So i am simply writing my_mailbox.put(obj_packet);
But it is not working and giving me FATAL ERROR : “Illegal unpacked assignment to packed LHS.”
Please provide some solutions.
Thank you.
`include “packet_class.sv”
program program_block();
mailbox mb1;
packet p,p_recv;
initial begin
repeat(12)
begin
mb1=new();
p=new();
p.randomize();
p.disp123();
mb1.put(p);
mb1.get(p_recv);
$display(“**********OBJECT is %p”,p);
end #100;
end
endprogram
Please provide some solutions and suggestions if there is some mistake in it.
Thank you.