Electronic – Increasing cache line size when cache and RAM don’t work asynchrounsly

cacheram

I want to improve a processor design. It has a simple directly mapped cache, and I want to improve the hit rate. I've been working on increasing the cache line size from one data word to four, but since all accesses to the cache and RAM are currently blocking (I mean that the operation of the whole CPU is blocked when it's waiting for a data read or write), I think that I am merely shifting the delay that is needed to access the RAM to the moment that any data in the same cacheline is needed. If I am correct, this won't make the processor execute any faster (and probably only slower, since more data is transferred between cache and RAM).

Is this the case or am I overlooking something?

Best Answer

By not decoupling the activity of the memory from the activity of the CPU, you're throwing away most of the benefit of having a cache.

But based on how you've described your system so far, it sounds like your analysis is correct: Increasing the line size will in effect prefetch some of the data, but this will not result in any performance gain. In fact, it could result in a slight performance loss on those occasions when the prefetched data is never actually used — the time spent fetching it was simply wasted.