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
Taverage=T1+(1−H1)×H2×[T2+B×R2]+(1−H1)×(1−H2)×[T2+Tmain memory+B×Rmain memory]