Hard Processor System Technical Reference Manual: Agilex™ 5 SoCs

ID 814346
Date 7/19/2024
Public
Document Table of Contents

5.1.6.3.1. Descriptor Structure

The EMAC supports the ring structure for DMA descriptor as shown below:
Figure 56. Descriptor Ring Structure
In the ring structure, descriptors are separated by the word, dword, or lword number programmed in the DSL field of the DMA_CH(#i)_Control register. The application needs to program the total ring length, that is, the total number of descriptors in ring span in the following registers of a DMA channel:
  • Transmit descriptor ring length register (DMA_CH(#i)_Tx_Control2)
  • Receive descriptor ring length register (DMA_CH(#i)_Rx_Control2)
The descriptor tail pointer register contains the pointer to the descriptor address (i). The descriptors up to one location less than the one indicated by the descriptor tail pointer (i – 1) are owned by the DMA. The DMA continues to process the descriptors until the following condition occurs:
  • Current descriptor pointer = descriptor tail pointer

The DMA goes into the suspend mode when this condition occurs. The application must perform a write to the descriptor tail pointer register and increase the offset so that the following condition is true:

  • Current descriptor < pointer descriptor tail pointer
The DMA automatically wraps around the base address when the last descriptor in the ring is processed, as shown in the following figure:
Figure 57. DMA Descriptor Ring

For descriptors owned by the application, the OWN bit of TDES3 and RDES3 fields are reset to 0. For descriptors owned by the DMA, the OWN bit is set to 1. If the application has only two descriptors in the beginning, the application sets the last descriptor address (tail pointer) to descriptor base address + 1. The DMA processes the first descriptor and then waits for the application to advance and change the tail pointer back to the descriptor base address.