Streaming Interfaces - Streaming Interfaces - 2021.2 English - UG1393

Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393)

Document_ID
UG1393
Release_Date
2022-03-29
Version
2021.2 English

If the data is accessed sequentially, a streaming interface can be used to transfer data to and from the device I/O on the target platform without the need to migrate the data through the global memory as an intermediate step. This transfer also occurs directly and without making use of global memory.

Modeling designs that use the streaming paradigm can be difficult in C. The approach of using pointers to perform multiple read and/or write accesses can introduce issues because there are implications for the type qualifier. Vitis HLS provides a C++ template class hls::stream<ap_axis<N>> for modeling streaming data structures. On the hardware, the streaming interface is implemented as an AXI4-Stream interface (axis). The Vitis compiler will infer an AXI4-Stream interface for the hls::stream data type.

Tip: To manually map the streaming data type to the AXI4-Stream interface, you should initially define the streaming data type as hls::stream<ap_axis<N>> and then map this data type to an AXI4-Stream interface using the INTERFACE pragma.

The AXI4-Stream and Vitis HLS has the following signature (defined in ap_axi_sdata.h):

template <typename T, size_t WUser, size_t WId, size_t WDest> struct axis { .. };
 interface is implemented
      as a struct type in 

Where:

  • T is a stream data type
  • WUser interface is implemented is the width of the TUSER signal
  • WId is the width of the TID signal
  • WDest is the width of the TDest signal

When the stream data type (T) are simple integer types, there are two predefined types of AXI4-Stream implementations available:

  • A signed implementation of the AXI4-Stream class:
    hls::axis<ap_int<WData>, WUser, WId, WDest>
  • An unsigned implementation of the AXI4-Stream class:
    hls::axis<ap_uint<WData>, WUser, WId, WDest>

The value specified for the WUser, WId, and WDest template parameters controls the usage of side-channel signals in the AXI4-Stream interface. TVALID, TREADY, and TLAST are necessary control signals for the AXI4-Stream protocol. TKEEP, TSTRB, TUSER, TID, and TDEST signals are special signals that can be used to pass around additional bookkeeping data. For more information, see .