Altera Home Page
文档资料 许可
在线购买 下载

  主页   |   产品   |   支持   |   最终市场   |   技术中心   |   教育与活动   |   公司介绍   |   在线购买  
  mySupport   |   器件   |   软件   |   IP   |   设计范例   |   参考设计  

 产品
      MAX/MAX II
      Stratix/Stratix GX
      Nios II
  
 功能
      算法
      存储器
      总线及I/O
      逻辑
      接口与外设
      DSP
      通信
      PLL & Clocking
  
 设计输入方法
      Quartus II软件工程
      Tcl
      VHDL
      Verilog HDL
      C Code 范例
      DSP Builder
      TimeQuest
   片内调试
  
 仿真工具
      Mentor Graphics ModelSim
      Cadence NCsim
      Synopsys VCS
  
 旧范例
      图形编辑器
      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).

The use of this design is governed by, and subject to, the terms and conditions of the Altera Hardware Reference Design License Agreement.

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

Design Examples Disclaimer

These design examples may only be used within Altera Corporation devices and remain the property of Altera. They are being provided on an “as-is” basis and as an accommodation; 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

  请填写反馈意见