-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathsummary.sh
More file actions
68 lines (62 loc) · 2.13 KB
/
summary.sh
File metadata and controls
68 lines (62 loc) · 2.13 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Summarize an experiment's result.
# Usage: ./summary.sh <target_dir> [max_dir_depth]
# `max_dir_depth`: maximum recursion depth of directories.
# Number of ERRORs.
num_err=0
summary() {
if [ $2 -lt 0 ]; then
echo "[ERROR] Directory is too deep to summarize recursively."
exit
fi
pushd `pwd` > /dev/null
cd $1
if [ -f $search_log ]; then
cat $search_log >> $search_summary;
fi
if [ -f $output_point_file ]; then
cat $output_point_file >> $result_summary;
fi
if [ -f $err_log ]; then
if [ -s $err_log ]; then
(( num_err++ ))
echo -e "[ERROR RECORD] No.$num_err" >> $error_summary
echo -e "[ERROR INPUT] " >> $error_summary
cat $search_log >> $error_summary
echo -e "[ERROR INFO]" >> $error_summary
cat $err_log >> $error_summary
echo "" >> $error_summary
fi
fi
for sub_dir in `ls`
do
if [ -d $sub_dir ]; then
summary $sub_dir `expr $2 - 1`
fi
done
popd > /dev/null
}
output_path=`readlink -f $1`
output_point_file="result.log"
output_struct_file="out.log"
err_log="err.log"
search_log="search.log"
# Summarize the experiment result.
search_summary=$output_path/search.log
error_summary=$output_path/error.log
result_summary=$output_path/result.log
result_summary_xlsx=$output_path/result.xlsx
if [ -f $search_summary ]; then rm $search_summary; fi
if [ -f $error_summary ]; then rm $error_summary; fi
if [ -f $result_summary ]; then rm $result_summary; fi
touch $search_summary
touch $error_summary
touch $result_summary
if [ $# -lt 2 ]; then
summary $1 13
else
summary $1 $2
fi
headers="tech,mm,nn,xx,yy,ss,bb,rr,ff,xcut,ycut,package_type,IO_type,nop_bw,ddr_type,ddr_bw,noc,mac,ul3,tops,cost_overall,energy,cycle,edp,cost,idx,ubuf,buf,bus,mac,NoC,NoP,DRAM,compute_die_area,IO_die_area,total_die_area,cosy_chip,cost_package,cost_system_package,cost_soc"
python3 pyscripts/log2csv.py $result_summary $output_path/result.csv
sed "1i\\$headers" -i $output_path/result.csv
python3 pyscripts/csv2xlsx.py $output_path/result.csv $result_summary_xlsx