diff --git a/tools/oneclick/base/hdl_config.py b/tools/oneclick/base/hdl_config.py index 1904c3da1ec637650c6b99f65415e0f720a09dc3..e98558da2feafacbaa64eaec6da8bc6adc4735df 100644 --- a/tools/oneclick/base/hdl_config.py +++ b/tools/oneclick/base/hdl_config.py @@ -178,19 +178,17 @@ class HdlConfig: return lib_order - def get_lib_build_dirs(self, build_type, lib_dicts=None): - """Get the tool build directory for all HDL libraries in the specified list of lib_dicts. + def get_tool_build_dir(self, build_type): + """Get the central tool build directory. The build_type can be: - 'sim' uses the 'build_dir_sim' key in the lib_dict, - 'synth' uses the 'build_dir_synth' key in the lib_dict + 'sim' uses the 'build_dir_sim' key in the self.tool dictionary + 'synth' uses the 'build_dir_synth' key in the self.tool dictionary - If the build dir key in HDL library config file is '' then - treat the build dir key as local directory in the HDL library directory. - else - treat the build dir key as central directory. + The build dir key value must be an absolute directory path. The tool build dir consists of + - the absolute path to the central main build directory + - the tool_name_key value as subdirectory """ - if lib_dicts==None: lib_dicts=self.libs.dicts build_dir_key = 'build_dir_' + build_type tool_name_key = 'tool_name_' + build_type if self.tool.get_key_values(build_dir_key)==None: @@ -200,12 +198,29 @@ class HdlConfig: sys.exit('Error : The build_dir_key value must be an absolute path') if self.tool.get_key_values(tool_name_key)==None: sys.exit('Error : Unknown build type for tool_name_key') - build_subdir = self.tool.get_key_values(tool_name_key) + build_tooldir = self.tool.get_key_values(tool_name_key) + return build_maindir, build_tooldir + + def get_lib_build_dirs(self, build_type, lib_dicts=None): + """Get the subdirectories within the central tool build directory for all HDL libraries in the specified list of lib_dicts. + + The build_type can be: + 'sim' uses the 'build_dir_sim' key in the self.tool dictionary + 'synth' uses the 'build_dir_synth' key in the self.tool dictionary + + The build dir key value must be an absolute directory path. The lib build dir consists of + - the absolute path to the central main build directory + - the tool_name_key value as subdirectory + - the library name as library subdirectory + """ + if lib_dicts==None: lib_dicts=self.libs.dicts + build_maindir, build_tooldir = self.get_tool_build_dir(build_type) build_dirs = [] for lib_dict in cm.listify(lib_dicts): lib_name = lib_dict['hdl_lib_name'] - build_dirs.append(os.path.join(build_maindir, build_subdir, lib_name)) # central build main directory with subdirectory per library + build_dirs.append(os.path.join(build_maindir, build_tooldir, lib_name)) # central build main directory with subdirectory per library return cm.unlistify(build_dirs) + def create_lib_order_files(self, build_type, lib_names=None): """Create the compile order file '<lib_name>_lib_order.txt' for all HDL libraries in the specified list of lib_names.