DMA, how devices connect to each other and to RAM

The Boss

PC

DMA, how devices connect to each other and to RAM

connect, devices, DMA, RAM

In the early days of home computing, DMA drives didn’t exist, so when devices needed to communicate with RAM, they did so in two different ways:

  • Some processors had a HALT pin which, upon receiving a signal, stopped its activity only to retrieve it at the same point later.
  • There have been instances where RAM access has been sandwiched between the processor and peripherals.

This is why it was necessary to add direct memory access controllers or DMA, in order to facilitate the work during the data transmission.

How a DMA Unit Works

DMA diagram

The operation of a DMA unit is as follows:

  1. A memory address is specified at the source
  2. The amount of data to be transmitted is specified
  3. A memory address is specified as the destination.
  4. Data is transferred from one memory to another.

DMA units are mainly used to give peripherals access to system RAMmy, but They are also used to transmit data from system RAM to local RAMs of different devices such as VRAM. They do this without any processor having to transfer data from one memory to another, allowing you to focus on other tasks.

Communication channels

DMA channels

A DMA controller can have several different channels, That is why you can search to make several simultaneous shipments with different origins and destinations. It’s more, DMA channels are used to directly communicate a processor with its coprocessors, not just to access memory.

AMD Smart Access Memory

For example. The resizable PCI Express bar, on which AMD’s Smart Access memory relies, is made possible by a DMA unit communicating the CPU directly with the VRAM.

This is also the case with dual graphics cards, either with two chips on the same card or on two different cards, where AMD’s Crossfire and NVIDIA SLI interfaces are always DMA units connected to each other. other.

Operating modes of a DMA unit

DMA paths

Keep in mind that a DMA player can work in one of the following ways, with both or all three at the same time, it will depend on how it is designed for data transfer.

  • Modo Burst: In this mode, the DMA unit sends an interrupt that paralyzes the use of memory by the processor, which stops until the DMA unit has completed the transfer.
  • Modo cycle flight: For each x bytes transmitted, the DMA reader returns memory access to the processor. Unlike the previous case, it does not require the processor to be idle for long periods of time.
  • Transparent mode: In this mode, the DMA unit transmits data only when the CPU executes an instruction that does not require memory access.

They are not just for transmitting data

RTX IO Decompressor

One of the things that DMA players allow is to vary the nature of the data they transmitFor example, we can have data compressed at the source and have it decompressed at the destination and even decode a multimedia format.

Because what a DMA unit does is pass a block of data from a source to a destination, it can have an accelerator or a fixed function unit that manipulates the information.. This is extremely useful when decoding multimedia data such as the following:

  • Image formats like JPEG, GIF. PNG.
  • Music formats like MP3, OGG, etc.
  • Video formats of all kinds.
  • File compression formats such as: Zlib, 7z, etc.

DMA units also take care of internal communication

DMA SPMSome accelerators and coprocessors do not use system memory and not even use their own memory as they are inside the processor and with their memory inside., these units need a DMA interface that allows them to send and receive data. In some specific cases, channels are assigned to them from the main DMA of the processor that they exclusively support.

This is especially used when we have a RAM notebook, which is a type of RAM that is inside the processor and with a different data path than RAM. Most coprocessors and accelerators are assigned notebook memory for local use where the only way to access it is through specific DMA channels.

Leave a Comment