1 CSE 45432 SUNY New Paltz Chapters 8 Interfacing Processors and Peripherals.

Slides:



Advertisements
Similar presentations
Bus Design.
Advertisements

IT253: Computer Organization
I/O Organization popo.
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.
1  1998 Morgan Kaufmann Publishers Interfacing Processors and Peripherals.
Datorteknik BusInterfacing bild 1 Bus Interfacing Processor-Memory Bus –High speed memory bus Backplane Bus –Processor-Interface bus –This is what we usually.
CS-334: Computer Architecture
CSCE 212 Chapter 8 Storage, Networks, and Other Peripherals Instructor: Jason D. Bakos.
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.
S. Barua – CPSC 440 CHAPTER 8 INTERFACING PROCESSORS AND PERIPHERALS Topics to be covered  How to.
Cache Performance, Interfacing, Multiprocessors CPSC 321 Andreas Klappenecker.
Lecture 25 Buses and I/O (2)
Interfacing Processors and Peripherals Andreas Klappenecker CPSC321 Computer Architecture.
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.
1  2004 Morgan Kaufmann Publishers Chapters 8 & 9 (partial coverage)
1 Interfacing Processors and Peripherals I/O Design affected by many factors (expandability, resilience) Performance: — access latency — throughput — connection.
Chapter 8: Part II Storage, Network and Other Peripherals.
Lecture 12 Today’s topics –CPU basics Registers ALU Control Unit –The bus –Clocks –Input/output subsystem 1.
Computer Architecture Lecture 08 Fasih ur Rehman.
Storage & Peripherals Disks, Networks, and Other Devices.
MicroComputer Engineering Bus slide 1 What is a bus? Slow vehicle that many people ride together –well, true... A bunch of wires...
CPU BASICS, THE BUS, CLOCKS, I/O SUBSYSTEM Philip Chan.
Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Peripherals.
1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,
MICROPROCESSOR INPUT/OUTPUT
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
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.
3/8/2002CSE Buses Buses Pentium 4 Processor L1 and L2 caches Memory Controller Hub RDRAM Disks RDRAM I/O Controller Hub MB/sec (33 MHz, 32.
Bus Mr. Mukul Varshney. Bus A bus, in computing, is a set of physical connections (cables, printed circuits, etc.) which can be shared by multiple hardware.
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.
Datorteknik F1 bild 1 What is a bus? Slow vehicle that many people ride together –well, true... A bunch of wires...
EEE440 Computer Architecture
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
Datorteknik F1 bild 1 What is a bus? Slow vehicle that many people ride together –well, true... A bunch of wires...
L/O/G/O Input Output Chapter 4 CS.216 Computer Architecture and Organization.
Csci 136 Computer Architecture II – Buses and IO
CS2100 Computer Organisation Input/Output – Own reading only (AY2015/6) Semester 1 Adapted from David Patternson’s lecture slides:
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 Lecture 14 Buses and I/O Data Transfer Peng Liu
بسم الله الرحمن الرحيم MEMORY AND I/O.
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 26 Bus Interconnect May 7,
Chapter 3 System Buses.  Hardwired systems are inflexible  General purpose hardware can do different tasks, given correct control signals  Instead.
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.
Computer Organization & Design 计算机组成与设计 Weidong Wang ( 王维东 ) College of Information Science & Electronic Engineering 信息与通信工程研究所 Zhejiang.
1 Computer Architecture & Assembly Language Spring 2001 Dr. Richard Spillman Lecture 19 – IO II.
Buses: Presentation Outline
Interconnection Structures
Bus Interfacing Processor-Memory Bus Backplane Bus I/O Bus
Operating Systems (CS 340 D)
What is a bus? Slow vehicle that many people ride together
Chapter 8-A BUS.
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
Overview of Computer Architecture and Organization
Lecture 14 Buses and I/O Data Transfer
Peng Liu Lecture 14 I/O Peng Liu
Buses: Presentation Outline
Overview of Computer Architecture and Organization
Presentation transcript:

1 CSE SUNY New Paltz Chapters 8 Interfacing Processors and Peripherals

2 CSE SUNY New Paltz Interfacing Processors and Peripherals Focus of processor design: Performance I/O Design affected by many factors (expandability, resilience) Performance in an I/O system may be primarily about: — access latency — throughput — connection between devices and the system A variety of different users (e.g., banks, supercomputers, engineers)

3 CSE SUNY New Paltz Impact of I/O on System Performance Example: Suppose we have a benchmark that executes in 100 seconds of elapsed time, where 90 seconds is CPU time and the rest is I/O time. If CPU time improves by 50% per year for the next 5 years but I/O time does not improve, how much faster will our program run at the end of five years? I/O may become a bottleneck, especially with fast CPUs I/O performance may be –How much data can we move through the system in a certain time? –How many I/O operations can we do per unit of time?

4 CSE SUNY New Paltz I/O Devices Very diverse devices — behavior (i.e., input vs. output) — partner (who is at the other end?) — data rate

5 CSE SUNY New Paltz Accessing I/O Devices Every device controller has a number of registers to reflect the status of the device and to accept commands The CPU can access the device registers –Memory mapped I/O versus isolated I/O There are two methods for the CPU to know the status of an I/O device: –Polling: periodically read the status registers –Interrupt: device interrupts the CPU when a change occurs

6 CSE SUNY New Paltz I/O Example: the mouse Registers to store X and Y positions (counters) Registers to indicate the status of buttons Cursor is updated by the CPU to reflect the contents of counters Initial Position +20 in Y -20 in X +20 in Y +20 in X -20 in X +20 in Y -20 in Y -20 in X -20 in Y +20 in X -20 in Y +20 in X

7 CSE SUNY New Paltz I/O Example: Disk Drives To access data: –wait time: until disk is not used for other transactions –seek: position head over the proper track –rotational latency: wait for desired sector –transfer: grab the data (one or more sectors) –controller time Typically: tracks per surface sectors per track 512 Bytes per sector All tracks have the same number of sectors real/write heads Cylinders

8 CSE SUNY New Paltz I/O Example: Disk Drives Typical specification: RPM ( approximately ms per revolution) Sector address = plate #, track #, sector # A file is physically stored as an ordered list of sectors Average seek time over all possible seeks ( ms) Rotation latency = 0.5 * time for a full rotation (1/RPM) = 4.2 to 8.3 ms Transfer rate = 2 to 15 MB/sec -- may improve by adding caches on disk Example: 512 bytes / sector, 5400 RPM, average seek time = 12 ms, Controller delay = 2 ms, transfer rate = 5 MB/sec. What is average disk access time? Assume disk is idle so that there is no waiting time.

9 CSE SUNY New Paltz I/O Example: Networks Major medium used to communicate between computers Point to point networks: –Example: RS232: Kb/sec over short distances Local area networks (LAN) –Example: Ethernet: a bus with multiple masters – Mb/sec over hundreds of meters Long-haul networks: usually switch networks –packet switch –usually uses a stack of protocols –example TCP/IP (Transmission Control Protocol /Internet Protocol) –100 Mb/sec - 1Gb/sec –Another example: ATM (Asynchronous Transfer Method) –155 Mb/sec Gb/sec

10 CSE SUNY New Paltz Buses Main memory CPU I/O Device shared communication link ( one or more wires) – address lines –data lines –control lines

11 CSE SUNY New Paltz Advantages and disadvantages of Buses Advantages: Versatility – New devices can be added easily – Peripherals can be moved between computers that use the same bus standard Low cost: a single set of wires is shared in multiple ways Mange complexity by partitioning the design Disadvantage Creates communication bottleneck The maximum bus speed is largely limited by – Length of the bus – The number of devices on the bus – the need to support a range of devices with varying latencies and transfer rates

12 CSE SUNY New Paltz Master Versus Slave A bus transaction includes two parts: –Issuing the command ( and address) - request –Transferring the data - action Master is the one who starts the bus transaction by: –Issuing the command (and address) Slave is the one who responds by: –Sending data to the master if master asks for data –Receiving data from the master if the master wants to send data A bus may only have one master device -- all other devices are slaves A bus may have more than one possible master –Need some arbitration to determine the master at any given time

13 CSE SUNY New Paltz Types of Buses Processor-Memory Bus ( design specific) –short and high speed –Only need to match the memory system –Connects directly to the processor I/O Bus (industry standard) –Usually lengthy and slower –Need to match a wide range of I/O devices –Connects to the processor-memory bus or the backplane bus Backplane Bus (standard or proprietary) –An interconnection structure within the chassis –Allows processor, memory, and I/O devices to coexist –Cost advantage: one bus for all components

14 CSE SUNY New Paltz A Computer with One Bus A single (backplane) bus is used for: –Processor to memory communication –Communication between I/O devices and memory Advantage: Simple and low cost Disadvantage: slow -- the bus can become a major bottleneck Example: IBM PC - AT Main memory Processor I/O Devices Backplane Bus

15 CSE SUNY New Paltz A Computer with two Bus System I/O buses tap into the processor - memory bus via bus adaptors: –Processor - memory bus: mainly for processor - memory traffic –I/O buses: provide expansion slots for I/O devices Example: Apple Macintosh II –NuBus: Processor, memory, and a few selected I/O devices –SCCI Bus: the rest of the I/O devices Main memory Processor Processor Memory Bus I/O Bus Bus Adaptor I/O Bus Bus Adaptor I/O Bus Bus Adaptor

16 CSE SUNY New Paltz A Computer with Three Bus System A small number of backplane buses tap into the processor memory bus Advantage: Processor-memory bus can be made much faster than the backplane bus. I/O system can be expanded by plugging many I/O controllers and buses into the backplane without affecting the speed of processor-memory bus Example: IBM RS/6000 and Silicon Graphics Multiprocessors Main memory Processor Processor Memory Bus I/O Bus Bus Adaptor Backplane Bus Bus Adaptor

17 CSE SUNY New Paltz Synchronous vs. Asynchronous Synchronous Bus –use a clock in the control lines –A fixed protocol for communication that is relative to the clock T1: Transmit address and read command T2: Memory responds –Advantage: involves very little logic and can run very fast –Disadvantage: every device must operate at same rate and clock skew requires the bus to be short Asynchronous Bus: –It is not clocked –It can accommodate a wide rage of devices –It can be lengthened without worrying about clock shew –It requires a handshaking protocol

18 CSE SUNY New Paltz Asynchronous Protocol for Read (example) ReadReq Address Ack DataRdy Data MasterSlave ReadReq Address Ack DataRdy Data

19 CSE SUNY New Paltz Asynchronous Protocol for Write (example) WriteReq Address Ack DataRdy Data MasterSlave WriteReq Address Ack DataRdy Data

20 CSE SUNY New Paltz Arbitration: Obtaining Access to the Bus One of the most important issues in bus design –How is the bus reserved by a device that wishes to use it? Chaos is avoided by a master-slave arrangement: –Only the bus master can control access to the bus: it initiates and control all bus requests –A slave responds to read and write requests The simplest system: –Processor is the only bus master –All bus requests must be controlled by the processor –Major drawback: the processor is involved in every transaction

21 CSE SUNY New Paltz Multiple Potential Masters: Need for Arbitration Bus arbitration scheme: –A bus master wanting to use the bus asserts the bus request –A bus master cannot use the bus until its request is granted –A bus master must signal to the arbiter after it finishes using the bus Try to balance two factors –Bus priority: the highest priority device should be serviced first –Fairness: even the lowest priority device should eventually get served Bus arbitration can be divided into four broad classes: –Daisy chain arbitration: single device with all request lines –centralized, Parallel arbitration (requires an arbiter), e.g., PCI –Distributed arbitration by self selection, e.g., NuBus used in Macintosh –Distributed arbitration by collision detection, e.g., Ethernet

22 CSE SUNY New Paltz Multiple Potential Masters: Need for Arbitration Bus Overview What is it? - shared communication line between subsystems. (PH Figure 8.1) Design factors: Speed is limited by length and number of devices. Must support a range of latencies and data rates. Structure: Data lines - carry information Address lines - carry address (sometimes multiplexed on data lines) Control lines - signal request and acknowledgement Types: (PH Figure 8.9) Processor-memory - short, high-speed I/O buses - long, many devices, usually don't connect directly to memory Backplane - balance I/O - memory with CPU-memory communication Asynchronous bus: Not clocked Uses handshaking protocol (look at PH Figures 8.10 and 8.11) with control lines (e.g. ReadReq, DataReq and Acq) Performance: - synchronous buses are faster (discuss the comparison on PH pp ) Read PH Section 8.5 Bus Arbitration: (e.g. how devices acquire access to the bus) Overview: A bus master initiates and controls a bus request. A slave (such as memory) responds to the request of a master. Need arbitration when more than one possible master. A master signals a bus request. The arbiter grants the request. Bus arbitration schemes: Daisy-chain (PH Figure 8.13) - simple and cheap but not fair or fast. Signal request line. Wait for transition on grant line from low to high. Intercept grant signal Stop asserting request line. Use bus. Assert release line. Centralized, parallel arbitration - needs multiple request lines, used by PCI Distributed arbitration by self-selection - multiple request lines, each device puts its code on the bus and determines whether it was the highest. Used by NuBus on Machintosh II's. Distributed arbitration by collision detection - Ethernet. Read PH Section 8.5 PCI bus (continued from last time) Reference: The Indispensable PC Hardware bBook by Messmer Refer to class handout. Current high-end PC bus Synchronous: Address in the first cycle Write data in second cycle Read data in the third cycle So read access is 44 Mbytes/second and write access is 66 Mbytes/sec for 32-bit width. Also comes in a 64-bit width. Maximum rate in burst mode is 133Mbytes/sec. PCI Bridge combines independent references into bursts. So a processor access to video ram will be combined even though the processor can't do it. Has three address areas: Memory I/O Configuration addresses: 256 bytes for each PCI unit - 64 registers of 32 bits 64 byte header 192 bytes are unit dependent. PC terminology Master = initiator Slave = target Basic protocol: initiator starts with NOT FRAME target signals NOT TRDY to indicate ready initiator does NOT IRDY to signal its ready to bridge C/NOT BEX are transfer byte signals Bus arbitration is done separately by a centralized arbiter while the previous bus access is still going on. I/O Programming Characteristics of I/O systems: Shared by multiple programs Use interrupts which cause a trap to kernel mode Complex low-level control involving concurrent events Role of the operating system: Guarantee security and access Provide device abstraction Handle resources Be fair Approaches: Memory mapped I/O versus I/O instructions Polling versus interrupts Direct memory access: (DMA) Uses specialized controller Process sets up by giving Identity of the device Operation Starting address Number of bytes to transfer DMA controller starts operation and arbitrates the bus. DMA controller interrupts the processor to signal completion. If time a look at the 8237A DMA chip