#!/bin/bash ################################### Include variables and constants . "common_520.sh" echo "[WARNING] This script is deprecated. Please use the python API package ktc instead." if [[ $# -lt 1 ]]; then echo "You need to provide an bie model or an onnx to run this script." exit 1 fi model=$1 #################################### Main Process # Prepare compiler input mkdir -p $TMP_FOLDER echo "running compiler and IP evaluator..." delFile $TMP_FOLDER/config_compiler.json delFolder $RESULT_FOLDER/compiler mkdir -p $RESULT_FOLDER/compiler python $LIBS_FOLDER/compiler/gen_config.py -t 520 -v model_rel -o $TMP_FOLDER/config_compiler.json -a ''{\"ip_evaluator_cfg\":\"$SCRIPT_FOLDER/res/ip_config_520.json\"}'' chk_flow $? "Generating compiler config fails!" echo "Compiler config generated." # # Run old compiler # cd $LIBS_FOLDER/compiler/build/bin && ./compile $TMP_FOLDER/output.onnx $TMP_FOLDER/config_compiler.json # chk_flow $? "compiler fails" # Run piano compiler cd $TMP_FOLDER && $LIBS_FOLDER/compiler/compile 520 $model $TMP_FOLDER/config_compiler.json warning compile.log chk_flow $? "compuler and ip evaluator fails!" # cp $TMP_FOLDER/ProfileResult.txt $RESULT_FOLDER/compiler/ # echo "finish save ip evaluator result" if [[ $debug_mode == "true" ]] then cp $TMP_FOLDER/*.txt $RESULT_FOLDER/compiler/ cp $TMP_FOLDER/*.v $RESULT_FOLDER/compiler/ cp $TMP_FOLDER/compiler_config.json $RESULT_FOLDER/compiler/ fi cp $TMP_FOLDER/*.bin $RESULT_FOLDER/compiler/ cp $TMP_FOLDER/ioinfo.csv $RESULT_FOLDER/compiler/ cp $TMP_FOLDER/ip_eval_prof.txt $RESULT_FOLDER/compiler/ echo "Compilation and IP Evaluation finished." rm -rf $TMP_FOLDER