Question

We run the following code with an empty TLB. Calculate the TLB miss rate for data...

We run the following code with an empty TLB. Calculate the TLB miss rate for data (ignore instruction fetches). Assume i and sum are stored in registers and cool is page-aligned.

#define LEAP 8 int cool[512];

... // Some code that assigns values into the array cool

... // Now flush the TLB.

Start counting TLB miss rate from here.

int sum;

for (int i = 0; i < 512; i += LEAP) {

sum += cool[i];

}

What is TLB miss rate?

Homework Answers

Answer #1

Let assume that LRU page replacement policy is used with a TLB of 4 sets that uses 8-way set associativity.

Now, 4 sets with 8-way associativity is used. Thus there are total 4*8 number of values can be stored in the TLB. The given for loop runs from i=0 to i<512 with an increment of 8 (since LEAP is defined as 8) at each step.

Since the total capacity of the TLB is 32 (number of values can be stored), the TLB miss rate will be 1/32. For the first 32 elements in the TLB, there will be no miss. Fresh values will be mapped in the TLB. But after every 32 elements, a TLB miss will be there.

Thus, the TLB miss rate will be: 1/32.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT