comparc-metrics/writeback

11 lines
363 B
Plaintext
Raw Normal View History

#!/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)