Intel® High Level Synthesis Compiler Standard Edition: Reference Manual

ID 683310
Date 12/18/2019
Public
Document Table of Contents

6.4. Loop Concurrency (max_concurrency Pragma)

You can use the max_concurrency pragma to increase or limit the concurrency of a loop in your component. The concurrency of a loop is how many iterations of that loop can be in progress at one time. By default, the Intel® HLS Compiler Standard Edition tries to maximize the concurrency of loops so that your component runs at peak throughput.

To achieve maximum concurrency in loops, sometimes private copies of component memory have to be created to break dependencies on the underlying hardware that prevent the loop from being fully pipelined.

You can see the number of private copies created for you component memories in the High Level Design report (report.html) for your component:
  • In the Details pane of the Loop analysis report as a message that says that the maximum number of simultaneous executions has been limited to N.
  • In the Bank view of your component memory in the Component Memory Viewer, where it graphically shows the number of private copies.
Creating private copies of component memory in this case is not the same as replicating memory in order to increase the number of ports.
If you want to exchange some performance for component memory savings, apply #pragma max_concurrency <N> to the loop. When you apply this pragma, the number of private copies changes and controls the number of iterations entering the loop, as shown in the following example:
#pragma max_concurrency 1
​for (int i = 0; i < N; i++) {
  int arr[M];
  // Doing work on arr
}

You can control the number of private copies created for a component memory accessed withing a loop by using the hls_max_concurrency memory attribute. For details, see hls_max_concurrency Memory Attribute.

You can also control the concurrency of your component by using the hls_max_concurrency component attribute. For more information about the hls_max_concurrency(N) component attribute, see Concurrency Control (hls_max_concurrency Attribute).