Computer and Digital System Architecture

Size: px
Start display at page:

Download "Computer and Digital System Architecture"

Transcription

1 Computer and Digital System Architecture EE/CpE-517-A Bruce McNair Stevens Institute of Technology - All rights reserved 1-1/68

2 Week 9 Hierarchical organization of system memory Furber Ch 10 Patterson & Hennessy Ch 5, 6 Stevens Institute of Technology - All rights reserved 1-2/68

3 Caching and memory organization analogy Desktop Stevens Institute of Technology - All rights reserved 1-3/68

4 Caching and memory organization analogy Local shelves Desktop Stevens Institute of Technology - All rights reserved 1-4/68

5 Caching and memory organization analogy Networks of libraries Local shelves Desktop Stevens Institute of Technology - All rights reserved 1-5/68

6 Caching and memory organization analogy Volume: ~1000s Access: ~minutes-hours Networks of libraries Volume: ~1,000,000s Access: ~days-weeks Local shelves Volume: ~10s Access: ~seconds-minutes Desktop Stevens Institute of Technology - All rights reserved 1-6/68

7 Memory cost/performance 100 ms Disk 10 ms 1 ms Access time 100 ms 10 ms 1 ms 100 ns DRAM 10 ns SRAM 1 ns ,000 10,000 $/GB Stevens Institute of Technology - All rights reserved 1-7/68

8 Memory hierarchy High-bandwidth, low-latency interface Low-bandwidth, high-latency interface Processor Small, fast memory Medium size/speed memory Increasing physical, electrical and logical separation Large, slow memory Stevens Institute of Technology - All rights reserved 1-8/68

9 Memory hierarchy Processor Small, fast memory How do you get the important data where you need it? Medium size/speed memory Large, slow memory Stevens Institute of Technology - All rights reserved 1-9/68

10 Typical memory hierarchy embedded systems ~100 bytes Processor registers Access in 1-3 nanoseconds ~8-32 kb RAM or RAM/cache Processor chip Access in ~10 nanoseconds ~10s 100s MB Off-chip RAM Access in ~100 nanoseconds Stevens Institute of Technology - All rights reserved 1-10/68

11 Typical memory hierarchy general purpose systems Processor registers RAM or RAM/cache Processor chip Multi-level cache Off-chip RAM/cache Mass storage Stevens Institute of Technology - All rights reserved 1-11/68

12 On-chip RAM vs cache memory Processor registers Processor registers RAM Processor chip cache RAM Processor chip Requires direct control of memory contents Predictable/deterministic behavior easy to predict interrupt latency Lower power Cheaper Requires complex support logic Handles dynamic operation of program without programmer intervention Unpredictable, nondeterministic behavior Hard to predict interrupt latency Stevens Institute of Technology - All rights reserved 1-12/68

13 Cache architecture FFFF FFFF 16 registers instructions processor address copies of instructions instructions and data data copies of data cache instructions and data memory Unified (single) cache Stevens Institute of Technology - All rights reserved 1-13/68

14 Cache architecture copies of instructions FFFF FFFF 16 cache address instructions instructions registers processor address data data copies of data cache memory Separate (modified Harvard architecture) instruction and data cache Stevens Institute of Technology - All rights reserved 1-14/68

15 Cache performance processor fetch execute fetch execute fetch execute fetch execute fetch execute X cache hit cache cache miss memory Cache hit rate = %(reads from cache)/(total reads) should be ~100% Depends on cache size and organization Stevens Institute of Technology - All rights reserved 1-15/68

16 Cache performance processor fetch execute fetch execute fetch execute fetch execute fetch execute X cache hit cache ( ) t = p t + p t + t access hit cache miss cache memory cache miss memory Cache hit rate = %(reads from cache)/(total reads) should be ~100% Depends on cache size and organization Stevens Institute of Technology - All rights reserved 1-16/68

17 Cache organization Direct mapped cache address: tag index tag RAM data RAM decoder compare mux hit data Typical tag: Block_address (modulo) cache_size Stevens Institute of Technology - All rights reserved 1-17/68

18 Portion of address used as tag for comparison with cache Cache organization Direct mapped cache address: tag index Portion of address used to index cache Tag is shorthand for data address reference decoder tag RAM data RAM Grouped lines of data Tag and index are calculated in parallel to increase speed Tag RAM is much smaller than data RAM faster access compare mux hit data Stevens Institute of Technology - All rights reserved 1-18/68

19 Cache organization Direct mapped cache example address: tag index Consider: decoder tag RAM data RAM 8 kb cache 16-byte data lines 512 lines 32-bit address: - 4-bits within data line - 9-bits to select line - leaves 19-bits for tag - requires ~1kB tag RAM compare mux hit data Stevens Institute of Technology - All rights reserved 1-19/68

20 Cache organization Direct mapped cache address: tag RAM tag index data RAM One memory item takes one cache location Items with same cache address contend for storage decoder Tag contention: addr2 = addr1 + (N x cache_size) compare hit mux data Different physical addresses have the same cache tag Stevens Institute of Technology - All rights reserved 1-20/68

21 Cache organization Set-associative cache address: tag index decoder tag RAM data RAM compare mux Hit Data compare mux decoder tag RAM data RAM Stevens Institute of Technology - All rights reserved 1-21/68

22 Cache organization Set-associative cache address: tag index decoder tag RAM data RAM Two direct-mapped caches compare Hit mux Contention of two data items sharing same cache location is avoided by duplicating Data cache compare mux decoder tag RAM data RAM Stevens Institute of Technology - All rights reserved 1-22/68

23 address: tag Cache organization Set-associative cache example index tag RAM data RAM Consider: decoder compare Hit mux Data 8 kb cache 16-byte data lines 256 lines in each half 32-bit address: - 4-bits within data line - 8-bits to select line - leaves 20-bits for tag - requires ~1kB tag RAM compare mux Slightly longer access time due to MUX delay time, but better performance due to less contention decoder tag RAM data RAM Stevens Institute of Technology - All rights reserved 1-23/68

24 address: tag Cache organization Set-associative cache example index decoder tag RAM data RAM When retrieving data, information present in either half of cache can be accessed, but when writing data, which half of cache should be used? compare mux Hit Data compare mux decoder tag RAM data RAM Stevens Institute of Technology - All rights reserved 1-24/68

25 address: tag Cache organization Set-associative cache example index decoder tag RAM data RAM When retrieving data, information present in either half of cache can be accessed, but when writing data, which half of cache should be used? compare compare Hit mux mux Data Options: Random assignment Least recently used Cyclic (round-robin) assign data alternatively to each half of cache decoder tag RAM data RAM Stevens Institute of Technology - All rights reserved 1-25/68

