• Home
  • Raw
  • Download

Lines Matching full:self

25     def get_config(self, cpu_type, cpu_plat):  argument
26 self.compile_mode = get_compile_mode()
27self.lib_type, self.plam_type, self.hcc_path, self.kconf_dir, self.system, self.core = get_cpu_inf…
28 …if not self.compile_mode and self.lib_type and self.plam_type and self.hcc_path and self.kconf_dir:
31self.config_file_path = '%s/build/uniproton_config/config_%s'%(self.home_path, self.kconf_dir)
33 self.objcopy_path = self.hcc_path
35 def setCmdEnv(self): argument
36 self.build_time_tag = time.strftime('%Y-%m-%d_%H:%M:00')
37 self.log_dir = '%s/logs/%s' % (self.build_dir, self.cpu_type)
38 self.log_file = '%s.log' % self.kconf_dir
40 def SetCMakeEnviron(self): argument
41 os.environ["CPU_TYPE"] = self.cpu_type
42 os.environ["PLAM_TYPE"] = self.plam_type
43 os.environ["LIB_TYPE"] = self.lib_type
44 os.environ["COMPILE_OPTION"] = self.compile_option
45 os.environ["HCC_PATH"] = self.hcc_path
46 os.environ["UNIPROTON_PACKING_PATH"] = self.UniProton_packing_path
47 os.environ["CONFIG_FILE_PATH"] = self.config_file_path
48 os.environ["LIB_RUN_TYPE"] = self.lib_run_type
49 os.environ["HOME_PATH"] = self.home_path
50 os.environ["COMPILE_MODE"] = self.compile_mode
51 os.environ["BUILD_MACHINE_PLATFORM"] = self.build_machine_platform
52 os.environ["SYSTEM"] = self.system
53 os.environ["CORE"] = self.core
54 os.environ["OBJCOPY_PATH"] = self.objcopy_path
55 os.environ['PATH'] = '%s:%s' % (self.hcc_path, os.getenv('PATH'))
59 def prepare_env(self, cpu_type, choice): argument
67 self.get_config(cpu_type, choice)
68 self.setCmdEnv()
69 self.SetCMakeEnviron()
72 def getOsPlatform(self): argument
73 self.cmake_env_path = get_tool_info('cmake', 'tool_path')
76 self.build_machine_platform = 'arm64'
78 self.build_machine_platform = 'x86'
81 …def __init__(self, cpu_type: str, make_option="normal", lib_run_type="FPGA", choice="ALL", make_ph… argument
84 self.system = ""
85 self.objcopy_path = ""
86 self.builder = None
87 self.compile_mode = ""
88 self.core = ""
89 self.plam_type = ""
90 self.kconf_dir = ""
91 self.build_tmp_dir = ""
92 self.log_dir = ""
93 self.lib_type = ""
94 self.hcc_path = ""
95 self.log_file = ""
96 self.config_file_path = ""
97 self.build_time_tag = ""
98 self.build_dir = globle.build_dir
99 self.home_path = globle.home_path
100 self.kbuild_path = globle.kbuild_path
102 self.cpu_type = cpu_type
103 self.compile_option = make_option
104 self.lib_run_type = lib_run_type
105 self.make_choice = choice.lower()
106 self.make_phase = make_phase
107self.UniProton_packing_path = UniProton_packing_path if make_phase == "CREATE_CMAKE_FILE" else '%s…
108 self.UniProton_binary_dir = os.getenv('RPROTON_BINARY_DIR')
109 self.UniProton_install_file_option = os.getenv('RPROTON_INSTALL_FILE_OPTION')
110self.UniProton_make_jx = 'VERBOSE=1' if self.UniProton_install_file_option == 'SUPER_BUILD' else '…
112 self.getOsPlatform()
115 def CMake(self): argument
116 if self.UniProton_binary_dir:
117 self.build_tmp_dir = '%s/output/tmp/%s' % (self.UniProton_binary_dir, self.kconf_dir)
119 self.build_tmp_dir = '%s/output/tmp/%s' % (self.build_dir, self.kconf_dir)
120 os.environ['BUILD_TMP_DIR'] = self.build_tmp_dir
122 if not os.path.exists(self.build_tmp_dir):
123 os.makedirs(self.build_tmp_dir)
124 if not os.path.exists(self.log_dir):
125 os.makedirs(self.log_dir)
127 log_msg('info', 'BUILD_TIME_TAG %s' % self.build_time_tag)
128 self.builder = BuilderNolog(os.path.join(self.log_dir, self.log_file))
129 if self.make_phase in ['CREATE_CMAKE_FILE', 'ALL']:
130 real_path = os.path.realpath(self.build_tmp_dir)
133 os.makedirs(self.build_tmp_dir)
135 if self.compile_option == 'fortify':
139 self.cmake_env_path, self.home_path, self.home_path, self.cpu_type,
140 self.UniProton_packing_path, self.log_dir, self.log_file)
141 elif self.compile_option == 'hllt':
144self.cmake_env_path, self.home_path, self.home_path, self.UniProton_packing_path, self.log_dir, se…
148self.cmake_env_path, self.home_path, self.home_path, self.UniProton_packing_path, self.log_dir, se…
150 if self.builder.run(cmd, cwd=self.build_tmp_dir, env=None):
157 def UniProton_clean(self): argument
158 for foldername,subfoldernames,filenames in os.walk(self.build_dir):
167 if os.path.exists('%s/cmake/common/build_auxiliary_script/__pycache__'%self.home_path):
168 shutil.rmtree('%s/cmake/common/build_auxiliary_script/__pycache__'%self.home_path)
169 if os.path.exists('%s/output'%self.home_path):
170 shutil.rmtree('%s/output'%self.home_path)
171 if os.path.exists('%s/tools/SRE/x86-win32/sp_makepatch/makepatch'%self.home_path):
172 os.remove('%s/tools/SRE/x86-win32/sp_makepatch/makepatch'%self.home_path)
173 if os.path.exists('%s/build/prepare/__pycache__'%self.home_path):
174 shutil.rmtree('%s/build/prepare/__pycache__'%self.home_path)
178 def make(self): argument
179 if self.make_phase in ['EXECUTING_MAKE', 'ALL']:
180 self.builder.run('make clean', cwd=self.build_tmp_dir, env=None)
182 if self.builder.run(
184self.UniProton_make_jx, self.log_dir, self.log_file), cwd=self.build_tmp_dir, env=None):
185 log_msg('error', 'make %s %s failed!' % (self.cpu_type, self.plam_type))
188 if self.compile_option in ['normal', 'coverity', 'single']:
189 …if self.builder.run('make install %s &>> %s/%s' % (self.UniProton_make_jx, self.log_dir, self.log_…
192 if os.path.exists('%s/%s' % (self.log_dir, self.log_file)):
193 self.builder.log_format()
195 log_msg('info', 'make %s %s succeed.' % (self.cpu_type, self.plam_type))
198 def SdkCompaile(self)->bool: argument
200 if self.hcc_path == 'None':
203 self.MakeBuildef()
204 if self.CMake() and self.make():
205 log_msg('info', 'make %s %s lib succeed!' % (self.cpu_type, self.make_choice))
208 log_msg('info', 'make %s %s lib failed!' % (self.cpu_type, self.make_choice))
212 def UniProtonCompile(self): argument
214 if self.cpu_type == 'clean':
216 return self.UniProton_clean()
218 if self.make_choice == "all":
219 for make_choice in globle.cpu_plat[self.cpu_type]:
220 self.prepare_env(self.cpu_type, make_choice)
221 if not self.SdkCompaile():
224 self.prepare_env(self.cpu_type, self.make_choice)
225 if not self.SdkCompaile():
229 def MakeBuildef(self): argument
231 if not make_buildef(globle.home_path,self.kconf_dir,"CREATE"):
233 log_msg('info', 'make_buildef_file.sh %s successfully.' % self.kconf_dir)