本文整理汇总了Python中vunit.project.Project.update方法的典型用法代码示例。如果您正苦于以下问题:Python Project.update方法的具体用法?Python Project.update怎么用?Python Project.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vunit.project.Project
的用法示例。
在下文中一共展示了Project.update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestProject
# 需要导入模块: from vunit.project import Project [as 别名]
# 或者: from vunit.project.Project import update [as 别名]
#.........这里部分代码省略.........
self.project.add_library("lib2", "lib2_path")
foo_arch = self.add_source_file("lib1", "foo_arch.vhd", """
architecture arch of foo is
begin
end architecture;
""")
foo1_ent = self.add_source_file("lib1", "foo1_ent.vhd", """
entity foo is
port (signal bar : boolean);
end entity;
""")
self.add_source_file("lib2", "foo2_ent.vhd", """
entity foo is
end entity;
""")
self.assert_compiles(foo1_ent, before=foo_arch)
def test_multiple_identical_file_names_with_different_path_in_same_library(self):
self.project.add_library("lib", "lib_path")
a_foo = self.add_source_file("lib", join("a", "foo.vhd"), """
entity a_foo is
end entity;
""")
b_foo = self.add_source_file("lib", join("b", "foo.vhd"), """
entity b_foo is
end entity;
""")
self.assert_should_recompile([a_foo, b_foo])
self.update(a_foo)
self.assert_should_recompile([b_foo])
self.update(b_foo)
self.assert_should_recompile([])
def test_finds_entity_architecture_dependencies(self):
self.project.add_library("lib", "lib_path")
entity = self.add_source_file("lib", "entity.vhd", """
entity foo is
end entity;
""")
arch1 = self.add_source_file("lib", "arch1.vhd", """
architecture arch1 of foo is
begin
end architecture;
""")
arch2 = self.add_source_file("lib", "arch2.vhd", """
architecture arch2 of foo is
begin
end architecture;
""")
self.assert_compiles(entity, before=arch1)
self.assert_compiles(entity, before=arch2)
def test_finds_package_dependencies(self):
self.project.add_library("lib", "lib_path")
package = self.add_source_file("lib", "package.vhd", """
package foo is
end package;
""")
示例2: TestProject
# 需要导入模块: from vunit.project import Project [as 别名]
# 或者: from vunit.project.Project import update [as 别名]
#.........这里部分代码省略.........
begin
end package body;
""")
self.assert_has_package("file1.vhd", "foo")
self.assert_has_package_body("file1.vhd", "foo")
def test_finds_entity_instantiation_dependencies(self):
self.create_dummy_three_file_project()
self.assert_compiles("file1.vhd", before="file2.vhd")
self.assert_compiles("file2.vhd", before="file3.vhd")
def test_primary_with_same_name_in_multiple_libraries_secondary_dependency(self):
self.project.add_library("lib1", "lib1_path")
self.project.add_library("lib2", "lib2_path")
self.add_source_file("lib1", "foo_arch.vhd", """
architecture arch of foo is
begin
end architecture;
""")
self.add_source_file("lib1", "foo1_ent.vhd", """
entity foo is
port (signal bar : boolean);
end entity;
""")
self.add_source_file("lib2", "foo2_ent.vhd", """
entity foo is
end entity;
""")
self.update("foo_arch.vhd")
self.update("foo1_ent.vhd")
self.update("foo2_ent.vhd")
self.assert_should_recompile([])
tick()
self.update("foo1_ent.vhd")
self.assert_should_recompile(["foo_arch.vhd"])
def test_multiple_identical_file_names_with_different_path_in_same_library(self):
self.project.add_library("lib", "lib_path")
self.add_source_file("lib", join("a", "foo.vhd"), """
entity a_foo is
end entity;
""")
self.add_source_file("lib", join("b", "foo.vhd"), """
entity b_foo is
end entity;
""")
self.assert_should_recompile([join("a", "foo.vhd"), join("b", "foo.vhd")])
self.update(join("a", "foo.vhd"))
self.update(join("b", "foo.vhd"))
self.assert_should_recompile([])
def test_finds_entity_architecture_dependencies(self):
self.project.add_library("lib", "lib_path")
self.add_source_file("lib", "entity.vhd", """
entity foo is
end entity;
""")
self.add_source_file("lib", "arch1.vhd", """
示例3: TestProject
# 需要导入模块: from vunit.project import Project [as 别名]
# 或者: from vunit.project.Project import update [as 别名]
#.........这里部分代码省略.........
end package body;
""")
self.assert_has_package("file1.vhd", "foo")
self.assert_has_package_body("file1.vhd", "foo")
def test_finds_entity_instantiation_dependencies(self):
self.create_dummy_three_file_project()
self.assert_compiles_before("file1.vhd", before="file2.vhd")
self.assert_compiles_before("file2.vhd", before="file3.vhd")
def test_primary_with_same_name_in_multiple_libraries_secondary_dependency(self):
self.project.add_library("lib1", "lib1_path")
self.project.add_library("lib2", "lib2_path")
self.add_source_file("lib1", "foo_arch.vhd", """
architecture arch of foo is
begin
end architecture;
""")
self.add_source_file("lib1", "foo1_ent.vhd", """
entity foo is
port (signal bar : boolean);
end entity;
""")
self.add_source_file("lib2", "foo2_ent.vhd", """
entity foo is
end entity;
""")
self.update("foo_arch.vhd")
self.update("foo1_ent.vhd")
self.update("foo2_ent.vhd")
self.assert_should_recompile([])
self.stub.tick()
self.update("foo1_ent.vhd")
self.assert_should_recompile(["foo_arch.vhd"])
def test_multiple_identical_file_names_with_different_path_in_same_library(self):
self.project.add_library("lib", "lib_path")
self.add_source_file("lib", join("a", "foo.vhd"), """
entity a_foo is
end entity;
""")
self.add_source_file("lib", join("b", "foo.vhd"), """
entity b_foo is
end entity;
""")
self.assert_should_recompile([join("a", "foo.vhd"), join("b", "foo.vhd")])
self.update(join("a", "foo.vhd"))
self.update(join("b", "foo.vhd"))
self.assert_should_recompile([])
def test_finds_entity_architecture_dependencies(self):
self.project.add_library("lib", "lib_path")
self.add_source_file("lib", "entity.vhd", """
entity foo is
end entity;
""")
self.add_source_file("lib", "arch1.vhd", """