我正在尝试在添加二级缓存时计算每条指令的内存停顿周期。
我有以下给定值:
UIApplication.topViewController()?.present(...)
据我了解,计算内存失速周期的方法是使用以下公式:
Direct Mapped cache with 128 blocks
16 KB cache
2ns Cache access time
1Ghz Clock Rate
1 CPI
80 clock cycles Miss Penalty
5% Miss rate
1.8 Memory Accesses per instruction
16 bit memory address
L2 Cache
4% Miss Rate
6 clock cycles miss penalty
可以简化为:
Memory stall cycles = Memory accesses x Miss rate x Miss penalty
我所做的是乘以Memory stall cycles = instructions per program x misses per instructions x miss penalty
这是正确的还是我错过了什么?