Cache Average Access Time
- H is the hit rate of cache level Liโ
- Tiโ is the access time of level Liโ
- Riโ is the burst rate per word of level Liโ (after startup access time)
- B is the block size
Taverageโ with L1โ cacheโ
Then there are two possible cases.
- We have a hit and only pay L1โ cache time.
- We miss and read the whole block to L1โ
Therefore, Average Access Time Taverageโ is (Hit Time) T1โ + (Miss Ratio) (1โH1โ) ร (Miss Penalty) (Tmainย memoryโ+BรRmainย memoryโ)
Taverageโ=T1โ+(1โH1โ)ร[Tmainย memoryโ+BรRmainย memoryโ]
Taverageโ with L2โ cacheโ
- Hit at L1โ cache
- Hit at L2โ cache
- We miss and read the whole block from memory
Similarly,
Taverageโ=T1โ+(1โH1โ)รH2โร[T2โ+BรR2โ]+(1โH1โ)ร(1โH2โ)ร[T2โ+Tmainย memoryโ+BรRmainย memoryโ]