LPT26x-HSF-4MB-Hilink_14.2..../build/script/parse_tool/parse_main_phase1.py

30 lines
925 B
Python
Raw Permalink Normal View History

2025-05-13 22:00:58 +08:00
#!/usr/bin/env python
# coding:utf-8
# Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2022-2023. All rights reserved.
import sys,string,re,os
sys.path.append(os.path.split(os.path.realpath(__file__))[0])
from ctypes import *
from parse_elf import *
import json
if __name__ == '__main__':
print("Running parse step1 at", sys.executable,
" version:%d.%d.%d " % (sys.version_info[0], sys.version_info[1], sys.version_info[2]))
out_dir = sys.argv[1]
debug_file = sys.argv[2]
nm_file = sys.argv[3]
xml_file = sys.argv[4]
if not os.path.isdir(out_dir):
os.makedirs(out_dir)
parse_elf_step_1(debug_file,
os.path.join(out_dir, 'auto_class.py'),
os.path.join(out_dir, 'auto_struct.txt'),
nm_file,
os.path.join(out_dir, 'global.txt'),
out_dir,
xml_file
)
print("Build parse tool success.")