Skip to content
Snippets Groups Projects
Commit fd9a79ec authored by Reinier van der Walle's avatar Reinier van der Walle
Browse files

Added the substitute_key_words function

parent 66cd943f
No related branches found
No related tags found
No related merge requests found
...@@ -110,7 +110,11 @@ class HdlConfig: ...@@ -110,7 +110,11 @@ class HdlConfig:
self.libRootDir = os.path.expandvars(self.tool_dict['lib_root_dir']) self.libRootDir = os.path.expandvars(self.tool_dict['lib_root_dir'])
self.libs = common_dict_file.CommonDictFile(self.libRootDir, libFileName, libFileSections) # library dict files self.libs = common_dict_file.CommonDictFile(self.libRootDir, libFileName, libFileSections) # library dict files
if self.libs.nof_dicts==0: sys.exit('Error : No HDL library config file found') if self.libs.nof_dicts==0: sys.exit('Error : No HDL library config file found')
# Substitute key words occurring in hdllib.cfg files with their value.
self.substitute_key_words()
# Keep the generic HDL libraries and remove those that do not match the specified IP technologies # Keep the generic HDL libraries and remove those that do not match the specified IP technologies
self.technologyNames = self.tool_dict['technology_names'].split() self.technologyNames = self.tool_dict['technology_names'].split()
self.removed_dicts = [] self.removed_dicts = []
...@@ -209,7 +213,15 @@ class HdlConfig: ...@@ -209,7 +213,15 @@ class HdlConfig:
self.unavailable_use_libs = self.unavailable_use_synth_libs + self.unavailable_use_ip_libs + self.unavailable_use_sim_libs self.unavailable_use_libs = self.unavailable_use_synth_libs + self.unavailable_use_ip_libs + self.unavailable_use_sim_libs
self.unavailable_use_libs = cm.unique(self.unavailable_use_libs) # aggregate list of use_*_libs self.unavailable_use_libs = cm.unique(self.unavailable_use_libs) # aggregate list of use_*_libs
self.unavailable_include_ip_libs = cm.unique(self.unavailable_include_ip_libs) # list of include_ip_use_libs self.unavailable_include_ip_libs = cm.unique(self.unavailable_include_ip_libs) # list of include_ip_use_libs
# The Key value pairs defined in hdltool<toolset>.cfg can be used in hdllib.cfg files. See hdllib.cfg of technology library
def substitute_key_words(self):
for lib in self.libs.dicts:
for lib_key, lib_value in lib.items():
for tool_key, tool_value in self.tool_dict.items():
tool_key_string = '<%s>' % tool_key
if tool_key_string in lib_value:
lib[lib_key] = lib_value.replace(tool_key_string,tool_value)
def check_library_names(self, check_lib_names, lib_names=None): def check_library_names(self, check_lib_names, lib_names=None):
"""Check that HDL library names exists within the list of library names, if not then exit with Error message. """Check that HDL library names exists within the list of library names, if not then exit with Error message.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment