Refactor how the combined project manifest is calculated

parent 212d24b3
......@@ -131,6 +131,19 @@ class Action(list):
"""Get the Top module from the pool"""
return self.top_module
def get_config_dict(self):
"""Get the combined hierarchical Manifest dictionary from the pool"""
config_dict = {}
for mod in self:
manifest_dict_tmp = mod.manifest_dict
if 'fetchto' in manifest_dict_tmp:
manifest_dict_tmp['fetchto'] = path_mod.relpath(os.path.join(
mod.path,
mod.manifest_dict['fetchto']))
manifest_dict_tmp.update(config_dict)
config_dict = manifest_dict_tmp
return config_dict
def _add(self, new_module):
"""Add the given new module if this is not already in the pool"""
from hdlmake.module import Module
......
......@@ -127,6 +127,12 @@ class ActionCore(Action):
for mod_aux in unfetched_modules:
logging.warning(
"List incomplete, module %s has not been fetched!", mod_aux)
print("88888888888888888888888888888888888888")
for module in self:
print(module.manifest_dict.get("action"))
print(module.manifest_dict.get("syn_top"))
print(module.manifest_dict.get("sim_top"))
print("88888888888888888888888888888888888888")
file_set = self.build_file_set(top_entity=self.env.options.top)
file_list = dep_solver.make_dependency_sorted_list(file_set)
files_str = [file_aux.path for file_aux in file_list]
......
......@@ -33,15 +33,7 @@ class ToolSim(ToolMakefile):
def simulation_makefile(self, pool):
"""Execute the simulation action"""
pool.check_all_fetched_or_quit()
manifest_project_dict = {}
for mod in pool:
manifest_project_dict.update(mod.manifest_dict)
if 'fetchto' in mod.manifest_dict:
self.repo_list.append(
os.path.abspath(
os.path.join(
mod.path,
mod.manifest_dict['fetchto'])))
manifest_project_dict = pool.get_config_dict()
_check_simulation_manifest(manifest_project_dict)
fset = pool.build_file_set(
manifest_project_dict.get("sim_top"),
......
......@@ -42,15 +42,7 @@ class ToolSyn(ToolMakefile):
def synthesis_project(self, pool):
"""Generate a project for the specific synthesis tool"""
pool.check_all_fetched_or_quit()
manifest_project_dict = {}
for mod in pool:
manifest_project_dict.update(mod.manifest_dict)
if 'fetchto' in mod.manifest_dict:
self.repo_list.append(
os.path.abspath(
os.path.join(
mod.path,
mod.manifest_dict['fetchto'])))
manifest_project_dict = pool.get_config_dict()
_check_synthesis_manifest(manifest_project_dict)
top_module = pool.get_top_module()
fileset = pool.build_file_set(
......
......@@ -45,7 +45,6 @@ class ToolMakefile(object):
self._hdl_files = []
self._supported_files = []
self._standard_libs = []
self.repo_list = []
self.fileset = None
if filename:
self._filename = filename
......
......@@ -82,9 +82,9 @@ if {{ $$keyword != "Complete!" }} {{
['part', syn_device + syn_package + syn_grade, 'current_project'],
['target_language', 'VHDL', 'current_project'],
['top', syn_top, 'get_property srcset [current_run]']]
if not self.repo_list == []:
repo_string = '{' + " ".join(self.repo_list) + '}'
properties.append(['ip_repo_paths', repo_string, 'current_fileset'])
fetchto = self.manifest_dict.get("fetchto")
if not fetchto is None:
properties.append(['ip_repo_paths', fetchto, 'current_fileset'])
if not syn_properties is None:
properties.extend(syn_properties)
for prop in properties:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment