Direct Memory Access

De Transcription | Bibliothèque patrimoniale numérique Mines ParisTech
Aller à : navigation, rechercher


Without DMA, when the CPU is using programmed input/output, it is often totally occupied for Memory Wave System all the duration of the read or write operation, and is thus unavailable to carry out other work. With DMA, the CPU first initiates the switch, then it does other operations while the transfer is in progress, and it finally receives an interrupt from the DMA controller (DMAC) when the operation is completed. This function is helpful at any time that the CPU can't sustain with the speed of data transfer, or when the CPU must perform work while waiting for a relatively gradual I/O data switch. Many hardware programs use DMA, including disk drive controllers, graphics playing cards, network playing cards and sound cards. DMA can be used for intra-chip information switch in some multi-core processors. Computers that have DMA channels can switch knowledge to and from units with much much less CPU overhead than computer systems with out DMA channels. Equally, a processing circuitry inside a multi-core processor can transfer information to and from its native memory without occupying its processor time, permitting computation and information switch to proceed in parallel.



DMA can also be used for "memory to memory" copying or moving of information within memory. DMA can offload costly memory operations, such as giant copies or scatter-collect operations, from the CPU to a devoted DMA engine. An implementation instance is the I/O Acceleration Technology. DMA is of curiosity in network-on-chip and in-memory computing architectures. Standard DMA, additionally called third-social gathering DMA, makes use of a DMA controller. A DMA controller can generate Memory Wave System addresses and initiate memory learn or write cycles. It accommodates a number of hardware registers that may be written and skim by the CPU. These include a memory deal with register, a byte count register, and a number of management registers. Relying on what features the DMA controller supplies, these control registers might specify some mixture of the supply, the destination, the course of the transfer (reading from the I/O gadget or writing to the I/O machine), the dimensions of the transfer unit, and/or the variety of bytes to transfer in one burst.



To carry out an enter, output or memory-to-memory operation, the host processor initializes the DMA controller with a depend of the number of words to transfer, and Memory Wave the memory deal with to make use of. The CPU then commands the peripheral system to initiate an information transfer. The DMA controller then offers addresses and read/write management traces to the system memory. Every time a byte of information is ready to be transferred between the peripheral device and memory, the DMA controller increments its internal address register till the full block of knowledge is transferred. Some examples of buses utilizing third-get together DMA are PATA, USB (before USB4), and SATA; nevertheless, their host controllers use bus mastering. In a bus mastering system, also known as a first-social gathering DMA system, the CPU and peripherals can every be granted control of the memory bus. The place a peripheral can turn out to be a bus grasp, it will possibly instantly write to system memory with out the involvement of the CPU, offering memory address and management alerts as required.



Some measures have to be supplied to put the processor right into a hold situation in order that bus contention does not happen. In burst mode, a complete block of information is transferred in a single contiguous sequence. As soon as the DMA controller is granted entry to the system bus by the CPU, it transfers all bytes of information in the information block earlier than releasing management of the system buses back to the CPU, but renders the CPU inactive for comparatively lengthy intervals of time. The mode is also called "Block Switch Mode". The cycle stealing mode is used in techniques by which the CPU should not be disabled for the length of time wanted for burst switch modes. In the cycle stealing mode, the DMA controller obtains access to the system bus the identical manner as in burst mode, Memory Wave utilizing BR (Bus Request) and BG (Bus Grant) signals, that are the two alerts controlling the interface between the CPU and the DMA controller. Nevertheless, in cycle stealing mode, after one unit of knowledge switch, the control of the system bus is deasserted to the CPU by way of BG.