-
Notifications
You must be signed in to change notification settings - Fork 14
/
get.energy.stats.sh
executable file
·98 lines (88 loc) · 2.82 KB
/
get.energy.stats.sh
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
################################################################################################################
#Common configurations in the script
PREFIX=$1
VERSION=$2
BASE_DIR=./parade-${PREFIX}-${VERSION}/
BENCHS=(
###Medical Imaging(MI) benchmarks##############
'Deblur_Modified'
'Denoise'
'Registration_Modified'
'Segmentation'
###CoMmercial(CM) benchmarks###################
'BlackScholes'
'StreamCluster'
'Swaptions'
###computer VISion(VIS) benchmarks#############
'LPCIP_Desc'
'Texture_Synthesis'
###NAVigation(NAV) benchmarks##################
'Robot_Localization'
'Disparity_Map'
'EKF_SLAM'
)
for bench in ${BENCHS[@]}; do
BENCH_DIR=${BASE_DIR}/${PREFIX}_${bench}/
_MCPAT_FILE=${BENCH_DIR}/mcpat.energy
_DSENT_FILE=${BENCH_DIR}/dsent.txt
_STATS_FILE=${BENCH_DIR}/stats.txt
printf "${bench}:"
# get Subthreshold Leakage for Core and L2
Subthreshold_Leakage="Subthreshold Leakage"
printf "\nSubthreshold_Leakage"
if grep "${Subthreshold_Leakage}" ${_MCPAT_FILE} > tmp1
then
sed -n '2,3p' tmp1 > tmp2
grep "${Subthreshold_Leakage}" tmp2 | awk '{printf "\t%s", $4}{if($4=="")printf "\t\terror"}'
else
echo -n -e "\terror"
fi
# get Gate Leakage for Core and L2
Gate_Leakage="Gate Leakage"
printf "\nGate_Leakage"
if grep "${Gate_Leakage}" ${_MCPAT_FILE} > tmp1
then
sed -n '2,3p' tmp1 > tmp2
grep "${Gate_Leakage}" tmp2 | awk '{printf "\t%s", $4}{if($4=="")printf "\t\terror"}'
else
echo -n -e "\terror"
fi
# get Runtime Dynamic for Core and L2
Runtime_Dynamic="Runtime Dynamic"
printf "\nRuntime_Dynamic"
if grep "${Runtime_Dynamic}" ${_MCPAT_FILE} > tmp1
then
sed -n '2,3p' tmp1 > tmp2
grep "${Runtime_Dynamic}" tmp2 | awk '{printf "\t%s", $4}{if($4=="")printf "\t\terror"}'
else
echo -n -e "\terror"
fi
# get Router power
Router_total_power="Router_total_power"
printf "\nRouter_total_power"
if grep "${Router_total_power}" ${_DSENT_FILE} > tmp
then
grep "${Router_total_power}" ${_DSENT_FILE} | awk '{printf "\t%s", $2}{if($2=="")printf "\t\terror"}'
else
echo -n -e "\terror"
fi
# get Link power
Link_total_power="Link_total_power"
printf "\nLink_total_power"
if grep "${Link_total_power}" ${_DSENT_FILE} > tmp
then
grep "${Link_total_power}" ${_DSENT_FILE} | awk '{printf "\t%s", $2}{if($2=="")printf "\t\terror"}'
else
echo -n -e "\terror"
fi
# get Dram power
Dram_total_power="averagePower"
printf "\nDram_total_power"
if grep "${Dram_total_power}" ${_STATS_FILE} > tmp
then
grep "${Dram_total_power}" ${_STATS_FILE} | awk '{printf "\t%s", $2}{if($2=="")printf "\t\terror"}'
else
echo -n -e "\terror"
fi
printf "\n"
done