Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 Background The microprocessor cache has a set of flag bits. We have used only one so far, the valid bit which indicates if a
Background
The microprocessor cache has a set of flag bits. We have used only one so far, the valid bit which
indicates if a row is in use. There are other bits:
Least recently used bitsLRU Some bits used as meta data to determine which is the
oldest block in the row. This determine which block gets evicted during a capacity miss.
Dirty bit. In multilevel caches, the dirty bit indicates if the current cache level has a modified
version of a block that is inconsistent with lower cache levels and the virtual memory
Here is an example of a way set associative cache with the flag bits described above:
In this assignment we will distinguish between load and store operations. Store operations
introduce a complication: if a change is made to a block how do you update all levels of cache and
the virtual memory The simplest approach is called writethrough, where on a store operation
the entire processor stalls as the block is copied into the L L etc. and the virtual memory. This
costs as much time as a hit, and is suboptimal.
Instead, modern microprocessors use a technique called writeback. When a block is written,
you only change the value in the L cache, and set the dirty bit. The change is not copied into the
L or virtual memory. This means that with writeback, values written to memory are inconsistent
across all cache levels and the virtual memory If a block with a dirty bit is evicted from a row the
change is pushed down one level below. The value is updated in the lower level making it consistent,
and setting the dirty bit in the lower level.
For example, if you initialize this change is only written to the level one cachethe value
of is garbage or unknown in all other cache levels and the virtual memory. If somehow the block
containing the concept of is evicted from the level one cache due to a capacity miss we note
that its dirty bit was set during the store operation. Then, the concept of is pushed to the level
two cache but not any lower and the dirty bit is set. If again, the concept of gets evicted
from the level two cache the process repeats. The change is pushed to a lower level. This created
an unusual phenomenon where variables in primary storage virtual memory are totally different
than the values the processor is using.
At a glance, you can see that this would resolve the issue from the last problem of the last
activity, you would not need to juggle the values in row it could hold both values. Real numbers
for set associativity range from to
Direct Instruction
The instructor will review these examples in class:
A system has two cache levels. The L cache has rows. The L cache has rows. Both
caches are twoway set associative and the block size is bytes. Ignore the LRU bit. You
must use writeback methodology. Profile the following memory requests to the cache:
a Store to
b Store to
c Store to
d Store to
Activity
A system has two cache levels. The L cache has rows. The L cache has rows. Both
caches are way set associative and the block size is bytes. Profile the following memory
requests to the cache:
a Write to
b Write to
c Write to
d Write to
e Write to
f Write to
g Write to
h Write to
Ignore the LRU bit, and profile these requests with writeback methodology. Assume the
virtual memory has garbage values for these variables to start.
What are the final values of each variable in each cache level?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started