Intel® High Level Synthesis Compiler Pro Edition: Reference Manual

ID 683349
Date 12/13/2021
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

10. Systems of Tasks

Your component design might contain operations that you want to run asynchronously from the main flow of your component. The Intel® HLS Compiler Pro Edition lets you define these asynchronous activities in task functions. These task functions, along with the component that invokes them, constitute a system of tasks.

The component keyword marks a single function and its subfunctions as a component. Within this component function, directly-called functions are in-lined while functions that use the systems of tasks API calls (ihc::launch and ihc::collect) generate hardware outside the component datapath and behave like an asynchronous call.

The function tagged with the component keyword marks the boundary of a system of tasks. Your external system can interact with all the interfaces that the component exposes.

Implementing your design as a system of tasks instead of a monolithic component can be useful in situations where expressing coarse-grained thread-level parallelism is needed. For example, a system of tasks is useful in the following situations:
  • Improving the performance of operations like executing loops in parallel
  • Reducing FPGA area utilization by sharing an expensive compute block with different parts of your component
Table 23.   Intel® HLS Compiler System of Tasks Summary
Function Description
ihc::launch Marks a function as an Intel® HLS Compiler task for hardware generation, and launches the task function asynchronously.
ihc::collect Synchronizes the completion of the specified task function in the component.
ihc::stream Allows streaming communication between different task functions.
ihc::launch_always_run Launches a task function at component power-on or reset and continuously executes the function.
Recommendation: Use the ihc_hls_set_component_wait_cycle with this function to keep your component and always-run task functions correctly coordinated.
Table 24.   Intel® HLS Compiler Systems of Tasks Streaming Interface Template Summary
Template Object or Parameter Description
ihc::stream Streaming interface to the component or task function.
ihc::buffer Specifies the capacity (in words) of the FIFO buffer on the input data that associates with the stream.
ihc::usesPackets Exposes the startofpacket and endofpacket sideband signals on the stream interface.
Table 25.   Intel® HLS Compiler Streaming Input Interface stream Function APIs
Function API Description
T read() Blocking read call to be used from within the component or task
T read(bool& sop, bool& eop)

Available only if usesPackets<true> is set.

Blocking read with out-of-band startofpacket and endofpacket signals.
T tryRead(bool &success) Non-blocking read call to be used from within the component or task. The success bool is set to true if the read was valid.
T tryRead(bool& success, bool& sop, bool& eop)

Available only if usesPackets<true> is set.

Non-blocking read with out-of-band startofpacket and endofpacket signals.
void write(T data) Blocking write call from the component or task.
void write(T data, bool sop, bool eop)

Available only if usesPackets<true> is set.

Blocking write with out-of-band startofpacket and endofpacket signals.
bool tryWrite(T data) Non-blocking write call from the component or task. The return value represents whether the write was successful.
bool tryWrite(T data, bool sop, bool eop)

Available only if usesPackets<true> is set.

Non-blocking write with out-of-band startofpacket and endofpacket signals.

The return value represents whether the write was successful.