while loop in High Level Synthesis (HLS)

  Kiến thức lập trình

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

New contributor

Mahesh Barve is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT