If the cache is holding a copy of the word at address

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Reference pattern for array a (Å ¿). The function has poor spatial locality because it scans memory with a stride-´Æ ¢ × Þ Ó ´ reference pattern. Æ Òصµ ¾ , because it scans the array column-wise instead of row-wise. Since C arrays are laid out in memory row-wise, the result is a stride-(Æ ¢ × Þ Ó ´ Òصµ reference pattern, as shown in Figure 6.19(b). 6.2.2 Locality of Instruction Fetches Since program instructions are stored in memory and must be fetched (read) by the CPU, we can also evaluate the locality of a program with respect to its instruction fetches. For example, in Figure 6.17 the instructions in the body of the for loop are executed in sequential memory order, and thus the loop enjoys good spatial locality. Since the loop body is executed multiple times, it also enjoys good temporal locality. An important property of code that distinguishes it from program data is that it can not be modified at runtime. While a program is executing, the CPU only reads its instru...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online