Skip to content
Snippets Groups Projects
Commit 3c8b56e2 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Merge branch 'modelsim_config_branch' into 'master'

added extra check to prevent duplicate libraries

See merge request !21
parents 7d6d62fd a71999d4
No related branches found
No related tags found
1 merge request!21added extra check to prevent duplicate libraries
...@@ -231,8 +231,20 @@ class ModelsimConfig(hdl_libraries_wizard.HdlLibrariesWizard): ...@@ -231,8 +231,20 @@ class ModelsimConfig(hdl_libraries_wizard.HdlLibrariesWizard):
for lib_clause, lib_work in tech_dict.items(): for lib_clause, lib_work in tech_dict.items():
fp.write('%s = %s\n' % (lib_clause, lib_work)) fp.write('%s = %s\n' % (lib_clause, lib_work))
# . all used libs for this lib_name
use_lib_names = self.derive_all_use_libs('sim', lib_name)
use_lib_dicts = self.libs.get_configfiles(key='hdl_lib_name', values=use_lib_names)
use_lib_build_sim_dirs = self.get_lib_build_dirs('sim', lib_dicts=use_lib_dicts)
use_lib_clause_names = self.libs.get_key_values('hdl_library_clause_name', use_lib_dicts)
for lib_clause, lib_dir in zip(use_lib_clause_names, cm.listify(use_lib_build_sim_dirs)):
lib_work = os.path.join(lib_dir, 'work')
fp.write('%s = %s\n' % (lib_clause, lib_work))
# . not used vendor technology libs are not compiled but are mapped to work to avoid compile error when mentioned in the LIBRARY clause # . not used vendor technology libs are not compiled but are mapped to work to avoid compile error when mentioned in the LIBRARY clause
for removed_lib in sorted(self.removed_libs): for removed_lib in sorted(self.removed_libs):
# Only map library to work if it does not exist as a libraries that is used. It might be the case that two libraries with the same
# name exist for multiple technologies causing it to show up in the "use_lib_clause_names" list as well as in the "removed_libs" list.
if self.removed_libs[removed_lib]['hdl_library_clause_name'] not in use_lib_clause_names:
fp.write('%s = work\n' % self.removed_libs[removed_lib]['hdl_library_clause_name']) fp.write('%s = work\n' % self.removed_libs[removed_lib]['hdl_library_clause_name'])
# . unavailable used libs are not compiled but are mapped to work to avoid compile error when mentioned in the LIBRARY clause # . unavailable used libs are not compiled but are mapped to work to avoid compile error when mentioned in the LIBRARY clause
...@@ -244,15 +256,6 @@ class ModelsimConfig(hdl_libraries_wizard.HdlLibrariesWizard): ...@@ -244,15 +256,6 @@ class ModelsimConfig(hdl_libraries_wizard.HdlLibrariesWizard):
else: else:
fp.write('%s_lib = work\n' % unavailable_use_name) fp.write('%s_lib = work\n' % unavailable_use_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_configfiles(key='hdl_lib_name', values=use_lib_names)
use_lib_build_sim_dirs = self.get_lib_build_dirs('sim', lib_dicts=use_lib_dicts)
use_lib_clause_names = self.libs.get_key_values('hdl_library_clause_name', use_lib_dicts)
for lib_clause, lib_dir in zip(use_lib_clause_names, cm.listify(use_lib_build_sim_dirs)):
lib_work = os.path.join(lib_dir, 'work')
fp.write('%s = %s\n' % (lib_clause, lib_work))
# . work # . work
fp.write('work = work\n') fp.write('work = work\n')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment