Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 20: Cache Design Spring 2009 W. Rhett Davis.

Slides:



Advertisements
Similar presentations
INPUT-OUTPUT ORGANIZATION
Advertisements

Dr. Rabie A. Ramadan Al-Azhar University Lecture 3
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 8: Sequential Design Spring 2009 W. Rhett.
Chapter 2 Microprocessor Bus Transfers. Big- and Little-Endian Ordering Bit-endian processor architecture –High-order-byte-first (H-O-B-F) map the highest-order.
Processor System Architecture
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 1: Introduction Spring 2009 W. Rhett Davis.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 21: Where do you go from here? Spring 2009.
Spring 20067W. Rhett Davis with minor modifications by Dean Brock ECE 406 at UNASlide 1 ECE 406 Design of Complex Digital Systems Lecture 10: 9: State.
Input-output and Communication Prof. Sin-Min Lee Department of Computer Science.
EECS 470 Cache and Memory Systems Lecture 14 Coverage: Chapter 5.
9/20/6Lecture 3 - Instruction Set - Al Hardware interface (part 2)
1 COMP541 State Machines – 2 Registers and Counters Montek Singh Feb 8, 2007.
A.Abhari CPS2131 Registers A register is a group of n flip-flops each of them capable of storing one bit of information There are two types of registers:
1 Sequential Circuits Registers and Counters. 2 Master Slave Flip Flops.
EE345: Introduction to Microcontrollers Register and Counters Prof. Ahmad Abu-El-Haija.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 13: Regression Testing, MemAccess Block.
INPUT-OUTPUT ORGANIZATION
MODES OF Details of Pins Pin 1 –Connected Ground Pins 2-16 –acts as both input/output. Outputs address at the first part of the cycle and outputs.
Computer Architecture Lecture 08 Fasih ur Rehman.
Spring 2007W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 7: Design Example,
Spring EE 437 Lillevik 437s06-l2 University of Portland School of Engineering Advanced Computer Architecture Lecture 2 NSD with MUX and ROM Class.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 19: Cache Operation & Design Spring 2009.
Spring 2007W. Rhett Davis with slight modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 11: Memories,
ECE 2372 Modern Digital System Design
Spring 2007W. Rhett DavisNC State UniversityECE 747Slide 1 ECE 747 Digital Signal Processing Architecture SoC Lecture – SoC Simulation Strategy ECE 747.
Computer Architecture
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 2: Introduction to Verilog Syntax Spring.
Lecture 16 Today’s topics: –MARIE Instruction Decoding and Control –Hardwired control –Micro-programmed control 1.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Top Level View of Computer Function and Interconnection.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 2.
ECP2036 Microprocessor and Interfacing Registers Control & Status Registers Program Counter User-Visible Registers Instruction Register... General-Purpose.
Realistic Memories and Caches Li-Shiuan Peh Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology March 21, 2012L13-1
Cache Control and Cache Coherence Protocols How to Manage State of Cache How to Keep Processors Reading the Correct Information.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 3: Structural Modeling Spring 2009 W. Rhett.
SEQUENTIAL CIRCUITS Component Design and Use. Register with Parallel Load  Register: Group of Flip-Flops  Ex: D Flip-Flops  Holds a Word of Data 
Spring EE 437 Lillevik 437s06-l16 University of Portland School of Engineering Advanced Computer Architecture Lecture 16 Cache design example Data/tag.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 7: Design Example, Modeling Flip-Flops Spring.
Spring 2007 W. Rhett Davis with minor editing by J. Dean Brock UNCA ECE Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 1: Introduction.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Lecture Objectives: 1)Explain the relationship between miss rate and block size in a cache. 2)Construct a flowchart explaining how a cache miss is handled.
By Fernan Naderzad.  Today we’ll go over: Von Neumann Architecture, Hardware and Software Approaches, Computer Functions, Interrupts, and Buses.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 16: Introduction to Buses and Interfaces.
Spring 2007W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 12: Intro to the.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 4: Testing, Dataflow Modeling Spring 2009.
Computer operation is of how the different parts of a computer system work together to perform a task.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 6: Procedural Modeling Spring 2009 W. Rhett.
Spring 20067W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 Design of Complex Digital Systems Lecture 11: Data Converter,
Memory Hierarchy and Caches. Who Cares about Memory Hierarchy? Processor Only Thus Far in Course CPU-DRAM Gap 1980: no cache in µproc; level cache,
Spring 2007W. Rhett DavisNC State UniversityECE 747Slide 1 ECE 747 Digital Signal Processing Architecture SoC Lecture – Working with Buses & Interconnects.
The System Bus. Conceptual CPU Block Diagram Datapath Regs Buses ALU Control Unit Bus Interface IR etc. PC etc. Control Signals Status Signals PSR System.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 12: Intro to the LC-3 Micro-architecture.
CAM Content Addressable Memory
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 9: State Machines & Reset Behavior Spring.
Direct Memory Access (DMA) Department of Computer Engineering, M.S.P.V.L. Polytechnic College, Pavoorchatram. A Presentation On.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 10: Data-Converter Example Spring 2009 W.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 18: More Complex Interfaces Spring 2009.
STUDY OF PIC MICROCONTROLLERS.. Design Flow C CODE Hex File Assembly Code Compiler Assembler Chip Programming.
ASYNCHRONOUS DATA TRANSFER
Class Exercise 1B.
Everybody.
Address – 32 bits WRITE Write Cache Write Main Byte Offset Tag Index Valid Tag Data 16K entries 16.
Dr. Michael Nasief Lecture 2
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
William Stallings Computer Organization and Architecture
Presentation transcript:

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 20: Cache Design Spring 2009 W. Rhett Davis NC State University with significant material from Paul Franzon, Bill Allen, & Xun Liu

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 2 Announcements l HW#8 Due Today l Proj#2 Due in 2 weeks l Exam Review in 2 weeks l Proj#2 Advising next Tuesday (in our regular classroom)

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 3 Mentor Moment l Keep the lines of communication open l How do you respond to your inbox? » My common mistake: –respond well » A much better approach: –respond quickly l Resist the urge to… » Use your inbox as a to-do list » Spend more than 2 minutes per message l My favorite time-management book:

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 4 Today’s Lecture l Project #2 Introduction

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 5 Project #1 System l Synchronous Memory with Separate din/dout/address lines

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 6 Project #2 Changes l Asynchronous Off-Chip Memory with Shared din/dout/address lines l Cache sits between processor and memory l LC3 Unchanged except for “macc” signal » High when state is Fetch, Read Memory, Write Memory, or Read Indirect Address l SimpleLC3 and Memory blocks will be provided

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 7 Data Transfer Interface Cache Off-chip Memory Read request (rrqst) Data/Address(data) Read ready(rrdy) Read data ready(rdrdy) Read data accept(rdacpt) Write request(wrqst) Write accept(wacpt) addr din rd dout complete clock reset Memory Access (macc)

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 8 Protocol for Read Miss addressdata0data1data2data3 Read request Read ready Read data ready Read data accept

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 9 Protocol for Write Hit addressdata Write request Write accept

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 10 Protocol for Write Miss Read request addrdata data0data1data2data3 Read data ready Read data accept Write reqst Write acpt data

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 11 Cache System Block-Diagram

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 12 UnifiedCache Schematic

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 13 CacheController Block l Takes the handshaking signals from the LC-3 CPU and Off-Chip Memory as inputs l Takes miss indicator from CacheData as input l Maintains the state of the Cache and Interfaces l Maintains a 2-bit counter that specifies the word offset to be loaded into the cache

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 14 Controller State Machine 0 3 Read-hit Read-miss rrdy==1 rdrdy==1 Read-complete && rdrdy==0 5 Write wacpt==1 wacpt==0 && Hit 67 wacpt==1 wacpt==0 rdrdy==1 reset 8 wacpt==0 && Miss always macc =0 || Read-incomplete && rdrdy==0 wacpt==0 wacpt==1 wacpt==0 wacpt==1 rdrdy==0 rrdy==0

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 15 Use Counter to Read Four Words 0 3 Read-hit Read-miss rrdy=1 rdrdy=1 Read-complete 5 Other Write wacpt=1 wacpt=0, hit 67 wacpt=1 wacpt=0 rdrdy=1 reset 8 wacpt=0, miss always macc =0 || Read-incomplete 32 rdrdy= rdrdy=0

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 16 States for Read Miss addressdata0data1data2data3 Read request Read ready Read data ready Read data accept

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 17 States for Write Hit addressdata Write request Write accept

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 18 States for Write Miss Read request addrdata data0data1data2data3 Read data ready Read data accept Write reqst Write acpt data

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 19 ProcInterface Block l Receives blockdata from CacheData block as input l Generates outputs for the LC-3 CPU » Sets dout[15:0] to the currently selected value » Sets complete to 1 on a read hit or on state 8 for other cases

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 20 ProcInterface Schematic

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 21 MemInterface Block l Generates outputs for the off-chip memory » sets rrqst, rdacpt, and wrqst depending on state » sets offdata to addr or din or high-impedance (Z), depending on state » block contains combinational logic only (no registers)

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 22 ValidArray Block l Maintains the register of Valid-Bits for the Cache l Outputs the valid-bit for the current cache-index to the CacheData block (depending on address from the LC-3 CPU) l After all memory-accesses, sets the valid-bit to true for the currently selected cache-index

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 23 ValidArray Schematic l When reset is 1, set all valid bits to 0 l When state is 8, set valid-bit for current index to 1

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 24 Note Top-Level Connections l index[3:0] connects to addr[5:2] in top-level

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 25 CacheData Block l Maintains CacheRAM l Reads and Writes to CacheRAM through Block- Registers l Receives Data Output from Off-Chip Memory l Determines whether or not there has been a Cache- Miss l Provides data for LC-3 CPU to ProcInterface Block

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 26 CacheData Schematic l Internal control signals » ramrd » blocksel0-3 l Asynchronous CacheRAM block » when rd is 1, reads memory » when rd is 0, data is high-impedence, writes memory » CacheRAM is provided for you

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 27 CacheRAM Model module CacheRAM(data, addr, rd); input [3:0] addr; inout [73:0] data; input rd; reg [73:0] memarray[15:0]; assign data=(rd==1)?memarray[addr]:74'hz; or addr or rd) if(rd==0) memarray[addr]=data; endmodule

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 28 CacheData Internal Signals l ramrd – 1 when the CacheRAM is being read, 0 when it is being written. Should be 1 at all times except » when current state is 3 (allows writing the values on a cache miss) » when current state is 5 and there is a cache hit. (allows writing the values on a write hit) l blocksel0-3 – control the values written to the block-registers on each cycle. The current output from the CacheRAM should always be written to the block-registers, except for the following two cases: » In state 4, the block-register indicated by the offset bits (bits [1:0] of the address from the LC-3 CPU) should get din[15:0] from the LC-3 CPU. » In state 2, the block-register indicated by the count from the CacheController should get offdata[15:0] from the off-chip memory. l miss – Should be 1 in either of the following cases » the current valid bit is 0 » the current valid bit is 1 and the tag for the current index does not match addr[15:6]