26 address: address: tag tag Cache organization Set-associative cache example index index decoder decoder tag tag RAM RAM data RAM data RAM The set-associative cache shown was a 2-way set associative cache Same approach could be used for higher level of associativity, but 4 is typical limit compare compare mux mux Hit Hit Data Data compare compare mux mux decoder decoder tag tag RAM RAM data RAM data RAM Stevens Institute of Technology - All rights reserved 1-26/68

27 Cache organization Fully-associative cache CAM: Content addressable memory content comparator is builtin Automatically performs search to find data given by tag address: tag CAM tag index data RAM Tag CAM stores all address bits other than those used to address bytes within line mux hit data Stevens Institute of Technology - All rights reserved 1-27/68

28 Read vs write strategies Read data/instruction processor cache Is info in cache yes no Cache miss: retrieve Information from memory memory Cache hit: Return cached information Continue processing Stevens Institute of Technology - All rights reserved 1-28/68

29 Read vs write strategies processor Write-through: Processor waits as data is written to memory If a copy is cached, cache is updated, also cache memory Advantages: Simplest Disadvantages: Slowest Stevens Institute of Technology - All rights reserved 1-29/68

30 Read vs write strategies processor Write-through with buffered write: Processor writes immediately to write buffer Write buffer writes data back to memory Cache is updated if needed buffer cache memory Advantages: Does not slow processor down Disadvantages: Additional hardware buffer needed Stevens Institute of Technology - All rights reserved 1-30/68

31 Read vs write strategies processor cache Copy-back (write-back): Copy-back cache is not kept consistent with memory Write only updates cache Cache lines remember when they have been modified using a dirty bit If dirty cache line gets allocated to new data, old data gets copied back first memory Advantages: Fastest with minimal memory bandwidth utilization Disadvantages: Most complicated of the three Potential issues if data synchronization is lost Stevens Institute of Technology - All rights reserved 1-31/68

32 Cache features and options Organizational feature Options Cache-MMU relationship Physical cache Virtual cache Cache contents Unified instruction and data cache Separate instruction and data cache Associativity Direct-mapped RAM-RAM Set-associative RAM-RAM Fully-associative CAM-RAM Replacement strategy Round-robin Random LRU Write strategy Write-through Write-through with write buffer Copy-back Stevens Institute of Technology - All rights reserved 1-32/68

33 ARM-3 cache performance example Caching options Relative performance No cache 10 Data-only cache 113 Instruction-only cache 195 Instruction and data cache 25 Stevens Institute of Technology - All rights reserved 1-33/68

34 ARM-3 cache performance example Caching options Relative performance No cache 10 Data-only cache 113 Instruction-only cache 195 Instruction and data cache 25 Instruction cache has maximum impact Stevens Institute of Technology - All rights reserved 1-34/68

35 ARM-3 performance relati ve performance 25 Relative performance depends on cache size and type of cache associative 05 2-way ca che size (Kbytes) 1 1/4 direct-mapped Stevens Institute of Technology - All rights reserved 1-35/68

36 Performance improvement with associativity associativity (ways) performance bandwidth Stevens Institute of Technology - All rights reserved 1-36/68

37 Performance improvement with associativity Improved performance with any associativity 25 Diminished improvement in performance with higher associativity associativity (ways) performance bandwidth Stevens Institute of Technology - All rights reserved 1-37/68

38 Performance improvement with associativity Virtually same performance For 64 vs 256 way assoc cache Split 256-way cache into four 64-way cache sections 3/4 inactive sections can be powered down associativity (ways) performance bandwidth Stevens Institute of Technology - All rights reserved 1-38/68

39 ARM3 cache organization virtual address user/supervisor enable decode [1:0] [3:2] data RAM byte addresses tag CAM tag CAM tag CAM tag CAM [9:0] 64 entry 64 entry 64 entry 64 entry 1024 x 32-bit word [9:4] hit data Stevens Institute of Technology - All rights reserved 1-39/68

40 ARM3 cache organization Select 1 of 4 CAM tag stores word select within cache line 31 address to look up in CAM store virtual address byte select within word user/supervisor enable decode [1:0] [3:2] data RAM byte addresses tag CAM tag CAM tag CAM tag CAM [9:0] 64 entry 64 entry 64 entry 64 entry 1024 x 32-bit word [9:4] hit data Stevens Institute of Technology - All rights reserved 1-40/68

41 Memory management in typical multitasking system Task switching Active process User process - 1 Supervisory process - 1 Stevens Institute of Technology - All rights reserved 1-41/68

42 Segmented memory management Memory processor MMU process memory table User process 1 stack segment User process 1 data segment User process 1 code segment Stevens Institute of Technology - All rights reserved 1-42/68

43 Segmented MMU Processor segment selector logical address Address base limit segment descriptor table limit + physical address >? access fault base segment logical addr physical address = segment_base_addr + logical_addr exception if (logical_addr > limit) Stevens Institute of Technology - All rights reserved 1-43/68

44 Issues with segmented memory managment Changing mix of coresident processes Memory U_proc 7 stack U_proc -7 data U_proc -7 code U_proc 3 stack U_proc 3 data U_proc -3 code Memory fragmentation User process 1 stack segment User process 1 data segment User process 1 code segment Stevens Institute of Technology - All rights reserved 1-44/68

45 Paging memory management Processor logical address data page directory page table page frame Stevens Institute of Technology - All rights reserved 1-45/68

46 Paging memory management Processor logical address data page directory page table page frame With single translation table, 4 kb pages would require 20-bit addresses, or to translate a 32-bit address, 2 20 x 20 = 25 MB Stevens Institute of Technology - All rights reserved 1-46/68

47 Paging memory management Processor logical address data page directory page table page frame With single translation table, 4 kb pages would require 20-bit addresses, or to translate a 32-bit address, 2 20 x 20 = 25 MB With two levels of paging, 10 bits could be used for 2 nd level page, in 1 st level page directory, next 10 bits could contain physical page number Stevens Institute of Technology - All rights reserved 1-47/68

48 Paging memory management Processor logical address data page directory page table page frame With two levels of paging, 10 bits could be used for 2 nd level page, in 1 st level page directory, next 10 bits could contain physical page number With 32-bits per directory and page table entry, and each 4 kb, a minimal 1 page system with 8 kb could manage 4 MB of memory, or a full system with 4 MB of tables could manage 32 GB Stevens Institute of Technology - All rights reserved 1-48/68

49 Virtual memory paging tables processor MMU memory storage memory access segment request Stevens Institute of Technology - All rights reserved 1-49/68

50 Virtual memory paging tables processor MMU memory storage memory access segment request (absent) Stevens Institute of Technology - All rights reserved 1-50/68

51 Virtual memory paging tables swapped out new processor MMU memory storage memory access segment request (absent) swap out segment Stevens Institute of Technology - All rights reserved 1-51/68

