Infinite Loop using While

In reply to haykp:

According to me Check following line might be hanging .

@ (negedge ifc.spi_cs );

Once ifc.spi_cs is equal to zero it might come out of while loop but to come out @ (negedge ifc.spi_cs ) it requires ifc.spi_cs to encounter a negedge not level sensitive zero.