3.6.1.12 Dataflow Channel

Syntax
#pragma HLS dataflow_channel variable(<var_name>) type(fifo|shared_buffer|double_buffer) depth(<int>)
Description
Specifies that a variable in a dataflow function should be converted to use a particular channel type.
Parameters
ParameterValueOptionalDefaultDescription
variablestringNo-Variable Name
typefifo|shared_buffer|double_bufferNodouble_bufferChannel type
depthIntegerYes2FIFO depth (only when type is FIFO)
Position
Before the variable declaration.
Examples
FIFO channels are used for a Canny edge detector, since the pixels are processed in sequential order.
void canny(hls::FIFO<unsigned char> &input_fifo,
           hls::FIFO<unsigned char> &output_fifo) {
#pragma HLS function dataflow

#pragma HLS dataflow_channel variable(output_gf) type(fifo)
    unsigned char output_gf [HEIGHT * WIDTH];
#pragma HLS dataflow_channel variable(output_sf) type(fifo)
    unsigned short output_sf [HEIGHT * WIDTH];
#pragma HLS dataflow_channel variable(output_nm) type(fifo)
    unsigned char output_nm [HEIGHT * WIDTH];

    gaussian_filter(input_fifo, output_gf);
    sobel_filter(output_gf, output_sf);
    nonmaximum_suppression(output_sf, output_nm);
    hysteresis_filter(output_nm, output_fifo);
}