当前位置: 首页>>代码示例>>Python>>正文


Python VUnit.from_argv方法代码示例

本文整理汇总了Python中vunit.VUnit.from_argv方法的典型用法代码示例。如果您正苦于以下问题:Python VUnit.from_argv方法的具体用法?Python VUnit.from_argv怎么用?Python VUnit.from_argv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vunit.VUnit的用法示例。


在下文中一共展示了VUnit.from_argv方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from vunit import VUnit [as 别名]
# 或者: from vunit.VUnit import from_argv [as 别名]
def main():
    ui = VUnit.from_argv()
    ui.add_osvvm()
    ui.enable_location_preprocessing()
    #  ui.add_com()
    ui.disable_ieee_warnings()

    root = dirname(__file__)

    for library_name in ('common_lib', 'memory'):
        ui.add_library(library_name).add_source_files(
            join(root, library_name, 'src', '*.vhd'))

    ui.add_library('str_format').add_source_files(
        join(root, 'hdl_string_format', 'src', '*.vhd'))

    ui.add_library('memory_tb').add_source_files(
        join(root, 'memory', 'test', 'async_fifo_tb.vhd'))

    ui.add_library('exp_golomb').add_source_files(
        join(root, 'exponential_golomb', 'src', '*.vhd'))

    #  ui.add_library('exp_golomb_tb').add_source_files(
    #      join(root, 'exponential_golomb', 'test', '*.vhd'))

    add_async_fifo_tests(ui.library('memory_tb').entity('async_fifo_tb'))

    ui.set_compile_option('modelsim.vcom_flags', ['-novopt', '-explicit'])
    ui.set_sim_option('modelsim.vsim_flags', ['-novopt'])
    ui.main()
开发者ID:suoto,项目名称:hdl_lib,代码行数:32,代码来源:run.py

示例2: run

# 需要导入模块: from vunit import VUnit [as 别名]
# 或者: from vunit.VUnit import from_argv [as 别名]
        def run(value):
            """
            Utility function to first run with pkg_body1 then pkg_body2
            """

            tb_pkg_file_name = join(self.data_path, "tb_pkg.vhd")
            pkg_file_name = join(self.data_path, "pkg.vhd")
            pkg_body_file_name = join(self.data_path, "pkg_body%i.vhd" % value)

            argv = ["--output-path=%s" % self.output_path,
                    "-v"]
            if value == 1:
                argv.append("--clean")

            ui = VUnit.from_argv(argv=argv)
            lib = ui.add_library("lib")
            lib.add_source_files(tb_pkg_file_name)
            lib.add_source_files(pkg_file_name)
            lib.add_source_files(pkg_body_file_name)
            lib.entity("tb_pkg").set_generic("value", value)

            try:
                ui.main()
            except SystemExit as ex:
                self.assertEqual(ex.code, 0)
开发者ID:barri,项目名称:vunit,代码行数:27,代码来源:test_dependencies.py

示例3: run

# 需要导入模块: from vunit import VUnit [as 别名]
# 或者: from vunit.VUnit import from_argv [as 别名]
def run():
    ui = VUnit.from_argv()
    # ui.add_osvvm()

    src_path = join(dirname(__file__), "vhdl_files")

    src_lib = ui.add_library("src_lib")
    src_lib.add_source_files(join(src_path, "src", "*.vhd"))

    test_lib = ui.add_library("test_lib")
    test_lib.add_source_files(join(src_path, "test", "*.vhd"))

    ui.main()
开发者ID:WinandS,项目名称:Thesis,代码行数:15,代码来源:run_vunit.py

示例4: main

# 需要导入模块: from vunit import VUnit [as 别名]
# 或者: from vunit.VUnit import from_argv [as 别名]
def main():

    # VUnit steals the command line args so we use an environment variable
    # to determine which core we're picking up
    toplevel = os.getenv("CORE", "")
    if not toplevel:
        sys.stderr.write("Need to provide CORE environment variable")
        sys.exit(1)

    # Create VUnit instance by parsing command line arguments
    vu = VUnit.from_argv()

    #Create singleton instances for core manager and configuration handler
    #Configuration manager is not needed in this example
    cm = CoreManager()

    # Assume we're running in the same directory containing the cores
    cm.add_cores_root(".")

    #Get the sorted list of dependencies starting from the top-level core
    try:
        cores = cm.get_depends(toplevel)
    except DependencyError as e:
        print("'{}' or any of its dependencies requires '{}', but this core was not found".format(top_core, e.value))
        sys.exit(2)

    #Iterate over cores, filesets and files and add all relevant sources files to vunit
    incdirs = set()
    src_files = []

    #'usage' is a list of tags to look for in the filesets.
    # Only look at filesets where any of these tags are present
    usage = ['sim']
    for core_name in cores:
        core = cm.get_core(core_name)
        core.setup()
        basepath = core.files_root
        for fs in core.file_sets:
            if (set(fs.usage) & set(usage)) and ((core_name == toplevel) or not fs.private):
                for file in fs.file:
                    if file.is_include_file:
                        #TODO: incdirs not used right now
                        incdirs.add(os.path.join(basepath, os.path.dirname(file.name)))
                    else:
                        try:
                            vu.library(file.logical_name)
                        except KeyError:
                            vu.add_library(file.logical_name)
                        vu.add_source_file(os.path.join(basepath, file.name), file.logical_name)
    # Run vunit function
    vu.main()
