In a traditional stream to disk application, data is passed from the instrument to disk as shown in Figure 1 below.
Figure 1: Traditional Flow of Data from Hardware Device to Disk
Due to the data copy created by the device driver read function, this approach causes five “hits” to the host memory controller. First, the hardware writes to the DMA buffer allocated by the device driver (1). When the device driver API Read function (FIFO.Read, RFSA Fetch, etc.) is called, the acquired data is read from the DMA buffer (2) written to ADE memory (4). However, in order to write the data to ADE memory, the data must first be read into the CPU cache (3). Finally, when the File I/O API’s write function is called, that data is read from ADE memory (5) in order to be written to disk. Figure 2 below shows the same five operations in the LabVIEW code for streaming FPGA data to disk.
Figure 2: Data Copy in LabVIEW FPGA Interface
In applications with little or no data processing between acquiring data and writing to disk, operations 2,3, and 4, all a cause of the data copy, are unnecessary uses of memory bandwidth. As an example, streaming 200MHz bandwidth of I16 RF IQ data (1GB/s) would use 5GB/s of memory bandwidth. Without the data copy, the same operation would only require 2GB/s of memory bandwidth. Zero-copy access to DMA buffers eliminates the unnecessary data copy.