Infinite Loop using While

In reply to raku:

Sorry i also checked that there is @ (posedge ifc.spi_sck ) inside while loop . So this simulator run waits until it gets posedge then after that it immediately checks while loop condition which if equal to 1 at that particular movement then it may hang. so can you check this condition . i think due to this it getting stuck in while loop