Test hanging inside ethernet driver transaction function: while loop

In reply to cgales:

Sry code was missing while(i<=packet_size),

I have updated code.

For eg. if pkt.dvaln_pos = 17, then for first 16 X’fer dval <= 'b1 is driven. After that IF condition is triggered, it enters the while loop drives the dval<='b0; but hangs after that waiting for posedge of clk(clocking block).

If I don’t drive dval<=0 in the if condition, ten same logic/loop works well and completes the test.

I am unable to understand how is driving dval<=0 is hanging test?