Calculating actual/effective CPI for 3 level cache

后端 未结 1 838
面向向阳花
面向向阳花 2021-01-28 07:49

(a) You are given a memory system that has two levels of cache (L1 and L2). Following are the specifications:

  • Hit time of L1 cache: 2 clock cycles
  • Hit rat
1条回答
  •  走了就别回头了
    2021-01-28 08:26

    (a) The AMAT calculation is correct if you notice that the MissPenalty_L2 parameter is what you called Miss penalty to main memory.

    The CPI is a bit more difficult. First of all, let's assume that the CPU is not pipelined (sequential processor).

    There are 1.37 memory accesses per instruction (one access to fetch the instruction and 0.37 due to data transfer instructions). The ideal case is that all memory acceses hit in the L1 cache. So, knowing that:

    CPI(ideal) = CPI(computation) + CPI(mem) = 
                 CPI(computation) + Memory_Accesses_per_Instruction*HitTime_L1 =
                 CPI(computation) + 1.37*HitTime_L1
    

    With real memory, the average memory access time is AMAT, so:

    CPI(actual) = CPI(computation) + Memory_Accesses_per_Instruction*AMAT =
                  CPI(ideal) + Memory_Accesses_per_Instruction*(AMAT - HitTime_L1) =
                  CPI(ideal) + 1.37*(AMAT - HitTime_L1)
    

    (b) Your AMAT calculation is wrong. After a miss at L2, it follows a L3 access that can be a hit or a miss. Try to finish the exercise yourself.

    0 讨论(0)
提交回复
热议问题