Some of the slides are adopted from David Patterson (UCB)

Slides:



Advertisements
Similar presentations
COMP3221 lec37-vm-II.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 37: Virtual Memory - II
Advertisements

1 Lecture 13: Cache and Virtual Memroy Review Cache optimization approaches, cache miss classification, Adapted from UCB CS252 S01.
Lecture 34: Chapter 5 Today’s topic –Virtual Memories 1.
CSIE30300 Computer Architecture Unit 10: Virtual Memory Hsin-Chou Chi [Adapted from material by and
Virtual Memory Hardware Support
COMP 3221: Microprocessors and Embedded Systems Lectures 27: Virtual Memory - III Lecturer: Hui Wu Session 2, 2005 Modified.
Virtual Memory Adapted from lecture notes of Dr. Patterson and Dr. Kubiatowicz of UC Berkeley.
CS61C L35 VM I (1) Garcia © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture.
CS61C L34 Virtual Memory I (1) Garcia, Spring 2007 © UCB 3D chips from IBM  IBM claims to have found a way to build 3D chips by stacking them together.
Chap. 7.4: Virtual Memory. CS61C L35 VM I (2) Garcia © UCB Review: Caches Cache design choices: size of cache: speed v. capacity direct-mapped v. associative.
CS 61C L24 VM II (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures.
Virtual Memory Adapted from lecture notes of Dr. Patterson and Dr. Kubiatowicz of UC Berkeley and Rabi Mahapatra & Hank Walker.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 34 – Virtual Memory II Jim Cicconi of AT&T says that the surge of video.
Virtual Memory.
S.1 Review: The Memory Hierarchy Increasing distance from the processor in access time L1$ L2$ Main Memory Secondary Memory Processor (Relative) size of.
CS 61C L23 VM I (1) A Carle, Summer 2006 © UCB inst.eecs.berkeley.edu/~cs61c/su06 CS61C : Machine Structures Lecture #23: VM I Andy Carle.
COMP3221 lec36-vm-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 13: Virtual Memory - I
CS 61C L24 VM II (1) A Carle, Summer 2005 © UCB inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #24: VM II Andy Carle.
CS61C L25 Virtual Memory I (1) Beamer, Summer 2007 © UCB Scott Beamer, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #25.
COMP 3221: Microprocessors and Embedded Systems Lectures 27: Virtual Memory - II Lecturer: Hui Wu Session 2, 2005 Modified.
CS61C L19 VM © UC Regents 1 CS61C - Machine Structures Lecture 19 - Virtual Memory November 3, 2000 David Patterson
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 35 – Virtual Memory III Researchers at three locations have recently added.
ECE 232 L27.Virtual.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 27 Virtual.
CS61C L34 Virtual Memory II (1) Garcia, Fall 2006 © UCB Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c UC Berkeley.
CS61C L36 VM II (1) Garcia, Fall 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures.
CS61C L33 Virtual Memory I (1) Garcia, Fall 2006 © UCB Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c UC Berkeley.
©UCB CS 162 Ch 7: Virtual Memory LECTURE 13 Instructor: L.N. Bhuyan
CS 430 – Computer Architecture 1 CS 430 – Computer Architecture Virtual Memory William J. Taffe using slides of David Patterson.
Cs 61C L18 Cache2.1 Patterson Spring 99 ©UCB CS61C Improving Cache Memory and Virtual Memory Introduction Lecture 18 April 2, 1999 Dave Patterson (http.cs.berkeley.edu/~patterson)
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 33 – Virtual Memory I OCZ has released a 1 TB solid state drive (the biggest.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 34 – Virtual Memory II Researchers at Stanford have developed “nanoscale.
©UCB CS 161 Ch 7: Memory Hierarchy LECTURE 24 Instructor: L.N. Bhuyan
COMP3221 lec37-vm-II.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 13: Virtual Memory - II
CS 61C L7.1.2 VM II (1) K. Meinz, Summer 2004 © UCB CS61C : Machine Structures Lecture VM II Kurt Meinz inst.eecs.berkeley.edu/~cs61c.
CSE431 L22 TLBs.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 22. Virtual Memory Hardware Support Mary Jane Irwin (
Virtual Memory. Virtual Memory: Topics Why virtual memory? Virtual to physical address translation Page Table Translation Lookaside Buffer (TLB)
Review (1/2) °Caches are NOT mandatory: Processor performs arithmetic Memory stores data Caches simply make data transfers go faster °Each level of memory.
Review °Apply Principle of Locality Recursively °Manage memory to disk? Treat as cache Included protection as bonus, now critical Use Page Table of mappings.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
1 Chapter Seven CACHE MEMORY AND VIRTUAL MEMORY. 2 SRAM: –value is stored on a pair of inverting gates –very fast but takes up more space than DRAM (4.
Virtual Memory Review Goal: give illusion of a large memory Allow many processes to share single memory Strategy Break physical memory up into blocks (pages)
LECTURE 12 Virtual Memory. VIRTUAL MEMORY Just as a cache can provide fast, easy access to recently-used code and data, main memory acts as a “cache”
CS203 – Advanced Computer Architecture Virtual Memory.
CS161 – Design and Architecture of Computer
Lecturer PSOE Dan Garcia
ECE232: Hardware Organization and Design
Memory COMPUTER ARCHITECTURE
CS161 – Design and Architecture of Computer
Lecture 12 Virtual Memory.
CS703 - Advanced Operating Systems
CS 704 Advanced Computer Architecture
Virtual Memory Use main memory as a “cache” for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main.
Some Real Problem What if a program needs more memory than the machine has? even if individual programs fit in memory, how can we run multiple programs?
IT 251 Computer Organization and Architecture
Memory Hierarchy Virtual Memory, Address Translation
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Review (1/2) Caches are NOT mandatory:
Csci 211 Computer System Architecture – Review on Virtual Memory
Virtual Memory 4 classes to go! Today: Virtual Memory.
Instructor Paul Pearce
Some of the slides are adopted from David Patterson (UCB)
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
Virtual Memory Overcoming main memory size limitation
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Albert Chae, Instructor
COMP3221: Microprocessors and Embedded Systems
Virtual Memory Lecture notes from MKP and S. Yalamanchili.
Virtual Memory Use main memory as a “cache” for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main.
CS61C Virtual Memory, 2nd try + Advice on Courses Lecture 19
Presentation transcript:

Some of the slides are adopted from David Patterson (UCB) ELEC2041 Microprocessors and Interfacing Lectures 35: Virtual Memory - II http://webct.edtec.unsw.edu.au/ June 2006 Saeid Nooshabadi saeid@unsw.edu.au Some of the slides are adopted from David Patterson (UCB)

Overview Page Table Translation Lookaside Buffer (TLB)

Review: Memory Hierarchy Regs Upper Level Instr. Operands Faster Cache { Cache Blocks L2 Cache Blocks Memory { Virtual Memory Pages Disk Files Larger Tape Lower Level

Review: Address Mapping: Page Table Virtual Address: page no. offset (actually, concatenation) Reg #2 in CP #15 in ARM index into page table + Physical Memory Address Page Table Val -id Access Rights Physical Page Number . V A.R. P. P. A. ... Page Table Base Reg Page Table located in physical memory

Paging/Virtual Memory for Multiple Processes User A: Virtual Memory User B: Virtual Memory ¥ Physical Memory ¥ Stack Stack 64 MB A Page Table B Page Table Heap Heap Static Static Code Code

Analogy Book title like virtual address (ARM System On- Chip) Library of Congress call number like (QA76.5.F8643 2000) physical address Card (or online-page) catalogue like page table, indicating mapping from book title to call number On card (or online-page) info for book, indicating in local library vs. in another branch like valid bit indicating in main memory vs. on disk On card (or online-page), available for 2-hour in library use (vs. 2-week checkout) like access rights

Address Map, Mathematically Speaking V = {0, 1, . . . , n - 1} virtual page address space (n > m) M = {0, 1, . . . , m - 1} physical page address space MAP: V --> M U {q} page address mapping function MAP(a) = a' if data at virtual address a is present in physical address a' and a' = q if data at virtual address a is not present in M a page fault Name Space V OS fault handler Processor Addr Trans Mechanism Main Memory Disk a a' physical address OS performs this transfer

Comparing the 2 Levels of Hierarchy Cache Version Virtual Memory vers. Block or Line Page Miss Page Fault Block Size: 32-64B Page Size: 4K-8KB Placement: Fully Associative Direct Mapped, N-way Set Associative Replacement: Least Recently Used LRU or Random (LRU) Write Thru or Back Write Back

OS must reserve “Swap Space” on disk for each process Notes on Page Table Solves Fragmentation problem: all chunks same size, so all holes can be used OS must reserve “Swap Space” on disk for each process To grow a process, ask Operating System If unused pages, OS uses them first If not, OS swaps some old pages to disk (Least Recently Used to pick pages to swap) Each process has its own Page Table Will add details, but Page Table is essence of Virtual Memory

Virtual Memory Problem #1 Not enough physical memory! Only, say, 64 MB of physical memory N processes, each 4GB of virtual memory! Could have 64 virtual pages/physical page! Spatial Locality to the rescue Each page is 4 KB, lots of nearby references No matter how big program is, at any time only accessing a few pages “Working Set”: recently used pages

Virtual Address and a Cache (#1/2) VA miss PA Cache Trans- lation Main Memory Processor hit data Cache operates on Virtual addresses. ARM Strategy The advantage: If in cache the translation is not required. Disadvantage: Several copies of the the same physical memory location may be present in several cache blocks. (Synonyms problem). Gives rise to some complications!

Virtual Address and a Cache (#2/2) PA miss VA Trans- lation Cache Main Memory Processor hit data Cache typically operates on physical addresses on most other systems. Address Translation (Page Table access) is another memory access for each program memory access! Accessing memory for Page Table to get Physical address (Slow Operation) Need to fix this!

Reading Material Steve Furber: ARM System On-Chip; 2nd Ed, Addison-Wesley, 2000, ISBN: 0-201- 67519-6. Chapter 10.

Virtual Memory Problem #2 Map every address  1 extra memory access for every memory access Observation: since locality in pages of data, must be locality in virtual addresses of those pages Why not use a cache of virtual to physical address translations to make translation fast? (small is fast) For historical reasons, this cache is called a Translation Lookaside Buffer, or TLB

Typical TLB Format Virtual Physical Dirty Ref Valid Access Address Address Rights TLB just a cache on the page table mappings TLB access time comparable to cache (much less than main memory access time) Ref: Used to help calculate LRU on replacement Dirty: since use write back, need to know whether or not to write page to disk when replaced

PROJECTS IN DIGITAL HARDWARE DESIGN FOR 4th Year

Digital Systems Laboratory Hardware DSL Board is A Board for 21st Century The State-of-the-Art Development Board DSL Board Contains: Designed by the University of Manchester with lots of collaboration from UNSW An ARM Microcontroller With 2 MB of Flash and up to 4 MB of SRAM Memory 2 Xilinx FPGAs for extended interfacing and specialised co-processors Optional Ethernet chip LCD Module Lots of uncommitted Switches and LEDs Terminal connector to FPGAs Two PCBs

DSLMU Hardware Block Diagram Two Printed circuit Boards

Projects with Digital Systems Lab Board Project 1: Design of a Vector Floating Point Co-Processor for ARM Core: Aim: The Aim of this project is to built Floating Point Vector Processor On the Virtex FPGA. Degree of Difficulty: Hard, and Challenging Ability: Number Representation, Digital System Design, DSP

Projects with Digital Systems Board Project 2: Design of a Fixed Point DSP for ARM Core: Aim: The Aim of this project is to built DSP Optimised Processor (Single Cycle MAC Processor/ Distributed Arithmetic) On the Virtex FPGA. Degree of Difficulty: Hard, and Challenging Ability: Number Representation, Digital System Design, DSP

Projects with Digital Systems Board Project 3: Development of a Simple Multi tasking/Threading Operating System Aim: The Aim of this project is Development of a Simple Multi tasking Operating System with Simple Virtual Memory Protection for on-board program monitoring and debugging. Degree of Difficulty: Moderate, and some Challenges Ability: Software Development, Basic Operating Systems Application: Our Undergraduate/Post Graduate Teaching Advantage: Make yourself Immortal!

Projects with Digital Systems Board Project 4: Interfacing GNU debugging tool with on-board emulator (Komodo) Aim: The Aim of this project is to Interface GNU debugging tool with on-board emulator program to facilitate source-level debugging and monitoring. Degree of Difficulty: Moderate to Hard with some Challenges Ability: Software Development, Basic Operating Systems Application: Our Undergraduate/Post Graduate Teaching Advantage: Make yourself Immortal!

Projects with Digital Systems Board Project 5: PS/2 and USB Controller For DSL Board Aim: The aim of this project is to design an PS/2 and USB Controller using the on-board FPGA chips. Degree of Difficulty: Hard, and Challenging Ability: Hardware Development, Basic Software development

Projects with Digital Systems Board Project 6: Frame Grabber Device for CMOS Digital Camera Aim: The aim of this project is to build a high resolution web camera using a Kodak KAC-1310 CMOS image sensor. The pixel data would buffered in SRAM /SDRAM, compressed and uploaded through the Internet interface for display on a PC. Degree of Difficulty: Very Hard, and Challenging Ability: DSP, Hardware Development, Basic Software development

Projects with Digital Systems Board Project 7: Audio Signal Processing Aim: The aim of this project is interface a codec to a DSP Audio Signal Processor/ Compressor built on the on- Board FPGAs Degree of Difficulty: Moderate to Hard, and Challenging Ability: DSP, Hardware Development, Basic Software development

Projects with Digital Systems Board Project 8: Location Aware Sound system Aim: The aim of this project is build wireless location detection system to provide optimum sound from stereo speakers depending the location of the listener. Degree of Difficulty: Moderate to Hard, and Challenging Ability: DSP, Hardware Development, Basic Software development

Things to Remember (#1/2) Apply Principle of Locality Recursively Reduce Miss Penalty? add a (L2) cache Manage memory to disk? Treat as cache Included protection as bonus, now critical Use Page Table of mappings vs. tag/data in cache Virtual memory to Physical Memory Translation too slow? Add a cache of Virtual to Physical Address Translations, called a TLB

Things to Remember (#2/2) Virtual Memory allows protected sharing of memory between processes with less swapping to disk, less fragmentation than always swap or base/bound Spatial Locality means Working Set of Pages is all that must be in memory for process to run fairly well

Virtual memory to Physical Memory Translation too slow? Things to Remember Spatial Locality means Working Set of Pages is all that must be in memory for process to run fairly well Virtual memory to Physical Memory Translation too slow? Add a cache of Virtual to Physical Address Translations, called a TLB TLB to reduce performance cost of VM