52 Virtual memory paging tables swapped out new new processor MMU memory storage memory access retry access swap in new segment Stevens Institute of Technology - All rights reserved 1-52/68

53 Virtual memory paging tables swapped out new new processor MMU memory storage memory access retry access Logical program size can be bigger than physical memory Stevens Institute of Technology - All rights reserved 1-53/68

54 Restartable instructions void main(void) { float x[10]; int y; z = subr(x, y); } Processor MMU cache memory request Stevens Institute of Technology - All rights reserved 1-54/68

55 Restartable instructions void main(void) { float x[10]; int y; z = subr(x, y); } Processor MMU cache memory exception Stevens Institute of Technology - All rights reserved 1-55/68

56 Restartable instructions void main(void) { float x[10]; int y; z = subr(x, y); } Processor MMU cache memory interrupt swap Stevens Institute of Technology - All rights reserved 1-56/68

57 Restartable instructions void main(void) { float x[10]; int y; z = subr(x, y); } Processor MMU cache memory start new task Stevens Institute of Technology - All rights reserved 1-57/68

58 Restartable instructions void main(void) { float x[10]; int y; z = subr(x, y); } Processor MMU cache memory segment ready swap segment Stevens Institute of Technology - All rights reserved 1-58/68

59 Restartable instructions void main(void) { float x[10]; int y; z = subr(x, y); } Processor MMU cache memory interrupt Stevens Institute of Technology - All rights reserved 1-59/68

60 Restartable instructions void main(void) { float x[10]; int y; z = subr(x, y); } Processor MMU cache memory restore state of previous process Processor must retain enough state (CPSR, stack, registers, etc) to restore running program following segmentation fault Stevens Institute of Technology - All rights reserved 1-60/68

61 Tradeoffs with paging Advantages: Complete freedom in running arbitrary code size Transparency to memory limitations/control Disadvantages: Multiple memory accesses to retrieve data (page directory + page table) Stevens Institute of Technology - All rights reserved 1-61/68

62 Tradeoffs with paging Advantages: Complete freedom in running arbitrary code size Transparency to memory limitations/control Disadvantages: Multiple memory accesses to retrieve data (page directory + page table) Solution: Cache recently used page translations (Translation Look-aside Buffers) Stevens Institute of Technology - All rights reserved 1-62/68

63 Translation look-aside buffer logical address hit logical page number physical page number physical address Stevens Institute of Technology - All rights reserved 1-63/68

64 Virtual and physical caches Virtual address processor MMU cache memory Virtual address Physical address Stevens Institute of Technology - All rights reserved 1-64/68

65 Virtual and physical caches Virtual address processor MMU cache memory Virtual address Physical address Cache access can start immediately after process produces an address no need to activate MMU if data is in cache But, cache may contain synonyms duplicate copies of same data in cache due to overlapping translations Processor may update one of several synonyms Stevens Institute of Technology - All rights reserved 1-65/68

66 Virtual and physical caches Physical address processor MMU cache memory Virtual address Physical address Stevens Institute of Technology - All rights reserved 1-66/68

67 Virtual and physical caches Physical address processor MMU cache memory Virtual address Physical address There are no problems with synonyms, since the cache contains copies of physical memory only MMU must be started up for all cache accesses, consuming power and potentially slowing cache access down Stevens Institute of Technology - All rights reserved 1-67/68

68 Intel i7 cache architecture processor 32 kb/core 4-way set assoc LRU 64-byte block write-back L1 L1 instruction instruction cache cache L1 L1 instruction cache per core 256 kb/core 8-way set assoc LRU 64-byte block write-back L2 unified cache L2 unified cache L2 L2 unified unified cache cache per core L1 L1 data data cache cache L1 L1 data cache per core 32 kb/core 8-way set assoc LRU 64-byte block write-back L3 unified cache (shared) 8 MB-shared 16-way set assoc 64-byte block write-back Memory (2 44 physical, 2 48 virtual) Stevens Institute of Technology - All rights reserved 1-68/68

Virtual Memory. Patterson & Hennessey Chapter 5 ELEC 5200/6200 1

Virtual Memory. Patterson & Hennessey Chapter 5 ELEC 5200/6200 1 Virtual Memory Patterson & Hennessey Chapter 5 ELEC 5200/6200 1 Virtual Memory Use main memory as a cache for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs

More information

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 7: Memory Organization Part II

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 7: Memory Organization Part II ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 7: Organization Part II Ujjwal Guin, Assistant Professor Department of Electrical and Computer Engineering Auburn University, Auburn,

More information

Page 1. Multilevel Memories (Improving performance using a little cash )

Page 1. Multilevel Memories (Improving performance using a little cash ) Page 1 Multilevel Memories (Improving performance using a little cash ) 1 Page 2 CPU-Memory Bottleneck CPU Memory Performance of high-speed computers is usually limited by memory bandwidth & latency Latency

More information

COMP 3221: Microprocessors and Embedded Systems

COMP 3221: Microprocessors and Embedded Systems COMP 3: Microprocessors and Embedded Systems Lectures 7: Cache Memory - III http://www.cse.unsw.edu.au/~cs3 Lecturer: Hui Wu Session, 5 Outline Fully Associative Cache N-Way Associative Cache Block Replacement

More information

Chapter Seven. Memories: Review. Exploiting Memory Hierarchy CACHE MEMORY AND VIRTUAL MEMORY

Chapter Seven. Memories: Review. Exploiting Memory Hierarchy CACHE MEMORY AND VIRTUAL MEMORY Chapter Seven CACHE MEMORY AND VIRTUAL MEMORY 1 Memories: Review SRAM: value is stored on a pair of inverting gates very fast but takes up more space than DRAM (4 to 6 transistors) DRAM: value is stored

More information

SE-292 High Performance Computing. Memory Hierarchy. R. Govindarajan

SE-292 High Performance Computing. Memory Hierarchy. R. Govindarajan SE-292 High Performance Computing Memory Hierarchy R. Govindarajan govind@serc Reality Check Question 1: Are real caches built to work on virtual addresses or physical addresses? Question 2: What about

More information

Memory Hierarchy. Mehran Rezaei

Memory Hierarchy. Mehran Rezaei Memory Hierarchy Mehran Rezaei What types of memory do we have? Registers Cache (Static RAM) Main Memory (Dynamic RAM) Disk (Magnetic Disk) Option : Build It Out of Fast SRAM About 5- ns access Decoders

More information

Memory and multiprogramming

Memory and multiprogramming Memory and multiprogramming COMP342 27 Week 5 Dr Len Hamey Reading TW: Tanenbaum and Woodhull, Operating Systems, Third Edition, chapter 4. References (computer architecture): HP: Hennessy and Patterson

More information

Lctures 33: Cache Memory - I. Some of the slides are adopted from David Patterson (UCB)

