Docsity

Cache Memory Organization, Slides of Embedded Systems

Toggle sidebar
bg1
1
Dr. Jeff Jackson Lecture 8-1Electrical & Computer Engineering – Embedded Systems
Embedded Systems
Cache Memory Organizations and
Replacement Policy Examples
Dr. Jeff Jackson Lecture 8-2Electrical & Computer Engineering – Embedded Systems
Element (Word) Hit ratio
•Assume two adjacent levels, numbered M1and M2,
in a memory hierarchy
•The word hit ratio, H, for the lower level in the
hierarchy is the number of address references that
are found in the lower level (N1) divided by the total
number of references (N1+N2)


•These references can be to instructions or data
pf3
pf4
pf5

Partial preview of the text

Download Cache Memory Organization and more Slides Embedded Systems in PDF only on Docsity!

Electrical & Computer Engineering – Embedded Systems Dr. Jeff Jackson Lecture 8-

Embedded Systems

Cache Memory Organizations and

Replacement Policy Examples

Electrical & Computer Engineering – Embedded Systems Dr. Jeff Jackson Lecture 8-

Element (Word) Hit ratio

• Assume two adjacent levels, numbered M 1 and M 2 ,

in a memory hierarchy

• The word hit ratio, H, for the lower level in the

hierarchy is the number of address references that

are found in the lower level (N 1 ) divided by the total

number of references (N 1 +N 2 )

ଵ ܰ൅^ ଶ

• These references can be to instructions or data

Electrical & Computer Engineering – Embedded Systems Dr. Jeff Jackson Lecture 8-

Block Address Reference Streams

• The performance of a replacement policy in a given

memory organization can be analyzed using a block

reference stream generated by a set of computations

• The block reference stream is a list of block addresses

that are referenced in a particular program execution

• For example:

would imply that the first block referenced is B 2 , the

second is B 3 , etc.

• There may be many consecutive word references within

a single block reference

Electrical & Computer Engineering – Embedded Systems Dr. Jeff Jackson Lecture 8-

Block Hit Ratio

• Let ܰ ଵ∗^ ܰand ଶ∗^ represent the number of block references

to M 1 and M 2 respectively

• For our purposes M 1 is a cache memory and M 2 is a

main memory

• The block hit ratio H* is defined as

ܪ ∗^ ܰൌ

• This is analogous to the word hit ratio H

• Let n* represent the average number of consecutive

word address references within each block

• H can be estimated from H* as

Electrical & Computer Engineering – Embedded Systems Dr. Jeff Jackson Lecture 8-

Example LRU Replacement

• * represents a block to be replaced if necessary

• H*=5/12=0.

• If n*=100 then H=.9941 (99.41%)

Time 1 2 3 4 5 6 7 8 9 10 11 12 Block Address Stream

Hit Hit Hit Hit Hit

Electrical & Computer Engineering – Embedded Systems Dr. Jeff Jackson Lecture 8-

Example OPT Replacement

• * represents a block to be replaced if necessary

• H*=6/12=0.

• If n*=100 then H=.995 (99.5%)

Time 1 2 3 4 5 6 7 8 9 10 11 12 Block Address Stream

Hit Hit Hit Hit Hit Hit

Electrical & Computer Engineering – Embedded Systems Dr. Jeff Jackson Lecture 8-

Other Considerations for Block Replacement

  • If the cache is direct mapped there is only one specific cache block into which a main memory block can be mapped - The block hit ratio for a direct mapped cache cannot be greater than that for a fully associative cache given a particular block address reference stream
  • If the cache is set associative there are only a few cache blocks into which a main memory block can be mapped - The block hit ratio for a set associative cache cannot be greater than that for a fully associative cache given a particular block address reference stream