1#!/usr/bin/env python3 2# encoding=utf-8 3# ============================================================================ 4# @brief Build nvbin 5 6# Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 7# Licensed under the Apache License, Version 2.0 (the "License"); 8# you may not use this file except in compliance with the License. 9# You may obtain a copy of the License at 10# 11# http://www.apache.org/licenses/LICENSE-2.0 12# 13# Unless required by applicable law or agreed to in writing, software 14# distributed under the License is distributed on an "AS IS" BASIS, 15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16# See the License for the specific language governing permissions and 17# limitations under the License. 18# ============================================================================ 19 20import os 21import sys 22file_dir = os.path.dirname(os.path.realpath(__file__)) 23g_root = os.path.realpath(os.path.join(file_dir, "..", "..", "..", "..")) 24sys.path.append(os.path.join(g_root, 'build', 'script', 'nv')) 25from nv_binary import nv_begin 26 27 28if __name__ == '__main__': 29 #配置文件路径 30 nv_config_json = os.path.join(g_root, "build", "config", "target_config", "ws63", "nv_bin_cfg", "mk_nv_bin_cfg.json") 31 #输出路径 32 nv_output_path = os.path.join(g_root, "output", "ws63", "acore", "nv_bin") 33 34 if not os.path.exists(nv_output_path): 35 os.makedirs(nv_output_path) 36 37 targets = ["acore"] 38 if len(sys.argv) >= 2: 39 target_name = sys.argv[1] 40 if target_name == 'ws63-liteos-perf': 41 nv_config_json = os.path.join(g_root, "build", "config", "target_config", "ws63", "nv_bin_cfg", 42 "mk_nv_bin_cfg_perf.json") 43 nv_begin(nv_config_json, targets, 1, True) 44