-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_mediabench.py
43 lines (34 loc) · 1.38 KB
/
run_mediabench.py
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
from subprocess import call
import sys
single_threaded =["mediabench2-h264-decode",
"mediabench2-jp2-decode",
"mediabench2-h264-encode",
"mediabench2-jp2-encode",
]
ramulator_bin = "/home/tianshi/Workspace/ramulator/ramulator"
if not len(sys.argv) == 7:
print "python run_mediabench.py trace_dir output_dir config_dir workloadid DRAM [multicore|single-threaded]"
sys.exit(0)
option = sys.argv[6]
DRAM = sys.argv[5]
workload_id = int(sys.argv[4])
config_dir = sys.argv[3]
output_dir = sys.argv[2]
trace_dir = sys.argv[1]
if option == "multicore":
output_dir += "/workload" + str(workload_id)
print output_dir
else:
output_dir += "/" + single_threaded[workload_id]
print output_dir
call(["mkdir", "-p", output_dir])
output = output_dir + "/" + DRAM + ".stats"
config = config_dir + "/" + DRAM + "-config.cfg"
if option == "multicore":
traces = [trace_dir + "/" + t + ".trace" for t in workloads[workload_id]]
print " ".join([ramulator_bin, config, "--mode=cpu", "--stats", output] + traces)
call([ramulator_bin, config, "--mode=cpu", "--stats", output] + traces)
elif option == "single-threaded":
trace = trace_dir + "/" + single_threaded[workload_id] + ".trace"
print " ".join([ramulator_bin, config, "--mode=cpu", "--stats", output, trace])
call([ramulator_bin, config, "--mode=cpu", "--stats", output, trace])