case "$1" in
0)
TOP=0
BOTTOM=14
SPLITS=10
;;
1)
TOP=0,7,11
BOTTOM=6,10,14
SPLITS=8,4,2
;;
2)
TOP=0,7,11
BOTTOM=6,10,14
SPLITS=10,10,10
;;
3)
TOP=0,7
BOTTOM=6,14
SPLITS=10,10
;;
4)
TOP=0,7
BOTTOM=6,14
SPLITS=8,4
;;
5)
TOP=0,7,11
BOTTOM=6,10,14
SPLITS=8,4,4
;;
*)
echo 'Usage ' $0 ' [0|1|2|3|4|5]'
echo '       to show five different splits'
exit 1
;;
esac

xcore-opt --xcore-op-split-tensor-arena=1  -tc 5 \
          --xcore-op-split-top-op=$TOP --xcore-op-split-bottom-op=$BOTTOM  \
          --xcore-op-split-num-splits=$SPLITS \
          --xcore-conv-channelwise-split-size=80000 \
          --xcore-tflmc-print -xp model --xcore-conv-err-threshold=2.1 \
          mobilenetv2.tflite -o model.tflite -f weights.flash \
| awk '
/^ *[0-9]*: / {printf("%-3s ", $1); for(i=1;i<=length($2);i+=2) printf("%c", substr($2, i, 1)); printf(" %s\n", $3);}
/Tensor arena size/ {print("Tensor arena size %d\n", $NF);}
'

(cp model.tflite.* ../app_an02008/src && cd ../app_an02008 && cmake -B build && xmake -C build)

xrun --xscope ../app_an02008/bin/app_an02008.xe 

ls -l weights.flash  model.tflite
