diff --git a/tools/oneclick/base/hdl_config.py b/tools/oneclick/base/hdl_config.py index d20e8b26fe5421e12062f3777693f9974c6c3b37..e88cef313146a43bc7ce0fb6c6e97496fc7e44f2 100644 --- a/tools/oneclick/base/hdl_config.py +++ b/tools/oneclick/base/hdl_config.py @@ -104,20 +104,23 @@ class HdlConfig: def get_used_libs(self, build_type, lib_dict, arg_exclude_libs=[]): """Get the list of used HDL libraries from the lib_dict and remove the excluded libs. - 'hdl_lib_uses_synth' and 'hdl_lib_uses_sim' define the used libraries that are directly used in this library - - 'hdl_lib_excludes' defines the libraries that must be excluded + - 'hdl_lib_excludes' defines the libraries that must be excluded for synthesis """ - # use list() to take local copy, to avoid next that default empty list argument arg_exclude_libs=[] gets disturbed - exclude_libs = list(arg_exclude_libs) + # Get use_libs if 'hdl_lib_uses_synth' in lib_dict: use_libs = lib_dict['hdl_lib_uses_synth'].split() if build_type=='sim': if 'hdl_lib_uses_sim' in lib_dict: - use_libs += lib_dict['hdl_lib_uses_sim'].split() - if 'hdl_lib_excludes' in lib_dict: - exclude_libs += lib_dict['hdl_lib_excludes'].split() - for exclude_lib in exclude_libs: - if exclude_lib in use_libs: - use_libs.remove(exclude_lib) + use_libs += lib_dict['hdl_lib_uses_sim'].split() + # For synthesis remove exclude_libs from use_libs + # use list() to take local copy, to avoid next that default empty list argument arg_exclude_libs=[] gets disturbed + exclude_libs = list(arg_exclude_libs) + if build_type=='synth': + if 'hdl_lib_excludes' in lib_dict: + exclude_libs += lib_dict['hdl_lib_excludes'].split() + for exclude_lib in exclude_libs: + if exclude_lib in use_libs: + use_libs.remove(exclude_lib) return use_libs, exclude_libs def derive_all_use_libs(self, build_type, lib_name, arg_exclude_libs=[]): diff --git a/tools/oneclick/base/modelsim_config.py b/tools/oneclick/base/modelsim_config.py index 30ee59d1997df4ba00ce33b8b354fc649895fa8b..b4a2b39d293a1905553387fcd0bf8dbaa40facc7 100755 --- a/tools/oneclick/base/modelsim_config.py +++ b/tools/oneclick/base/modelsim_config.py @@ -151,12 +151,6 @@ class ModelsimConfig(hdl_config.HdlConfig): # . not used vendor technology libs are not compiled but are mapped to work to avoid compile error when mentioned in the LIBRARY clause for tech_dict in self.removed_dicts: fp.write('%s = work\n' % tech_dict['hdl_library_clause_name']) - # . excluded libs are not compiled but are mapped to work to avoid compile error when mentioned in the LIBRARY clause - if 'hdl_lib_excludes' in lib_dict: - exclude_libs = lib_dict['hdl_lib_excludes'].split() - for exclude_lib_name in exclude_libs: - exclude_lib_dict = self.libs.get_dicts('hdl_lib_name', exclude_lib_name) - fp.write('%s = work\n' % exclude_lib_dict['hdl_library_clause_name']) # . all used libs for this lib_name use_lib_names = self.derive_all_use_libs('sim', lib_name) use_lib_dicts = self.libs.get_dicts('hdl_lib_name', use_lib_names)