Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In the previous activity we learned how to use a single cache level to profile requests to the memory. Today we will learn two new
In the previous activity we learned how to use a single cache level to profile requests to the memory. Today we
will learn two new concepts: cache levels and setassociative caches. The processor has many cache levels that are
progressively larger in size. If a row hits capacity and a block is lost, there is a chance it will still be contained in a
lower level of the cache. The general for for any cache level i is this:
The input to the cache level is a request for an aligned memory address
Go to the appropriate row, check the valid bit, and check if the tag matches.
a If the valid bit is zero, it is a miss cold start. Push the request to a lower level.
b If the tag is mismatched, it is a miss. If there are no free blocks it is a capacity miss. Push the request to
a lower level.
c If the tag matches, it is a hit. Return the block in this row up to a higher level.
The levels of a cache are generally:
Level L In practice, there are two level caches, one for instructions and one for data. For our assignments
we will have a single L to keep things simple.
L
L In practice, this level is shared across multiple logical processors, but this will not come into play for our
assignments because we only work with a single logical processor.
The virtual memory.
The processor starts on level and works its way down.
nway Set Associative Cache With the last question on the last activity, we experienced a major flaw in our
directmapped cache design. You worked out an example where the cache kept juggling the block in and out of row
Each time it is a miss, this means it had to go to a lower level. The simplest way to address this is to have each
row hold multiple blocks. For example, with a directmapped cache, if you think about it in terms of a tuple:
Row Tag, v Data
Where v is the valid bit. We can extend this notation so that each row holds n blocks:
Row Tag
v Data Tag
v Data Tagn, vn Datan,
Note that since the row is the key, we do not need to duplicate it With this new notation we can hold n blocks. We
call this an nway setassociative cache. For example, if n the table would look like:
Row Tag Valid Data Tag Valid Data
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 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. Profile the following memory requests to the cache:
ab
bb
cb
db
Activity
A system has two cache levels. The L cache has rows. The L cache has rows. Both caches are directmapped and the block size is bytes. Profile the following memory requests to the cache:
ab
bb
cb
db
eb
fb
gb
hb
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