In reply to Shashank Gurijala:
in $display statement you are using “max”, you should use “I” in put section.
$display(“\ndata sent = %0d at time = %0dns”,mbx,$time);
In get section, you should use a different variable other than the loop iterator (“i”) to save the value from mailbox, lets say “j”.
mbx.get(j);
$display(“\ndata received = %0d at time = %0dns”,j,$time);