DMA Is Implemented Using A DMA Controller
DMA Is Implemented Using A DMA Controller
Introduction Implementing DMA in a computer system Data transfer using DMA controller Internal configuration of a DMA controller Process of DMA transfer DMA transfer modes Modification of the CPU to work with DMA Summary
What is DMA?
Direct Memory Access Assists the movement of data between external memory and internal peripherals with minimal CPU intervention An internal peripheral is assigned to one or more DMA channels. Each channel moves data one direction. It either receives incoming data or transmits outgoing data.
Can move data while ARM executes from Cache Simple Implementation
Good for repetitive data movement
DMA is implemented using a DMA controller DMA controller Acts as slave to processor Receives instructions from processor
Modes of Operation
Fly-by
Data is directly transferred between memory and the peripheral
Memory to Memory
Data is not directly transferred, but buffered in between transfers Data is copied from the source location into a temporary area in the DMA channel, and then written into the destination location.
DMA Request
Peripheral
Add
DMA Grant
Memory
DATA
Peripheral
DATA
Memory
DATA
ADD
Internal Configuration
The DMA controller includes several registers :The DMA Address Register contains the memory address to be used in the data transfer. The CPU treats this signal as one or more output ports. The DMA Count Register, also called Word Count Register, contains the no. of bytes of data to be transferred. Like the DMA address register, it too is treated as an O/P port (with a diff. Address) by the CPU. The DMA Control Register accepts commands from the CPU. It is also treated as an O/P port by the CPU.
If a peripheral device receives data from outside it asserts the request signal to the DMAC. The DMAC transfers the received data from the peripheral device controller to the memory and asserts the acknowledge signal to the peripheral device. When the transfer is completed a flag in the status register of the DMAC will be set and/or the DMA controller sends an interrupt to the CPU.
A transfer can be triggered by sending a software command from the CPU or by asserting of a request signal DREQ. The controller asserts an acknowledge signal DACK as a response on a hardware request.
This chart shows the theoretical (top curve) and measured transfer rate of the DMAC. These transfer rates apply to a 25 MHz system clock. The measured transfer rate is lower than the theoretical transfer rate due to the used memory configuration.
Advantages of DMA
Fast memory transfer of data CPU and DMA run concurrently under cache mode DMA can trigger an interrupt, which frees the CPU from polling the channel
Advantages of DMA
Summary
Computer system performance is improved by direct transfer of data between memory and I/O devices, bypassing the CPU. CPU is free to perform operations that do not use system buses.
Disadvantages of DMA
In case of Burst Mode data transfer, the CPU is rendered inactive for relatively long periods of time.
DMA Controller
Request Acknowledge
Peripheral Device
Conclusions
A DMA controller specification for a SoC has been conceived supporting a list of typical and application-specific features. A sophisticated DMA controller has been designed. The DMA controller has been implemented successfully as a VHDL IP core. The DMA Controller has been integrated together with the LEON-2 IP core in a Xilinx Virtex-II FPGA. The functionality of DMA controller has been tested extensively. The DMAC is suitable for use with High-bandwidth Peripherals. The following CAD tools have been used:
Mentor ModelSim Synplicity Synplify XILINX Foundation ISE 5.1