Lctures 33: Cache Memory - I. Some of the slides are adopted from David Patterson (UCB) Lctures 33: Cache Memory - I Some of the slides are adopted from David Patterson (UCB) Outline Memory Hierarchy On-Chip SRAM Direct-Mapped Cache Review: ARM System Architecture Fast on-chip RAM External

More information

1. Creates the illusion of an address space much larger than the physical memory

1. Creates the illusion of an address space much larger than the physical memory Virtual memory Main Memory Disk I P D L1 L2 M Goals Physical address space Virtual address space 1. Creates the illusion of an address space much larger than the physical memory 2. Make provisions for

More information

Memory hierarchy and cache

Memory hierarchy and cache Memory hierarchy and cache QUIZ EASY 1). What is used to design Cache? a). SRAM b). DRAM c). Blend of both d). None. 2). What is the Hierarchy of memory? a). Processor, Registers, Cache, Tape, Main memory,

More information

LECTURE 4: LARGE AND FAST: EXPLOITING MEMORY HIERARCHY

LECTURE 4: LARGE AND FAST: EXPLOITING MEMORY HIERARCHY LECTURE 4: LARGE AND FAST: EXPLOITING MEMORY HIERARCHY Abridged version of Patterson & Hennessy (2013):Ch.5 Principle of Locality Programs access a small proportion of their address space at any time Temporal

More information

EN1640: Design of Computing Systems Topic 06: Memory System

EN1640: Design of Computing Systems Topic 06: Memory System EN164: Design of Computing Systems Topic 6: Memory System Professor Sherief Reda http://scale.engin.brown.edu Electrical Sciences and Computer Engineering School of Engineering Brown University Spring

More information

EITF20: Computer Architecture Part 5.1.1: Virtual Memory

EITF20: Computer Architecture Part 5.1.1: Virtual Memory EITF20: Computer Architecture Part 5.1.1: Virtual Memory Liang Liu liang.liu@eit.lth.se 1 Outline Reiteration Cache optimization Virtual memory Case study AMD Opteron Summary 2 Memory hierarchy 3 Cache

More information

and data combined) is equal to 7% of the number of instructions. Miss Rate with Second- Level Cache, Direct- Mapped Speed

and data combined) is equal to 7% of the number of instructions. Miss Rate with Second- Level Cache, Direct- Mapped Speed 5.3 By convention, a cache is named according to the amount of data it contains (i.e., a 4 KiB cache can hold 4 KiB of data); however, caches also require SRAM to store metadata such as tags and valid

More information

Chapter 5A. Large and Fast: Exploiting Memory Hierarchy

Chapter 5A. Large and Fast: Exploiting Memory Hierarchy Chapter 5A Large and Fast: Exploiting Memory Hierarchy Memory Technology Static RAM (SRAM) Fast, expensive Dynamic RAM (DRAM) In between Magnetic disk Slow, inexpensive Ideal memory Access time of SRAM

More information

CS 152 Computer Architecture and Engineering. Lecture 7 - Memory Hierarchy-II

CS 152 Computer Architecture and Engineering. Lecture 7 - Memory Hierarchy-II CS 152 Computer Architecture and Engineering Lecture 7 - Memory Hierarchy-II Krste Asanovic Electrical Engineering and Computer Sciences University of California at Berkeley http://www.eecs.berkeley.edu/~krste

More information

LECTURE 10: Improving Memory Access: Direct and Spatial caches

LECTURE 10: Improving Memory Access: Direct and Spatial caches EECS 318 CAD Computer Aided Design LECTURE 10: Improving Memory Access: Direct and Spatial caches Instructor: Francis G. Wolff wolff@eecs.cwru.edu Case Western Reserve University This presentation uses

More information

Lecture 2: Memory Systems

Lecture 2: Memory Systems Lecture 2: Memory Systems Basic components Memory hierarchy Cache memory Virtual Memory Zebo Peng, IDA, LiTH Many Different Technologies Zebo Peng, IDA, LiTH 2 Internal and External Memories CPU Date transfer

More information

Computer Architecture. Memory Hierarchy. Lynn Choi Korea University

Computer Architecture. Memory Hierarchy. Lynn Choi Korea University Computer Architecture Memory Hierarchy Lynn Choi Korea University Memory Hierarchy Motivated by Principles of Locality Speed vs. Size vs. Cost tradeoff Locality principle Temporal Locality: reference to

More information

LECTURE 11. Memory Hierarchy

LECTURE 11. Memory Hierarchy LECTURE 11 Memory Hierarchy MEMORY HIERARCHY When it comes to memory, there are two universally desirable properties: Large Size: ideally, we want to never have to worry about running out of memory. Speed

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 28: More Virtual Memory Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Overview Virtual memory used to protect applications from

More information

Reducing Hit Times. Critical Influence on cycle-time or CPI. small is always faster and can be put on chip

Reducing Hit Times. Critical Influence on cycle-time or CPI. small is always faster and can be put on chip Reducing Hit Times Critical Influence on cycle-time or CPI Keep L1 small and simple small is always faster and can be put on chip interesting compromise is to keep the tags on chip and the block data off

More information

ECE 571 Advanced Microprocessor-Based Design Lecture 13

ECE 571 Advanced Microprocessor-Based Design Lecture 13 ECE 571 Advanced Microprocessor-Based Design Lecture 13 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 21 March 2017 Announcements More on HW#6 When ask for reasons why cache

More information

LECTURE 5: MEMORY HIERARCHY DESIGN

LECTURE 5: MEMORY HIERARCHY DESIGN LECTURE 5: MEMORY HIERARCHY DESIGN Abridged version of Hennessy & Patterson (2012):Ch.2 Introduction Programmers want unlimited amounts of memory with low latency Fast memory technology is more expensive

More information

The Memory System. Components of the Memory System. Problems with the Memory System. A Solution

The Memory System. Components of the Memory System. Problems with the Memory System. A Solution Datorarkitektur Fö 2-1 Datorarkitektur Fö 2-2 Components of the Memory System The Memory System 1. Components of the Memory System Main : fast, random access, expensive, located close (but not inside)

More information

LRU. Pseudo LRU A B C D E F G H A B C D E F G H H H C. Copyright 2012, Elsevier Inc. All rights reserved.

LRU. Pseudo LRU A B C D E F G H A B C D E F G H H H C. Copyright 2012, Elsevier Inc. All rights reserved. LRU A list to keep track of the order of access to every block in the set. The least recently used block is replaced (if needed). How many bits we need for that? 27 Pseudo LRU A B C D E F G H A B C D E

More information

Multilevel Memories. Joel Emer Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology

Multilevel Memories. Joel Emer Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology 1 Multilevel Memories Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology Based on the material prepared by Krste Asanovic and Arvind CPU-Memory Bottleneck 6.823

