COMP381 by M. Hamdi 1 Input/Output Systems. COMP381 by M. Hamdi 2 Motivation: Who Cares About I/O? CPU Performance: 60% per year I/O system performance.

Slides:



Advertisements
Similar presentations
IT253: Computer Organization
Advertisements

Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
Lecture 21Comp. Arch. Fall 2006 Chapter 8: I/O Systems Adapted from Mary Jane Irwin at Penn State University for Computer Organization and Design, Patterson.
Computer Architecture
1  1998 Morgan Kaufmann Publishers Interfacing Processors and Peripherals.
CS-334: Computer Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Input-Output.
IOSystems.1 Review: Major Components of a Computer Processor Control Datapath Memory Devices Input Output  Important metrics for an I/O system l Performance.
EE30332 Ch8 DP – 1 Ch 8 Interfacing Processors and Peripherals Buses °Fundamental tool for designing and building computer systems divide the problem into.
Interfacing Processors and Peripherals Andreas Klappenecker CPSC321 Computer Architecture.
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.
1  1998 Morgan Kaufmann Publishers Chapter 8 Storage, Networks and Other Peripherals.
Processor Design 5Z0321 Processor Design 5Z032 Chapter 8 Interfacing Processors and Peripherals Henk Corporaal.
1  1998 Morgan Kaufmann Publishers Chapter 8 Interfacing Processors and Peripherals.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
1 Interfacing Processors and Peripherals I/O Design affected by many factors (expandability, resilience) Performance: — access latency — throughput — connection.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 22 - Input/Output.
Chapter 8: Part II Storage, Network and Other Peripherals.
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
I/0 devices.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
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.
Storage & Peripherals Disks, Networks, and Other Devices.
3/11/2002CSE Input/Output Input/Output Control Datapath Memory Processor Input Output Memory Input Output Network Control Datapath Processor.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
I/O – Chapter 8 Introduction Disk Storage and Dependability – 8.2 Buses and other connectors – 8.4 I/O performance measures – 8.6.
1chapter 8 Review: Major Components of a Computer Processor Control Datapath Memory Devices Input Output Important metrics for an I/O system –Performance.
1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
2007 Oct 18SYSC2001* - Dept. Systems and Computer Engineering, Carleton University Fall SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices.
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
Top Level View of Computer Function and Interconnection.
CS2100 Computer Organisation Input/Output (AY2010/2011) Semester 2 Adapted from.
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.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
Lecture 35: Chapter 6 Today’s topic –I/O Overview 1.
I/O Computer Organization II 1 Interconnecting Components Need interconnections between – CPU, memory, I/O controllers Bus: shared communication channel.
August 1, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 9: I/O Devices and Communication Buses * Jeremy R. Johnson Wednesday,
CSIE30300 Computer Architecture Unit 11: Bus and I/O Systems Hsin-Chou Chi [Adapted from material by and
MBG 1 CIS501, Fall 99 Lecture 18: Input/Output (I/O): Buses and Peripherals Michael B. Greenwald Computer Architecture CIS 501 Fall 1999.
EEE440 Computer Architecture
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
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.
CS2100 Computer Organisation Input/Output – Own reading only (AY2015/6) Semester 1 Adapted from David Patternson’s lecture slides:
Adapted from Computer Organization and Design, Patterson & Hennessy ECE232: Hardware Organization and Design Part 17: Input/Output Chapter 6
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Chapter 6 Storage and Other I/O Topics. Chapter 6 — Storage and Other I/O Topics — 2 Introduction I/O devices can be characterized by Behaviour: input,
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
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.
1 Ó1998 Morgan Kaufmann Publishers Chapter 8 I/O Systems.
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 26 Bus Interconnect May 7,
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
COSC 6340: Disks 1 Disks and Files DBMS stores information on (“hard”) disks. This has major implications for DBMS design! » READ: transfer data from disk.
10/15: Lecture Topics Input/Output –Types of I/O Devices –How devices communicate with the rest of the system communicating with the processor communicating.
1  2004 Morgan Kaufmann Publishers Page Tables. 2  2004 Morgan Kaufmann Publishers Page Tables.
CSE431 L24 IOSystems.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 24. I/O Systems Mary Jane Irwin ( )
Disks and Files DBMS stores information on (“hard”) disks.
Computer Architecture
Virtual Memory Main memory can act as a cache for the secondary storage (disk) Advantages: illusion of having more physical memory program relocation protection.
Input-output I/O is very much architecture/system dependent
Chapter 13: I/O Systems.
Presentation transcript:

COMP381 by M. Hamdi 1 Input/Output Systems

COMP381 by M. Hamdi 2 Motivation: Who Cares About I/O? CPU Performance: 60% per year I/O system performance limited by mechanical delays (disk I/O) < 10% per year (IO per sec) 10% IO & 10x CPU => 5x Performance (lose 50%) 10% IO & 100x CPU => 10x Performance (lose 90%) I/O bottleneck: Diminishing value of faster CPUs

COMP381 by M. Hamdi 3 Input and Output Devices I/O devices are incredibly diverse with respect to –Behavior – input, output or storage –Partner – human or machine –Data rate – the peak rate at which data can be transferred between the I/O device and the main memory or processor DeviceBehaviorPartnerData rate (Mb/s) Keyboardinputhuman Mouseinputhuman Laser printeroutputhuman Graphics displayoutputhuman Network/LANinput or output machine Magnetic diskstoragemachine orders of magnitude range

COMP381 by M. Hamdi 4 I/O Performance Measures I/O bandwidth (throughput) – amount of information that can be input (output) and communicated across an interconnect (e.g., a bus) to the processor/memory (I/O device) per unit time 1.How much data can we move through the system in a certain time? 2.How many I/O operations can we do per unit time? I/O response time (latency) – the total elapsed time to accomplish an input or output operation –An especially important performance metric in real-time systems Many applications require both high throughput and short response times

COMP381 by M. Hamdi 5 A Typical I/O System Processor Cache Memory - I/O Bus Main Memory I/O Controller Disk I/O Controller I/O Controller Graphics Network interrupts

COMP381 by M. Hamdi 6 The Processor Picture Processor/Memory Bus PCI Bus I/O Busses

COMP381 by M. Hamdi 7 Introduction to I/O I/O devices are very slow compared to the cycle time of a CPU. Much like memory, the architecture of I/O systems is an active area of research. –I/O systems can define the success of a system. Computer architects strive to design systems that do not tie up the CPU waiting for slow I/O systems (too many applications running simultaneously on processor). Importance of IO: People care more about storing information and communicating information than calculating –"Information Technology" vs. "Computer Science" –1960s and 1980s: Computing Revolution –1990s and 2000s: Information Age

COMP381 by M. Hamdi 8 Example IO: Hard Disk Actuator Arm Head Platters (12) { Spindle

COMP381 by M. Hamdi 9 Hard Disk Performance Platter Arm Actuator HeadSector Inner Track Outer Track Disk Latency = Seek Time + Rotation Time + Transfer Time + Controller Overhead Seek Time depends on no. tracks and movement of arm Rotation Time depends on how fast the disk rotates and how far sector is from head Transfer Time depends on data rate (bandwidth) of disk and size of request Controller Spindle

COMP381 by M. Hamdi 10 Disk Access Time + Rotational delay + Transfer time Seek time Disk access time = + Other delays Disk platter Disk arm Disk head block x in memory I want block X

COMP381 by M. Hamdi 11 State of the Art: Barracuda 180 –181.6 GB, 3.5 inch disk –12 platters, 24 surfaces –24,247 cylinders –7,200 RPM; (4.2 ms avg. latency) –7.4/8.2 ms avg. seek (r/w) –65 to 35 MB/s (internal) –0.1 ms controller time source: Latency = Queuing Time + Controller time + Seek Time + Rotation Time + Size / Bandwidth per access per byte { +

COMP381 by M. Hamdi 12 Disk Performance Example Calculate time to read 64 KB (128 sectors) for Barracuda 180 X using advertised performance; sector is on outer track Disk latency = average seek time + average rotational delay + transfer time + controller overhead = 7.4 ms * 1/(7200 RPM) + 64 KB / (65 MB/s) ms = 7.4 ms /(7200 RPM/(60000ms/M)) + 64 KB / (65 KB/ms) ms = ms = 12.7 ms

COMP381 by M. Hamdi 13 Communication of I/O Devices and Processor How the processor directs the I/O devices –Special I/O instructions Must specify both the device (port number) and the command –For example: inpreg, port; register:=port outport, reg; port:=register Physical address space each device gets one or more addresses each device gets one or more addresses I/O address space

COMP381 by M. Hamdi 14 Communication of I/O Devices and Processor How the processor directs the I/O devices –Memory-mapped I/O Portions of the high-order memory address space are assigned to each I/O device Read and writes to those memory addresses are interpreted as commands to the I/O devices Load/stores to the I/O address space can only be done by the OS each device gets one or more addresses each device gets one or more addresses Physical address space

COMP381 by M. Hamdi 15 Communication of I/O Devices and Processor How the I/O device communicates with the processor –Polling – the processor periodically checks the status of an I/O device to determine its need for service Processor is totally in control – but does all the work Can waste a lot of processor time due to speed differences –Interrupt-driven I/O – the I/O device issues an interrupts to the processor to indicate that it needs attention

COMP381 by M. Hamdi 16 Interrupt-Driven Input add sub and or beq lbu sb... jr memory user program 1. input interrupt input interrupt service routine Processor Receiver Memory : Keyboard

COMP381 by M. Hamdi 17 Interrupt-Driven Input memory user program 1. input interrupt 2.1 save state Processor Receiver Memory add sub and or beq lbu sb... jr 2.2 jump to interrupt service routine 2.4 return to user code Keyboard 2.3 service interrupt input interrupt service routine

COMP381 by M. Hamdi 18 Interrupt-Driven Output Processor Trnsmttr Memory Display add sub and or beq lbu sb... jr memory user program 1.output interrupt 2.1 save state output interrupt service routine 2.2 jump to interrupt service routine 2.4 return to user code 2.3 service interrupt

COMP381 by M. Hamdi 19 Direct-Memory Access (DMA) Interrupt-driven IO relieves the CPU from waiting for every IO event But the CPU can still be bugged down if it is used in transferring IO data. –Typically blocks of bytes. For high-bandwidth devices (like disks) interrupt- driven I/O would consume a lot of processor cycles

COMP381 by M. Hamdi 20 DMA DMA – the I/O controller has the ability to transfer data directly to/from the memory without involving the processor

COMP381 by M. Hamdi 21 DMA Consider printing a 60-line by 80-character page With no DMA: –CPU will be interrupted 4800 times, once for each character printed. With DMA: –OS sets up an I/O buffer and CPU writes the characters into the buffer. –DMA is commanded (includes the beginning address of the block and its size) to print the buffer. –DMA will take items from the block one-at-a-time and performs everything requested. –Once the operation is complete, the DMA sends a single interrupt signal to the CPU.

COMP381 by M. Hamdi 22 I/O Communication Protocols Typically one I/O channel controls multiple I/O devices. We need a two-way communication between the channel and the I/O devices. –The channel needs to send the command/data to the I/O devices. –The I/O devices need to send the data/status information to the channel whenever they are ready.

COMP381 by M. Hamdi 23 Channel to I/O Device Communication Channel sends the address of the device on the bus. All devices compare their addresses against this address. –Optionally, the device which has matched its address places its own address on the bus again. First, it is an acknowledgement signal to the channel; Second, it is a check of validity of the address. The channel then places the I/O command/data on the bus received by the correct I/O device. The command/data is queued at the I/O device and is processed whenever the device is ready.

COMP381 by M. Hamdi 24 I/O Devices to Channel Communication The I/O devices-to-channel communication is more complicated, since now several devices may require simultaneous access to the channel. –Need arbitration among multiple devices (bus master?) –Need priority scheme to handle requests one-at-a-time. There are 3 methods for providing I/O devices-to- channel communication

COMP381 by M. Hamdi 25 Daisy Chaining Two schemes Centralized control (priority scheme) Channel I/O 1 2 n Bus Data/Address/Control lines Grant Request Busy

COMP381 by M. Hamdi 26 Daisy Chaining The I/O devices activate the request line for bus access. If the bus is not busy (indicated by no signal on busy line), the channel sends a Grant signal to the first I/O device (closest to the channel). –If the device is not the one that requested the access, it propagates the Grant signal to the next device. –If the device is the one that requested an access, it then sends a busy signal on the busy line and begins access to the bus. Only a device that holds the Grant signal can access the bus. When the device is finished, it resets the busy line. The channel honors the requests only if the bus is not busy. Obviously, devices closest to the channel have a higher priority and block access requests by lower priority devices.

COMP381 by M. Hamdi 27 Daisy Chaining Decentralized control (Round-robin Scheme) Channel I/O 1 2 n Bus Data/Address/Control lines Grant Request

COMP381 by M. Hamdi 28 Daisy Chaining The I/O devices send their request. The channel activates the Grant line. The first I/O device which requested access accepts the Grant signal and has control over the bus. –Only the devices that have received the grant signal can have access to the bus. When a device is finished with an access, it checks to see if the request line is activated or not. If it is activated, the current device sends the Grant signal to the next I/O device (Round-Robin) and the process continues. –Otherwise, the Grant signal is deactivated.

COMP381 by M. Hamdi 29 Polling The channel interrogates (polls) the devices to find out which one requested access:

COMP381 by M. Hamdi 30 Polling Any device requesting access places a signal on request line. If the busy signal is off, the channel begins polling the devices to see which one is requesting access. –It does this by sequentially sending a count from 1 to n on log 2 n lines to the devices. Whenever a requesting device matches the count against its own number (address), it activates the busy line. The channel stops the count (polling) and the device has access over the bus. When access is over, the busy line is deactivated and the channel can either continue the count from the last device (Round-Robin) or start from the beginning (priority).

COMP381 by M. Hamdi 31 Independent Requests

COMP381 by M. Hamdi 32 Independent Requests Each device has its own Request-Grant lines: –Again, a device sends in its request, the channel responds by granting access –Only the device that holds the grant signal can access the bus –When a device finishes access, it lowers it request signal. –The channel can use either a Priority scheme or Round- Robin scheme to grant the access.

COMP381 by M. Hamdi 33 I/O Buses Connect I/O devices (channels) to memory. –Many types of devices are connected to a bus. –Have a wide range of bandwidth requirements for the devices connected to a bus. –Typically follow a bus standard, e.g., PCI, SCSI. Clocking schemes: –Synchronous: The bus includes a clock signal in the control lines and a fixed protocol for address and data relative to the clock.

COMP381 by M. Hamdi 34 I/O Buses Synchronous bus read transaction. 1 1 CPU/IO channel puts memory address on the address bus and deasserts read signal.

COMP381 by M. Hamdi 35 I/O Buses Synchronous bus read transaction. 2 2 Memory puts data on the data bus and deasserts the wait signal.

COMP381 by M. Hamdi 36 I/O Buses Synchronous bus read transaction. 3 3 During the next falling edge of the clock when the data is stabilized on the bus and the wait is completely deasserted, the data is read from the bus.

COMP381 by M. Hamdi 37 I/O Buses Synchronous buses are fast and inexpensive, but –All devices on the bus must run at the same clock rate. –Due to clock-skew problems, buses cannot be long. –CPU-Memory buses are typically implemented as synchronous buses. The front side bus (FSB) clock rate typically determines the clock speed of the memory you must install.

COMP381 by M. Hamdi 38 I/O Buses Asynchronous buses are self-timed and use a handshaking protocol between the sender and receiver. This allows the bus to accommodate a wide variety of devices and to lengthen the bus. I/O buses are typically asynchronous. –A master (e.g., an I/O channel writing into memory) asserts address, data, and control and begins the handshaking process.

COMP381 by M. Hamdi 39 I/O Buses Asynchronous write: master asserts address, data, write buses.

COMP381 by M. Hamdi 40 I/O Buses Asynchronous write: master asserts request, expecting acknowledgement later.

COMP381 by M. Hamdi 41 I/O Buses Asynchronous write: slave (memory) asserts acknowledgment, expecting request to be deasserted later.

COMP381 by M. Hamdi 42 I/O Buses Asynchronous write: master deasserts request and expects the acknowledgement to be deasserted later.

COMP381 by M. Hamdi 43 I/O Buses Asynchronous write: slave deasserts acknowledgement and operation completes.

COMP381 by M. Hamdi 44 I/O Bus Examples Multiple master I/O buses:

COMP381 by M. Hamdi 45 I/O Bus Examples Multiple master CPU-memory buses: