CSC3050 – Computer Architecture

Slides:



Advertisements
Similar presentations
1  1998 Morgan Kaufmann Publishers Interfacing Processors and Peripherals.
Advertisements

Chapter 10 Input/Output Organization. Connections between a CPU and an I/O device Types of bus (Figure 10.1) –Address bus –Data bus –Control bus.
Lecture Objectives: 1)Explain the limitations of flash memory. 2)Define wear leveling. 3)Define the term IO Transaction 4)Define the terms synchronous.
Input-output and Communication Prof. Sin-Min Lee Department of Computer Science.
Chapter 6 Storage and Other I/O Topics CprE 381 Computer Organization and Assembly Level Programming, Fall 2013 Zhao Zhang Iowa State University Revised.
Memory/Storage Architecture Lab Computer Architecture Lecture Storage and Other I/O Topics.
Lecture 17: Storage and I/O EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014, Dr.
Computer Input & Output Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
C OMPUTER O RGANIZATION AND D ESIGN The Hardware/Software Interface 5 th Edition Chapter 5 Storage and Other I/O Topics (condensed lecture)
I/O 1 Computer Organization II © McQuain Introduction I/O devices can be characterized by – Behavior: input, output, storage – Partner:
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.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Lecture 16: Storage and I/O EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014, Dr.
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.
I/O Computer Organization II 1 Introduction I/O devices can be characterized by – Behavior: input, output, storage – Partner: human or machine – Data rate:
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.
Computer Organization CS224 Fall 2012 Lessons 47 & 48.
MBG 1 CIS501, Fall 99 Lecture 18: Input/Output (I/O): Buses and Peripherals Michael B. Greenwald Computer Architecture CIS 501 Fall 1999.
L/O/G/O Input Output Chapter 4 CS.216 Computer Architecture and Organization.
CS2100 Computer Organisation Input/Output – Own reading only (AY2015/6) Semester 1 Adapted from David Patternson’s lecture slides:
Introduction I/O devices can be characterized by – Behaviour: input, output, storage – Partner: human or machine – Data rate: bytes/sec, transfers/sec.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
Five Components of Computers Input Output Memory Control Datapath Processor.
Chapter 6 Storage and Other I/O Topics. Chapter 6 — Storage and Other I/O Topics — 2 Introduction I/O bus connections §6.1 Introduction.
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,
1 Lecture 14 Buses and I/O Data Transfer Peng Liu
Computer Organization & Design 计算机组成与设计 Weidong Wang ( 王维东 ) College of Information Science & Electronic Engineering 信息与通信工程研究所 Zhejiang.
Computer Organization and Architecture + Networks Lecture 6 Input/Output.
CSCE 385: Computer Architecture Spring 2014 Dr. Mike Turi I/O.
I/O techniques - Interfacing
William Stallings Computer Organization and Architecture 6th Edition
I/O Lecture notes from MKP and S. Yalamanchili.
I/O Systems Shmuel Wimer prepared and instructed by
Lecture 2. A Computer System for Labs
Chapter 13: I/O Systems.
I/O Lecture notes from MKP and S. Yalamanchili.
Department of Computer Science and Engineering
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Morgan Kaufmann Publishers Storage and Other I/O Topics
CS703 - Advanced Operating Systems
Morgan Kaufmann Publishers Storage and Other I/O Topics
Operating Systems (CS 340 D)
CS 286 Computer Organization and Architecture
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.
Computer Architecture Computer Science & Engineering
CSCI 315 Operating Systems Design
Introduction I/O devices can be characterized by I/O bus connections
Morgan Kaufmann Publishers Storage and Other I/O Topics
Overview of Computer Architecture and Organization
Morgan Kaufmann Publishers Storage and Other I/O Topics
Lecture 14 Buses and I/O Data Transfer
Peng Liu Lecture 14 I/O Peng Liu
Morgan Kaufmann Publishers Storage and Other I/O Topics
Overview of Computer Architecture and Organization
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
CSC3050 – Computer Architecture
CSE 471 Autumn 1998 Virtual memory
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Chapter 1: Introduction CSS503 Systems Programming
Chapter 13: I/O Systems.
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

CSC3050 – Computer Architecture Prof. Yeh-Ching Chung School of Science and Engineering Chinese University of Hong Kong, Shenzhen

Introduction I/O devices can be characterized by I/O bus connections Behaviour: input, output, storage Partner: human or machine Data rate: bytes/sec, transfers/sec I/O bus connections

