Networked Embedded Systems Pengyu Zhang & Sachin Katti EE107 Spring 2016 Lecture 11 Direct Memory Access.

Slides:



Advertisements
Similar presentations
Bus arbitration Processor and DMA controllers both need to initiate data transfers on the bus and access main memory. The device that is allowed to initiate.
Advertisements

Homework Reading Machine Projects Labs
Computer Architecture
I/O Organization popo.
Computer Architecture
9/20/6Lecture 3 - Instruction Set - Al1 The Hardware Interface.
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Interfacing. This Week In DIG II  Basic communications terminology  Communications protocols  Microprocessor interfacing: I/O addressing  Port and.
Interrupts (contd..) Multiple I/O devices may be connected to the processor and the memory via a bus. Some or all of these devices may be capable of generating.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
Chapter 7 Interupts DMA Channels Context Switching.
CHAPTER 9: Input / Output
Computer Architecture Lecture 08 Fasih ur Rehman.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
THE COMPUTER SYSTEM. Lecture Objectives Computer functions – Instruction fetch & execute – Interrupt Handling – I/O functions Interconnections Computer.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Top Level View of Computer Function and Interconnection.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
DMA Versus Polling or Interrupt Driven I/O
2009 Sep 10SYSC Dept. Systems and Computer Engineering, Carleton University F09. SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices 7.2.
ECEG-3202 Computer Architecture and Organization Chapter 3 Top Level View of Computer Function and Interconnection.
Modes of transfer in computer
CH10 Input/Output DDDData Transfer EEEExternal Devices IIII/O Modules PPPProgrammed I/O IIIInterrupt-Driven I/O DDDDirect Memory.
Lecture 1: Review of Computer Organization
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
IT3002 Computer Architecture
Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.
Chapter 3 System Buses.  Hardwired systems are inflexible  General purpose hardware can do different tasks, given correct control signals  Instead.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Direct Memory Access (DMA) Department of Computer Engineering, M.S.P.V.L. Polytechnic College, Pavoorchatram. A Presentation On.
1 load [2], [9] Transfer contents of memory location 9 to memory location 2. Illegal instruction.
INPUT/OUTPUT ORGANIZATION
Input / Output Chapter 9.
Interconnection Structures
Department of Computer Science and Engineering
Bus Interfacing Processor-Memory Bus Backplane Bus I/O Bus
Direct Memory address and 8237 dma controller LECTURE 6
I/O Memory Interface Topics:
CHAPTER 4 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
I/O system.
EE 107 Fall 2017 Lecture 7 Serial Buses – I2C Direct Memory Access
Dr. Michael Nasief Lecture 2
Chapter 3 Top Level View of Computer Function and Interconnection
COMP2121: Microprocessors and Interfacing
Overview Peripheral Devices Input-Output Interface
Computer Architecture
BIC 10503: COMPUTER ARCHITECTURE
Input/Output Organization
Multiprocessor Introduction and Characteristics of Multiprocessor
Computer System Overview
ECEG-3202 Computer Architecture and Organization
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Created by Vivi Sahfitri
Computer System Overview
Wireless Embedded Systems
COMP3221: Microprocessors and Embedded Systems
William Stallings Computer Organization and Architecture 7th Edition
Jazan University, Jazan KSA
Advanced Computer Architecture Lecture 3
Presentation transcript:

Networked Embedded Systems Pengyu Zhang & Sachin Katti EE107 Spring 2016 Lecture 11 Direct Memory Access

Why do we need DMA?

Polling and Interrupt driven I/O concentrates on data transfer between the processor and I/O devices. An instruction to transfer (mov datain,R0) only occurs after the processor determines that the I/O device is ready Either by polling a status flag in the device interface or Waits for the device to send an interrupt request. Considerable overhead is incurred, because several program instructions must be executed for each data word transferred. Instructions are needed to increment memory address and keeping track of work count. With interrupts, additional overhead associated with saving and restoring the program counter and other state information.

Direct Memory Access (DMA) To transfer large blocks of data at high speed, an alternative approach is used. Blocks of data are transferred between an external device and the main memory, without continuous intervention by the processor.

DMA Controller DMA controller is part of the I/O interface. Performs the functions that would normally be carried out by the processor when access main memory. For each word transferred, it provides the memory address and all the bus signals that control data transfer.

DMA Controller Device wishing to perform DMA asserts the processors bus request signal. Processor completes the current bus cycle and then asserts the bus grant signal to the device. The device then asserts the bus grant ack signal. The DMA device performs the transfer from the source to destination address. Once the DMA operations have been completed, the device releases the bus by asserting the bus release signal. Processor acknowledges the bus release and resumes its bus cycles from the point it left off.

Use of DMA Controllers DMA controller Processor Bus control logic RAMGPIOs Storage 3. Data is transferred 2. DMA controller requests transfer to memory 1. CPU programs the DMA controller 4. ACK 5. Interrupt when done

How is OS involved I/O operations are always performed by the OS in response to a request from an application program. OS is also responsible for suspending the execution of one program and starting another. OS puts the program that requested the transfer in the Blocked state, initiates the DMA operation, starts execution of another program. When the transfer is complete, the DMA controller informs the processor by sending an interrupt request. OS puts suspended program in the Runnable state so that it can be selected by the scheduler to continue execution.

Linear logical memory

Memory Architecture

Cache coherency problems Imagine a CPU equipped with a cache and an external memory that can be accessed directly by devices using DMA. When the CPU accesses location X in the memory, the current value will be stored in the cache. Subsequent operations on X will update the cached copy of X, but not the external memory version of X, assuming a write-back cache. If the cache is not flushed to the memory before the next time a device tries to access X, the device will receive a stale value of X.

Buffers and Arbitration Most DMACs have a data storage buffer – network interfaces receive data from main memory at bus speed, send data onto network at network speed. Bus Arbitration is needed to resolve conflicts with more than one device (2 DMACs or DMA and processor, etc..) try to use the bus to access main memory.

Bus Arbitration Bus Master – the device that is allowed to initiate bus transfers on the bus at any given time. When the current master relinquishes control, another device can acquire this status. Bus Arbitration – the process by which the next device to become bus master is selected and bus mastership is transferred to it.

Arbitration Approaches Centralized – a single arbiter performs the arbitration. Distributed – all devices participate in the selection of the next bus master.

Centralized Arbitration Bus arbiter may be processor or a separate unit connected to the bus. Processor DMA controller 1 DMA controller 2 BBSY BR BG1 BG2

Distributed Arbitration No central arbiter used Each device on bus is assigned a 4-bit identification number. When one or more devices request the bus, they assert the Start-Arbitration signal and place their 4-bit ID number on ARB[3..0]. The request that has the highest ID number ends up having the highest priority. Advantages – offers higher reliability (operation of the bus is not dependent on any one device). SCSI bus is an example of distributed (decentralized) arbitration.