• Home
  • Raw
  • Download

Lines Matching refs:self

39     def get_config(self, cpu_type, cpu_plat):  argument
40 self.compile_mode = get_compile_mode()
41self.lib_type, self.plam_type, self.hcc_path, self.kconf_dir, self.system, self.core = get_cpu_inf…
42 …if not self.compile_mode and self.lib_type and self.plam_type and self.hcc_path and self.kconf_dir:
45self.config_file_path = '%s/build/uniproton_config/config_%s'%(self.home_path, self.kconf_dir)
47 self.objcopy_path = self.hcc_path
49 def setCmdEnv(self): argument
50 self.build_time_tag = time.strftime('%Y-%m-%d_%H:%M:00')
51 self.log_dir = '%s/logs/%s' % (self.build_dir, self.cpu_type)
52 self.log_file = '%s.log' % self.kconf_dir
54 def SetCMakeEnviron(self): argument
55 os.environ["CPU_TYPE"] = self.cpu_type
56 os.environ["PLAM_TYPE"] = self.plam_type
57 os.environ["LIB_TYPE"] = self.lib_type
58 os.environ["COMPILE_OPTION"] = self.compile_option
59 os.environ["HCC_PATH"] = self.hcc_path
60 os.environ["UNIPROTON_PACKING_PATH"] = self.UniProton_packing_path
61 os.environ["CONFIG_FILE_PATH"] = self.config_file_path
62 os.environ["LIB_RUN_TYPE"] = self.lib_run_type
63 os.environ["HOME_PATH"] = self.home_path
64 os.environ["COMPILE_MODE"] = self.compile_mode
65 os.environ["BUILD_MACHINE_PLATFORM"] = self.build_machine_platform
66 os.environ["SYSTEM"] = self.system
67 os.environ["CORE"] = self.core
68 os.environ["OBJCOPY_PATH"] = self.objcopy_path
69 os.environ['PATH'] = '%s:%s' % (self.hcc_path, os.getenv('PATH'))
73 def prepare_env(self, cpu_type, choice): argument
81 self.get_config(cpu_type, choice)
82 self.setCmdEnv()
83 self.SetCMakeEnviron()
86 def getOsPlatform(self): argument
87 self.cmake_env_path = get_tool_info('cmake', 'tool_path')
90 self.build_machine_platform = 'arm64'
92 self.build_machine_platform = 'x86'
95 …def __init__(self, cpu_type: str, make_option="normal", lib_run_type="FPGA", choice="ALL", make_ph… argument
98 self.system = ""
99 self.objcopy_path = ""
100 self.builder = None
101 self.compile_mode = ""
102 self.core = ""
103 self.plam_type = ""
104 self.kconf_dir = ""
105 self.build_tmp_dir = ""
106 self.log_dir = ""
107 self.lib_type = ""
108 self.hcc_path = ""
109 self.log_file = ""
110 self.config_file_path = ""
111 self.build_time_tag = ""
112 self.build_dir = globle.build_dir
113 self.home_path = globle.home_path
114 self.kbuild_path = globle.kbuild_path
116 self.cpu_type = cpu_type
117 self.compile_option = make_option
118 self.lib_run_type = lib_run_type
119 self.make_choice = choice.lower()
120 self.make_phase = make_phase
121self.UniProton_packing_path = UniProton_packing_path if make_phase == "CREATE_CMAKE_FILE" else '%s…
122 self.UniProton_binary_dir = os.getenv('RPROTON_BINARY_DIR')
123 self.UniProton_install_file_option = os.getenv('RPROTON_INSTALL_FILE_OPTION')
124self.UniProton_make_jx = 'VERBOSE=1' if self.UniProton_install_file_option == 'SUPER_BUILD' else '…
126 self.getOsPlatform()
129 def CMake(self): argument
130 if self.UniProton_binary_dir:
131 self.build_tmp_dir = '%s/output/tmp/%s' % (self.UniProton_binary_dir, self.kconf_dir)
133 self.build_tmp_dir = '%s/output/tmp/%s' % (self.build_dir, self.kconf_dir)
134 os.environ['BUILD_TMP_DIR'] = self.build_tmp_dir
136 if not os.path.exists(self.build_tmp_dir):
137 os.makedirs(self.build_tmp_dir)
138 if not os.path.exists(self.log_dir):
139 os.makedirs(self.log_dir)
141 log_msg('info', 'BUILD_TIME_TAG %s' % self.build_time_tag)
142 self.builder = BuilderNolog(os.path.join(self.log_dir, self.log_file))
143 if self.make_phase in ['CREATE_CMAKE_FILE', 'ALL']:
144 real_path = os.path.realpath(self.build_tmp_dir)
147 os.makedirs(self.build_tmp_dir)
149 if self.compile_option == 'fortify':
153 self.cmake_env_path, self.home_path, self.home_path, self.cpu_type,
154 self.UniProton_packing_path, self.log_dir, self.log_file)
155 elif self.compile_option == 'hllt':
158self.cmake_env_path, self.home_path, self.home_path, self.UniProton_packing_path, self.log_dir, se…
162self.cmake_env_path, self.home_path, self.home_path, self.UniProton_packing_path, self.log_dir, se…
164 if self.builder.run(cmd, cwd=self.build_tmp_dir, env=None):
171 def UniProton_clean(self): argument
172 for foldername,subfoldernames,filenames in os.walk(self.build_dir):
181 if os.path.exists('%s/cmake/common/build_auxiliary_script/__pycache__'%self.home_path):
182 shutil.rmtree('%s/cmake/common/build_auxiliary_script/__pycache__'%self.home_path)
183 if os.path.exists('%s/output'%self.home_path):
184 shutil.rmtree('%s/output'%self.home_path)
185 if os.path.exists('%s/tools/SRE/x86-win32/sp_makepatch/makepatch'%self.home_path):
186 os.remove('%s/tools/SRE/x86-win32/sp_makepatch/makepatch'%self.home_path)
187 if os.path.exists('%s/build/prepare/__pycache__'%self.home_path):
188 shutil.rmtree('%s/build/prepare/__pycache__'%self.home_path)
192 def make(self): argument
193 if self.make_phase in ['EXECUTING_MAKE', 'ALL']:
194 self.builder.run('make clean', cwd=self.build_tmp_dir, env=None)
196 if self.builder.run(
198self.UniProton_make_jx, self.log_dir, self.log_file), cwd=self.build_tmp_dir, env=None):
199 log_msg('error', 'make %s %s failed!' % (self.cpu_type, self.plam_type))
202 if self.compile_option in ['normal', 'coverity', 'single']:
203 …if self.builder.run('make install %s &>> %s/%s' % (self.UniProton_make_jx, self.log_dir, self.log_…
206 if os.path.exists('%s/%s' % (self.log_dir, self.log_file)):
207 self.builder.log_format()
209 log_msg('info', 'make %s %s succeed.' % (self.cpu_type, self.plam_type))
212 def SdkCompaile(self)->bool: argument
214 if self.hcc_path == 'None':
217 self.MakeBuildef()
218 if self.CMake() and self.make():
219 log_msg('info', 'make %s %s lib succeed!' % (self.cpu_type, self.make_choice))
222 log_msg('info', 'make %s %s lib failed!' % (self.cpu_type, self.make_choice))
226 def UniProtonCompile(self): argument
228 if self.cpu_type == 'clean':
230 return self.UniProton_clean()
232 if self.make_choice == "all":
233 for make_choice in globle.cpu_plat[self.cpu_type]:
234 self.prepare_env(self.cpu_type, make_choice)
235 if not self.SdkCompaile():
238 self.prepare_env(self.cpu_type, self.make_choice)
239 if not self.SdkCompaile():
243 def MakeBuildef(self): argument
245 if not make_buildef(globle.home_path,self.kconf_dir,"CREATE"):
247 log_msg('info', 'make_buildef_file.sh %s successfully.' % self.kconf_dir)