Intel® FPGA SDK for OpenCL™: Stratix® V Network Reference Platform Porting Guide

ID 683645
Date 11/06/2017
Document Table of Contents

3.1.6. SG-DMA

The acl_dma_core.qsys file within the OpenCL™ SGDMA Controller IP encapsulates and parameterizes the modular scatter-gather SG-DMA hardware. The board.qsys system instantiates the acl_dma.qsys file within the OpenCL SGDMA Controller IP. For more information on SG-DMA, visit the Modular SG-DMA page on the Altera® Wiki website.


The acl_dma_core.qsys file presents slave ports for the control and status registers (dma_csr) and the descriptors (dma_descriptors). It also provides separate masters for read and write operations. The acl_dma.qsys Platform Designer (Standard) System File adds the following features:

  • An address span extender for non-DMA memory accesses
  • A merged read/write master

The merged read/write master issues constant bursts of size 16, resulting in a 1/16 efficiency degradation from sharing the time interface. However, the bandwidth of this unit exceeds the bandwidth of the PCIe® connection by more than this amount. Therefore, there is no observable host-to-memory bandwidth degradation.


When the MMD receives a request for data transfer, it uses DMA when both of the following conditions are true:

  1. The transfer size is bigger than 1024 bytes.
  2. There are 64-byte alignments with the starting addresses for both the host buffer and the device offset.

Perform the following tasks to carry out a DMA transfer:

  1. Check if there are remaining bytes to be sent.
  2. Unpin the memory from the previous transfer.
  3. Pin the memory for the new transfer.
  4. Set up the Address Translation Tables on the PCIe.
  5. Create and send the DMA descriptor.
  6. Wait until the DMA finishes and then repeat Step 1.
Attention: For the Stratix® V Network Reference Platform, this implementation is in the Linux kernel driver in the <path_to_s5_net>/linux64/driver/aclpci_dma.c file. For Windows systems, the implementation is in the <path_to_s5_net>\source\host\mmd\acl_pcie_dma_windows.cpp file.