Class FileFromHostBuffer

Inheritance Relationships

Base Type

Class Documentation

class FileFromHostBuffer : public FromHostBuffer

FromHost DMA buffer with FLX card emulation. The card is emulated by a separate thread that can copy the data to a file or a fifo.

Public Functions

explicit FileFromHostBuffer(std::shared_ptr<Device> d, std::string &filename, bool fifo)
~FileFromHostBuffer()
virtual void allocate_buffer(size_t size, const std::string &name, bool vmem, bool free_previous_cmem = false) override
Parameters:
  • size -- of the FromHost DMA buffer.

  • name -- of the buffer passed to the CMEM driver.

  • vmem -- allocate the buffer without using the CMEM driver.

  • free_previous_cmem -- claim an unlocked/orphaned CMEM buffer with the same name.

virtual void dma_start_continuous() override
virtual void dma_start_circular_trickle_buffer() override

Here I only need to update where to start reading, also known as the Firmware pointer emulator (emu_fw_ptr). The dimensions of the buffer (pend) do not change, also the pointer that tells until where in the buffer has been written (pc_ptr), is updated after writing with dma_set_write_offset()

inline virtual void set_oneshot_trickle_buffer(size_t config_size) override
virtual bool dma_is_full() override
virtual uint64_t dma_get_read_offset() override
virtual size_t dma_free_bytes() override
Returns:

free space in the FromHost buffer in bytes.

virtual uint64_t dma_get_write_offset() override
virtual uint64_t dma_get_write_ptr() override
virtual void dma_set_write_offset(uint64_t addr) override
virtual void dma_advance_write_ptr(size_t bytes) override