More information

Virtual Memory, Address Translation

Virtual Memory, Address Translation Memory Hierarchy Virtual Memory, Address Translation Slides contents from: Hennessy & Patterson, 5ed Appendix B and Chapter 2 David Wentzlaff, ELE 475 Computer Architecture MJT, High Performance Computing,

More information

CSF Improving Cache Performance. [Adapted from Computer Organization and Design, Patterson & Hennessy, 2005]

CSF Improving Cache Performance. [Adapted from Computer Organization and Design, Patterson & Hennessy, 2005] CSF Improving Cache Performance [Adapted from Computer Organization and Design, Patterson & Hennessy, 2005] Review: The Memory Hierarchy Take advantage of the principle of locality to present the user

More information

Transistor: Digital Building Blocks

Transistor: Digital Building Blocks Final Exam Review Transistor: Digital Building Blocks Logically, each transistor acts as a switch Combined to implement logic functions (gates) AND, OR, NOT Combined to build higher-level structures Multiplexer,

More information

Locality. Cache. Direct Mapped Cache. Direct Mapped Cache

Locality. Cache. Direct Mapped Cache. Direct Mapped Cache Locality A principle that makes having a memory hierarchy a good idea If an item is referenced, temporal locality: it will tend to be referenced again soon spatial locality: nearby items will tend to be

More information

CS 152 Computer Architecture and Engineering. Lecture 7 - Memory Hierarchy-II

CS 152 Computer Architecture and Engineering. Lecture 7 - Memory Hierarchy-II CS 152 Computer Architecture and Engineering Lecture 7 - Memory Hierarchy-II Krste Asanovic Electrical Engineering and Computer Sciences University of California at Berkeley http://www.eecs.berkeley.edu/~krste!

More information

Lecture 12. Memory Design & Caches, part 2. Christos Kozyrakis Stanford University

Lecture 12. Memory Design & Caches, part 2. Christos Kozyrakis Stanford University Lecture 12 Memory Design & Caches, part 2 Christos Kozyrakis Stanford University http://eeclass.stanford.edu/ee108b 1 Announcements HW3 is due today PA2 is available on-line today Part 1 is due on 2/27

More information

Key Point. What are Cache lines

Key Point. What are Cache lines Caching 1 Key Point What are Cache lines Tags Index offset How do we find data in the cache? How do we tell if it s the right data? What decisions do we need to make in designing a cache? What are possible

More information

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Chapter 5. Large and Fast: Exploiting Memory Hierarchy Chapter 5 Large and Fast: Exploiting Memory Hierarchy Memory Technology Static RAM (SRAM) 0.5ns 2.5ns, $2000 $5000 per GB Dynamic RAM (DRAM) 50ns 70ns, $20 $75 per GB Magnetic disk 5ms 20ms, $0.20 $2 per

More information

Memory Hierarchy Y. K. Malaiya

Memory Hierarchy Y. K. Malaiya Memory Hierarchy Y. K. Malaiya Acknowledgements Computer Architecture, Quantitative Approach - Hennessy, Patterson Vishwani D. Agrawal Review: Major Components of a Computer Processor Control Datapath

More information

CSE 431 Computer Architecture Fall Chapter 5A: Exploiting the Memory Hierarchy, Part 1

