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

Key hdl_lib_excludes now only applies to synthesis to avoid Modelsim compile...

Key hdl_lib_excludes now only applies to synthesis to avoid Modelsim compile error on library clause in e.g. tech_ddr_stratixiv.vhd.
parent 02bebb22
No related branches found
No related tags found
No related merge requests found
...@@ -104,20 +104,23 @@ class HdlConfig: ...@@ -104,20 +104,23 @@ class HdlConfig:
def get_used_libs(self, build_type, lib_dict, arg_exclude_libs=[]): 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. """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_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 # Get use_libs
exclude_libs = list(arg_exclude_libs)
if 'hdl_lib_uses_synth' in lib_dict: if 'hdl_lib_uses_synth' in lib_dict:
use_libs = lib_dict['hdl_lib_uses_synth'].split() use_libs = lib_dict['hdl_lib_uses_synth'].split()
if build_type=='sim': if build_type=='sim':
if 'hdl_lib_uses_sim' in lib_dict: if 'hdl_lib_uses_sim' in lib_dict:
use_libs += lib_dict['hdl_lib_uses_sim'].split() use_libs += lib_dict['hdl_lib_uses_sim'].split()
if 'hdl_lib_excludes' in lib_dict: # For synthesis remove exclude_libs from use_libs
exclude_libs += lib_dict['hdl_lib_excludes'].split() # use list() to take local copy, to avoid next that default empty list argument arg_exclude_libs=[] gets disturbed
for exclude_lib in exclude_libs: exclude_libs = list(arg_exclude_libs)
if exclude_lib in use_libs: if build_type=='synth':
use_libs.remove(exclude_lib) 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 return use_libs, exclude_libs
def derive_all_use_libs(self, build_type, lib_name, arg_exclude_libs=[]): def derive_all_use_libs(self, build_type, lib_name, arg_exclude_libs=[]):
......
...@@ -151,12 +151,6 @@ class ModelsimConfig(hdl_config.HdlConfig): ...@@ -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 # . 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: for tech_dict in self.removed_dicts:
fp.write('%s = work\n' % tech_dict['hdl_library_clause_name']) 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 # . all used libs for this lib_name
use_lib_names = self.derive_all_use_libs('sim', 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) use_lib_dicts = self.libs.get_dicts('hdl_lib_name', use_lib_names)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment