from periphondemand.bin.define import HEADERTPL from periphondemand.bin.define import VHDLEXT from periphondemand.bin.define import ONETAB from periphondemand.bin.define import COMPONENTSPATH from periphondemand.bin.define import HDLDIR from periphondemand.bin.utils.settings import Settings from periphondemand.bin.utils.poderror import PodError from periphondemand.bin.utils import wrappersystem as sy from periphondemand.bin.core.component import Component from periphondemand.bin.core.port import Port from periphondemand.bin.core.interface import Interface from periphondemand.bin.core.hdl_file import HdlFile SETTINGS = Settings() def header(author, intercon): """ return vhdl header """ header = open(SETTINGS.path + TEMPLATESPATH + "/" + HEADERTPL, "r").read() header = header.replace("$tpl:author$", author) header = header.replace("$tpl:date$", str(datetime.date.today())) header = header.replace("$tpl:filename$", intercon.name + VHDLEXT) header = header.replace("$tpl:abstract$", intercon.description) return header def entity(intercon): """ generate entity