I have a question on use of while loop in HLS. In my code, I need to wait for 2 streams to go non-full, before writing data to them. So can I write a code similar to one below :
void funct1()
{
while (strm1.full() || strm2.full());
//wait for two streams to go non full
//write some data into them
strm1.write(data1);
strm2.write(data1);
…
}
Also will this code be logically equivalent to following implemented with if(since HLS functions translate into hardware blocks, which execute continuously)
void funct1()
{
if(!strm1.full() && !strm2.full());
strm1.write(data1);
strm2.write(data1);
…
}
Can someone help me in understanding this.
regards,
Mahesh Barve
When I try synthesis with while loop as given above, it gives a warning of infinite loop.
regards,
mahesh barve