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 T
    

    Datatype for each array element

  • auto ArraySize
    

    Number of elements in input arrays, must be a power of 2.

  • auto ArrayDepth
    

    Maximum 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.

Aliases

  • using array_t = T[ArraySize] §source
    

    Input and output array type

Methods

  • fifo::array_t
    dequeue_and_discard(index_t<ArraySize> discard_column_count) §source
    

    Read one column from FIFO and discard discard_column_count subsequent columns from the same square. Block if FIFO is empty and DequeueBlocking is true.

  • fifo::array_t dequeue() §source
    

    Read one column from FIFO. Block if FIFO is empty and DequeueBlocking is true.

  • void
    enqueue_and_discard(
        fifo::array_t values,
        index_t<ArraySize> discard_row_count
        ) §source
    

    Write 1 + discard_row_count rows into the FIFO. Block if FIFO is full and EnqueueBlocking is true.

    Arguments

    • fifo::array_t values
      

      The value of the first row to write into the FIFO.

    • index_t<ArraySize> discard_row_count
      

      The number of additional rows (with undefined content) to write into the FIFO.

  • void enqueue(fifo::array_t values) §source
    

    Write one row into the FIFO. Block if FIFO is full and EnqueueBlocking is true.

Invariants

  • (0 == (ArraySize & (ArraySize - 1)))
    

    ArraySize must be a power of 2

  • (0 == (ArrayDepth & (ArrayDepth - 1)))
    

    ArrayDepth must be a power of 2