Just another working refactoring checkpoint

parent 28f89a9e
import os
from .core import ModuleCore
from hdlmake.util import path as path_mod
class ModuleAltera(object):
class ModuleAltera(ModuleCore):
def __init__(self):
# Manifest Altera Properties
self.quartus_preflow = None
......@@ -12,14 +13,14 @@ class ModuleAltera(object):
def process_manifest(self):
self._process_manifest_altera()
#super(ModuleAltera, self).process_manifest()
super(ModuleAltera, self).process_manifest()
def _process_manifest_altera(self):
from hdlmake.srcfile import TCLFile
if self.manifest_dict["quartus_preflow"] != None:
path = path_mod.rel2abs(self.manifest_dict["quartus_preflow"], self.path);
if not os.path.exists(path):
p.error("quartus_preflow file listed in " + self.manifest.path + " doesn't exist: "
p.error("quartus_preflow file listed in " + self.path + " doesn't exist: "
+ path + ".\nExiting.")
quit()
self.quartus_preflow = TCLFile(path)
......@@ -27,7 +28,7 @@ class ModuleAltera(object):
if self.manifest_dict["quartus_postmodule"] != None:
path = path_mod.rel2abs(self.manifest_dict["quartus_postmodule"], self.path);
if not os.path.exists(path):
p.error("quartus_postmodule file listed in " + self.manifest.path + " doesn't exist: "
p.error("quartus_postmodule file listed in " + self.path + " doesn't exist: "
+ path + ".\nExiting.")
quit()
self.quartus_postmodule = TCLFile(path)
......@@ -35,7 +36,7 @@ class ModuleAltera(object):
if self.manifest_dict["quartus_postflow"] != None:
path = path_mod.rel2abs(self.manifest_dict["quartus_postflow"], self.path);
if not os.path.exists(path):
p.error("quartus_postflow file listed in " + self.manifest.path + " doesn't exist: "
p.error("quartus_postflow file listed in " + self.path + " doesn't exist: "
+ path + ".\nExiting.")
quit()
self.quartus_postflow = TCLFile(path)
......
import logging
from .core import ModuleCore
from hdlmake import fetch
from hdlmake.util import path as path_mod
class ModuleContent(object):
class ModuleContent(ModuleCore):
def __init__(self):
# Manifest Files Properties
self.files = None
......@@ -17,7 +18,7 @@ class ModuleContent(object):
self._process_manifest_fetch()
self._process_manifest_files()
self._process_manifest_modules()
#super(ModuleContent, self).process_manifest()
super(ModuleContent, self).process_manifest()
def _process_manifest_files(self):
from hdlmake.srcfile import (TCLFile, VerilogFile, VHDLFile,
......
"""Provides the core functionality for the HDLMake module"""
import os
import logging
from hdlmake import fetch
class ModuleCore(object):
"""This is the class providing the module core functionality"""
......@@ -12,11 +10,16 @@ class ModuleCore(object):
self.library = "work"
self.target = None
self.action = None
self.top_entity = None
super(ModuleCore, self).__init__()
# Manifest Force tool Property
self.force_tool = None
self.pool = None
self.top_module = None
self.manifest_dict = None
#super(ModuleCore, self).__init__()
def set_pool(self, pool):
"""Set the associated pool for the module instance"""
self.pool = pool
self.top_module = pool.get_top_module()
def process_manifest(self):
......
......@@ -35,32 +35,24 @@ import logging
from hdlmake.manifest_parser import ManifestParser
from hdlmake.util import path as path_mod
from hdlmake import fetch
from hdlmake.module import (ModuleCore, ModuleSynthesis, ModuleOrigin,
from hdlmake.module import (ModuleSynthesis, ModuleOrigin,
ModuleSimulation, ModuleContent, ModuleAltera)
class Module(ModuleCore, ModuleSynthesis, ModuleOrigin,
class Module(ModuleSynthesis, ModuleOrigin,
ModuleSimulation, ModuleContent, ModuleAltera):
"""
This is the class providing the HDLMake module, the basic element
providing the modular behavior allowing for structured designs.
"""
def set_pool(self, pool):
"""Set the associated pool for the module instance"""
self.pool = pool
self.top_module = pool.get_top_module()
def __init__(self, parent, url, source, fetchto):
"""Calculate and initialize the origin attributes: path, source..."""
assert url is not None
assert source is not None
self.pool = None
self.top_module = None
self.top_entity = None
self.source = source
self.parent = parent
self.manifest_dict = None
self.set_origin(parent, url, source, fetchto)
super(Module, self).__init__()
......@@ -118,11 +110,11 @@ class Module(ModuleCore, ModuleSynthesis, ModuleOrigin,
contained in the action specific inherited Python modules.
"""
logging.debug("Process manifest at: " + os.path.dirname(self.path))
#super(Module, self).process_manifest()
module_list = [ModuleCore, ModuleSynthesis, ModuleSimulation,
ModuleContent, ModuleAltera]
for module_plugin in module_list:
module_plugin.process_manifest(self)
super(Module, self).process_manifest()
#module_list = [ModuleSynthesis, ModuleSimulation,
# ModuleContent, ModuleAltera]
#for module_plugin in module_list:
# module_plugin.process_manifest(self)
def parse_manifest(self):
......
import os
import logging
from .core import ModuleCore
from hdlmake import fetch
from hdlmake.util import path as path_mod
class ModuleOrigin(object):
class ModuleOrigin(ModuleCore):
def set_origin(self, parent, url, source, fetchto):
# Manifest Module Origin Properties
self.fetchto = fetchto
......
from .core import ModuleCore
from hdlmake.util import path as path_mod
class ModuleSimulation(object):
class ModuleSimulation(ModuleCore):
def __init__(self):
# Manifest Simulation Properties
......@@ -21,7 +22,7 @@ class ModuleSimulation(object):
def process_manifest(self):
self._process_manifest_simulation()
self._process_manifest_includes()
#super(ModuleSimulation, self).process_manifest()
super(ModuleSimulation, self).process_manifest()
def _process_manifest_simulation(self):
from hdlmake.srcfile import SourceFileSet
......
class ModuleSynthesis(object):
from .core import ModuleCore
class ModuleSynthesis(ModuleCore):
def __init__(self):
# Manifest Synthesis Properties
self.syn_device = None
......@@ -19,7 +21,7 @@ class ModuleSynthesis(object):
def process_manifest(self):
self._process_manifest_synthesis()
self._process_manifest_included_makefiles()
#super(ModuleSynthesis, self).process_manifest()
super(ModuleSynthesis, self).process_manifest()
def _process_manifest_synthesis(self):
# Synthesis 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