From 92fd83a4aa3802432ad4d6f58c258aed80e7a90e Mon Sep 17 00:00:00 2001 From: dheatovwil Date: Tue, 23 Jun 2020 02:40:06 +0800 Subject: [PATCH] Add HDDACCESS and WRITEBACK metric - Cache average access time for write-back policy - HDD average access time using RPM and head-seek time --- hddaccess | 7 +++++++ writeback | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100755 hddaccess create mode 100755 writeback diff --git a/hddaccess b/hddaccess new file mode 100755 index 0000000..de1613c --- /dev/null +++ b/hddaccess @@ -0,0 +1,7 @@ +#!/bin/python + +rpm = int(input("RPM? ")) +headseek = int(input("AVG head seek? (ms) ")) # ms +rotlat = 60/rpm/2 * 1000 # ms +print(headseek+rotlat) + diff --git a/writeback b/writeback new file mode 100755 index 0000000..d080cfb --- /dev/null +++ b/writeback @@ -0,0 +1,10 @@ +#!/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)