Ejemplo n.º 1
0
 def test_artificial_verilog(self):
     self.check(self.artificial_run_verilog, exit_code=1)
     check_report(
         self.report_file,
         [
             ("passed", "lib.tb_other_file_tests.pass"),
             ("failed", "lib.tb_other_file_tests.fail"),
             ("passed", "lib.tb_magic_paths.Test magic paths are correct"),
             ("passed", "lib.tb_with_define.test 1"),
             ("failed", "lib.tb_fail_on_warning.fail"),
             ("failed", "lib.tb_fail_on_fatal_and_early_finish.fatal0"),
             ("failed", "lib.tb_fail_on_fatal_and_early_finish.fatal1"),
             ("failed", "lib.tb_fail_on_fatal_and_early_finish.finish0"),
             ("failed", "lib.tb_fail_on_fatal_and_early_finish.finish1"),
             ("passed", "lib.tb_with_parameter_config.Test 0"),
             ("passed", "lib.tb_with_parameter_config.cfg.Test 1"),
             ("passed", "lib.tb_with_parameter_config.Test 2"),
             ("passed", "lib.tb_with_parameter_config.cfg.Test 3"),
             ("passed", "lib.tb_with_parameter_config.cfg.Test 4"),
             ("passed", "lib.tb_same_sim_all_pass.cfg.Test 1"),
             ("passed", "lib.tb_same_sim_all_pass.cfg.Test 2"),
             ("passed", "lib.tb_same_sim_all_pass.cfg.Test 3"),
             ("passed", "lib.tb_same_sim_some_fail.Test 1"),
             ("failed", "lib.tb_same_sim_some_fail.Test 2"),
             ("skipped", "lib.tb_same_sim_some_fail.Test 3"),
             ("passed", "lib.tb_with_runner.pass"),
             ("failed", "lib.tb_with_runner.fail"),
         ],
     )
Ejemplo n.º 2
0
 def _test_artificial(self, args=None):
     """
     Utility function to run and check the result of all test benches
     using either persistent or non-persistent simulator interface mode
     """
     self.check(self.artificial_run_vhdl, exit_code=1, args=args)
     check_report(self.report_file, EXPECTED_REPORT)
Ejemplo n.º 3
0
 def test_verilog_ams_example(self):
     self.check(ROOT / "examples" / "verilog" / "verilog_ams" / "run.py")
     check_report(
         self.report_file,
         [
             ("passed", "lib.tb_dut.Test that pass"),
             ("failed", "lib.tb_dut.Test that fail"),
         ],
     )
Ejemplo n.º 4
0
 def test_vhdl_composite_generics_example_project(self):
     self.check(ROOT / "examples/vhdl/composite_generics/run.py")
     check_report(
         self.report_file,
         [
             ("passed", "tb_lib.tb_composite_generics.VGA.Test 1"),
             ("passed", "tb_lib.tb_composite_generics.tiny.Test 1"),
         ],
     )
Ejemplo n.º 5
0
 def test_vhdl_composite_generics_example_project(self):
     self.check(
         join(ROOT, "examples", "vhdl", "composite_generics", "run.py"))
     check_report(
         self.report_file,
         [
             ("passed", "tb_lib.tb_composite_generics.VGA.Test 1"),
             ("passed", "tb_lib.tb_composite_generics.tiny.Test 1"),
         ],
     )
Ejemplo n.º 6
0
 def test_vhdl_user_guide_example_project(self):
     self.check(ROOT / "examples/vhdl/user_guide/run.py", exit_code=1)
     check_report(
         self.report_file,
         [
             ("passed", "lib.tb_example.all"),
             ("passed", "lib.tb_example_many.test_pass"),
             ("failed", "lib.tb_example_many.test_fail"),
         ],
     )
Ejemplo n.º 7
0
 def test_vhdl_user_guide_example_project(self):
     self.check(join(ROOT, "examples", "vhdl", "user_guide", "run.py"),
                exit_code=1)
     check_report(
         self.report_file,
         [
             ("passed", "lib.tb_example.all"),
             ("passed", "lib.tb_example_many.test_pass"),
             ("failed", "lib.tb_example_many.test_fail"),
         ],
     )
Ejemplo n.º 8
0
    def _test_run_selected_tests_in_same_sim_test_bench(self, run_file):
        """
        Run selected "same_sim" test in isolation
        """
        self.check(run_file, exit_code=0, clean=True, args=["*same_sim_some_fail*Test 1*"])
        check_report(self.report_file, [("passed", "lib.tb_same_sim_some_fail.Test 1")])

        self.check(run_file, exit_code=1, clean=False, args=["*same_sim_some_fail*Test 2*"])
        check_report(self.report_file, [("failed", "lib.tb_same_sim_some_fail.Test 2")])

        self.check(run_file, exit_code=0, clean=False, args=["*same_sim_some_fail*Test 3*"])
        check_report(self.report_file, [("passed", "lib.tb_same_sim_some_fail.Test 3")])

        self.check(
            run_file,
            exit_code=1,
            clean=False,
            args=["*same_sim_some_fail*Test 2*", "*same_sim_some_fail*Test 3*"],
        )
        check_report(
            self.report_file,
            [
                ("failed", "lib.tb_same_sim_some_fail.Test 2"),
                ("skipped", "lib.tb_same_sim_some_fail.Test 3"),
            ],
        )
