Refactoring ModuleAltera.py

parent c8692b97
"""This is a interim module providing Intel/Altera stuff"""
import os
import logging
from .core import ModuleCore
from hdlmake.util import path as path_mod
class ModuleAltera(ModuleCore):
"""Class providing the TCL files that Altera Quartus requires"""
def __init__(self):
# Manifest Altera Properties
self.quartus_preflow = None
......@@ -12,32 +18,39 @@ class ModuleAltera(ModuleCore):
super(ModuleAltera, self).__init__()
def process_manifest(self):
"""Method that process the Altera section of the manifest_dict"""
self._process_manifest_altera()
super(ModuleAltera, self).process_manifest()
def _process_manifest_altera(self):
"""Method that checks if the TCL files declared by the module
manifest dictionary exists and if so create them and
initialize the appropriated variables in the Module instance"""
from hdlmake.srcfile import TCLFile
if self.manifest_dict["quartus_preflow"] != None:
path = path_mod.rel2abs(self.manifest_dict["quartus_preflow"], self.path);
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.path + " doesn't exist: "
+ path + ".\nExiting.")
logging.error("quartus_preflow file listed in " + self.path +
" doesn't exist: " + path + ".\nExiting.")
quit()
self.quartus_preflow = TCLFile(path)
if self.manifest_dict["quartus_postmodule"] != None:
path = path_mod.rel2abs(self.manifest_dict["quartus_postmodule"], self.path);
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.path + " doesn't exist: "
+ path + ".\nExiting.")
logging.error("quartus_postmodule file listed in " + self.path +
" doesn't exist: " + path + ".\nExiting.")
quit()
self.quartus_postmodule = TCLFile(path)
if self.manifest_dict["quartus_postflow"] != None:
path = path_mod.rel2abs(self.manifest_dict["quartus_postflow"], self.path);
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.path + " doesn't exist: "
+ path + ".\nExiting.")
logging.error("quartus_postflow file listed in " + self.path +
" doesn't exist: " + path + ".\nExiting.")
quit()
self.quartus_postflow = TCLFile(path)
......
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