Altera Home Page
Literature Licensing
Buy On-Line Download

  Home   |   Products   |   Support   |   End Markets   |   Technology Center   |   Education & Events   |   Corporate   |   Buy On-Line  
  Knowledge Database   |   Devices   |   Design Software   |   Intellectual Property   |   Design Examples   |   mySupport   |   Reference Designs  

 Products
      MAX/MAX II
      Stratix/Stratix GX
      Nios II
  
 Functionality
      Arithmetic
      Memory
      Bus & I/O
      Logic
      Interfaces & Peripherals
      DSP
      Communications
      PLL & Clocking
  
 Design Entry
      Quartus II Project
      Tcl
      VHDL
      Verilog HDL
      C Code Examples
      DSP Builder
      TimeQuest
   On-Chip Debugging
  
 Simulation Tools
      Mentor Graphics ModelSim
      Cadence NCsim
      Synopsys VCS
  
 Legacy Examples
      Graphic Editor
      AHDL
  

Scatter-Gather DMA Design Example

The Scatter-Gather Direct Memory Access (SGDMA) design example illustrates how you can perform data transfers without processor overhead becoming a limiting factor. The SGDMA intellectual property (IP) is available for free in SOPC Builder and allows you to transfer between Avalon® memory-mapped and streaming interfaces. The main difference between the SGDMA and a regular DMA is that multiple transfers are handled by the hardware itself instead of by intervention from a host such as the Nios® II embedded processor. This typically reduces the downtime between transfers to a single clock cycle. Applications that typically benefit from using a SGDMA are networking, audio, and video processing.

The design example performs memory transfers between an external SSRAM memory component and on-chip FIFOs components. Nios II software is provided that demonstrates how to configure the SGDMA and create the necessary descriptor information used by the SGDMA. The design also demonstrates how to use the on-chip FIFO component to perform efficient clock domain crossing.

Download sg-dma.zip (418 KB).

Design Specifications

The design contains the following components:

  • Nios II processor
  • Two SGDMAs
  • Two on-chip FIFOs
  • Tri-state bridge
  • SSRAM
  • JTAG UART
  • Phase-locked loop (PLL)
  • System ID

This design targets the Nios Cyclone® II and Stratix® II restriction of hazardous substances (RoHS) development boards. The Cyclone II design uses an 83-MHz control plane and a 200-MHz data plane. The Stratix II design uses a 100-MHz control plane and a 300-MHz data plane.

Figure 1. Scatter-Gather DMA Design Example

Figure 1. Scatter-Gather DMA Design Example

View Full Size

Notes:

  1. S: Avalon memory-mapped slave port
  2. M: Avalon memory-mapped  Master Port
  3. SRC: Avalon streaming source port
  4. SNK: Avalon streaming sink port

Design Functionality

The Nios II processor coordinates the design by performing the following steps in the order shown:

  1. Allocates memory to store the descriptors (transmit and receive pairs)
  2. Allocates memory to store the data that will be transferred (transmit and receive buffers)
  3. Creates incrementing test data in the transmit buffers and populates the descriptor pairs
  4. Writes the first descriptor pair to the SGDMAs, thereby starting the transfer
  5. Waits until both SGDMAs complete the transfer of all data buffers
  6. Validates that the received data matches what was transferred

All the descriptors and data buffers are stored in external SSRAM. Each data buffer is transmitted through the system interconnect fabric via Avalon memory-mapped and Avalon streaming ports. The SGDMA fetches the data from SSRAM (Avalon memory-mapped port) and transmits the data to the on-chip FIFO component (Avalon streaming port). Avalon streaming ports provide flow control between source and sink pairs, allowing two on-chip FIFO components to transmit data between each other. The second SGDMA performs a similar transfer by reading the contents out of the on-chip FIFO component and sending the data to SSRAM to be later validated.

Design Adaptation

You can use this design example as a reference for any number of applications that require data and control plane segmentation. Instead of placing on-chip FIFO components in the data plane, you can insert any high-speed IP, for example, a video processing block. You can also use the SGDMAs to read and write to many separate interfaces, which is common in channel processing.

Related Links


Feedback

Did this information help you?

If not, please log onto mySupport to file a technical request or enhancement.


These Website Design Examples may be used within Altera Corporation devices only and remain the property of Altera. They are being provided on an "as-is" basis and as an accommodation, and therefore all warranties, representations, or guarantees of any kind (whether express, implied or statutory) including, without limitation, warranties of merchantability, non-infringement, or fitness for a particular purpose, are specifically disclaimed. Altera expressly does not recommend, suggest, or require that these examples be used in combination with any other product not provided by Altera.

 
Scatter-Gather DMA Controller Core

On-chip FIFO Memory Core

Avalon Streaming Interconnect Components

  Please Give Us Feedback