Forum Discussion
Altera_Forum
Honored Contributor
8 years agoThe example you are looking at does NOT create multiple call sites per channel ID since it unrolls the channel ID, and not the data being read from it. In fact, in that example, if the loop is NOT unrolled you will get a compilation failure due to variable channel ID. This has nothing to do with whether the channel call is blocking or non-blocking.
For the sake of clarification, the following is allowed and valid:#pragma unroll
for (int i = 0; i < N; i++)
{
data_in = read_channel_altera(CH_DATA_IN);
} But this is not: #pragma unroll
for (int i = 0; i < N; i++)
{
data_in = read_channel_altera(CH_DATA_IN);
} Note that the newer versions of the compiler (17+) seem to also support multiple call sites per channel, so the second example might now work (I haven't checked), but it will NOT work with older versions (v16.1.2 and below).