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

Define separate method get_tool_build_dir().

parent fa1c3b6a
No related branches found
No related tags found
No related merge requests found
...@@ -178,19 +178,17 @@ class HdlConfig: ...@@ -178,19 +178,17 @@ class HdlConfig:
return lib_order return lib_order
def get_lib_build_dirs(self, build_type, lib_dicts=None): def get_tool_build_dir(self, build_type):
"""Get the tool build directory for all HDL libraries in the specified list of lib_dicts. """Get the central tool build directory.
The build_type can be: The build_type can be:
'sim' uses the 'build_dir_sim' 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 lib_dict 'synth' uses the 'build_dir_synth' key in the self.tool dictionary
If the build dir key in HDL library config file is '' then The build dir key value must be an absolute directory path. The tool build dir consists of
treat the build dir key as local directory in the HDL library directory. - the absolute path to the central main build directory
else - the tool_name_key value as subdirectory
treat the build dir key as central directory.
""" """
if lib_dicts==None: lib_dicts=self.libs.dicts
build_dir_key = 'build_dir_' + build_type build_dir_key = 'build_dir_' + build_type
tool_name_key = 'tool_name_' + build_type tool_name_key = 'tool_name_' + build_type
if self.tool.get_key_values(build_dir_key)==None: if self.tool.get_key_values(build_dir_key)==None:
...@@ -200,13 +198,30 @@ class HdlConfig: ...@@ -200,13 +198,30 @@ class HdlConfig:
sys.exit('Error : The build_dir_key value must be an absolute path') sys.exit('Error : The build_dir_key value must be an absolute path')
if self.tool.get_key_values(tool_name_key)==None: if self.tool.get_key_values(tool_name_key)==None:
sys.exit('Error : Unknown build type for tool_name_key') 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 = [] build_dirs = []
for lib_dict in cm.listify(lib_dicts): for lib_dict in cm.listify(lib_dicts):
lib_name = lib_dict['hdl_lib_name'] 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) return cm.unlistify(build_dirs)
def create_lib_order_files(self, build_type, lib_names=None): 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. """Create the compile order file '<lib_name>_lib_order.txt' for all HDL libraries in the specified list of lib_names.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment