Improving Efficiency When Accessing DMA FIFOs (FPGA Module)

LabVIEW 2018 FPGA Module Help

Edition Date: March 2018
Part Number: 371599P-01
View Product Info

DOWNLOAD (Windows Only)

LabVIEW 2016 FPGA Module Help
LabVIEW 2017 FPGA Module Help
LabVIEW 2018 FPGA Module Help
LabVIEW 2019 FPGA Module Help
LabVIEW 2020 FPGA Module Help

To implement traditional DMA FIFOs, LabVIEW uses multiple data copies to move data between LabVIEW and the device driver. These additional data copies consume CPU cycles and limit the size of applications that you can build using DMA FIFOs. For large, resource-intensive applications, consider using an external data value reference to avoid the data copy and reduce CPU overhead.

What to Use

Use the following block diagram objects to execute DMA transfers while incurring fewer data copies:

What to Do

Create the following block diagram to execute DMA transfers while incurring fewer data copies. This block diagram uses the Invoke Method function configured with the Acquire Read Region method to acquire a region to read from the buffer, then passes the reference to the read region through an In Place Element structure. The subVI in the In Place Element structure executes application-specific code. After the subVI executes, the Delete Data Value Reference function releases the region on the buffer.

Customize the gray sections for your programming goals.

The following list describes important details about the previous diagram:

Configure an Invoke Method function. Select either the Acquire Write Region or the Acquire Read Region method, depending on the needs of your application.
Wire the reference to the read or write region to an In Place Element structure configured with Data Value Read/Write nodes.
Include code customized to meet your programming goals.
Delete the data value reference. You must delete the data value reference to make the reserved buffer region accessible again.
Ensure that the VI handles errors in the correct order using a Merge Errors function. You must handle incoming errors from the Invoke Method function before incoming errors from the In Place Element structure.

Tips and Troubleshooting Information

When acquiring a region, Number of Elements and Elements in Region are not necessarily the same. For some targets, the number of bytes allocated in memory is coerced to a value that is valid for the specific target and is a multiple of 4096. For these targets, specify a Number of Elements that is a multiple of 4096 to avoid buffer wrapping. Refer to your target hardware documentation for more information about valid FIFO depths.

If the buffer is unable to acquire a region, the Invoke Method function returns error -61219. In most cases, this error results from failing to delete the data value reference that the Invoke Method function returns. If your application handles specific errors by code, ensure that you check for error -61219.

Related Information

How DMA Transfers Work

Storing Data and Reducing Data Copies with Data Value References


Not Helpful