Cache Average Access Time
- $H$ is the hit rate of cache level $L_i$
- $T_i$ is the access time of level $L_i$
- $R_i$ is the burst rate per word of level $L_i$ (after startup access time)
- $B$ is the block size
$T_\text{average}$ with $L_1$ cache
Then there are two possible cases.
- We have a hit and only pay $L_1$ cache time.
- We miss and read the whole block to $L_1$
Therefore, Average Access Time $T_\text{average}$ is (Hit Time) $T_1$ + (Miss Ratio) $(1-H_1)$ ร (Miss Penalty) $(T_\text{main memory} + B \times R_\text{main memory})$
Taverageโ=T1โ+(1โH1โ)ร[Tmainย memoryโ+BรRmainย memoryโ]$T_\text{average}$ with $L_2$ cache
- Hit at $L_1$ cache
- Hit at $L_2$ 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โ]