ICC Module 3 Lesson 2 – Memory Hierarchies 1 / 25 © 2015 Ph. Janson Information, Computing & Communication Memory Hierarchies – Clip 8 – Example School.

Slides:



Advertisements
Similar presentations
RISC Instruction Pipelines and Register Windows
Advertisements

UPC MICRO35 Istanbul Nov Effective Instruction Scheduling Techniques for an Interleaved Cache Clustered VLIW Processor Enric Gibert 1 Jesús Sánchez.
ICS’02 UPC An Interleaved Cache Clustered VLIW Processor E. Gibert, J. Sánchez * and A. González * Dept. d’Arquitectura de Computadors Universitat Politècnica.
COSC513 Operating System Research Paper Fundamental Properties of Programming for Parallelism Student: Feng Chen (134192)
CS492B Analysis of Concurrent Programs Memory Hierarchy Jaehyuk Huh Computer Science, KAIST Part of slides are based on CS:App from CMU.
Computer Architecture Instruction-Level Parallel Processors
School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) Parallelism & Locality Optimization.
Vector: Data Layout Vector: x[n] P processors Assume n = r * p
Instruction-Level Parallel Processors {Objective: executing two or more instructions in parallel} 4.1 Evolution and overview of ILP-processors 4.2 Dependencies.
Cache Here we focus on cache improvements to support at least 1 instruction fetch and at least 1 data access per cycle – With a superscalar, we might need.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Loops (Part 1) Computer Science Erwin High School Fall 2014.
Chapter 2- Visual Basic Schneider
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 5 - Functions Outline 5.1Introduction 5.2Program.
Computer ArchitectureFall 2007 © November 7th, 2007 Majd F. Sakr CS-447– Computer Architecture.
C Lecture Notes Functions (Cont...). C Lecture Notes 5.8Calling Functions: Call by Value and Call by Reference Used when invoking functions Call by value.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Basic Operational Concepts of a Computer
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
MSJ-1 Alignment Network. MSJ-2 Alignment Network ALU 32 general purpose registers 32 bits memory width − a.k.a., block size (8 bytes, in this example)
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. C How To Program - 4th edition Deitels Class 05 University.
Stack Stack Pointer A stack is a means of storing data that works on a ‘Last in first out’ (LIFO) basis. It reverses the order that data arrives and is.
Array Cs212: DataStructures Lab 2. Array Group of contiguous memory locations Each memory location has same name Each memory location has same type a.
Chapter Twelve Memory Organization
Computer Organization and Architecture Tutorial 1 Kenneth Lee.
COEN 180 Memory Hierarchy. We are therefore forced to recognize the possibility of constructing a hierarchy of memories, each of which has greater capacity.
Time Parallel Simulations I Problem-Specific Approach to Create Massively Parallel Simulations.
KIC/Computer Programming & Problem Solving 1.  Header Files  Storage Classes  Scope Rules  Recursion Outline KIC/Computer Programming & Problem Solving.
ICC Module 3 Lesson 5 – IT Security 1 / 4 © 2015 Ph. Janson Information, Computing & Communication Security – Clip 0 – Introduction School of Computer.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 26 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 1 – Assembler.
Parallel and Distributed Simulation Time Parallel Simulation.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 12 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 6 – Logic parallelism.
ICC Module 3 Lesson 2 – Memory Hierarchies 1 / 13 © 2015 Ph. Janson Information, Computing & Communication Memory Hierarchies – Clip 9 – Locality School.
ICC Module 3 Lesson 4 – Networking 1 / 8 © 2015 Ph. Janson Information, Computing & Communication Networking – Clip 4 – Switching School of Computer Science.
ICC Module 3 Lesson 2 – Memory Hierarchies 1 / 9 © 2015 Ph. Janson Information, Computing & Communication Memory Hierarchies – Clip 1 – Technologies School.
ICC Module 3 Lesson 4 – Networking 1 / 16 © 2015 Ph. Janson Information, Computing & Communication Networking – Clip 3 – Protocol encapsulation School.
ICC Module 3 Lesson 2 – Memory Hierarchies 1 / 6 © 2015 Ph. Janson Information, Computing & Communication Memory Hierarchies – Clip 2 – Concept School.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 9 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 7 – Architectural.
ICC Module 3 Lesson 4 – Networking 1 / 9 © 2015 Ph. Janson Information, Computing & Communication Networking – Clip 6 – Internet addressing School of.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 12 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 5 – Memory Circuits.
ICC Module 3 Lesson 3 – Storage 1 / 6 © 2015 Ph. Janson Information, Computing & Communication Storage – Clip 1 – Principles School of Computer Science.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 13 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 2 – Von Neumann.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 6 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 3 – Instruction.
Threaded Programming Lecture 1: Concepts. 2 Overview Shared memory systems Basic Concepts in Threaded Programming.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
ICC Module 3 Lesson 4 – Networking 1 / 4 © 2015 Ph. Janson Information, Computing & Communication Networking – Clip 0 – Introduction School of Computer.
ICC Module 3 Lesson 2 – Memory Hierarchies 1 / 14 © 2015 Ph. Janson Information, Computing & Communication Memory Hierarchies – Clip 5 – Reading School.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 11 © 2015 Ph. Janson Information, Computing & Communication Module 3 : Systems.
ICC Module 3 Lesson 3 – Storage 1 / 4 © 2015 Ph. Janson Information, Computing & Communication Storage – Clip 0 – Introduction School of Computer Science.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Computer Organization
CS2100 Computer Organization
Computer Architecture
The Processor and Machine Language
Assignment 4 – (a) Consider a symmetric MP with two processors and a cache invalidate write-back cache. Each block corresponds to two words in memory.
قانون المنافسة ومنع الاحتكار
Functional Units.
Interconnect with Cache Coherency Manager
Computer System Design (Processor Design)
Sequencing, Selection, and Loops in Machine Language
Phillipa Gill SCI 199 Y Tutorial Sept. 14, 2009 Phillipa Gill
Computer System Design Lecture 9
CSCI-N 100 Dept. of Computer and Information Science
RTL Design Methodology
Outline for October 9 Input and Output (continued)
Course Outline for Computer Architecture
Homework Due Friday.
Fetch And Add – switching network
Presentation transcript:

ICC Module 3 Lesson 2 – Memory Hierarchies 1 / 25 © 2015 Ph. Janson Information, Computing & Communication Memory Hierarchies – Clip 8 – Example School of Computer Science & Communications B. Falsafi (charts), Ph. Janson (commentary)

ICC Module 3 Lesson 2 – Memory Hierarchies 2 / 25 © 2015 Ph. Janson Outline ►Clip 1 – TechnologiesClip 1 ►Clip 2 – ConceptClip 2 ►Clip 3 – PrincipleClip 3 ►Clip 4 – ImplementationClip 4 ►Clip 5 – Reading memoryClip 5 ►Clip 6 – Writing memoryClip 6 ►Clip 7 – Cache management – the Least Recently Used algorithmClip 7 ►Clip 8 – A simulated exampleClip 8 ►Clip 9 – LocalityClip 9 First clipPrevious clipNext clip

ICC Module 3 Lesson 2 – Memory Hierarchies 3 / 25 © 2015 Ph. Janson Example from the preceding lesson: sum of integers up to n Sum of n first integers input : n output : m s  0 while n > 0 s  s + n n  n – 1 m  s

ICC Module 3 Lesson 2 – Memory Hierarchies 4 / 25 © 2015 Ph. Janson Focus on the loop Sum of n first integers input : n output : m s  0 while n > 0 s  s + n n  n – 1 m  s

ICC Module 3 Lesson 2 – Memory Hierarchies 5 / 25 © 2015 Ph. Janson Imagine a hypothetical computer  Cache with 2 blocks  Memory with 4 blocks  Blocks of 4 words each  (Only one register in the processor) Cache ? ? ? ? Main memory Processor

ICC Module 3 Lesson 2 – Memory Hierarchies 6 / 25 © 2015 Ph. Janson Assume the following memory layout ►s and m initially 0 ►n initially 2 Cache ? ? ? ? Main memory m=0 n=2 s=0 Processor

ICC Module 3 Lesson 2 – Memory Hierarchies 7 / 25 © 2015 Ph. Janson 13 Cache ? ? ? ? Main memory m=0 n=2 s= Execution Processor While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 8 / 25 © 2015 Ph. not in cache ((de)fault) Cache ? ? ? ? Main memory m=0 n=2 s= Execution Processor While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 9 / 25 © 2015 Ph. not in cache ((de)fault) load Cache ? ? ? ? Main memory m=0 n=2 s=0 load Execution Processor While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 10 / 25 © 2015 Ph. not in cache ((de)fault) load Cache ? ? ? ? Processor n=2 s=0 12 Execution Main memory m=0 n=2 s= While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 11 / 25 © 2015 Ph. not in cache ((de)fault) load place Main memory m=0 n=2 s=0 Processor Execution Cache ? ? 12 n=2 s=0 While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 12 / 25 © 2015 Ph. not in cache ((de)fault) load place return 2 Processor = 2 Cache ? ? 12 n=2 s=0 Main memory m=0 n=2 s= While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 13 / 25 © 2015 Ph. Janson Cache ? ? Processor 12 n=2 s=0 read not in cache ((de)fault) load place return 2 Main memory m=0 n=2 s= While n > 0 s  s + n n  n – 1 Execution