CSE 431 Computer Architecture Fall Chapter 5A: Exploiting the Memory Hierarchy, Part 1 CSE 431 Computer Architecture Fall 2008 Chapter 5A: Exploiting the Memory Hierarchy, Part 1 Mary Jane Irwin ( www.cse.psu.edu/~mji ) [Adapted from Computer Organization and Design, 4 th Edition, Patterson

More information

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

(Advanced) Computer Organization & Architechture. Prof. Dr. Hasan Hüseyin BALIK (4 th Week) + (Advanced) Computer Organization & Architechture Prof. Dr. Hasan Hüseyin BALIK (4 th Week) + Outline 2. The computer system 2.1 A Top-Level View of Computer Function and Interconnection 2.2 Cache Memory

More information

EITF20: Computer Architecture Part 5.1.1: Virtual Memory

EITF20: Computer Architecture Part 5.1.1: Virtual Memory EITF20: Computer Architecture Part 5.1.1: Virtual Memory Liang Liu liang.liu@eit.lth.se 1 Outline Reiteration Virtual memory Case study AMD Opteron Summary 2 Memory hierarchy 3 Cache performance 4 Cache

More information

Processes and Tasks What comprises the state of a running program (a process or task)?

Processes and Tasks What comprises the state of a running program (a process or task)? Processes and Tasks What comprises the state of a running program (a process or task)? Microprocessor Address bus Control DRAM OS code and data special caches code/data cache EAXEBP EIP DS EBXESP EFlags

More information

CENG 3420 Computer Organization and Design. Lecture 08: Memory - I. Bei Yu

CENG 3420 Computer Organization and Design. Lecture 08: Memory - I. Bei Yu CENG 3420 Computer Organization and Design Lecture 08: Memory - I Bei Yu CEG3420 L08.1 Spring 2016 Outline q Why Memory Hierarchy q How Memory Hierarchy? SRAM (Cache) & DRAM (main memory) Memory System

More information

Virtual Memory, Address Translation

Virtual Memory, Address Translation Memory Hierarchy Virtual Memory, Address Translation Slides contents from: Hennessy & Patterson, 5ed Appendix B and Chapter 2 David Wentzlaff, ELE 475 Computer Architecture MJT, High Performance Computing,

More information

Memory Hierarchy: Caches, Virtual Memory

Memory Hierarchy: Caches, Virtual Memory Memory Hierarchy: Caches, Virtual Memory Readings: 5.1-5.4, 5.8 Big memories are slow Computer Fast memories are small Processor Memory Devices Control Input Datapath Output Need to get fast, big memories

More information

Chapter 6 Caches. Computer System. Alpha Chip Photo. Topics. Memory Hierarchy Locality of Reference SRAM Caches Direct Mapped Associative

Chapter 6 Caches. Computer System. Alpha Chip Photo. Topics. Memory Hierarchy Locality of Reference SRAM Caches Direct Mapped Associative Chapter 6 s Topics Memory Hierarchy Locality of Reference SRAM s Direct Mapped Associative Computer System Processor interrupt On-chip cache s s Memory-I/O bus bus Net cache Row cache Disk cache Memory

More information

Levels in memory hierarchy

Levels in memory hierarchy CS1C Cache Memory Lecture 1 March 1, 1999 Dave Patterson (http.cs.berkeley.edu/~patterson) www-inst.eecs.berkeley.edu/~cs1c/schedule.html Review 1/: Memory Hierarchy Pyramid Upper Levels in memory hierarchy

More information

Memory Hierarchy. Goal: Fast, unlimited storage at a reasonable cost per bit.

Memory Hierarchy. Goal: Fast, unlimited storage at a reasonable cost per bit. Memory Hierarchy Goal: Fast, unlimited storage at a reasonable cost per bit. Recall the von Neumann bottleneck - single, relatively slow path between the CPU and main memory. Fast: When you need something

More information

CS162 Operating Systems and Systems Programming Lecture 14. Caching (Finished), Demand Paging

CS162 Operating Systems and Systems Programming Lecture 14. Caching (Finished), Demand Paging CS162 Operating Systems and Systems Programming Lecture 14 Caching (Finished), Demand Paging October 11 th, 2017 Neeraja J. Yadwadkar http://cs162.eecs.berkeley.edu Recall: Caching Concept Cache: a repository

More information

CS3350B Computer Architecture

CS3350B Computer Architecture CS335B Computer Architecture Winter 25 Lecture 32: Exploiting Memory Hierarchy: How? Marc Moreno Maza wwwcsduwoca/courses/cs335b [Adapted from lectures on Computer Organization and Design, Patterson &

More information

Structure of Computer Systems

Structure of Computer Systems 222 Structure of Computer Systems Figure 4.64 shows how a page directory can be used to map linear addresses to 4-MB pages. The entries in the page directory point to page tables, and the entries in a

More information

COSC 6385 Computer Architecture - Memory Hierarchies (III)

COSC 6385 Computer Architecture - Memory Hierarchies (III) COSC 6385 Computer Architecture - Memory Hierarchies (III) Edgar Gabriel Spring 2014 Memory Technology Performance metrics Latency problems handled through caches Bandwidth main concern for main memory

More information

Topics: Memory Management (SGG, Chapter 08) 8.1, 8.2, 8.3, 8.5, 8.6 CS 3733 Operating Systems

Topics: Memory Management (SGG, Chapter 08) 8.1, 8.2, 8.3, 8.5, 8.6 CS 3733 Operating Systems Topics: Memory Management (SGG, Chapter 08) 8.1, 8.2, 8.3, 8.5, 8.6 CS 3733 Operating Systems Instructor: Dr. Turgay Korkmaz Department Computer Science The University of Texas at San Antonio Office: NPB

More information

EN1640: Design of Computing Systems Topic 06: Memory System

EN1640: Design of Computing Systems Topic 06: Memory System EN164: Design of Computing Systems Topic 6: Memory System Professor Sherief Reda http://scale.engin.brown.edu Electrical Sciences and Computer Engineering School of Engineering Brown University Spring

More information

Memory Hierarchy Computing Systems & Performance MSc Informatics Eng. Memory Hierarchy (most slides are borrowed)

Memory Hierarchy Computing Systems & Performance MSc Informatics Eng. Memory Hierarchy (most slides are borrowed) Computing Systems & Performance Memory Hierarchy MSc Informatics Eng. 2011/12 A.J.Proença Memory Hierarchy (most slides are borrowed) AJProença, Computer Systems & Performance, MEI, UMinho, 2011/12 1 2

More information

Computer Architecture Computer Science & Engineering. Chapter 5. Memory Hierachy BK TP.HCM

Computer Architecture Computer Science & Engineering. Chapter 5. Memory Hierachy BK TP.HCM Computer Architecture Computer Science & Engineering Chapter 5 Memory Hierachy Memory Technology Static RAM (SRAM) 0.5ns 2.5ns, $2000 $5000 per GB Dynamic RAM (DRAM) 50ns 70ns, $20 $75 per GB Magnetic

More information

Computer Architecture Memory hierarchies and caches

Computer Architecture Memory hierarchies and caches Computer Architecture Memory hierarchies and caches S Coudert and R Pacalet January 23, 2019 Outline Introduction Localities principles Direct-mapped caches Increasing block size Set-associative caches

More information

Page 1. Review: Address Segmentation " Review: Address Segmentation " Review: Address Segmentation "

Page 1. Review: Address Segmentation  Review: Address Segmentation  Review: Address Segmentation Review Address Segmentation " CS162 Operating Systems and Systems Programming Lecture 10 Caches and TLBs" February 23, 2011! Ion Stoica! http//inst.eecs.berkeley.edu/~cs162! 1111 0000" 1110 000" Seg #"

More information

EECS151/251A Spring 2018 Digital Design and Integrated Circuits. Instructors: John Wawrzynek and Nick Weaver. Lecture 19: Caches EE141

EECS151/251A Spring 2018 Digital Design and Integrated Circuits. Instructors: John Wawrzynek and Nick Weaver. Lecture 19: Caches EE141 EECS151/251A Spring 2018 Digital Design and Integrated Circuits Instructors: John Wawrzynek and Nick Weaver Lecture 19: Caches Cache Introduction 40% of this ARM CPU is devoted to SRAM cache. But the role

More information

Caches. Hiding Memory Access Times

Caches. Hiding Memory Access Times Caches Hiding Memory Access Times PC Instruction Memory 4 M U X Registers Sign Ext M U X Sh L 2 Data Memory M U X C O N T R O L ALU CTL INSTRUCTION FETCH INSTR DECODE REG FETCH EXECUTE/ ADDRESS CALC MEMORY

More information

Memory Hierarchy Computing Systems & Performance MSc Informatics Eng. Memory Hierarchy (most slides are borrowed)

Memory Hierarchy Computing Systems & Performance MSc Informatics Eng. Memory Hierarchy (most slides are borrowed) Computing Systems & Performance Memory Hierarchy MSc Informatics Eng. 2012/13 A.J.Proença Memory Hierarchy (most slides are borrowed) AJProença, Computer Systems & Performance, MEI, UMinho, 2012/13 1 2

More information

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Chapter 5. Large and Fast: Exploiting Memory Hierarchy Chapter 5 Large and Fast: Exploiting Memory Hierarchy Processor-Memory Performance Gap 10000 µproc 55%/year (2X/1.5yr) Performance 1000 100 10 1 1980 1983 1986 1989 Moore s Law Processor-Memory Performance

More information

Cache memory. Lecture 4. Principles, structure, mapping

Cache memory. Lecture 4. Principles, structure, mapping Cache memory Lecture 4 Principles, structure, mapping Computer memory overview Computer memory overview By analyzing memory hierarchy from top to bottom, the following conclusions can be done: a. Cost

More information

Adapted from David Patterson s slides on graduate computer architecture

Adapted from David Patterson s slides on graduate computer architecture Mei Yang Adapted from David Patterson s slides on graduate computer architecture Introduction Ten Advanced Optimizations of Cache Performance Memory Technology and Optimizations Virtual Memory and Virtual

More information

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Chapter 5. Large and Fast: Exploiting Memory Hierarchy Chapter 5 Large and Fast: Exploiting Memory Hierarchy Processor-Memory Performance Gap 10000 µproc 55%/year (2X/1.5yr) Performance 1000 100 10 1 1980 1983 1986 1989 Moore s Law Processor-Memory Performance

More information

Background. Memory Hierarchies. Register File. Background. Forecast Memory (B5) Motivation for memory hierarchy Cache ECC Virtual memory.

Background. Memory Hierarchies. Register File. Background. Forecast Memory (B5) Motivation for memory hierarchy Cache ECC Virtual memory. Memory Hierarchies Forecast Memory (B5) Motivation for memory hierarchy Cache ECC Virtual memory Mem Element Background Size Speed Price Register small 1-5ns high?? SRAM medium 5-25ns $100-250 DRAM large

More information

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

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Computer Architecture ECE 568/668 UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Computer Architecture ECE 568/668 Part Hierarchy - I Israel Koren ECE568/Koren Part.. 3 4 5 6 7 8 9 A B C D E F 6 blocks 3 4 block

More information

Chapter 6 Memory 11/3/2015. Chapter 6 Objectives. 6.2 Types of Memory. 6.1 Introduction

Chapter 6 Memory 11/3/2015. Chapter 6 Objectives. 6.2 Types of Memory. 6.1 Introduction Chapter 6 Objectives Chapter 6 Memory Master the concepts of hierarchical memory organization. Understand how each level of memory contributes to system performance, and how the performance is measured.

More information

Memory Management. Dr. Yingwu Zhu

Memory Management. Dr. Yingwu Zhu Memory Management Dr. Yingwu Zhu Big picture Main memory is a resource A process/thread is being executing, the instructions & data must be in memory Assumption: Main memory is infinite Allocation of memory

More information

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Chapter 5. Large and Fast: Exploiting Memory Hierarchy Chapter 5 Large and Fast: Exploiting Memory Hierarchy Principle of Locality Programs access a small proportion of their address space at any time Temporal locality Items accessed recently are likely to

More information

Agenda. EE 260: Introduction to Digital Design Memory. Naive Register File. Agenda. Memory Arrays: SRAM. Memory Arrays: Register File

Agenda. EE 260: Introduction to Digital Design Memory. Naive Register File. Agenda. Memory Arrays: SRAM. Memory Arrays: Register File EE 260: Introduction to Digital Design Technology Yao Zheng Department of Electrical Engineering University of Hawaiʻi at Mānoa 2 Technology Naive Register File Write Read clk Decoder Read Write 3 4 Arrays:

More information

The Memory Hierarchy. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. April 3, 2018 L13-1

The Memory Hierarchy. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. April 3, 2018 L13-1 The Memory Hierarchy Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. April 3, 2018 L13-1 Memory Technologies Technologies have vastly different tradeoffs between capacity, latency,

More information

MEMORY. Objectives. L10 Memory

MEMORY. Objectives. L10 Memory MEMORY Reading: Chapter 6, except cache implementation details (6.4.1-6.4.6) and segmentation (6.5.5) https://en.wikipedia.org/wiki/probability 2 Objectives Understand the concepts and terminology of hierarchical

More information

Virtual Memory - Objectives

Virtual Memory - Objectives ECE232: Hardware Organization and Design Part 16: Virtual Memory Chapter 7 http://www.ecs.umass.edu/ece/ece232/ Adapted from Computer Organization and Design, Patterson & Hennessy Virtual Memory - Objectives

More information

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Computer Organization and Structure. Bing-Yu Chen National Taiwan University Computer Organization and Structure Bing-Yu Chen National Taiwan University Large and Fast: Exploiting Memory Hierarchy The Basic of Caches Measuring & Improving Cache Performance Virtual Memory A Common

More information

COSC 6385 Computer Architecture - Memory Hierarchies (I)

COSC 6385 Computer Architecture - Memory Hierarchies (I) COSC 6385 Computer Architecture - Memory Hierarchies (I) Edgar Gabriel Spring 2018 Some slides are based on a lecture by David Culler, University of California, Berkley http//www.eecs.berkeley.edu/~culler/courses/cs252-s05

More information

CS252 S05. Main memory management. Memory hardware. The scale of things. Memory hardware (cont.) Bottleneck

CS252 S05. Main memory management. Memory hardware. The scale of things. Memory hardware (cont.) Bottleneck Main memory management CMSC 411 Computer Systems Architecture Lecture 16 Memory Hierarchy 3 (Main Memory & Memory) Questions: How big should main memory be? How to handle reads and writes? How to find

More information

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts Memory management Last modified: 26.04.2016 1 Contents Background Logical and physical address spaces; address binding Overlaying, swapping Contiguous Memory Allocation Segmentation Paging Structure of

More information

ECE331: Hardware Organization and Design

ECE331: Hardware Organization and Design ECE331: Hardware Organization and Design Lecture 29: an Introduction to Virtual Memory Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Overview Virtual memory used to protect applications

More information

Page 1. Memory Hierarchies (Part 2)

Page 1. Memory Hierarchies (Part 2) Memory Hierarchies (Part ) Outline of Lectures on Memory Systems Memory Hierarchies Cache Memory 3 Virtual Memory 4 The future Increasing distance from the processor in access time Review: The Memory Hierarchy

More information

Virtual Memory. Virtual Memory

Virtual Memory. Virtual Memory Virtual Memory Virtual Memory Main memory is cache for secondary storage Secondary storage (disk) holds the complete virtual address space Only a portion of the virtual address space lives in the physical

More information

CPU issues address (and data for write) Memory returns data (or acknowledgment for write)

CPU issues address (and data for write) Memory returns data (or acknowledgment for write) The Main Memory Unit CPU and memory unit interface Address Data Control CPU Memory CPU issues address (and data for write) Memory returns data (or acknowledgment for write) Memories: Design Objectives

More information

Chapter 5B. Large and Fast: Exploiting Memory Hierarchy

Chapter 5B. Large and Fast: Exploiting Memory Hierarchy Chapter 5B Large and Fast: Exploiting Memory Hierarchy One Transistor Dynamic RAM 1-T DRAM Cell word access transistor V REF TiN top electrode (V REF ) Ta 2 O 5 dielectric bit Storage capacitor (FET gate,

More information

Virtual Memory 2. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. P & H Chapter 5.4

Virtual Memory 2. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. P & H Chapter 5.4 Virtual Memory 2 Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University P & H Chapter 5.4 Administrivia Project3 available now Design Doc due next week, Monday, April 16 th Schedule

More information

Memory Technology. Caches 1. Static RAM (SRAM) Dynamic RAM (DRAM) Magnetic disk. Ideal memory. 0.5ns 2.5ns, $2000 $5000 per GB

Memory Technology. Caches 1. Static RAM (SRAM) Dynamic RAM (DRAM) Magnetic disk. Ideal memory. 0.5ns 2.5ns, $2000 $5000 per GB Memory Technology Caches 1 Static RAM (SRAM) 0.5ns 2.5ns, $2000 $5000 per GB Dynamic RAM (DRAM) 50ns 70ns, $20 $75 per GB Magnetic disk 5ms 20ms, $0.20 $2 per GB Ideal memory Average access time similar

More information

Virtual or Logical. Logical Addr. MMU (Memory Mgt. Unit) Physical. Addr. 1. (50 ns access)

Virtual or Logical. Logical Addr. MMU (Memory Mgt. Unit) Physical. Addr. 1. (50 ns access) Virtual Memory - programmer views memory as large address space without concerns about the amount of physical memory or memory management. (What do the terms 3-bit (or 6-bit) operating system or overlays

More information

Chapter 5 Memory Hierarchy Design. In-Cheol Park Dept. of EE, KAIST

Chapter 5 Memory Hierarchy Design. In-Cheol Park Dept. of EE, KAIST Chapter 5 Memory Hierarchy Design In-Cheol Park Dept. of EE, KAIST Why cache? Microprocessor performance increment: 55% per year Memory performance increment: 7% per year Principles of locality Spatial

More information

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

5. Memory Hierarchy Computer Architecture COMP SCI 2GA3 / SFWR ENG 2GA3. Emil Sekerinski, McMaster University, Fall Term 2015/16 5. Memory Hierarchy Computer Architecture COMP SCI 2GA3 / SFWR ENG 2GA3 Emil Sekerinski, McMaster University, Fall Term 2015/16 Movie Rental Store You have a huge warehouse with every movie ever made.

More information

The levels of a memory hierarchy. Main. Memory. 500 By 1MB 4GB 500GB 0.25 ns 1ns 20ns 5ms

The levels of a memory hierarchy. Main. Memory. 500 By 1MB 4GB 500GB 0.25 ns 1ns 20ns 5ms The levels of a memory hierarchy CPU registers C A C H E Memory bus Main Memory I/O bus External memory 500 By 1MB 4GB 500GB 0.25 ns 1ns 20ns 5ms 1 1 Some useful definitions When the CPU finds a requested

More information

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

Virtual Memory. Reading. Sections 5.4, 5.5, 5.6, 5.8, 5.10 (2) Lecture notes from MKP and S. Yalamanchili Virtual Memory Lecture notes from MKP and S. Yalamanchili Sections 5.4, 5.5, 5.6, 5.8, 5.10 Reading (2) 1 The Memory Hierarchy ALU registers Cache Memory Memory Memory Managed by the compiler Memory Managed

More information

Introduction to cache memories

Introduction to cache memories Course on: Advanced Computer Architectures Introduction to cache memories Prof. Cristina Silvano Politecnico di Milano email: cristina.silvano@polimi.it 1 Summary Summary Main goal Spatial and temporal

More information

ECE7995 (6) Improving Cache Performance. [Adapted from Mary Jane Irwin s slides (PSU)]

ECE7995 (6) Improving Cache Performance. [Adapted from Mary Jane Irwin s slides (PSU)] ECE7995 (6) Improving Cache Performance [Adapted from Mary Jane Irwin s slides (PSU)] Measuring Cache Performance Assuming cache hit costs are included as part of the normal CPU execution cycle, then CPU

More information

Virtual Memory. Stefanos Kaxiras. Credits: Some material and/or diagrams adapted from Hennessy & Patterson, Hill, online sources.

Virtual Memory. Stefanos Kaxiras. Credits: Some material and/or diagrams adapted from Hennessy & Patterson, Hill, online sources. Virtual Memory Stefanos Kaxiras Credits: Some material and/or diagrams adapted from Hennessy & Patterson, Hill, online sources. Caches Review & Intro Intended to make the slow main memory look fast by

More information

CHAPTER 6 Memory. CMPS375 Class Notes (Chap06) Page 1 / 20 Dr. Kuo-pao Yang

CHAPTER 6 Memory. CMPS375 Class Notes (Chap06) Page 1 / 20 Dr. Kuo-pao Yang CHAPTER 6 Memory 6.1 Memory 341 6.2 Types of Memory 341 6.3 The Memory Hierarchy 343 6.3.1 Locality of Reference 346 6.4 Cache Memory 347 6.4.1 Cache Mapping Schemes 349 6.4.2 Replacement Policies 365

More information

Caches. Samira Khan March 23, 2017

Caches. Samira Khan March 23, 2017 Caches Samira Khan March 23, 2017 Agenda Review from last lecture Data flow model Memory hierarchy More Caches The Dataflow Model (of a Computer) Von Neumann model: An instruction is fetched and executed

More information

3Introduction. Memory Hierarchy. Chapter 2. Memory Hierarchy Design. Computer Architecture A Quantitative Approach, Fifth Edition

3Introduction. Memory Hierarchy. Chapter 2. Memory Hierarchy Design. Computer Architecture A Quantitative Approach, Fifth Edition Computer Architecture A Quantitative Approach, Fifth Edition Chapter 2 Memory Hierarchy Design 1 Introduction Programmers want unlimited amounts of memory with low latency Fast memory technology is more

More information

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Chapter 5. Large and Fast: Exploiting Memory Hierarchy Chapter 5 Large and Fast: Exploiting Memory Hierarchy Memory Technology Static RAM (SRAM) 0.5ns 2.5ns, $2000 $5000 per GB Dynamic RAM (DRAM) 50ns 70ns, $20 $75 per GB Magnetic disk 5ms 20ms, $0.20 $2 per

More information

EE 4683/5683: COMPUTER ARCHITECTURE

EE 4683/5683: COMPUTER ARCHITECTURE EE 4683/5683: COMPUTER ARCHITECTURE Lecture 6A: Cache Design Avinash Kodi, kodi@ohioedu Agenda 2 Review: Memory Hierarchy Review: Cache Organization Direct-mapped Set- Associative Fully-Associative 1 Major

More information

Operating Systems, Fall

Operating Systems, Fall Operating Systems: Memory management Fall 2008 Basic Memory Management: One program Monoprogramming without Swapping or Paging Tiina Niklander No memory abstraction, no address space, just an operating

More information

Operating Systems, Fall

Operating Systems, Fall Operating Systems: Memory management Fall 2008 Tiina Niklander Memory Management Programmer wants memory to be Indefinitely large Indefinitely fast Non volatile Memory hierarchy Memory manager handles

More information

Memory Hierarchy. Slides contents from:

Memory Hierarchy. Slides contents from: Memory Hierarchy Slides contents from: Hennessy & Patterson, 5ed Appendix B and Chapter 2 David Wentzlaff, ELE 475 Computer Architecture MJT, High Performance Computing, NPTEL Memory Performance Gap Memory

More information