Lecture 18: Memory Systems. Spring 2018 Jason Tang

Similar documents
Contents. Memory System Overview Cache Memory. Internal Memory. Virtual Memory. Memory Hierarchy. Registers In CPU Internal or Main memory

CS 261 Fall Mike Lam, Professor. Memory

CENG3420 Lecture 08: Memory Organization

Memory memories memory

Large and Fast: Exploiting Memory Hierarchy

Computer Organization and Assembly Language (CS-506)

CS 261 Fall Mike Lam, Professor. Memory

COSC 243. Memory and Storage Systems. Lecture 10 Memory and Storage Systems. COSC 243 (Computer Architecture)

Computer Organization: A Programmer's Perspective

Computer Architecture and System Software Lecture 09: Memory Hierarchy. Instructor: Rob Bergen Applied Computer Science University of Winnipeg

Module 1: Basics and Background Lecture 4: Memory and Disk Accesses. The Lecture Contains: Memory organisation. Memory hierarchy. Disks.

Storage Technologies and the Memory Hierarchy

CS 33. Memory Hierarchy I. CS33 Intro to Computer Systems XVI 1 Copyright 2016 Thomas W. Doeppner. All rights reserved.

CS429: Computer Organization and Architecture

Computer Systems. Memory Hierarchy. Han, Hwansoo

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 26, SPRING 2013

CS429: Computer Organization and Architecture

Random Access Memory (RAM)

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Advanced Parallel Architecture Lesson 4 bis. Annalisa Massini /2015

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 26, FALL 2012

ECE 341. Lecture # 16

Memory Hierarchy Y. K. Malaiya

Announcement. Computer Architecture (CSC-3501) Lecture 20 (08 April 2008) Chapter 6 Objectives. 6.1 Introduction. 6.

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

CENG4480 Lecture 09: Memory 1

Memory Pearson Education, Inc., Hoboken, NJ. All rights reserved.

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2017 Lecture 13

UNIT-V MEMORY ORGANIZATION

Chapter 4 Main Memory

Semiconductor Memory Types Microprocessor Design & Organisation HCA2102

CSCI-UA.0201 Computer Systems Organization Memory Hierarchy

The Memory Hierarchy 10/25/16

Concept of Memory. The memory of computer is broadly categories into two categories:

k -bit address bus n-bit data bus Control lines ( R W, MFC, etc.)

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. 5 th. Edition. Chapter 5. Large and Fast: Exploiting Memory Hierarchy

COMPUTER ARCHITECTURE

+ Random-Access Memory (RAM)

Memory Technology. Chapter 5. Principle of Locality. Chapter 5 Large and Fast: Exploiting Memory Hierarchy 1

PRATHYUSHA INSTITUTE OF TECHNOLOGY AND MANAGEMENT

5. Memory Hierarchy Computer Architecture COMP SCI 2GA3 / SFWR ENG 2GA3. Emil Sekerinski, McMaster University, Fall Term 2015/16

Giving credit where credit is due

MEMORY. Computer memory refers to the hardware device that are used to store and access data or programs on a temporary or permanent basis.

BCN1043. By Dr. Mritha Ramalingam. Faculty of Computer Systems & Software Engineering

Computer Architecture and System Software Lecture 08: Assembly Language Programming + Memory Hierarchy

Chapter 6 Objectives

Chapter 5 Internal Memory

Foundations of Computer Systems

Memory classification:- Topics covered:- types,organization and working

COMPUTER ARCHITECTURE AND ORGANIZATION

Virtual Memory. Reading. Sections 5.4, 5.5, 5.6, 5.8, 5.10 (2) Lecture notes from MKP and S. Yalamanchili

The Memory Hierarchy Sept 29, 2006

Random-Access Memory (RAM) CS429: Computer Organization and Architecture. SRAM and DRAM. Flash / RAM Summary. Storage Technologies

CISC 360. The Memory Hierarchy Nov 13, 2008

Chapter 6 Objectives

Organization. 5.1 Semiconductor Main Memory. William Stallings Computer Organization and Architecture 6th Edition

COMPUTER ORGANIZATION AND DESIGN

UNIT:4 MEMORY ORGANIZATION

William Stallings Computer Organization and Architecture 6th Edition. Chapter 5 Internal Memory

The Memory Hierarchy /18-213/15-513: Introduction to Computer Systems 11 th Lecture, October 3, Today s Instructor: Phil Gibbons

MEMORY. Objectives. L10 Memory

,e-pg PATHSHALA- Computer Science Computer Architecture Module 25 Memory Hierarchy Design - Basics

Module 5a: Introduction To Memory System (MAIN MEMORY)

Memory. Objectives. Introduction. 6.2 Types of Memory

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

