CPEG3231 Integration of cache and MIPS Pipeline  Data-path control unit design  Pipeline stalls on cache misses.

Slides:



Advertisements
Similar presentations
Main MemoryCS510 Computer ArchitecturesLecture Lecture 15 Main Memory.
Advertisements

COEN 180 DRAM. Dynamic Random Access Memory Dynamic: Periodically refresh information in a bit cell. Else it is lost. Small footprint: transistor + capacitor.
Main Mem.. CSE 471 Autumn 011 Main Memory The last level in the cache – main memory hierarchy is the main memory made of DRAM chips DRAM parameters (memory.
CS.305 Computer Architecture Memory: Structures Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from slides kindly made.
Memory Computer Architecture Lecture 16: Memory Systems.
331 Week13.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 13 Basics of Cache [Adapted from Dave Patterson’s UCB CS152.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 20 - Memory.
1  1998 Morgan Kaufmann Publishers Chapter Seven Large and Fast: Exploiting Memory Hierarchy.
Memory Chapter 7 Cache Memories.
Memory Hierarchy.1 Review: Major Components of a Computer Processor Control Datapath Memory Devices Input Output.
331 Lec20.1Fall :332:331 Computer Architecture and Assembly Language Fall 2003 Week 13 Basics of Cache [Adapted from Dave Patterson’s UCB CS152.
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
CIS °The Five Classic Components of a Computer °Today’s Topics: Memory Hierarchy Cache Basics Cache Exercise (Many of this topic’s slides were.
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
EECC550 - Shaaban #1 Lec # 10 Summer Main Memory Main memory generally utilizes Dynamic RAM (DRAM), which use a single transistor to store.
331 Lec20.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 13 Basics of Cache [Adapted from Dave Patterson’s UCB CS152.
1 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 as a charge.
Main Memory by J. Nelson Amaral.
Overview Booth’s Algorithm revisited Computer Internal Memory Cache memory.
1 CSE SUNY New Paltz Chapter Seven Exploiting Memory Hierarchy.
Computing Systems Memory Hierarchy.
Memory Technology “Non-so-random” Access Technology:
CPE432 Chapter 5A.1Dr. W. Abu-Sufah, UJ Chapter 5A: Exploiting the Memory Hierarchy, Part 1 Adapted from Slides by Prof. Mary Jane Irwin, Penn State University.
CPE232 Memory Hierarchy1 CPE 232 Computer Organization Spring 2006 Memory Hierarchy Dr. Gheith Abandah [Adapted from the slides of Professor Mary Irwin.
CSIE30300 Computer Architecture Unit 07: Main Memory Hsin-Chou Chi [Adapted from material by and
Review: Basic Building Blocks  Datapath l Execution units -Adder, multiplier, divider, shifter, etc. l Register file and pipeline registers l Multiplexers,
Survey of Existing Memory Devices Renee Gayle M. Chua.
EECS 318 CAD Computer Aided Design LECTURE 10: Improving Memory Access: Direct and Spatial caches Instructor: Francis G. Wolff Case.
Chapter 5 Large and Fast: Exploiting Memory Hierarchy CprE 381 Computer Organization and Assembly Level Programming, Fall 2013 Zhao Zhang Iowa State University.
Lecture 19 Today’s topics Types of memory Memory hierarchy.
EEE-445 Review: Major Components of a Computer Processor Control Datapath Memory Devices Input Output Cache Main Memory Secondary Memory (Disk)
Lecture 13 Main Memory Computer Architecture COE 501.
Main Memory CS448.
CSIE30300 Computer Architecture Unit 08: Cache Hsin-Chou Chi [Adapted from material by and
The Memory Hierarchy Lecture # 30 15/05/2009Lecture 30_CA&O_Engr Umbreen Sabir.
The Goal: illusion of large, fast, cheap memory Fact: Large memories are slow, fast memories are small How do we create a memory that is large, cheap and.
CS/EE 5810 CS/EE 6810 F00: 1 Main Memory. CS/EE 5810 CS/EE 6810 F00: 2 Main Memory Bottom Rung of the Memory Hierarchy 3 important issues –capacity »BellÕs.
1 Chapter Seven. 2 Users want large and fast memories! SRAM access times are ns at cost of $100 to $250 per Mbyte. DRAM access times are ns.
DECStation 3100 Block Instruction Data Effective Program Size Miss Rate Miss Rate Miss Rate 1 6.1% 2.1% 5.4% 4 2.0% 1.7% 1.9% 1 1.2% 1.3% 1.2% 4 0.3%
CS.305 Computer Architecture Memory: Caches Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from slides kindly made available.
Caches Hiding Memory Access Times. PC Instruction Memory 4 MUXMUX Registers Sign Ext MUXMUX Sh L 2 Data Memory MUXMUX CONTROLCONTROL ALU CTL INSTRUCTION.
CPE232 Cache Introduction1 CPE 232 Computer Organization Spring 2006 Cache Introduction Dr. Gheith Abandah [Adapted from the slides of Professor Mary Irwin.
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.
1 Chapter Seven. 2 Users want large and fast memories! SRAM access times are ns at cost of $100 to $250 per Mbyte. DRAM access times are ns.
1  1998 Morgan Kaufmann Publishers Chapter Seven.
1 Adapted from UC Berkeley CS252 S01 Lecture 18: Reducing Cache Hit Time and Main Memory Design Virtucal Cache, pipelined cache, cache summary, main memory.
Computer Organization CS224 Fall 2012 Lessons 39 & 40.
The Memory Hierarchy (Lectures #17 - #20) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 14: Memory Hierarchy Chapter 5 (4.
Chapter 5 Large and Fast: Exploiting Memory Hierarchy.
1 Chapter Seven. 2 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.
CS35101 Computer Architecture Spring 2006 Lecture 18: Memory Hierarchy Paul Durand ( ) [Adapted from M Irwin (
CSE431 L18 Memory Hierarchy.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 18: Memory Hierarchy Review Mary Jane Irwin (
1Chapter 7 Memory Hierarchies Outline of Lectures on Memory Systems 1. Memory Hierarchies 2. Cache Memory 3. Virtual Memory 4. The future.
Cache Issues Computer Organization II 1 Main Memory Supporting Caches Use DRAMs for main memory – Fixed width (e.g., 1 word) – Connected by fixed-width.
CMSC 611: Advanced Computer Architecture Memory & Virtual Memory Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material.
CS 704 Advanced Computer Architecture
COSC3330 Computer Architecture
Address – 32 bits WRITE Write Cache Write Main Byte Offset Tag Index Valid Tag Data 16K entries 16.
Yu-Lun Kuo Computer Sciences and Information Engineering
The Goal: illusion of large, fast, cheap memory
Improving Memory Access 1/3 The Cache and Virtual Memory
Morgan Kaufmann Publishers Memory & Cache
Integration of cache System into MIPS Pipeline
CMSC 611: Advanced Computer Architecture
Memory Organization.
Morgan Kaufmann Publishers Memory Hierarchy: Cache Basics
Morgan Kaufmann Publishers Memory Hierarchy: Introduction
Chapter Five Large and Fast: Exploiting Memory Hierarchy
Memory & Cache.
Presentation transcript:

CPEG3231 Integration of cache and MIPS Pipeline  Data-path control unit design  Pipeline stalls on cache misses

CPEG3232 Actions Needed on an I-Cache Miss 1. Compute the value of PC Instruct the main memory to perform a read and wait for the memory to complete its access. 3. Write the cache entry, putting the data from memory in the data portion of the entry, writing the upper bits of the address (from the ALU) into the tag field, and turning the valid bit on. 4. Restart the instruction execution at the first step, which will re- fetch the instruction, this time finding it in the cache.

CPEG3233 A Case Study: DEC Station 3100  Separate I-Cache and D-Cache  “Write-through” policy  One-word-line simplifies write-miss handling

CPEG3234 How to Handle Read/Write  Write Write-through: for both write hit/miss 1. Index the cache using bits 15-2 of the address. 2. Write both the tag portion (using bits of the address) and the data portion with the word. 3.Also write the word to main memory using the entire address.

CPEG3235 Performance Penalty due to Write-Through on DEC Station 3100  CPI without cache misses: 1.2 (gcc),but with each write takes 10 cycles: CPI becomes 2.3 (gcc) Note: in gcc, 11% of instructions are stores, each takes 10 cycles  Solution: write buffers (in DEC Station 3100: size=4)

CPEG3236 Large and Fast: Exploiting Memory Hierarchy Instruction and data miss rates for the DECStation 3100 when executing the different programs. The combined miss rate is the effective miss rate seen. It is obtained by weighting the instruction and data individual miss rates by the frequency of instruction and data references.

CPEG3237 Combined I-Cache/D-Cache ?  Hit ratio: Combined may be better: In DECStation 3100: 4.8% vs 5.4%  Bandwidth considerations

CPEG3238 The primary method of achieving higher memory bandwidth is to increase the physical or logical width of the memory system. In this figure there are two ways in which the memory bandwidth is improved. The simplest design, (a), uses a memory where all components are one word wide; (b) shows a wider memory, bus, and cache while (c) shows a narrow bus and cache with an interleaved memory. CPU Cache Bus Memo- ry CPU Cache Bus CPU Bu s Memory Multiplexer Cache Memory bank 0 Memory bank 1 Memory bank 2 Memory bank 3 a. One-word-wide memory organization b. Wide memory organizationc. Interleaved memory organization High-Bandwidth Design Alternatives

CPEG3239 Review: Major Components of a Computer Processor Control Datapath Memory Devices Input Output

CPEG32310 Processor-Memory Performance Gap “Moore’s Law” µProc 55%/year (2X/1.5yr) DRAM 7%/year (2X/10yrs) Processor-Memory Performance Gap (grows 50%/year)

CPEG32311 The “Memory Wall”  Logic vs DRAM speed gap continues to grow Clocks per instruction Clocks per DRAM access

CPEG32312 Memory Performance Impact on Performance  Suppose a processor executes at l ideal CPI = 1.1 l 50% arith/logic, 30% ld/st, 20% control and that 10% of data memory operations miss with a 50 cycle miss penalty  CPI = ideal CPI + average stalls per instruction = 1.1(cycle) + ( 0.30 (datamemops/instr) x 0.10 (miss/datamemop) x 50 (cycle/miss) ) = 1.1 cycle cycle = 2.6 so 58% of the time the processor is stalled waiting for memory!  A 1% instruction miss rate would add an additional 0.5 to the CPI!

CPEG32313 The Memory Hierarchy Goal  Fact: Large memories are slow and fast memories are small  How do we create a memory that gives the illusion of being large, cheap and fast (most of the time)? l With hierarchy l With parallelism

CPEG32314 Second Level Cache (SRAM) A Typical Memory Hierarchy Control Datapath Secondary Memory (Disk) On-Chip Components RegFile Main Memory (DRAM) Data Cache Instr Cache ITLB DTLB eDRAM Speed (%cycles): ½’s 1’s 10’s 100’s 1,000’s Size (bytes): 100’s K’s 10K’s M’s G’s to T’s Cost: highest lowest  By taking advantage of the principle of locality l Can present the user with as much memory as is available in the cheapest technology l at the speed offered by the fastest technology

CPEG32315 Characteristics of the Memory Hierarchy Increasing distance from the processor in access time L1$ L2$ Main Memory Secondary Memory Processor (Relative) size of the memory at each level Inclusive– what is in L1$ is a subset of what is in L2$ is a subset of what is in MM that is a subset of is in SM 4-8 bytes (word) 1 to 4 blocks 1,024+ bytes (disk sector = page) 8-32 bytes (block)

CPEG32316 Memory Hierarchy Technologies  Caches use SRAM for speed and technology compatibility l Low density (6 transistor cells), high power, expensive, fast l Static: content will last “forever” (until power turned off)  Main Memory uses DRAM for size (density) l High density (1 transistor cells), low power, cheap, slow l Dynamic: needs to be “refreshed” regularly (~ every 8 ms) -1% to 2% of the active cycles of the DRAM l Addresses divided into 2 halves (row and column) -RAS or Row Access Strobe triggering row decoder -CAS or Column Access Strobe triggering column selector Dout[15-0] SRAM 2M x 16 Din[15-0] Address Chip select Output enable Write enable 16 21

CPEG32317 Memory Performance Metrics  Latency: Time to access one word l Access time: time between the request and when the data is available (or written) l Cycle time: time between requests l Usually cycle time > access time l Typical read access times for SRAMs in 2004 are 2 to 4 ns for the fastest parts to 8 to 20ns for the typical largest parts  Bandwidth: How much data from the memory can be supplied to the processor per unit time l width of the data channel * the rate at which it can be used  Size: DRAM to SRAM ­ 4 to 8  Cost/Cycle time: SRAM to DRAM ­ 8 to 16

CPEG32318 Classical RAM Organization (~Square) RowDecoderRowDecoder row address data bit or word RAM Cell Array word (row) line bit (data) lines Each intersection represents a 6-T SRAM cell or a 1-T DRAM cell Column Selector & I/O Circuits column address One memory row holds a block of data, so the column address selects the requested bit or word from that block

CPEG32319 data bit Classical DRAM Organization (~Square Planes) RowDecoderRowDecoder row address Column Selector & I/O Circuits column address data bit word (row) line bit (data) lines Each intersection represents a 1-T DRAM cell The column address selects the requested bit from the row in each plane data word... RAM Cell Array

CPEG32320 Classical DRAM Operation  DRAM Organization: l N rows x N column x M-bit l Read or Write M-bit at a time l Each M-bit access requires a RAS / CAS cycle Row Address CAS RAS Col AddressRow AddressCol Address N rows N cols DRAM M bit planes Row Address Column Address M-bit Output 1 st M-bit Access 2 nd M-bit Access Cycle Time

CPEG32321 N rows N cols DRAM Column Address M-bit Output M bit planes N x M SRAM Row Address Page Mode DRAM Operation  Page Mode DRAM l N x M SRAM to save a row  After a row is read into the SRAM “register” l Only CAS is needed to access other M-bit words on that row l RAS remains asserted while CAS is toggled Row Address CAS RAS Col Address 1 st M-bit Access2 nd M-bit3 rd M-bit4 th M-bit Cycle Time

CPEG32322 N rows N cols DRAM Column Address M-bit Output M bit planes N x M SRAM Row Address Synchronous DRAM (SDRAM) Operation  After a row is read into the SRAM register l Inputs CAS as the starting “burst” address along with a burst length l Transfers a burst of data from a series of sequential addresses within that row - A clock controls transfer of successive words in the burst – 300MHz in Row Address CAS RAS Col Address 1 st M-bit Access2 nd M-bit3 rd M-bit4 th M-bit Cycle Time Row Add

CPEG32323 Other DRAM Architectures  Double Data Rate SDRAMs – DDR-SDRAMs (and DDR- SRAMs) l Double data rate because they transfer data on both the rising and falling edge of the clock l Are the most widely used form of SDRAMs  DDR2-SDRAMs

CPEG32324 DRAM Memory Latency & Bandwidth Milestones  In the time that the memory to processor bandwidth doubles the memory latency improves by a factor of only 1.2 to 1.4  To deliver such high bandwidth, the internal DRAM has to be organized as interleaved memory banks DRAMPage DRAM FastPage DRAM Synch DRAM DDR SDRAM Module Width16b 32b64b Year Mb/chip Die size (mm 2 ) Pins/chip BWidth (MB/s) Latency (nsec) Patterson, CACM Vol 47, #10, 2004

CPEG32325  The off-chip interconnect and memory architecture can affect overall system performance in dramatic ways Memory Systems that Support Caches CPU Cache Memory bus One word wide organization (one word wide bus and one word wide memory)  Assume 1. 1 clock cycle to send the address clock cycles for DRAM cycle time, 8 clock cycles access time 3. 1 clock cycle to return a word of data  Memory-Bus to Cache bandwidth number of bytes accessed from memory and transferred to cache/CPU per clock cycle 32-bit data & 32-bit addr per cycle on-chip

CPEG32326 One Word Wide Memory Organization CPU Cache Memory bus on-chip  If the block size is one word, then for a memory access due to a cache miss, the pipeline will have to stall the number of cycles required to return one data word from memory cycle to send address cycles to read DRAM cycle to return data total clock cycles miss penalty  Number of bytes transferred per clock cycle (bandwidth) for a single miss is bytes per clock

CPEG32327 One Word Wide Memory Organization CPU Cache Memory bus on-chip  If the block size is one word, then for a memory access due to a cache miss, the pipeline will have to stall the number of cycles required to return one data word from memory cycle to send address cycles to read DRAM cycle to return data total clock cycles miss penalty  Number of bytes transferred per clock cycle (bandwidth) for a single miss is bytes per clock /27 = 0.148

CPEG32328 One Word Wide Memory Organization, con’t CPU Cache Memory bus on-chip  What if the block size is four words? cycle to send 1 st address cycles to read DRAM cycles to return last data word total clock cycles miss penalty  Number of bytes transferred per clock cycle (bandwidth) for a single miss is bytes per clock

CPEG32329 One Word Wide Memory Organization, con’t CPU Cache Memory bus on-chip  What if the block size is four words? cycle to send 1 st address cycles to read DRAM cycles to return last data word total clock cycles miss penalty  Number of bytes transferred per clock cycle (bandwidth) for a single miss is bytes per clock 25 cycles 1 4 x 25 = (4 x 4)/102 = 0.157

CPEG32330 One Word Wide Memory Organization, con’t CPU Cache Memory bus on-chip  What if the block size is four words and if a fast page mode DRAM is used? cycle to send 1 st address cycles to read DRAM cycles to return last data word total clock cycles miss penalty  Number of bytes transferred per clock cycle (bandwidth) for a single miss is bytes per clock

CPEG32331 One Word Wide Memory Organization, con’t CPU Cache Memory bus on-chip  What if the block size is four words and if a fast page mode DRAM is used? cycle to send 1 st address cycles to read DRAM cycles to return last data word total clock cycles miss penalty  Number of bytes transferred per clock cycle (bandwidth) for a single miss is bytes per clock 25 cycles 8 cycles *8 = (4 x 4)/51 = 0.314

CPEG32332 Interleaved Memory Organization  For a block size of four words cycle to send 1 st address cycles to read DRAM cycles to return last data word total clock cycles miss penalty CPU Cache Memory bank 1 bus on-chip Memory bank 0 Memory bank 2 Memory bank 3  Number of bytes transferred per clock cycle (bandwidth) for a single miss is bytes per clock

CPEG32333 Interleaved Memory Organization  For a block size of four words cycle to send 1 st address cycles to read DRAM cycles to return last data word total clock cycles miss penalty CPU Cache Memory bank 1 bus on-chip Memory bank 0 Memory bank 2 Memory bank 3  Number of bytes transferred per clock cycle (bandwidth) for a single miss is bytes per clock 25 cycles (4 x 4)/30 = =

CPEG32334 DRAM Memory System Summary  Its important to match the cache characteristics l caches access one block at a time (usually more than one word)  with the DRAM characteristics l use DRAMs that support fast multiple word accesses, preferably ones that match the block size of the cache  with the memory-bus characteristics l make sure the memory-bus can support the DRAM access rates and patterns l with the goal of increasing the Memory-Bus to Cache bandwidth