Solve constructors hierarchy issues for Class ModulePool

parent 8c6a146b
...@@ -26,13 +26,14 @@ import logging ...@@ -26,13 +26,14 @@ import logging
from hdlmake import new_dep_solver as dep_solver from hdlmake import new_dep_solver as dep_solver
class Action(object): class Action(list):
"""This is the base class providing the common Action methods""" """This is the base class providing the common Action methods"""
def __init__(self): def __init__(self, *args):
self.top_module = None self.top_module = None
self._deps_solved = False self._deps_solved = False
self.env = None self.env = None
list.__init__(self, *args)
def _check_all_fetched_or_quit(self): def _check_all_fetched_or_quit(self):
......
...@@ -31,6 +31,9 @@ from .action import Action ...@@ -31,6 +31,9 @@ from .action import Action
class ActionCheck(Action): class ActionCheck(Action):
"""Class providing the method to check general properties""" """Class providing the method to check general properties"""
def __init__(self, *args):
Action.__init__(self, *args)
def check_manifest(self): def check_manifest(self):
"""Method that checks the manifest dict""" """Method that checks the manifest dict"""
logging.warning("Problems with top_module at %s", self.top_module.path) logging.warning("Problems with top_module at %s", self.top_module.path)
......
...@@ -36,6 +36,9 @@ from .action import Action ...@@ -36,6 +36,9 @@ from .action import Action
class ActionCore(Action): class ActionCore(Action):
"""Class that contains the methods for core actions""" """Class that contains the methods for core actions"""
def __init__(self, *args):
Action.__init__(self, *args)
def fetch(self): def fetch(self):
"""Fetch the missing required modules from their remote origin""" """Fetch the missing required modules from their remote origin"""
top_module = self.get_top_module() top_module = self.get_top_module()
......
...@@ -27,6 +27,10 @@ import logging ...@@ -27,6 +27,10 @@ import logging
from .action import Action from .action import Action
class QsysHwTclUpdate(Action): class QsysHwTclUpdate(Action):
def __init__(self, *args):
Action.__init__(self, *args)
def qsys_hw_tcl_update(self): def qsys_hw_tcl_update(self):
file_set = self.build_file_set( file_set = self.build_file_set(
self.get_top_module().manifest_dict["syn_top"]) self.get_top_module().manifest_dict["syn_top"])
......
...@@ -40,6 +40,15 @@ class ActionSimulation(Action, ...@@ -40,6 +40,15 @@ class ActionSimulation(Action,
ToolActiveHDL, ToolRiviera, ToolGHDL): ToolActiveHDL, ToolRiviera, ToolGHDL):
"""This class contains the simulation specific methods""" """This class contains the simulation specific methods"""
def __init__(self, *args):
Action.__init__(self, *args)
ToolIVerilog.__init__(self, *args)
ToolISim.__init__(self, *args)
ToolModelsim.__init__(self, *args)
ToolActiveHDL.__init__(self, *args)
ToolRiviera.__init__(self, *args)
ToolGHDL.__init__(self, *args)
def _check_simulation_makefile(self): def _check_simulation_makefile(self):
"""Check if the simulation keys are provided by the top manifest""" """Check if the simulation keys are provided by the top manifest"""
if not self.get_top_module().manifest_dict["sim_top"]: if not self.get_top_module().manifest_dict["sim_top"]:
......
...@@ -41,6 +41,15 @@ class ActionSynthesis(Action, ...@@ -41,6 +41,15 @@ class ActionSynthesis(Action,
ToolQuartus, ToolDiamond, ToolLibero): ToolQuartus, ToolDiamond, ToolLibero):
"""Class providing the public synthesis methods for the user""" """Class providing the public synthesis methods for the user"""
def __init__(self, *args):
Action.__init__(self, *args)
ToolISE.__init__(self, *args)
ToolPlanAhead.__init__(self, *args)
ToolVivado.__init__(self, *args)
ToolQuartus.__init__(self, *args)
ToolDiamond.__init__(self, *args)
ToolLibero.__init__(self, *args)
def _load_synthesis_tool(self): def _load_synthesis_tool(self):
"""Returns a tool_object that provides the synthesis tool interface""" """Returns a tool_object that provides the synthesis tool interface"""
tool_name = self.get_top_module().manifest_dict["syn_tool"] tool_name = self.get_top_module().manifest_dict["syn_tool"]
......
...@@ -30,6 +30,9 @@ from .action import Action ...@@ -30,6 +30,9 @@ from .action import Action
class ActionTree(Action): class ActionTree(Action):
"""Class providing methods to create a graph from pool and to analyze it""" """Class providing methods to create a graph from pool and to analyze it"""
def __init__(self, *args):
Action.__init__(self, *args)
def _generate_tree_web(self, hierarchy, top_id): def _generate_tree_web(self, hierarchy, top_id):
"""Create a JSON file containing the graph hierarchy from pool""" """Create a JSON file containing the graph hierarchy from pool"""
if self.env.options.web: if self.env.options.web:
......
...@@ -34,23 +34,28 @@ from .util import path as path_mod ...@@ -34,23 +34,28 @@ from .util import path as path_mod
from . import fetch from . import fetch
from .env import Env from .env import Env
from .action import (Action, ActionCheck, ActionCore, from .action import (ActionCheck, ActionCore,
ActionTree, ActionSimulation, ActionTree, ActionSimulation,
ActionSynthesis, ActionSynthesis,
QsysHwTclUpdate) QsysHwTclUpdate)
class ModulePool(list, ActionCheck, ActionCore, class ModulePool(ActionCheck, ActionCore,
ActionTree, ActionSimulation, ActionTree, ActionSimulation,
ActionSynthesis, ActionSynthesis,
QsysHwTclUpdate): QsysHwTclUpdate):
""" """
The ModulePool class acts as the container for the HDLMake modules that The ModulePool class acts as the container for the HDLMake modules that
are progressively being added to the design hierarchy. are progressively being added to the design hierarchy.
""" """
def __init__(self, *args): def __init__(self, *args):
list.__init__(self, *args) ActionCheck.__init__(self, *args)
Action.__init__(self) ActionCore.__init__(self, *args)
ActionTree.__init__(self, *args)
ActionSimulation.__init__(self, *args)
ActionSynthesis.__init__(self, *args)
QsysHwTclUpdate.__init__(self, *args)
def set_environment(self, options): def set_environment(self, options):
"""Initialize the module pool environment from the provided options""" """Initialize the module pool environment from the provided options"""
...@@ -95,7 +100,7 @@ class ModulePool(list, ActionCheck, ActionCore, ...@@ -95,7 +100,7 @@ class ModulePool(list, ActionCheck, ActionCore,
new_module_args = ModuleArgs() new_module_args = ModuleArgs()
new_module_args.set_args(parent, url, source, fetchto) new_module_args.set_args(parent, url, source, fetchto)
new_module = Module(new_module_args, self) new_module = Module(new_module_args, self)
if not self.__contains(new_module): if not self.__contains(new_module):
self._add(new_module) self._add(new_module)
if not self.top_module: if not self.top_module:
......
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