コード例 #1
0
    def test_compile_project_extra_flags(self, check_output):
        simif = GHDLInterface(prefix="prefix", output_path="")
        write_file("file.vhd", "")

        project = Project()
        project.add_library("lib", "lib_path")
        source_file = project.add_source_file("file.vhd",
                                              "lib",
                                              file_type="vhdl")
        source_file.set_compile_option("ghdl.flags", ["custom", "flags"])
        simif.compile_project(project)
        check_output.assert_called_once_with(
            [
                join("prefix", "ghdl"),
                "-a",
                "--workdir=lib_path",
                "--work=lib",
                "--std=08",
                "-Plib_path",
                "custom",
                "flags",
                "file.vhd",
            ],
            env=simif.get_env(),
        )
コード例 #2
0
ファイル: test_ghdl_interface.py プロジェクト: cjchin/vunit
    def test_compile_project_93(self, check_output):  # pylint: disable=no-self-use
        simif = GHDLInterface(prefix="prefix", output_path="")
        write_file("file.vhd", "")

        project = Project()
        project.add_library("lib", "lib_path")
        project.add_source_file("file.vhd", "lib", file_type="vhdl", vhdl_standard=VHDL.standard("93"))
        simif.compile_project(project)
        check_output.assert_called_once_with(
            [join("prefix", 'ghdl'), '-a', '--workdir=lib_path', '--work=lib',
             '--std=93', '-Plib_path', 'file.vhd'], env=simif.get_env())
コード例 #3
0
    def test_compile_project_93(self, check_output):  # pylint: disable=no-self-use
        simif = GHDLInterface(prefix="prefix", output_path="")
        write_file("file.vhd", "")

        project = Project()
        project.add_library("lib", "lib_path")
        project.add_source_file("file.vhd", "lib", file_type="vhdl", vhdl_standard="93")
        simif.compile_project(project)
        check_output.assert_called_once_with(
            [join("prefix", 'ghdl'), '-a', '--workdir=lib_path', '--work=lib',
             '--std=93', '-Plib_path', 'file.vhd'], env=simif.get_env())
コード例 #4
0
ファイル: test_ghdl_interface.py プロジェクト: cjchin/vunit
    def test_compile_project_extra_flags(self, check_output):  # pylint: disable=no-self-use
        simif = GHDLInterface(prefix="prefix", output_path="")
        write_file("file.vhd", "")

        project = Project()
        project.add_library("lib", "lib_path")
        source_file = project.add_source_file("file.vhd", "lib", file_type="vhdl")
        source_file.set_compile_option("ghdl.flags", ["custom", "flags"])
        simif.compile_project(project)
        check_output.assert_called_once_with(
            [join("prefix", 'ghdl'), '-a', '--workdir=lib_path', '--work=lib', '--std=08',
             '-Plib_path', 'custom', 'flags', 'file.vhd'], env=simif.get_env())
コード例 #5
0
    def test_compile_project_extra_flags(self, check_output):  # pylint: disable=no-self-use
        simif = GHDLInterface(prefix="prefix", output_path="")
        write_file("file.vhd", "")

        project = Project()
        project.add_library("lib", "lib_path")
        source_file = project.add_source_file("file.vhd", "lib", file_type="vhdl")
        source_file.set_compile_option("ghdl.flags", ["custom", "flags"])
        simif.compile_project(project)
        check_output.assert_called_once_with(
            [join("prefix", 'ghdl'), '-a', '--workdir=lib_path', '--work=lib', '--std=08',
             '-Plib_path', 'custom', 'flags', 'file.vhd'], env=simif.get_env())
コード例 #6
0
    def test_compile_project_2002(self, run_command):  # pylint: disable=no-self-use
        simif = GHDLInterface(prefix="prefix")
        write_file("file.vhd", "")

        project = Project()
        project.add_library("lib", "lib_path")
        project.add_source_file("file.vhd",
                                "lib",
                                file_type="vhdl",
                                vhdl_standard="2002")
        simif.compile_project(project)
        run_command.assert_called_once_with([
            join("prefix", 'ghdl'), '-a', '--workdir=lib_path', '--work=lib',
            '--std=02', '-Plib_path', 'file.vhd'
        ],
                                            env=simif.get_env())
コード例 #7
0
    def test_compile_project_93(self, check_output):
        simif = GHDLInterface(prefix="prefix", output_path="")
        write_file("file.vhd", "")

        project = Project()
        project.add_library("lib", "lib_path")
        project.add_source_file("file.vhd",
                                "lib",
                                file_type="vhdl",
                                vhdl_standard=VHDL.standard("93"))
        simif.compile_project(project)
        check_output.assert_called_once_with(
            [
                join("prefix", "ghdl"),
                "-a",
                "--workdir=lib_path",
                "--work=lib",
                "--std=93",
                "-Plib_path",
                "file.vhd",
            ],
            env=simif.get_env(),
        )