Solve constructors hierarchy issues for Class ModulePool

parent 8c6a146b
......@@ -26,13 +26,14 @@ import logging
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"""
def __init__(self):
def __init__(self, *args):
self.top_module = None
self._deps_solved = False
self.env = None
list.__init__(self, *args)
def _check_all_fetched_or_quit(self):
......
......@@ -31,6 +31,9 @@ from .action import Action
class ActionCheck(Action):
"""Class providing the method to check general properties"""
def __init__(self, *args):
Action.__init__(self, *args)
def check_manifest(self):
"""Method that checks the manifest dict"""
logging.warning("Problems with top_module at %s", self.top_module.path)
......
......@@ -36,6 +36,9 @@ from .action import Action
class ActionCore(Action):
"""Class that contains the methods for core actions"""
def __init__(self, *args):
Action.__init__(self, *args)
def fetch(self):
"""Fetch the missing required modules from their remote origin"""
top_module = self.get_top_module()
......
......@@ -27,6 +27,10 @@ import logging
from .action import Action
class QsysHwTclUpdate(Action):
def __init__(self, *args):
Action.__init__(self, *args)
def qsys_hw_tcl_update(self):
file_set = self.build_file_set(
self.get_top_module().manifest_dict["syn_top"])
......
......@@ -40,6 +40,15 @@ class ActionSimulation(Action,
ToolActiveHDL, ToolRiviera, ToolGHDL):
"""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):
"""Check if the simulation keys are provided by the top manifest"""
if not self.get_top_module().manifest_dict["sim_top"]:
......
......@@ -41,6 +41,15 @@ class ActionSynthesis(Action,
ToolQuartus, ToolDiamond, ToolLibero):
"""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):
"""Returns a tool_object that provides the synthesis tool interface"""
tool_name = self.get_top_module().manifest_dict["syn_tool"]
......
......@@ -30,6 +30,9 @@ from .action import Action
class ActionTree(Action):
"""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):
"""Create a JSON file containing the graph hierarchy from pool"""
if self.env.options.web:
......
......@@ -34,13 +34,13 @@ from .util import path as path_mod
from . import fetch
from .env import Env
from .action import (Action, ActionCheck, ActionCore,
from .action import (ActionCheck, ActionCore,
ActionTree, ActionSimulation,
ActionSynthesis,
QsysHwTclUpdate)
class ModulePool(list, ActionCheck, ActionCore,
class ModulePool(ActionCheck, ActionCore,
ActionTree, ActionSimulation,
ActionSynthesis,
QsysHwTclUpdate):
......@@ -48,9 +48,14 @@ class ModulePool(list, ActionCheck, ActionCore,
The ModulePool class acts as the container for the HDLMake modules that
are progressively being added to the design hierarchy.
"""
def __init__(self, *args):
list.__init__(self, *args)
Action.__init__(self)
ActionCheck.__init__(self, *args)
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):
"""Initialize the module pool environment from the provided options"""
......
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