-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeystone.py
More file actions
54 lines (36 loc) · 1.44 KB
/
Copy pathkeystone.py
File metadata and controls
54 lines (36 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import matplotlib.pyplot as plt
import pandas as pd
import re
from pathlib import Path
import numpy as np
import io
from plot import *
import csv
def extract_keystone(path="results"):
folder_path = Path(path)
output = []
for file_path in sorted(folder_path.rglob('*')):
output.append(extract_keystone_value(file_path))
return np.array(output)
def extract_keystone_value(file_path):
with open(file_path, 'r') as file:
lines = file.readlines()
lines = list(filter(lambda x: "iruntime" in x, lines))
lines = list(map(lambda x: int(x.split(" ")[1]), lines))
lines = np.array(lines)
return np.mean(lines)
if __name__ == "__main__":
title = 'Coremarkpro - [iterations/s] - multicore'
workloads = ["aes", "dhrystone", "miniz", "norx", "prime", "sha", "sort"]
output_board = extract_keystone(f"keystone/board")
output_keystone = extract_keystone(f"keystone/keystone")
native = output_board.copy() / 1000 / 1000
native = list(map(lambda x: "{} s".format(round(x,2)), native))
output_keystone = output_board / output_keystone
output_board /= output_board
print("Output keystone performance :", np.sort(output_keystone))
print("Mean value : ", np.mean(output_keystone))
plot_bar(workloads, {
'Board': output_board,
'Keystone': output_keystone,
}, 'keystone', native, 1.004, 1.025, ymin=0.8, figsize=(6.5, 2.7), fontsize=14, valfontsize=11)