Bishop_1
Bishop_1

Reputation: 71

How to Calculate Effective Memory Access Time with Multi-Level TLBs?

I’m working on a problem involving the calculation of effective memory-access time (EMAT) for a system with multi-level TLBs, and I want to confirm if my understanding is correct. Here’s the problem setup:


Problem Details:

  1. Memory and TLB Parameters:

    • Memory access time (Δt_mem): 100 ns
    • TLB miss penalty: On a TLB miss, 4 additional memory accesses are required.
    • TLB access times:
      Δt_TLB, L1-D = 1 ns
      Δt_TLB, L2 = 5 ns
      
    • TLB hit rates:
      ρ_TLB, L1-D = 30%
      ρ_TLB, L2 = 98%
      
  2. Behavior:

    • If an L1-D TLB hit occurs, the memory-access time includes just Δt_TLB, L1-D.
    • If the L1-D TLB misses but the L2 TLB hits, it adds Δt_TLB, L2.
    • If both TLB levels miss, it requires 4 additional memory accesses.

My Attempt:

I’ve tried breaking this into three cases:

  1. Case 1: L1-D TLB Hit (30%):

    Time = Δt_TLB, L1-D = 1 ns
    
  2. Case 2: L1-D Miss, L2 TLB Hit (70% × 98%):

    Time = Δt_TLB, L1-D + Δt_TLB, L2 = 1 ns + 5 ns = 6 ns
    
  3. Case 3: Both L1-D and L2 TLB Miss (70% × 2%):

    Time = Δt_TLB, L1-D + Δt_TLB, L2 + 4 × Δt_mem
    Time = 1 ns + 5 ns + 4 × 100 ns = 406 ns
    

Finally, I believe the overall EMAT is the weighted sum of these cases based on their probabilities, but I’m unsure if I’m combining them correctly.


My Question:

I’d appreciate any clarification or suggestions to ensure my understanding is correct.

Thanks!

Upvotes: 1

Views: 92

Answers (1)

codenz
codenz

Reputation: 1

Your approach is fine.

Instead of three seperate cases you could also use this, which is not better but just another way of doing it:

EMAT = (L1 hit rate × L1 time) + 
   (L1 miss rate × L2 hit rate × L2 time) + 
   (L1 miss rate × L2 miss rate × full miss penalty)

Upvotes: 0

Related Questions