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


Python Project.add_file方法代码示例

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


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

示例1: testFileSet

# 需要导入模块: from chiptools.core.project import Project [as 别名]
# 或者: from chiptools.core.project.Project import add_file [as 别名]
    def testFileSet(self):
        project = Project()

        expected_files = []
        for libname in self.project_structure.keys():
            files = self.project_structure[libname]
            for path in files:
                expected_files.append(os.path.basename(path))
                project.add_file(path, libname)

        self.assertEqual(
            sorted(expected_files),
            sorted([os.path.basename(f.path) for f in project.get_files()]),
        )
开发者ID:hoangt,项目名称:chiptools,代码行数:16,代码来源:testProjectFunctionality.py

示例2: for

# 需要导入模块: from chiptools.core.project import Project [as 别名]
# 或者: from chiptools.core.project.Project import add_file [as 别名]
# The constraints are added to the project using the add_constraints method.
# The optional 'flow' argument is used to explicitly identify which synthesis
# flow the constraints are intended for (the default is to infer supported
# flows from the file extension).
# project.add_constraints('axi_lite_slave_example.xdc', flow='vivado')

# Synthesis generics can be assigned via the add_generic command, in this
# example we set the data_Width generic to 32:
project.add_generic('data_width', 32)

# Source files for the component are added to the project. The Project
# 'add_file' method accepts a file path and library name, if no library is
# specified it will default to 'work'. Other file attributes are available but
# not covered in this example.
project.add_file('axi_lite_slave_example.v', library='lib_example')

# When adding the testbench file we supply a 'synthesise' attribute and set it
# to 'False', this tells the synthesis tool not to try to synthesise this file.
# If not specified, 'synthesise' will default to 'True'
project.add_file(
    'tb_axi_lite_slave_example.v',
    library='lib_tb_example',
    synthesise=False
)

if __name__ == '__main__':

    interactive = True  # Set True to load the ChipTools CLI

    if interactive:
开发者ID:kayws426,项目名称:axi-lite-gen,代码行数:32,代码来源:axi_lite_slave_example_project.py

示例3: for

# 需要导入模块: from chiptools.core.project import Project [as 别名]
# 或者: from chiptools.core.project.Project import add_file [as 别名]
# The constraints are added to the project using the add_constraints method.
# The optional 'flow' argument is used to explicitly identify which synthesis
# flow the constraints are intended for (the default is to infer supported
# flows from the file extension).
project.add_constraints('max_hold.xdc', flow='vivado')
project.add_constraints('max_hold.ucf', flow='ise')

# Synthesis generics can be assigned via the add_generic command, in this
# example we set the data_Width generic to 3:
project.add_generic('data_width', 3)

# Source files for the max_hold component are added to the project. The Project
# 'add_file' method accepts a file path and library name, if no library is
# specified it will default to 'work'. Other file attributes are available but
# not covered in this example.
project.add_file('max_hold.vhd', library='lib_max_hold')
project.add_file('pkg_max_hold.vhd', library='lib_max_hold')

# When adding the testbench file we supply a 'synthesise' attribute and set it
# to 'False', this tells the synthesis tool not to try to synthesise this file.
# If not specified, 'synthesise' will default to 'True'
project.add_file(
    'tb_max_hold.vhd',
    library='lib_tb_max_hold',
    synthesise=False
)

interactive = False

if interactive:
    # ChipTools provides a command line interface to allow you to perform
开发者ID:hoangt,项目名称:chiptools,代码行数:33,代码来源:max_hold_project.py


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