data.fifo.transpose ≡
Transposing fifo
template < typename T, auto ArraySize, auto ArrayDepth, bool EnqueueBlocking = true, bool DequeueBlocking = true > class fifo §source
A FIFO that accepts rows of type T[ArraySize],
transposes each square group of ArraySize x ArraySize
elements, and returns columns of type T[ArraySize]
Parameters
-
typename TDatatype for each array element
-
auto ArraySizeNumber of elements in input arrays, must be a power of 2.
-
auto ArrayDepthMaximum number of arrays that can be stored, must be a power of 2.
-
bool EnqueueBlocking = true
Block on enqueue if the FIFO is full until an entry frees up. By default this is true. Otherwise, the caller must ensure that the FIFO is not full.
-
bool DequeueBlocking = true
Block on dequeue if the FIFO is empty until an entry arrives. By default, this is true. Otherwise, the caller must ensure that the FIFO is not empty.
Methods
-
fifo::array_t dequeue_and_discard(index_t<ArraySize> discard_column_count) §source
Read one column from FIFO and discard
discard_column_countsubsequent columns from the same square. Block if FIFO is empty andDequeueBlockingis true. -
fifo::array_t dequeue() §source
Read one column from FIFO. Block if FIFO is empty and
DequeueBlockingis true. -
void enqueue_and_discard( fifo::array_t values, index_t<ArraySize> discard_row_count ) §source
-
void enqueue(fifo::array_t values) §source
Write one row into the FIFO. Block if FIFO is full and
EnqueueBlockingis true.
Invariants
-
(0 == (ArraySize & (ArraySize - 1)))
ArraySize must be a power of 2
-
(0 == (ArrayDepth & (ArrayDepth - 1)))
ArrayDepth must be a power of 2