开发者ID:potentialventures,项目名称:buildtools,代码行数:53,代码来源:funit.py

示例5: main

# 需要导入模块: from vunit import VUnit [as 别名]
# 或者: from vunit.VUnit import from_argv [as 别名]
def main():
    ui = VUnit.from_argv()
    ui.add_osvvm()

    root_path = dirname(__file__)

    exp_golomb = ui.add_library("exp_golomb")
    exp_golomb.add_source_files(join(root_path, "src", "*.vhd"))

    exp_golomb_tb = ui.add_library("exp_golomb_tb")
    exp_golomb_tb.add_source_files(join(root_path, "test", "*.vhd"))

    ui.set_compile_option('modelsim.vcom_flags', ['-novopt', '-explicit'])
    ui.set_sim_option('modelsim.vsim_flags', ['-novopt'])
    ui.main()
开发者ID:suoto,项目名称:hdl_lib,代码行数:17,代码来源:run.py

示例6: Copyright

# 需要导入模块: from vunit import VUnit [as 别名]
# 或者: from vunit.VUnit import from_argv [as 别名]
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014-2015, Lars Asplund [email protected]

from os.path import join, dirname
from vunit import VUnit

root = dirname(__file__)
ui = VUnit.from_argv()
lib = ui.add_library("lib")
lib.add_source_files(join(root, "test", "*.vhd"))
ui.main()
开发者ID:KevinKes,项目名称:vunit,代码行数:16,代码来源:run.py

示例7: Copyright

# 需要导入模块: from vunit import VUnit [as 别名]
# 或者: from vunit.VUnit import from_argv [as 别名]
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014-2018, Lars Asplund [email protected]

from os.path import join, dirname
from vunit import VUnit

root = dirname(__file__)

prj = VUnit.from_argv()
prj.add_com()
tb_com_lib = prj.add_library("tb_com_lib")
tb_com_lib.add_source_files(join(root, 'test', '*.vhd'))
pkg = tb_com_lib.package('custom_types_pkg')
pkg.generate_codecs(codec_package_name='custom_codec_pkg', used_packages=['ieee.std_logic_1164', 'constants_pkg',
                                                                          'tb_com_lib.more_constants_pkg'])
prj.main()
开发者ID:barri,项目名称:vunit,代码行数:21,代码来源:run.py

示例8: Copyright

# 需要导入模块: from vunit import VUnit [as 别名]
# 或者: from vunit.VUnit import from_argv [as 别名]
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2015, Lars Asplund [email protected]

from os.path import join, dirname, basename
from vunit import VUnit
from vunit.check_preprocessor import CheckPreprocessor
from glob import glob

vhdl_path = join(dirname(__file__), "test")
ui = VUnit.from_argv(compile_builtins=False)
ui.add_builtins('vunit_lib', mock_log=True)
lib = ui.add_library('lib')
lib.add_source_files(join(vhdl_path, "test_support.vhd"))

if ui.vhdl_standard in ('2002', '2008'):
    lib.add_source_files(join(vhdl_path, "test_count.vhd"))
    lib.add_source_files(join(vhdl_path, "test_types.vhd"))
elif ui.vhdl_standard == '93':
    lib.add_source_files(join(vhdl_path, "test_count93.vhd"))

if ui.vhdl_standard == '2008':
    lib.add_source_files(join(vhdl_path, "tb_check_relation.vhd"), [CheckPreprocessor()])
else:
    lib.add_source_files(join(vhdl_path, "tb_check_relation93_2002.vhd"), [CheckPreprocessor()])

for file_name in glob(join(vhdl_path, "tb_*.vhd")):
    if basename(file_name) == "tb_check_relation.vhd":
        continue
开发者ID:enzochiau,项目名称:vunit,代码行数:33,代码来源:run.py

示例9: Copyright

# 需要导入模块: from vunit import VUnit [as 别名]
# 或者: from vunit.VUnit import from_argv [as 别名]
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2015, Lars Asplund [email protected]

"""
Example of how you can extract compilation order using VUnit
Note that you cannot run VUnit normally via this script
"""

from os.path import join
from vunit import VUnit
from project import create_project, ROOT

ui = VUnit.from_argv(argv=[])
create_project(ui)
source_files = ui.get_project_compile_order(target=join(ROOT, "compile_order_top.vhd"))

for source_file in source_files:
    print(source_file.library.name + ", " + source_file.name)
开发者ID:varunnagpaal,项目名称:vunit,代码行数:23,代码来源:print_compile_order.py


注:本文中的vunit.VUnit.from_argv方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。