The Memory Hierarchy / : Introduction to Computer Systems 10 th Lecture, Feb 12, 2015

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2014 Lecture 14

Basic Organization Memory Cell Operation. CSCI 4717 Computer Architecture. ROM Uses. Random Access Memory. Semiconductor Memory Types

ECE468 Computer Organization and Architecture. Memory Hierarchy

211: Computer Architecture Summer 2016

CS 153 Design of Operating Systems

The University of Adelaide, School of Computer Science 13 September 2018

Computer Architecture A Quantitative Approach, Fifth Edition. Chapter 2. Memory Hierarchy Design. Copyright 2012, Elsevier Inc. All rights reserved.

Adapted from instructor s supplementary material from Computer. Patterson & Hennessy, 2008, MK]

Memory and Disk Systems

CS 61C: Great Ideas in Computer Architecture. The Memory Hierarchy, Fully Associative Caches

CS 61C: Great Ideas in Computer Architecture. Direct Mapped Caches

1.1 Bits and Bit Patterns. Boolean Operations. Figure 2.1 CPU and main memory connected via a bus. CS11102 Introduction to Computer Science

CHAPTER 6 Memory. CMPS375 Class Notes Page 1/ 16 by Kuo-pao Yang

Overview. EE 4504 Computer Organization. Historically, the limiting factor in a computer s performance has been memory access time

Computer Organization. 8th Edition. Chapter 5 Internal Memory

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface

Where Have We Been? Ch. 6 Memory Technology

Caches. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Internal Memory. Computer Architecture. Outline. Memory Hierarchy. Semiconductor Memory Types. Copyright 2000 N. AYDIN. All rights reserved.

Today. The Memory Hierarchy. Byte Oriented Memory Organization. Simple Memory Addressing Modes

NEXT SET OF SLIDES FROM DENNIS FREY S FALL 2011 CMSC313.

LECTURE 5: MEMORY HIERARCHY DESIGN

Random-Access Memory (RAM) Lecture 13 The Memory Hierarchy. Conventional DRAM Organization. SRAM vs DRAM Summary. Topics. d x w DRAM: Key features

Computer Organization

V. Primary & Secondary Memory!

Design and Implementation of an AHB SRAM Memory Controller

Copyright 2012, Elsevier Inc. All rights reserved.

Topic 4: Storage Devices

Computer Architecture. A Quantitative Approach, Fifth Edition. Chapter 2. Memory Hierarchy Design. Copyright 2012, Elsevier Inc. All rights reserved.

(Advanced) Computer Organization & Architechture. Prof. Dr. Hasan Hüseyin BALIK (5 th Week)

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Computer Architecture ECE 568

Semiconductor Memory Types. Computer & Microprocessor Architecture HCA103. Memory Cell Operation. Semiconductor Memory.

Storage Devices for Database Systems

Copyright 2012, Elsevier Inc. All rights reserved.

Transcription:

Lecture 18: Memory Systems Spring 2018 Jason Tang 1

Topics Memory hierarchy Memory operations Cache basics 2

Computer Organization Computer Processor Memory Devices Control Datapath Input Output So far, discussion has focused on processor design Memory system is not just a bunch of flip-flops Its design greatly affects system performance 3

Memory Hierarchy Multiple memory systems on a modern computer Faster Smaller More Expensive Towards processor Slower Larger Less Expensive Towards cloud Registers Internal Cache External Cache Main Memory Solid State Drive Magnetic Hard Disk Tape Drive Processor Primary Storage Secondary Storage Controlled by Compiler Controlled by Operating System 4

Processor to Memory Performance Processor-Memory performance gap has grown over years Memory is bottleneck for many operations https://www.extremetech.com/computing/252007-mitannounces-breakthrough-3d-chips-integrate-memory-cpu 5

Memory Terminology Temporal Locality: Data recently accessed are likely to be accessed again Spatial Locality: If some data are accessed, nearby data are likely to be accessed next Line: Size of a data increment for a particular memory level Hit: Data appear in a some line for a particular memory level Hit Rate: Ratio of accesses resolved by that memory level Hit Time: Time to access memory, equal to Memory Access Time + Time to determine hit/miss 6

Memory Technology Types Random Access: access time is same for all locations SRAM: Static Random Access Memory DRAM: Dynamic Random Access Memory NVRAM: Non-Volatile Random Access Memory Linear Access: access time varies from location to location Almost-Linear : can jump to a location, and then linear access Sequential Access: must access memory purely linearly 7

Examples of Memory Technologies Memory Technology ROM SRAM DRAM NVRAM Magnetic Optical Sequential Access Examples PROM, EPROM, Bootstrap CPU Registers, Cache DDR, GPU DDR Solid State Drive, SD Card, Firmware Floppy Drive, Hard Disk CD, DVD, Blu-ray Tape drive, Paper tape 8

