Question: 4. Consider a cache that uses the write-back with no-write-allocate policy and the LRU replacement policy. a) What control bits are needed in each line





4. Consider a cache that uses the write-back with no-write-allocate policy and the LRU replacement policy. a) What control bits are needed in each line of this cache? b) Write the actions taken in this cache (including actions on the control bits) for each of the following cases. Use a format similar to what we followed in the class for other write policies. i. Read hit ii. Read miss iii. Write hit iv. Write miss Write Policy When a block that is resident in the cache is to be replaced there are two cases to consider: There are two problems to contend with: If the old block in the cache has not been altered then it may be overwritten with a new block without first writing out the old block More than one device may have access to main memory If at least one write operation has been performed on a word in that line of the cache then main memory must be updated by writing the line of cache out to the block of memory before bringing in the new block A more complex problem occurs when multiple processors are attached to the same bus and each processor has its own local cache - if a word is altered in one cache it could conceivably invalidate a word in other caches Write Through and Write Back Write through - Simplest technique All write operations are made to main memory as well as to the cache The main disadvantage of this technique is that it generates substantial memory traffic and may create a bottleneck Write back Minimizes memory writes Updates are made only in the cache Portions of main memory are invalid and hence accesses by I/O modules can be allowed only through the cache This makes for complex circuitry and a potential bottleneck Write Miss Alternatives There are two alternatives in the event of a write miss at a cache level: - Write allocate The block containing the word to be written is fetched from main memory (or next level cache) into the cache and the processor proceeds with the write cycle - No write allocate The block containing the word to be written is modified in the main memory and not loaded into the cache Either of these policies can be used with either write through or write back No write allocate is most commonly used with write through Write allocate is most commonly used with write back 4. Consider a cache that uses the write-back with no-write-allocate policy and the LRU replacement policy. a) What control bits are needed in each line of this cache? b) Write the actions taken in this cache (including actions on the control bits) for each of the following cases. Use a format similar to what we followed in the class for other write policies. i. Read hit ii. Read miss iii. Write hit iv. Write miss Write Policy When a block that is resident in the cache is to be replaced there are two cases to consider: There are two problems to contend with: If the old block in the cache has not been altered then it may be overwritten with a new block without first writing out the old block More than one device may have access to main memory If at least one write operation has been performed on a word in that line of the cache then main memory must be updated by writing the line of cache out to the block of memory before bringing in the new block A more complex problem occurs when multiple processors are attached to the same bus and each processor has its own local cache - if a word is altered in one cache it could conceivably invalidate a word in other caches Write Through and Write Back Write through - Simplest technique All write operations are made to main memory as well as to the cache The main disadvantage of this technique is that it generates substantial memory traffic and may create a bottleneck Write back Minimizes memory writes Updates are made only in the cache Portions of main memory are invalid and hence accesses by I/O modules can be allowed only through the cache This makes for complex circuitry and a potential bottleneck Write Miss Alternatives There are two alternatives in the event of a write miss at a cache level: - Write allocate The block containing the word to be written is fetched from main memory (or next level cache) into the cache and the processor proceeds with the write cycle - No write allocate The block containing the word to be written is modified in the main memory and not loaded into the cache Either of these policies can be used with either write through or write back No write allocate is most commonly used with write through Write allocate is most commonly used with write back
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
