The pool total config only needs to be calculated once

parent 25ce764b
...@@ -71,6 +71,7 @@ class Action(list): ...@@ -71,6 +71,7 @@ class Action(list):
url=os.getcwd(), url=os.getcwd(),
source=fetch_mod.LOCAL, source=fetch_mod.LOCAL,
fetchto=".") fetchto=".")
self.config = self._get_config_dict()
def new_module(self, parent, url, source, fetchto): def new_module(self, parent, url, source, fetchto):
"""Add new module to the pool. """Add new module to the pool.
...@@ -159,7 +160,7 @@ class Action(list): ...@@ -159,7 +160,7 @@ class Action(list):
"""Get the Top module from the pool""" """Get the Top module from the pool"""
return self.top_module return self.top_module
def get_config_dict(self): def _get_config_dict(self):
"""Get the combined hierarchical Manifest dictionary from the pool""" """Get the combined hierarchical Manifest dictionary from the pool"""
config_dict = {} config_dict = {}
for mod in self: for mod in self:
......
...@@ -33,15 +33,14 @@ class ToolSim(ToolMakefile): ...@@ -33,15 +33,14 @@ class ToolSim(ToolMakefile):
def simulation_makefile(self, pool): def simulation_makefile(self, pool):
"""Execute the simulation action""" """Execute the simulation action"""
pool.check_all_fetched_or_quit() pool.check_all_fetched_or_quit()
manifest_project_dict = pool.get_config_dict() _check_simulation_manifest(pool.config)
_check_simulation_manifest(manifest_project_dict)
fset = pool.build_file_set( fset = pool.build_file_set(
manifest_project_dict.get("sim_top"), pool.config.get("sim_top"),
standard_libs=self._standard_libs) standard_libs=self._standard_libs)
# Filter the not parseable files! # Filter the not parseable files!
dep_files = fset.filter(DepFile) dep_files = fset.filter(DepFile)
# dep_solver.solve(dep_files) # dep_solver.solve(dep_files)
self.makefile_setup(manifest_project_dict, dep_files, self.makefile_setup(pool.config, dep_files,
filename=pool.options.filename) filename=pool.options.filename)
self.makefile_check_tool('sim_path') self.makefile_check_tool('sim_path')
self.makefile_sim_top() self.makefile_sim_top()
......
...@@ -42,10 +42,9 @@ class ToolSyn(ToolMakefile): ...@@ -42,10 +42,9 @@ class ToolSyn(ToolMakefile):
def synthesis_makefile(self, pool): def synthesis_makefile(self, pool):
"""Generate a Makefile for the specific synthesis tool""" """Generate a Makefile for the specific synthesis tool"""
pool.check_all_fetched_or_quit() pool.check_all_fetched_or_quit()
manifest_project_dict = pool.get_config_dict() _check_synthesis_manifest(pool.config)
_check_synthesis_manifest(manifest_project_dict)
fileset = pool.build_file_set( fileset = pool.build_file_set(
manifest_project_dict["syn_top"], pool.config["syn_top"],
standard_libs=self._standard_libs) standard_libs=self._standard_libs)
sup_files = pool.build_complete_file_set() sup_files = pool.build_complete_file_set()
privative_files = [] privative_files = []
...@@ -57,7 +56,7 @@ class ToolSyn(ToolMakefile): ...@@ -57,7 +56,7 @@ class ToolSyn(ToolMakefile):
logging.info("Detected %d supported files that are not parseable", logging.info("Detected %d supported files that are not parseable",
len(privative_files)) len(privative_files))
fileset.add(privative_files) fileset.add(privative_files)
self.makefile_setup(manifest_project_dict, fileset, self.makefile_setup(pool.config, fileset,
filename=pool.options.filename) filename=pool.options.filename)
self.makefile_check_tool('syn_path') self.makefile_check_tool('syn_path')
self.makefile_includes() self.makefile_includes()
......
...@@ -58,8 +58,7 @@ def _load_sim_tool(modules_pool): ...@@ -58,8 +58,7 @@ def _load_sim_tool(modules_pool):
def write_makefile(modules_pool): def write_makefile(modules_pool):
"""Function that detects the appropriated tool and write the Makefile""" """Function that detects the appropriated tool and write the Makefile"""
manifest_project_dict = modules_pool.get_config_dict() action = modules_pool.config.get('action')
action = manifest_project_dict.get('action')
if action == "simulation": if action == "simulation":
sim_writer = _load_sim_tool(modules_pool) sim_writer = _load_sim_tool(modules_pool)
sim_writer.simulation_makefile(modules_pool) sim_writer.simulation_makefile(modules_pool)
...@@ -69,4 +68,3 @@ def write_makefile(modules_pool): ...@@ -69,4 +68,3 @@ def write_makefile(modules_pool):
else: else:
logging.error("Unknown requested action: %s", action) logging.error("Unknown requested action: %s", action)
quit() quit()
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