FIFOs

class nifpga.session._FIFO(session, nifpga, bitfile_fifo)[source]

Bases: object

_FIFO is a private class that is a wrapper for the logic that associated with a FIFO.

All FIFOs will exists in a sessions session.fifos property. This means that all possible FIFOs for a given session are created during session initialization; a user should never need to create a new instance of this class.

configure(requested_depth)[source]

Specifies the depth of the host memory part of the DMA FIFO.

Parameters:requested_depth (int) – The depth of the host memory part of the DMA FIFO in number of elements.
Returns:The actual number of elements in the host memory part of the DMA FIFO, which may be more than the requested number.
Return type:actual_depth (int)
datatype

Property of a Fifo that contains its datatype.

get_peer_to_peer_endpoint()[source]

Gets an endpoint reference to a peer-to-peer FIFO.

name

Property of a Fifo that contains its name.

read(number_of_elements, timeout_ms=0)[source]

Read the specified number of elements from the FIFO.

Note

If the FIFO has not been started before calling _FIFO.read(), then it will automatically start and continue to work as expected.

Parameters:
  • number_of_elements (int) – The number of elements to read from the FIFO.
  • timeout_ms (int) – The timeout to wait in milliseconds.
Returns:

ReadValues (namedtuple):

ReadValues.data (list): containing the data from
    the FIFO.
ReadValues.elements_remaining (int): The amount of elements
    remaining in the FIFO.

start()[source]

Starts the FIFO.

stop()[source]

Stops the FIFO.

write(data, timeout_ms=0)[source]

Writes the specified data to the FIFO.

Note

If the FIFO has not been started before calling _FIFO.write(), then it will automatically start and continue to work as expected.

Parameters:
  • data (list) – Data to be written to the FIFO.
  • timeout_ms (int) – The timeout to wait in milliseconds.
Returns:

The number of elements remaining in the host memory part of the DMA FIFO.

Return type:

elements_remaining (int)