• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python vunit.VUnit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: main

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,代码行数:30,代码来源:run.py


示例2: run

        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,代码行数:25,代码来源:test_dependencies.py


示例3: run

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,代码行数:13,代码来源:run_vunit.py


示例4: main

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,代码行数:51,代码来源:funit.py


示例5: main

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,代码行数:15,代码来源:run.py


示例6: Copyright

# 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,代码行数:14,代码来源:run.py


示例7: Copyright

# 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,代码行数:19,代码来源:run.py


示例8: dirname

#  -------

from vunit import VUnit, VUnitCLI

root = dirname(__file__)

# These lines add the option to specify the Bitvis Utility Library root directory
# from the command line (python run.py -b <path to my BVUL root>). They
# can be replaced by a single line, ui = VUnit.from_argv(), if you assign the root
# directory to the bvul_root variable directly
cli = VUnitCLI()
cli.parser.add_argument('-b', '--bvul-root',
                        required=True,
                        help='Bitvis Utility Library root directory')
args = cli.parse_args()
ui = VUnit.from_args(args)
# ------

# Create VHDL libraries and add the related BVUL files to these
bvul_root = args.bvul_root

bvul_lib = ui.add_library('bitvis_util')
bvul_lib.add_source_files(join(bvul_root, 'bitvis_util', 'src2008', '*.vhd'))

bitvis_vip_spi_lib = ui.add_library('bitvis_vip_sbi')
bitvis_vip_spi_lib.add_source_files(join(bvul_root, 'bitvis_vip_sbi', 'src', '*.vhd'))

# Add all testbenches to lib
lib = ui.add_library('lib')
lib.add_source_files(join(root, 'test', '*.vhd'))
开发者ID:jonasalowersson,项目名称:vunit,代码行数:30,代码来源:run.py


示例9: Copyright

# 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,代码行数:31,代码来源:run.py


示例10: VUnitCLI

# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

from collections import OrderedDict
import os.path
from fusesoc.config import Config
from fusesoc.coremanager import CoreManager, DependencyError
from vunit import VUnitCLI, VUnit

cli = VUnitCLI()
cli.parser.add_argument('--core', nargs=1, required=True, help='Top-level FuseSoC core')
args = cli.parse_args()

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

top_core = args.core[0]

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

#Add core libraries that were picked up from fusesoc.conf by the config handler
#Not really necessary for this example as we can just add 'corelib' manually
try:
    #cm.add_cores_root(config.cores_root)
    cm.add_cores_root('corelib')
except (RuntimeError, IOError) as e:
    pr_warn("Failed to register cores root '{}'".format(str(e)))
开发者ID:olofk,项目名称:fusesoc_vunit_demo,代码行数:31,代码来源:run_vunit.py


示例11: Copyright

# 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,代码行数:21,代码来源:print_compile_order.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python dependency_graph.DependencyGraph类代码示例发布时间:2022-05-26
下一篇:
Python utils.http_request_full函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap