本文整理匯總了Python中chiptools.core.project.Project.add_constraints方法的典型用法代碼示例。如果您正苦於以下問題:Python Project.add_constraints方法的具體用法?Python Project.add_constraints怎麽用?Python Project.add_constraints使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類chiptools.core.project.Project
的用法示例。
在下文中一共展示了Project.add_constraints方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_constraints
# 需要導入模塊: from chiptools.core.project import Project [as 別名]
# 或者: from chiptools.core.project.Project import add_constraints [as 別名]
def test_constraints(self):
project = Project()
for constraints in self.project_constraints:
project.add_constraints(constraints, flow='dummy_flow')
constraints = project.get_constraints()
self.assertEquals(
len(constraints),
len(self.project_constraints),
msg='Incorrect number of constraints added to project.'
)
self.assertTrue(
len(constraints) > 0,
msg='Not correctly tested as no constraints are present.'
)
for idx in range(len(constraints)):
self.assertEquals(
constraints[idx].path,
os.path.abspath(self.project_constraints[idx]),
msg='Constraints path was incorrectly processed.'
)
示例2: for
# 需要導入模塊: from chiptools.core.project import Project [as 別名]
# 或者: from chiptools.core.project.Project import add_constraints [as 別名]
# The Project class provides an add_config or add_config_dict method. We use
# the add_config_dict method here to load the config dictionary, you can set
# individual configuration items using add_config.
project.add_config_dict(**config)
# Some unit tests have been written for the max_hold component and stored in
# max_hold_tests.py. The Project class provides an 'add_unittest' method for
# adding unit tests to the project, it expects a path to the unit test file.
project.add_unittest('max_hold_tests.py')
project.add_unittest('basic_unit_test.py')
# 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.