Data-Driven TLP - Data-Driven TLP - WP554

Vitis HLS: High-Performance Design Using Task-level Parallelism (WP554)

Document_ID
WP554
Release_Date
2023-08-23
Revision
v1.0 English
  • Users explicitly define task level parallelism using hls::tasks.
  • Each task executes independently based on the availability of streaming input data.
void diamond(hls::stream<data_t> &vecIn,
hls::stream<data_t> &vecOut) {

hls::stream<data_t> c1,c2,c3,c4;

 hls_thread_local hls::task taskA(funcA,vecIn, c1, c2);

 hls_thread_local hls::task taskB(funcB,c1,c3);

 hls_thread_local hls::task taskC(funcC,c2,c4);

 hls_thread_local hls::task taskD(funcD,c3,c4,vecOut);

}

 void funcA(hls::stream<data_t> &in,

       hls::stream<data_t> &out1

       hls::stream<data_t> &out2)

  data_t t = in.read();

  out1.write(t);

  out2.write(t);

}

The code example illustrates the concept of data-driven parallelism. As you can see, a key difference between control-driven and data-driven TLP is that in the latter case, tasks are explicitly dictated by the user. With the absence of control signals, each task can be thought of as an infinite loop. Because there are no control signals, the data-driven tasks require streaming interfaces to indicate when the channel contains data, and thus, when the task can run.

Data-driven TLP is useful for purely streaming designs like video processing or network packet processing, where tasks can exhibit parallelism and require user control for designs involving feedback.

It is important to see that control driven and data driven TLP are not mutually exclusive concepts. They will commonly be used in different parts of the same project.