SRAM Basic flip-flop, using six to eight transistors per bit Very fast, very small Access time is measured in picoseconds Instead of accessing a single bit at a time, SRAM are accessed a row at a time Low power, but volatile Consumes little power to maintain memory while system is idle http://www.radio-electronics.com/info/data/ semicond/memory/sram-memory-basics-tutorial.php 9

DRAM Memory bit stored in a capacitor Because capacitor discharges over time, it must be periodically refreshed (hence dynamic RAM) Simpler than SRAM, but slower (measured in nanoseconds) and uses more power Every time a bit is read, its capacitor is discharged and thus the read value must be rewritten back to that capacitor Separate DRAM clock responsible for refreshing all of DRAM every (often) 64 milliseconds, either all at once, or one row at a time staggered During a refresh, access to that DRAM is stalled http://www.radio-electronics.com/info/data/semicond/ memory/dram-technology-basics-tutorial.php 10

DRAM Organization During a read, a row address strobe (RAS) discharges the capacitors selected by the row address line; the resulting values are stored into a row buffer That row buffer is rewritten back to DRAM Column address then selects which of those bits in the row buffer to then return to the processor Modern DRAM consist of multiple parallel chips to handle simultaneous requests https://en.wikipedia.org/wiki/ Dynamic_random-access_memory 11

Rowhammer Attack DRAM capacitors can leak to nearby row, especially given modern densely packaged DRAM When two rows are constantly refreshed, the row in between could have its voltage changed If that victim row is not refreshed soon enough, then a disturbance error occurs This results in an arbitrary write to memory, bypassing software security schemes https://en.wikipedia.org/wiki/row_hammer 12

NVRAM Heavily used in modern systems: For system execution, in firmware and firmware settings As secondary storage, in solid-state drives (SSD), USB flash drives, and SD cards Two variants: NAND flash (more common) and NOR flash Block erasure: must erase entire block at a time Memory wear: may only erase the same block finite times 13

NAND versus NOR Flash NOR flash has random byte-level access, is faster to read, but slow to write Good for mostly read-only operations, like storing code NAND flash is cheaper than NOR flash, smaller, but must read and write an entire row at a time Good for storing data files Flash memory is also susceptible to rowhammer attacks https://www.omicsonline.org/open-access/nand-flash-memoryorganization-and-operations-2165-7866-1000139.php?aid=46500 14

Magnetic Hard Disk Spindle motor spins a stack of platters coated with magnetic material Spins from 5400 to over 10000 RPMs Actuator motor moves a disk head over the platters, to sense polarity of the track underneath https://www.technobuffalo.com/2012/11/24/western-digitalexpands-high-performance-wd-black-hard-drive-line-to-4tb/ 15

Magnetic Hard Disk Cylinder: All of the tracks under the disk read heads for all platters Sector: A fixed-size subdivision of a track, often 512 bytes Positioning time (random-access time): time to move disk arm to desired cylinder (seek time) plus time for desired sector to rotate under disk head (rotational latency) Measured in milliseconds Transfer rate: rate which data flow between drive and computer Modern SATA III transfer rate is 6 Gb/sec 16

Caching Technically, a cache is any memory device that stores a subset of a slower memory system in a faster memory system Example: frequently accessed data files are stored in the SSD of a hybrid disk system Example: a copy of frequently read files are stored in a ramdisk Example: frequently accessed data bits are stored in processor cache Cache for this class refers to the processor cache Constructed as a series of blocks 17

Cache Basics Upon a request for some bit of memory, cache is first checked If data are in cache, those bits are used (a hit) Otherwise, target data are brought from memory into cache (a miss) X4 X1 Xn 2 Xn 1 X2 X3 a. Before the reference to Xn X4 X1 Xn 2 Xn 1 X2 Xn X3 b. After the reference to Xn In simplest case, cache is direct mapped Each cache location holds a single word and corresponds to a memory address: (block address) mod (number of blocks in cache) 18

Cache Metadata Index: resulting cache block number given an address For direct-mapped cache, the result of modulo operation When multiple addresses map to same index, need some way to distinguish which particular memory address is being cached Tag: extra bits recording which particular address is held Valid bit: bit indicating if tag holds a valid address 19

Building a Direct Cache Cache size depends upon number of cache blocks, address length, data word size Hit Tag Address (showing bit positions) 31 30 13 12 11 2 1 0 20 10 Byte offset Data Index Example: 32-bit addresses, 32-bit words, 1024 cache blocks, and a single valid bit per cache block Index 0 1 2 Valid Tag Data Tag is thus 20 bits 1021 1022 1023 A cache block thus uses 53 bits 20 32 Thus total cache size is 54272 bits 20