The object at dereference depth 1 is being used before it was constructed/allocated. Please make sure that the object is allocated before using it

In reply to alexd555:

What about of monitor ? should there be posedge clk ?
Where else ?

All components connected to the virtual interface has to be synchronized with the clk signal.