I/O System Characteristic Dependability is important Particularly for storage devices Performance measures Latency (response time) Throughput (bandwidth) Desktops & embedded systems Mainly interested in response time & diversity of devices Servers Mainly interested in throughput & expandability of devices

Dependability Measures Reliability: mean time to failure (MTTF) Service interruption: mean time to repair (MTTR) Mean time between failures MTBF = MTTF + MTTR Availability = MTTF / (MTTF + MTTR) Improving Availability Increase MTTF: fault avoidance, fault tolerance, fault forecasting Reduce MTTR: improved tools and processes for diagnosis and repair

Interconnecting Components Need interconnections between CPU, memory, I/O controllers Bus: shared communication channel Parallel set of wires for data and synchronization of data transfer Can become a bottleneck Performance limited by physical factors Wire length, number of connections More recent alternative: high-speed serial connections with switches Like networks

Bus Types Processor-Memory buses I/O buses Short, high speed Design is matched to memory organization I/O buses Longer, allowing multiple connections Specified by standards for interoperability Connect to processor-memory bus through a bridge

Bus Signals and Synchronization Data lines Carry address and data Multiplexed or separate Control lines Indicate data type, synchronize transactions Synchronous Uses a bus clock Asynchronous Uses request/acknowledge control lines for handshaking

I/O Bus Examples Firewire USB 2.0 PCI Express Serial ATA Serial Attached SCSI Intended use External Internal Devices per channel 63 127 1 4 Data width 2 2/lane Peak bandwidth 50MB/s or 100MB/s 0.2MB/s, 1.5MB/s, or 60MB/s 250MB/s/lane 1×, 2×, 4×, 8×, 16×, 32× 300MB/s Hot pluggable Yes Depends Max length 4.5m 5m 0.5m 1m 8m Standard IEEE 1394 USB Implementers Forum PCI-SIG SATA-IO INCITS TC T10

Typical x86 PC I/O System

I/O Management I/O is mediated by the OS Multiple programs share I/O resources Need protection and scheduling I/O causes asynchronous interrupts Same mechanism as exceptions I/O programming is complicated OS provides abstractions to programs

I/O Commands I/O devices are managed by I/O controller hardware Transfers data to/from device Synchronizes operations with software Command registers Cause device to do something Status registers Indicate what the device is doing and occurrence of errors Data registers Write: transfer data to a device Read: transfer data from a device

I/O Register Mapping Memory-mapped I/O Registers are addressed in same space as memory Address decoder distinguishes between them OS uses address translation mechanism to make them only accessible to kernel I/O instructions (or port-mapped I/O) Separate instructions to access I/O registers Can only be executed in kernel mode Example: x86 (in and out)

Polling Periodically check I/O status register If device ready, do operation If error, take action Common in small or low-performance real-time embedded systems Predictable timing Low hardware cost In other systems, wastes CPU time

Interrupts When a device is ready or error occurs Controller interrupts CPU Interrupt is like an exception But not synchronized to instruction execution Can invoke handler between instructions Cause information often identifies the interrupting device Priority interrupts Devices needing more urgent attention get higher priority Can interrupt handler for a lower priority interrupt

I/O Data Transfer Polling and interrupt-driven I/O CPU transfers data between memory and I/O data registers Time consuming for high-speed devices Direct memory access (DMA) OS provides starting address in memory I/O controller transfers to/from memory autonomously Controller interrupts on completion or error

DMA/Cache Interaction If DMA writes to a memory block that is cached Cached copy becomes stale If write-back cache has dirty block, and DMA reads memory block Reads stale data Need to ensure cache coherence Flush blocks from cache if they will be used for DMA Or use non-cacheable memory locations for I/O

DMA/VM Interaction OS uses virtual addresses for memory DMA blocks may not be contiguous in physical memory Should DMA use virtual addresses? Would require controller to do translation If DMA uses physical addresses May need to break transfers into page-sized chunks Or chain multiple transfers Or allocate contiguous physical pages for DMA Whichever is used, the OS must cooperate by not remapping pages while a DMA transfer involving that page is in progress

The DMA Stale Data Problem In systems with caches, there can be two copies of a data item, one in the cache and one in the main memory For a DMA input (from disk to memory) – the processor will be using stale data if that location is also in the cache For a DMA output (from memory to disk) and a write-back cache –the I/O device will receive stale data if the data is in the cache and has not yet been written back to the memory The coherency problem can be solved by Routing all I/O activity through the cache – expensive and a large negative performance impact Having the OS invalidate all the entries in the cache for an I/O input or force write-backs for an I/O output (called a cache flush) Providing hardware to selectively invalidate cache entries – i.e., need a snooping cache controller