I have the following situation:
A machine takes on average c cycles per instruction without
considering memory stalls,
and has a miss penalty p for all misses. Let i and d be respectively the instruction cache
miss rate and data cache miss rate for a program with n instructions and f memory references
per instruction. Assume that the hit time is not a factor in determining cache performance.
I have worked out that the number of cycles required to run the program with memory stalls taken into account is n(c + ip + fdp).
The next part says:
If we want to improve the execution time of this pro- gram by a factor
of k, how much do
we need to reduce the number of cycles that each instruction takes?
Another way to improve the execution time is to reduce the cycle time of the machine.
If we want to improve the execution time by a factor of k, how much do we need to
improve the cycle time?
I have got n(c + ip + fdp) / k so I’m thinking that the answer must be 1/k for the first part, but that seems too obvious. And surely if the cycle time is t then n(c + ip + fdp) * t gives the overall execution time, so it must be 1/k again?
Thanks
For the first part, I don’t believe you are allowed to change anything other than c to get the desired speed-up; your solution assumes you are speeding up the cache misses as well.
The second part has a similar issue: speeding up the cycle time would not necessarily reduce the cache penalty, so the value of p would GROW as you reduced the cycle time (to keep the time constant, you’d need more of these shorter cycles).
This assumes, as you seem to, that p is measured in terms of cycles.