Пример #1
0
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
Пример #2
0
import cmd,os
#import readline

from periphondemand.bin.define   import *
from periphondemand.bin.utils.basecli  import BaseCli
from periphondemand.bin.utils.settings import Settings
from periphondemand.bin.utils.basecli  import Statekeeper
from periphondemand.bin.utils.error    import Error
from periphondemand.bin.utils.display  import Display
from periphondemand.bin.utils import wrappersystem as sy
from periphondemand.bin.core.project   import Project

from periphondemand.bin.commandline.projectcli import ProjectCli
from periphondemand.bin.commandline.librarycli import LibraryCli

settings = Settings()
display  = Display()

class Cli(BaseCli):
    """ 
    ---------------------------------
     Command line interpreter for POD
    ---------------------------------
    """
    # Specific command for project
    def __init__(self,parent=None):
        BaseCli.__init__(self,parent)
        settings.active_project = Project("void",void=1)

    def do_project(self,arg):
       """\
Пример #3
0
from   periphondemand.bin.utils.basecli  import BaseCli
from   periphondemand.bin.utils.error    import Error

from   periphondemand.bin.core.project     import Project
from   periphondemand.bin.core.component   import Component
from   periphondemand.bin.core.platform    import Platform
from   periphondemand.bin.core.library     import Library

from   periphondemand.bin.code.intercon      import Intercon
from   periphondemand.bin.code.vhdl.topvhdl  import TopVHDL

from   periphondemand.bin.toolchain.synthesis   import Synthesis
from   periphondemand.bin.toolchain.simulation  import Simulation
from   periphondemand.bin.toolchain.driver      import Driver

settings = Settings()
display  = Display()

class ProjectCli(BaseCli):
    """ Project command line interface
    """
    def __init__(self,parent=None):
        BaseCli.__init__(self,parent)
        settings.active_project = Project("void",void=1)
        if settings.active_project is None:
            settings.active_project = Project("",void=1)
        if settings.active_library is None:
            settings.active_library = Library()

    def do_synthesis(self,arg):
        """\
Пример #4
0
# 2008/06/20 |Fabien Marteau |adding completion function
#
#-----------------------------------------------------------------------------

__doc__ = "Basic Command Line Interface"
__version__ = "1.0.0"
__author__ = "Fabrice MOUSSET <*****@*****.**> "+\
             "and Fabien Marteau <*****@*****.**>"

import cmd, re, os, sys
from periphondemand.bin.define import *
from periphondemand.bin.utils.error import Error
from periphondemand.bin.utils.settings import Settings
from periphondemand.bin.utils import wrappersystem as sy

settings = Settings()

class BaseCli(cmd.Cmd):
    case_insensitive = True
    comment_marks = '#*'
    exclude_from_history = ['EOF','source','savehistory']
    multiline_commands = []
    shortcuts = {'?': 'help', '!': 'shell'}
    terminators = ';\n'
    default_extension = 'txt'

    def __init__(self, parent=None, *args, **kwargs):
        cmd.Cmd.__init__(self, *args, **kwargs)
        self.parent=parent
        settings.history = settings.history[:-1]