ICC Module 3 Lesson 2 – Memory Hierarchies 14 / 25 © 2015 Ph. Janson Cache ? ? Processor 12 n=2 = 0 (in not in cache ((de)fault) load place return 2 (in cache!) return 0 Main memory m=0 n=2 s= While n > 0 s  s + n n  n – 1 Execution

ICC Module 3 Lesson 2 – Memory Hierarchies 15 / 25 © 2015 Ph. Janson Cache ? ? Processor 12 n=2 s=0 not in cache ((de)fault) load place return 2 (in cache) return 0 Main memory m=0 n=2 s= While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 16 / 25 © 2015 Ph. Janson Cache ? ? Processor 12 n=2 = 2 (in cache !) not in cache ((de)fault) load place return 2 (in cache) return 0 (in cache) return 2 Main memory m=0 n=2 s= While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 17 / 25 © 2015 Ph. Janson Cache ? ? Processor 12 n=2 not in cache ((de)fault) load place return 2 (in cache) return 0 (in cache) return 2 add s, n (0 + 2) Main memory m=0 n=2 s= While n > 0 s  s + n n  n – 1 Execution

ICC Module 3 Lesson 2 – Memory Hierarchies 18 / 25 © 2015 Ph. Janson Cache ? ? Processor 12 n=2 s=2 write not in cache ((de)fault) load place return 2 (in cache) return 0 (in cache) return 2 add s, n (0 + 2) write (in cache) Main memory m=0 n=2 s= While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 19 / 25 © 2015 Ph. Janson Cache ? ? Processor 12 n=2 s=2 not in cache ((de)fault) load place return 2 (in cache) return 0 (in cache) return 2 add s, n (0 + 2) write (in cache) (in cache) Main memory m=0 n=2 s= While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 20 / 25 © 2015 Ph. Janson Cache ? ? Processor 12 n=2 = 2 not in cache ((de)fault) load place return 2 (in cache) return 0 (in cache) return 2 add s, n (0 + 2) write (in cache) (in cache) return 2 Main memory m=0 n=2 s= While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 21 / 25 © 2015 Ph. not in cache ((de)fault) load place return 2 (in cache) return 0 (in cache) return 2 add s, n (0 + 2) write (in cache) (in cache) return 2 add n, -1 (2 – 1) Cache ? ? Processor 12 n=2 s=2 Execution Main memory m=0 n=2 s= While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 22 / 25 © 2015 Ph. not in cache ((de)fault) load place return 2 (in cache) return 0 (in cache) return 2 add s, n (0 + 2) write (in cache) (in cache) return 2 add n, -1 (2 – 1) write 13 (in cache) Cache ? ? Processor 12 n=1 s=2 Execution Main memory m=0 n=2 s= write While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 23 / 25 © 2015 Ph. not in cache ((de)fault) load place return (in cache) return 0 (in cache) return 2 add s, n (0 + 2) write (in cache)1 (in cache) return 2 add n, -1 (2 – 1) write 13 (in cache) Cache ? ? Processor 12 n=1 s=2 How many accesses to the cache and to the main memory ? Main memory m=0 n=2 s= While n > 0 s  s + n n  n – 1

ICC Module 3 Lesson 2 – Memory Hierarchies 24 / 25 © 2015 Ph. Janson (in cache) load place return 2 (in cache) return 0 (in cache) return 2 add s, n (0 + 2) write (in cache) (in cache) return 2 add n, -1 (2 – 1) write 13 (in cache) Cache ? ? Processor 12 n=1 s=2 For all subsequent iterations of the loop Main memory m=0 n=2 s= While n > 0 s  s + n n  n – 1 6 cache accesses, 0 (de)fault

ICC Module 3 Lesson 2 – Memory Hierarchies 25 / 25 © 2015 Ph. Janson Overall For a total of 6n memory accesses ►6(n-1) + 5 in cache (at 1ns / access) ►1 cache (de)fault => memory access (at 100ns)  Overall performance => ( n) ns  Not bad at all if n is large which is typically the case in real programs Cache ? ? Processor 12 n=1 s=2 Main memory m=0 n=2 s=