Example #1
0
 def create_ui(self, test_patterns=None, persistent_sim=True):
     vhdl_path = join(dirname(__file__), "vhdl")
     ui = VUnit(verbose=True,
                clean=True,
                test_filter=make_test_filter(test_patterns),
                output_path=self.output_path,
                xunit_xml=self.report_file,
                persistent_sim=persistent_sim)
     ui.add_library("lib")
     ui.add_source_files(join(vhdl_path, "*.vhd"), "lib")
     return ui
Example #2
0
 def test_compile_verilog(self):
     verilog_path = join(dirname(__file__), "verilog")
     ui = VUnit(verbose=True,
                clean=True,
                output_path=self.output_path,
                xunit_xml=self.report_file,
                compile_only=True)
     ui.add_library("lib")
     ui.add_source_files(join(verilog_path, "*.v"), "lib")
     ui.add_source_files(join(verilog_path, "*.sv"), "lib")
     try:
         ui.main()
     except SystemExit as e:
         self.assertEqual(e.code, 0)
Example #3
0
    def _create_ui(self, *args):
        """ Create an instance of the VUnit public interface class """
        ui = VUnit.from_argv(argv=["--output-path=%s" % self._output_path, "--clean"] + list(args))
        ui.add_library("lib")

        factory = MockSimulatorFactory(self._output_path)
        self.mocksim = factory.mocksim
        ui._simulator_factory = factory  # pylint: disable=protected-access
        return ui
Example #4
0
    def run_sim(self, vhdl_standard):
        output_path = join(dirname(abspath(__file__)), 'string_ops_out')
        vhdl_path = join(dirname(abspath(__file__)), '..', 'vhdl')

        ui = VUnit(clean=True, 
                   output_path=output_path,
                   vhdl_standard=vhdl_standard,
                   compile_builtins=False)
        ui.add_library("lib")
        ui.add_builtins("vunit_lib", mock_lang=True)
        ui.add_source_files(join(vhdl_path, "string_ops", "test", "*.vhd"), "lib")

        try:
            ui.main()
        except SystemExit as e:            
            self.assertEqual(e.code, 0)
Example #5
0
    def run_sim(self, vhdl_standard):
        output_path = join(dirname(abspath(__file__)), 'array_out')
        src_path = join(dirname(abspath(__file__)), '..', 'vhdl', 'array')

        vu = VUnit(clean=True,
                   output_path=output_path,
                   vhdl_standard=vhdl_standard)

        vu.add_library("lib")
        vu.add_array_util("lib")
        vu.add_source_files(join(src_path, "test", "*.vhd"), "lib")

        try:
            vu.main()
        except SystemExit as e:
            self.assertEqual(e.code, 0)
Example #6
0
    def run_sim(self, vhdl_standard):
        output_path = join(dirname(abspath(__file__)), 'logging_out')
        vhdl_path = join(dirname(abspath(__file__)), '..', 'vhdl', 'logging')
        ui = VUnit(clean=True,
                   output_path=output_path,
                   vhdl_standard=vhdl_standard,
                   compile_builtins=False)
        
        ui.add_builtins('vunit_lib', mock_lang=True)            
        ui.enable_location_preprocessing()
        lib = ui.add_library('lib')
        lib.add_source_files(join(vhdl_path, "test", "tb_logging.vhd"))

        try:
            ui.main()
        except SystemExit as e:            
            self.assertEqual(e.code, 0)
Example #7
0
    def run_sim(self, vhdl_standard):
        output_path = join(dirname(abspath(__file__)), 'path_out')
        vhdl_path = join(dirname(abspath(__file__)), '..', 'vhdl')

        ui = VUnit(clean=True,
                   output_path=output_path,
                   vhdl_standard=vhdl_standard)
        ui.add_library("lib")
        ui.add_source_files(join(vhdl_path, "path", "test", "*.vhd"), "lib")

        try:
            ui.main()
        except SystemExit as e:            
            self.assertEqual(e.code, 0)
Example #8
0
 def _create_ui(self):
     """ Create an instance of the VUnit public interface class """
     ui = VUnit.from_argv(argv=["--output-path=%s" % self._output_path,
                                "--clean"])
     ui.add_library('lib')
     return ui
Example #9
0
 def test_can_add_non_ascii_encoded_files(self):
     ui = VUnit.from_argv(argv=["--output-path=%s" % self._output_path,
                                "--clean"])
     lib = ui.add_library('lib')
     lib.add_source_files(join(dirname(__file__), 'encoding', 'encoding.vhd'))
     lib.entity("encoding")  # Fill raise exception of not found
Example #10
0
 def _create_ui_real_sim(self, *args):
     """ Create an instance of the VUnit public interface class """
     return VUnit.from_argv(argv=["--output-path=%s" % self._output_path,
                                  "--clean"] + list(args),
                            compile_builtins=False)