kneron_model_converter/scripts/compilerIpevaluator_630.sh
2026-01-28 06:16:04 +00:00

51 lines
1.4 KiB
Bash

#!/bin/bash
################################### Include variables and constants
. common_720.sh
echo "[WARNING] This script is deprecated. Please use the python API package ktc instead."
if [[ $# -lt 1 ]]; then
echo "You need to provide a bie model to run this script."
exit 1
fi
model=$1
if [ "$2" == "knerondebug" ]
then
echo "start debug mode"
debug_mode="true"
echo "debug_mode: $debug_mode"
fi
#################################### Main Process
# Prepare compiler input and output space
mkdir -p $TMP_FOLDER
echo "running compiler and ipEvaluator..."
delFolder $RESULT_FOLDER/compiler
mkdir -p $RESULT_FOLDER/compiler
cp $SCRIPT_FOLDER/res/ip_config_630.json $TMP_FOLDER
python $LIBS_FOLDER/compiler/gen_config.py -t 630 -v model_rel -o $TMP_FOLDER/config_compiler.json -a ''{\"ip_evaluator_cfg\":\"$SCRIPT_FOLDER/res/ip_config_630.json\"}''
chk_flow $? "Generating compiler config fails!"
cd $TMP_FOLDER && $LIBS_FOLDER/compiler/compile 630 $model $TMP_FOLDER/config_compiler.json warning compile.log
chk_flow $? "compuler and ip evaluator fails!"
if [[ $debug_mode == "true" ]]
then
cp $TMP_FOLDER/*.json $RESULT_FOLDER/compiler/
fi
cp $TMP_FOLDER/*.bin $RESULT_FOLDER/compiler/
cp $TMP_FOLDER/ioinfo.json $RESULT_FOLDER/compiler/
cp $TMP_FOLDER/ProfileResult.txt $RESULT_FOLDER/compiler/
echo "Compilation and IP Evaluation finished."
rm -rf $TMP_FOLDER