Relocate makefile writer capabilities in the Class hierarchy

parent 844c0f10
......@@ -25,6 +25,7 @@
from .check import ActionCheck
from .core import ActionCore
from .tree import ActionTree
from .makefile import ActionMakefile
from .synthesis import ActionSynthesis
from .simulation import ActionSimulation
......
......@@ -44,6 +44,7 @@ class Action(list):
self._deps_solved = False
self.env = None
list.__init__(self, *args)
super(Action, self).__init__(*args)
def new_module(self, parent, url, source, fetchto):
......
......@@ -32,7 +32,7 @@ class ActionCheck(Action):
"""Class providing the method to check general properties"""
def __init__(self, *args):
Action.__init__(self, *args)
super(ActionCheck, self).__init__(*args)
def check_manifest(self):
"""Method that checks the manifest dict"""
......
......@@ -37,7 +37,7 @@ class ActionCore(Action):
"""Class that contains the methods for core actions"""
def __init__(self, *args):
Action.__init__(self, *args)
super(ActionCore, self).__init__(*args)
def fetch(self):
"""Fetch the missing required modules from their remote origin"""
......
......@@ -23,8 +23,8 @@
import os
from . import fetch
from hdlmake import fetch
from .action import Action
class _StaticClassVariable():
pass
......@@ -33,7 +33,7 @@ _m = _StaticClassVariable()
_m.initialized = False
class MakefileWriter(object):
class ActionMakefile(Action):
def __init__(self, filename=None):
self._file = None
......@@ -41,7 +41,7 @@ class MakefileWriter(object):
self._filename = filename
else:
self._filename = "Makefile"
super(MakefileWriter, self).__init__()
super(ActionMakefile, self).__init__()
def __del__(self):
if self._file:
......
......@@ -29,7 +29,7 @@ from .action import Action
class QsysHwTclUpdate(Action):
def __init__(self, *args):
Action.__init__(self, *args)
super(QsysHwTclUpdate, self).__init__(*args)
def qsys_hw_tcl_update(self):
file_set = self.build_file_set(
......
......@@ -33,21 +33,14 @@ from hdlmake.tools import (
ToolIVerilog, ToolISim, ToolModelsim,
ToolActiveHDL, ToolRiviera, ToolGHDL)
from .action import Action
class ActionSimulation(Action,
class ActionSimulation(
ToolIVerilog, ToolISim, ToolModelsim,
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)
super(ActionSimulation, self).__init__(*args)
def _check_simulation_makefile(self):
"""Check if the simulation keys are provided by the top manifest"""
......
......@@ -34,21 +34,13 @@ from hdlmake.tools import (
ToolISE, ToolPlanAhead, ToolVivado,
ToolQuartus, ToolDiamond, ToolLibero)
from .action import Action
class ActionSynthesis(Action,
class ActionSynthesis(
ToolISE, ToolPlanAhead, ToolVivado,
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)
super(ActionSynthesis, self).__init__(*args)
def _load_synthesis_tool(self):
"""Returns a tool_object that provides the synthesis tool interface"""
......
......@@ -31,7 +31,7 @@ class ActionTree(Action):
"""Class providing methods to create a graph from pool and to analyze it"""
def __init__(self, *args):
Action.__init__(self, *args)
super(Action, self).__init__(*args)
def _generate_tree_web(self, hierarchy, top_id):
"""Create a JSON file containing the graph hierarchy from pool"""
......
......@@ -23,10 +23,10 @@
import string
from hdlmake.makefile_writer import MakefileWriter
from hdlmake.action import ActionMakefile
class ToolActiveHDL(MakefileWriter):
class ToolActiveHDL(ActionMakefile):
def __init__(self):
super(ToolActiveHDL, self).__init__()
......
......@@ -27,12 +27,12 @@ import os
import logging
import string
from hdlmake.makefile_writer import MakefileWriter
from hdlmake.action import ActionMakefile
DIAMOND_STANDARD_LIBS = ['ieee', 'std']
class ToolDiamond(MakefileWriter):
class ToolDiamond(ActionMakefile):
def __init__(self):
super(ToolDiamond, self).__init__()
......
......@@ -22,10 +22,10 @@
#
import string
from hdlmake.makefile_writer import MakefileWriter
from hdlmake.action import ActionMakefile
class ToolGHDL(MakefileWriter):
class ToolGHDL(ActionMakefile):
def __init__(self):
super(ToolGHDL, self).__init__()
......
......@@ -32,7 +32,7 @@ import string
from subprocess import Popen, PIPE
import hdlmake.new_dep_solver as dep_solver
from hdlmake.makefile_writer import MakefileWriter
from hdlmake.action import ActionMakefile
XmlImpl = xml.dom.minidom.getDOMImplementation()
......@@ -49,7 +49,7 @@ FAMILY_NAMES = {
"XC7A": "Artix7"}
class ToolISE(MakefileWriter):
class ToolISE(ActionMakefile):
def __init__(self):
super(ToolISE, self).__init__()
......
......@@ -31,7 +31,7 @@ import sys
import string
import platform
from hdlmake.makefile_writer import MakefileWriter
from hdlmake.action import ActionMakefile
ISIM_STANDARD_LIBS = ['std', 'ieee', 'ieee_proposed', 'vl', 'synopsys',
......@@ -41,7 +41,7 @@ ISIM_STANDARD_LIBS = ['std', 'ieee', 'ieee_proposed', 'vl', 'synopsys',
'unimacro_ver', 'xilinxcorelib_ver', 'secureip']
class ToolISim(MakefileWriter):
class ToolISim(ActionMakefile):
def __init__(self):
super(ToolISim, self).__init__()
......
......@@ -27,7 +27,7 @@ import os
import platform
import logging
from hdlmake.makefile_writer import MakefileWriter
from hdlmake.action import ActionMakefile
IVERILOG_STANDARD_LIBS = ['std', 'ieee', 'ieee_proposed', 'vl', 'synopsys',
......@@ -37,7 +37,7 @@ IVERILOG_STANDARD_LIBS = ['std', 'ieee', 'ieee_proposed', 'vl', 'synopsys',
'unimacro_ver', 'xilinxcorelib_ver', 'secureip']
class ToolIVerilog(MakefileWriter):
class ToolIVerilog(ActionMakefile):
def __init__(self):
super(ToolIVerilog, self).__init__()
......
......@@ -27,13 +27,13 @@ import os
import string
import logging
from hdlmake.makefile_writer import MakefileWriter
from hdlmake.action import ActionMakefile
LIBERO_STANDARD_LIBS = ['ieee', 'std']
class ToolLibero(MakefileWriter):
class ToolLibero(ActionMakefile):
def __init__(self):
super(ToolLibero, self).__init__()
......
......@@ -28,13 +28,13 @@ import string
from string import Template
import logging
from hdlmake.makefile_writer import MakefileWriter
from hdlmake.action import ActionMakefile
PLANAHEAD_STANDARD_LIBS = ['ieee', 'std']
class ToolPlanAhead(MakefileWriter):
class ToolPlanAhead(ActionMakefile):
def __init__(self):
super(ToolPlanAhead, self).__init__()
......
......@@ -28,13 +28,13 @@ from string import Template
import logging
from hdlmake import fetch
from hdlmake.makefile_writer import MakefileWriter
from hdlmake.action import ActionMakefile
QUARTUS_STANDARD_LIBS = ['altera', 'altera_mf', 'lpm', 'ieee', 'std']
class ToolQuartus(MakefileWriter):
class ToolQuartus(ActionMakefile):
def __init__(self):
super(ToolQuartus, self).__init__()
......
......@@ -25,10 +25,10 @@ import os
import platform
import string
from hdlmake.makefile_writer import MakefileWriter
from hdlmake.action import ActionMakefile
class VsimMakefileWriter(MakefileWriter):
class VsimMakefileWriter(ActionMakefile):
"""A Makefile writer for simulation suitable for vsim based simulators.
......
......@@ -27,13 +27,13 @@ import os
import string
import logging
from hdlmake.makefile_writer import MakefileWriter
from hdlmake.action import ActionMakefile
VIVADO_STANDARD_LIBS = ['ieee', 'std']
class ToolVivado(MakefileWriter):
class ToolVivado(ActionMakefile):
def __init__(self):
super(ToolVivado, self).__init__()
......
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