Differences between revisions 1 and 2
Revision 1 as of 2004-03-18 21:14:33
Size: 1166
Editor: yakko
Comment:
Revision 2 as of 2004-03-18 21:16:29
Size: 1260
Editor: yakko
Comment:
Deletions are marked like this. Additions are marked like this.
Line 32: Line 32:
''Ignoring memory system behavior in writing programs or in general code in a compiler''

Back to ComputerTerms

See: CaChe, VirtualMemory (includes: TLB, and Page table)

Pitfalls:

Don't forget to account for byte addressing or the cache block size in simulating a cache.

Example: If we have a 32-byte, direct-mapped cache with a block size of 4 bytes, the byte address 36 maps into block 1 of the cache since byte addres 36 is block address 9 and (9 mod 8)=1. On the other hand if address 36 is a word address, then it maps into block (36 mod 8)=6. NOTE: here the size of the cache in blocks is what counts: 32/4=8 blocks.

Example: Suppose we have a cache with 256 bytes and a block size of 32 bytes. Which block does the byte address 300 fall into?

Byte address 300 is 

  Int(300/32) = 9

The number of blocks in the cace is Int(256/32) = 8

Block #9 falls into cache block number (9 mod 8) = 1

Using miss rate as teh only metric for evaluating a memory hierarchy

You should also include hit time. Recall

   CPU time = (CPU execution clock cycles + Mem-stall cycles) x ClockCycleTime

   Mem-stall cycles = Instructions/program x Misses/instruction x Miss penalty

Ignoring memory system behavior in writing programs or in general code in a compiler

Back to ComputerTerms

MemoryHierarchy (last edited 2004-03-18 21:29:31 by yakko)