data.fifo.wide_to_narrow

Wide to narrow fifo


template <
    typename T,
    auto ArraySize,
    auto ArrayDepth,
    bool EnqueueBlocking = true,
    bool DequeueBlocking = true
    >
class fifo §source

A FIFO that accepts arrays of inputs, and returns single values

Parameters

  • typename T
    

    Datatype for each entry of the FIFO.

  • 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

Callbacks and Fields

  • const auto ScalarDepth = (ArrayDepth * ArraySize) §source
    

    The number of scalar elements the FIFO can hold

Methods

  • T dequeue_and_discard(index_t<ArraySize> discard_count) §source
    

    Read one entry from FIFO and discard discard_count subsequent entries. Block if FIFO is empty and DequeueBlocking is true.

  • T dequeue() §source
    

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

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

    Write one entry to 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