#include "xf_utils_hw/axi_to_multi_stream.hpp"
template < int _BurstLen, int _WAxi, typename _TStrm0, typename _TStrm1, typename _TStrm2 > void axiToMultiStream ( ap_uint <_WAxi>* rbuf, hls::stream <_TStrm0>& ostrm0, hls::stream <bool>& e_ostrm0, hls::stream <_TStrm1>& ostrm1, hls::stream <bool>& e_ostrm1, hls::stream <_TStrm2>& ostrm2, hls::stream <bool>& e_ostrm2, const int len [3], const int offset [3] )
Loading multiple categories of data from one AXI master to streams.
Transform AXI transaction into multiple data stream.
This primitive assumes the width of AXI port is multiple of alignment width. When alignment width is less than AXI port width, the AXI port bandwidth will not be fully used.
AXI port width and width of each type are assumed to be multiple of 8. It is assumed that the data width in bits is 8 * sizeof(T)
, and data type can be casted from raw bits of matching width.
This module assumes the data is tightly packed, so that the begining of Type 2 data may be placed in one AXI port row with the end of Type 1 data.
AXI word [ elements of Type 1 ........................................ ]
AXI word [ elements of Type 1 ..... end | begin elements of Type 2 ... ]
AXI word [ elements of Type 2 ........................................ ]
Notice: argument len and offset requires array_partition pragma at its defination loaction
Parameters:
_BurstLen | burst length. |
_WAxi | width of AXI port, must be power of 2 and between 8 to 512. |
_TStrm0 | first stream’s type. |
_TStrm1 | second stream’s type. |
_TStrm2 | third stream’s type. |
rbuf | input AXI master port. |
ostrm0 | output stream of type 0. |
e_ostrm0 | end flag for output stream of type 0. |
ostrm1 | output stream of type 1. |
e_ostrm1 | end flag for output stream of type 1. |
ostrm2 | output stream of type 2. |
e_ostrm2 | end flag for output stream of type 2. |
len | length of data in byte requested for each type. |
offset | offset for each type, in number of bytes. |