comparc-metrics/writeback
dheatovwil 92fd83a4aa Add HDDACCESS and WRITEBACK metric
- Cache average access time for write-back policy
- HDD average access time using RPM and head-seek time
2020-06-23 02:40:06 +08:00

11 lines
363 B
Python
Executable File

#!/bin/python
perchit = float(input("PERCENT HIT? "))
percw = float(input("PERCENT WRITE? "))
cacher = int(input("CACHE READ TIME? "))
cachew = int(input("CACHE WRITE TIME? "))
memr = int(input("MEM READ TIME? "))
memw = int(input("MEM WRITE TIME? "))
print(perchit*percw*cachew + perchit*(1-percw)*cacher + (1-perchit)*percw*memw + (1-perchit)*(1-percw)*memr)