Ejemplo n.º 9
0
 def test_vhdl_generate_tests_example_project(self):
     self.check(ROOT / "examples" / "vhdl" / "generate_tests" / "run.py")
     check_report(
         self.report_file,
         [
             ("passed", "lib.tb_generated.data_width=1,sign=False.Test 1"),
             ("passed", "lib.tb_generated.data_width=1,sign=True.Test 1"),
             ("passed", "lib.tb_generated.data_width=2,sign=False.Test 1"),
             ("passed", "lib.tb_generated.data_width=2,sign=True.Test 1"),
             ("passed", "lib.tb_generated.data_width=3,sign=False.Test 1"),
             ("passed", "lib.tb_generated.data_width=3,sign=True.Test 1"),
             ("passed", "lib.tb_generated.data_width=4,sign=False.Test 1"),
             ("passed", "lib.tb_generated.data_width=4,sign=True.Test 1"),
             ("passed", "lib.tb_generated.data_width=16,sign=True.Test 2"),
         ],
     )
Ejemplo n.º 10
0
 def test_vhdl_run_example_project(self):
     self.check(str(ROOT / "examples" / "vhdl" / "run" / "run.py"),
                exit_code=1)
     check_report(
         self.report_file,
         [
             ("passed", "lib.tb_with_watchdog.Test to_string for boolean"),
             ("passed",
              "lib.tb_with_watchdog.Test that needs longer timeout"),
             ("passed", "lib.tb_standalone.Test to_string for boolean"),
             ("passed",
              "lib.tb_with_test_cases.Test to_string for integer"),
             ("passed",
              "lib.tb_with_test_cases.Test to_string for boolean"),
             ("passed", "lib.tb_with_lower_level_control.Test something"),
             ("passed",
              "lib.tb_with_lower_level_control.Test something else"),
             ("passed", "lib.tb_running_test_case.Test scenario A"),
             ("passed", "lib.tb_running_test_case.Test scenario B"),
             ("passed", "lib.tb_running_test_case.Test something else"),
             ("passed", "lib.tb_minimal.all"),
             ("passed", "lib.tb_magic_paths.all"),
             ("failed", "lib.tb_with_watchdog.Test that stalls"),
             (
                 "failed",
                 "lib.tb_with_watchdog.Test that stalling processes can inform why they caused a timeout",
             ),
             (
                 "failed",
                 "lib.tb_counting_errors.Test that fails multiple times but doesn't stop",
             ),
             (
                 "failed",
                 "lib.tb_standalone.Test that fails on VUnit check procedure",
             ),
             ("failed",
              "lib.tb_many_ways_to_fail.Test that fails on an assert"),
             (
                 "failed",
                 "lib.tb_many_ways_to_fail.Test that crashes on boundary problems",
             ),
             (
                 "failed",
                 "lib.tb_many_ways_to_fail.Test that fails on VUnit check procedure",
             ),
         ],
     )
Ejemplo n.º 11
0
 def test_verilog_user_guide_example_project(self):
     self.check(ROOT / "examples/verilog/user_guide/run.py", exit_code=1)
     check_report(
         self.report_file,
         [
             ("passed", "lib.tb_example_basic.all"),
             ("passed", "lib.tb_example.Test that a successful test case passes"),
             (
                 "failed",
                 "lib.tb_example.Test that a failing test case actually fails",
             ),
             (
                 "failed",
                 "lib.tb_example.Test that a test case that takes too long time fails with a timeout",
             ),
         ],
     )
Ejemplo n.º 12
0
 def test_vhdl_third_party_integration_example_project(self):
     self.check(
         ROOT / "examples/vhdl/third_party_integration/run.py",
         exit_code=1,
     )
     check_report(
         self.report_file,
         [
             ("passed", "lib.tb_external_framework_integration.Test that pass"),
             (
                 "failed",
                 "lib.tb_external_framework_integration.Test that stops the simulation on first error",
             ),
             (
                 "failed",
                 "lib.tb_external_framework_integration.Test that doesn't stop the simulation on error",
             ),
         ],
     )
Ejemplo n.º 13
0
    def test_artificial_elaborate_only(self):
        self.check(self.artificial_run_vhdl, exit_code=1, args=["--elaborate"])

        elab_expected_report = []
        for status, name in EXPECTED_REPORT:
            if name in ("lib.tb_elab_fail.all", ):
                status = "failed"
            else:
                status = "passed"
            elab_expected_report.append((status, name))

        check_report(self.report_file, elab_expected_report)

        self.check(
            self.artificial_run_vhdl,
            exit_code=0,
            clean=False,
            args=["--elaborate", "lib.tb_pass.all"],
        )
        check_report(self.report_file, [("passed", "lib.tb_pass.all")])

        self.check(
            self.artificial_run_vhdl,
            exit_code=1,
            clean=False,
            args=["--elaborate", "lib.tb_elab_fail.all"],
        )
        check_report(self.report_file, [("failed", "lib.tb_elab_fail.all")])