L1 Data mover

The L1 data mover modules are used to move matrix and vector data between their on-chip storage and the input/output streams of the computation modules. These data movers are intended to be used in conjunction with computation modules to form the HLS implementations for BLAS level 1 and 2 functions. Users can find this usage in uut_top.cpp files of the BLAS function name folders under directory L1/tests.

1. Matrix storage format

The following matrix storage formats are supported by L1 data mover modules.

  • row-based storage in a contiguous array

  • packed storage for symmetric and triangular matrices

  • banded storage for banded matrices

For symmetric, triangular and banded storage, both Up and Lo storage modes are supported. More details about each storage format can be found in xf_blas/L1/matrix_storage.

2. Data mover APIs


sbmSuper2Stream

template  <typename t_DataType, unsigned int t_ParEntries, unsigned int t_ParBlocks = 1>
void sbmSuper2Stream(unsigned int p_n, unsigned int p_k, t_DataType* p_a, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

sbmSuper2Stream function that moves symmetric banded matrix with super diagonals from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

t_ParBlocks

number of t_ParEntries, p_n must be multiple t_ParEntries * t_ParBlocks

p_n

number of rows/cols in a square matrix

p_k

number of superdiagonals

p_a

a p_n x p_n symmetric banded matrix with on-chip column-major storage and corresponding 0 paddings

p_out

output stream, which is row-aligned with 0 paddings along subdiagonals

sbmSub2Stream

template  <typename t_DataType, unsigned int t_ParEntries, unsigned int t_ParBlocks = 1>
void sbmSub2Stream(unsigned int p_n, unsigned int p_k, t_DataType* p_a, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

sbmSub2Stream function that moves symmetric banded matrix with sub diagonals from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

t_ParBlocks

number of t_ParEntries, p_n must be multiple t_ParEntries * t_ParBlocks

p_n

number of rows/cols in a square matrix

p_k

number of subdiagonals

p_a

a p_n x p_n symmetric banded matrix with on-chip column-major storage and corresponding 0 paddings

p_out

output stream, which is row-aligned with 0 paddings along subdiagonals

gbm2Stream

template  <typename t_DataType, unsigned int t_ParEntries, unsigned int t_ParBlocks = 1>
void gbm2Stream(unsigned int p_n, unsigned int p_kl, unsigned int p_ku, t_DataType* p_a, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

gbm2Stream function that moves symmetric banded matrix with from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

t_ParBlocks

number of t_ParEntries, p_n must be multiple t_ParEntries * t_ParBlocks

p_n

number of rows/cols in a square matrix

p_kl

number of subdiagonals

p_ku

number of superdiagonals

p_a

a p_m x p_n symmetric banded matrix with on-chip column-major storage and corresponding 0 paddings

p_out

output stream, which is row-aligned with 0 paddings along subdiagonals

vec2GbMatStream

template  <typename t_DataType, unsigned int t_ParEntries>
void vec2GbMatStream(unsigned int p_n, unsigned int p_kl, unsigned int p_ku, t_DataType* p_x, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

vec2SbMatStream function that moves vector from memory to stream that matches the sbMat2Stream outputs

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

p_n

number of rows/cols in a square matrix

p_ku

number of superdiagonals

p_kl

number of subdiagonals

p_x

vector input

p_out

output stream, which matches the outputs of gbMat2Stream or sbMat2Stream

tbmSuper2Stream

template  <typename t_DataType, unsigned int t_ParEntries, unsigned int t_ParBlocks = 1>
void tbmSuper2Stream(unsigned int p_n, unsigned int p_k, t_DataType* p_a, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

tbmSuper2Stream function that moves triangular banded matrix with super diagonals from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

t_ParBlocks

number of t_ParEntries, p_n must be multiple t_ParEntries * t_ParBlocks

p_n

number of rows/cols in a square matrix

p_k

number of superdiagonals

p_a

a p_n x p_n triangular banded matrix with on-chip column-major storage and corresponding 0 paddings

p_out

output stream, which is row-aligned with 0 paddings along subdiagonals

tbmSub2Stream

template  <typename t_DataType, unsigned int t_ParEntries, unsigned int t_ParBlocks = 1>
void tbmSub2Stream(unsigned int p_n, unsigned int p_k, t_DataType* p_a, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

tbmSub2Stream function that moves triangular banded matrix with sub diagonals from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

t_ParBlocks

number of t_ParEntries, p_n must be multiple t_ParEntries * t_ParBlocks

p_n

number of rows/cols in a square matrix

p_k

number of subdiagonals

p_a

a p_n x p_n triangular banded matrix with on-chip column-major storage and corresponding 0 paddings

p_out

output stream, which is row-aligned with 0 paddings along subdiagonals

vec2TbUpMatStream

template  <typename t_DataType, unsigned int t_ParEntries>
void vec2TbUpMatStream(unsigned int p_n, unsigned int p_k, t_DataType* p_x, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

vec2TbUpMatStream function that moves vector from memory to stream that matches the sbMat2Stream outputs

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

p_n

number of rows/cols in a square matrix

p_k

number of super/sub-diagonals

p_x

vector input

p_out

output stream

vec2TbLoMatStream

template  <typename t_DataType, unsigned int t_ParEntries>
void vec2TbLoMatStream(unsigned int p_n, unsigned int p_k, t_DataType* p_x, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

vec2TbLoMatStream function that moves vector from memory to stream that matches the sbMat2Stream outputs

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

p_n

number of rows/cols in a square matrix

p_k

number of sub-diagonals

p_x

vector input

p_out

output stream

gem2Stream

template  <typename t_DataType, unsigned int t_ParEntries>
void gem2Stream(unsigned int p_m, unsigned int p_n, t_DataType* p_in, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

gem2Stream function that moves row-major matrix from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

p_m

number of rows in a matrix

p_n

number of cols in a matrix

p_in

a p_m x p_n matrix with on-chip row-major storage

p_out

output stream

vec2GemStream

template  <typename t_DataType, unsigned int t_ParEntries>
void vec2GemStream(unsigned int p_m, unsigned int p_n, t_DataType* p_in, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

vec2GemStream function that moves vector from memory to stream that matches the gem2Stream outputs

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

p_m

number of rows in a matrix

p_n

number of cols in a matrix

p_in

vector input

p_out

output stream

symUp2Stream

template  <typename t_DataType, unsigned int t_ParEntries>
void symUp2Stream(unsigned int p_n, t_DataType* p_a, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

symUp2Stream function that moves super-symmetric matrix from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallel processed entries in the matrix

p_n

number of rows/cols in a symmetric matrix

p_a

point to a p_n x p_n symmetric matrix

p_out

output stream

symLo2Stream

template  <typename t_DataType, unsigned int t_ParEntries>
void symLo2Stream(unsigned int p_n, t_DataType* p_a, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

symLo2Stream function that moves sub-symmetric matrix from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallel processed entries in the matrix

p_n

number of rows/cols in a symmetric matrix

p_a

point to a p_n x p_n symmetric matrix

p_out

output stream

spmUp2Stream

template  <typename t_DataType, unsigned int t_ParEntries>
void spmUp2Stream(unsigned int p_n, t_DataType* p_a, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

spmUp2Stream function that moves packed super-symmetric matrix from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallel processed entries in the matrix

p_n

number of rows/cols in a symmetric matrix

p_a

point to a p_n x p_n symmetric matrix

p_out

output stream

spmLo2Stream

template  <typename t_DataType, unsigned int t_ParEntries>
void spmLo2Stream(unsigned int p_n, t_DataType* p_a, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

spmLo2Stream function that moves packed sub-symmetric matrix from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallel processed entries in the matrix

p_n

number of rows/cols in a symmetric matrix

p_a

point to a p_n x p_n symmetric matrix

p_out

output stream

vec2SymStream

template  <typename t_DataType, unsigned int t_ParEntries>
void vec2SymStream(unsigned int p_n, t_DataType* p_x, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

vec2SymStream function that moves vector from memory to stream that matches the symatrix matrix data mover outputs

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

p_n

number of rows/cols in a square matrix

p_x

vector input

p_out

output stream

trmUp2Stream

template  <typename t_DataType, unsigned int t_ParEntries>
void trmUp2Stream(unsigned int p_n, t_DataType* p_a, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

trmUp2Stream function that read the super-triangular matrix from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

the number of parallelly processed entries in the matrix

p_n

number of rows/cols in a symmetric matrix

p_a

memory location of a p_n x p_n symmetric matrix

p_out

the streams of matrix entries

trmLo2Stream

template  <typename t_DataType, unsigned int t_ParEntries>
void trmLo2Stream(unsigned int p_n, t_DataType* p_a, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

trmLo2Stream function that read the sub-tridiagonal matrix with from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

the number of parallelly processed entries in the matrix

p_n

number of rows/cols in a symmetric matrix

p_a

memory location of a p_n x p_n symmetric matrix

p_out

the streams of matrix entries

tpmUp2Stream

template  <typename t_DataType, unsigned int t_ParEntries>
void tpmUp2Stream(unsigned int p_n, t_DataType* p_a, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

tpmUp2Stream function that read the packed super-triangular matrix from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

the number of parallelly processed entries in the matrix

p_n

number of rows/cols in a symmetric matrix

p_a

memory location of a p_n x p_n symmetric matrix

p_out

the streams of matrix entries

tpmLo2Stream

template  <typename t_DataType, unsigned int t_ParEntries>
void tpmLo2Stream(unsigned int p_n, t_DataType* p_a, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

tpmLo2Stream function that read the packed sub-symmetric matrix with from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

the number of parallelly processed entries in the matrix

p_n

number of rows/cols in a symmetric matrix

p_a

memory location of a p_n x p_n symmetric matrix

p_out

the streams of matrix entries

vec2TrmUpStream

template  <typename t_DataType, unsigned int t_ParEntries>
void vec2TrmUpStream(unsigned int p_n, t_DataType* p_x, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

vec2TrmUpStream function that moves vector from memory to stream that matches the trmUp2Stream/tpmUp2Stream outputs

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

p_n

number of rows/cols in a square matrix

p_x

vector input

p_out

output stream

vec2TrmLoStream

template  <typename t_DataType, unsigned int t_ParEntries>
void vec2TrmLoStream(unsigned int p_n, t_DataType* p_x, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

vec2TrmLoStream function that moves vector from memory to stream that matches the trmLo2Stream/tpmLo2Stream outputs

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

p_n

number of rows/cols in a square matrix

p_x

vector input

p_out

output stream

readVec2Stream

template  <typename t_DataType, unsigned int t_ParEntries>
void readVec2Stream(t_DataType* p_in, unsigned int p_n, hls::stream<WideType<t_DataType, t_ParEntries>>& p_out)

readVec2Stream function that moves vector from memory to stream

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

p_n

number of entries in a vectpr

p_in

vector input

p_out

output stream

writeStream2Vec

template  <typename t_DataType, unsigned int t_ParEntries>
void writeStream2Vec(hls::stream<WideType<t_DataType, t_ParEntries>>& p_in, unsigned int p_n, t_DataType* p_out)

writeStream2Vec function that moves vector from stream to vector

Parameters:

t_DataType

the data type of the matrix entries

t_ParEntries

number of parallelly processed entries in the matrix

p_n

number of entries in a vectpr

p_in

vector stream input

p_out

vector output memory