-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_meas.sh
executable file
·53 lines (48 loc) · 1.26 KB
/
run_meas.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
ID=0
NE16=1
START_MODEL=0
STOP_MODEL=4
SEC_FLASH=1
MODEL_TYPE=tflite
LOG_DIR=log_meas
SUFF="_sq8"
if [ ${NE16} -eq 1 ]
then
SUFF="_ne16"
fi
wait_finished_job() {
if [ $? -eq "1" ]; then # kill the measurement job
for job in `jobs -p`
do
echo $job
kill -9 $job
done
continue
else # wait measurment job
for job in `jobs -p`
do
echo $job
wait $job
done
fi
}
for ID in `seq $START_MODEL $STOP_MODEL`;
do
touch efficientnet_lite.c
make_cmd="make MODEL_SIZE=${ID} MODEL_TYPE=${MODEL_TYPE} USE_PRIVILEGED_FLASH=${SEC_FLASH} MODEL_NE16=${NE16}"
echo ${make_cmd}
${make_cmd} clean_model model > ${LOG_DIR}/efficientnet_lite_${ID}${SUFF}_at.log
${make_cmd} io=uart all -j
# High Performance
F=370
V=800
python $GAP_SDK_HOME/utils/power_meas_utils/ps4444Measure.py ${LOG_DIR}/efficientnet_lite_${ID}${SUFF}_${F}MHz_${V}mV & touch efficientnet_lite.c && \
${make_cmd} GPIO_MEAS=1 FREQ_CL=${F} FREQ_FC=${F} FREQ_PE=${F} VOLTAGE=${V} io=uart run
wait_finished_job
# Energy Efficient
F=240
V=650
python $GAP_SDK_HOME/utils/power_meas_utils/ps4444Measure.py ${LOG_DIR}/efficientnet_lite_${ID}${SUFF}_${F}MHz_${V}mV & touch efficientnet_lite.c && \
${make_cmd} GPIO_MEAS=1 FREQ_CL=${F} FREQ_FC=${F} FREQ_PE=${F} VOLTAGE=${V} io=uart run
wait_finished_job
done