Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing hs gcc linux full system fails #88

Open
luismgsilva opened this issue Oct 25, 2022 · 3 comments
Open

Testing hs gcc linux full system fails #88

luismgsilva opened this issue Oct 25, 2022 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@luismgsilva
Copy link
Member

Im having a issue when testing the hs gcc linux on full system. This problem doesn't happen every time. Yesterday with the same configuration i managed to execute the tests, but later on i was not able to. The issue is the following:

qemu-system-arc: ../../sources/qemu/target/arc/translate.c:378: arc_map_opcode: Assertion `"This should not happen" == 0' failed.

To build the toolchain i used the following command.

  • /scratch/luiss/builder/sources/hs-gnu-toolchain/configure --prefix=/scratch/luiss/builder/install/arc_gcc_linux/20221024 --target=arc --enable-linux ; make -j32

I module loaded the the toolchain build.
I executed qemu with a linux image with the following command.

  • qemu-system-arc -M virt -cpu archs -nographic -no-reboot -netdev user,id=net0,hostfwd=tcp:127.0.0.1:7005-:21,hostfwd=tcp:127.0.0.1:7006-:23 -device virtio-net-device,netdev=net0 -kernel /scratch/luiss/testing/test/.bsf/.config/images/vmlinux

To execute the test I used the following command to make the connection and run the test itself

  • QEMU_HOME=`dirname $(dirname $ (which qemu-system-arc))` ARC_MULTILIB_OPTIONS='cpu=archs' TARGET_TELNET_PORT=7006 TARGET_FTP_PORT=7005 runtest dg.exp

The JSON Format bellow represents all the versions used in the current execution.

{
    "hs-gcc-linux-qemu": {
        "arc_gcc_linux": {
		    "build_date": "2022-10-24 18:05:01",
			"hs-gnu-toolchain": {
				"repo": "https://github.com/foss-for-synopsys-dwc-arc-processors/arc-gnu-toolchain",
				"branch": "hs_testing",
				"hash": "3d2e8b8dc03c7358b029f3f357dc3895e97a6a25"
			},
			"gcc": {
				"branch": "arc64",
				"hash": "94ee2463f3e984d8358c07239a454ad04fc8a9af"
			},
			"binutils-gdb": {
				"branch": "arc64",
				"hash": "aee19ba3712d69584a72171173e2311c17602074"
			},
			"glibc": {
				"hash": "c804cd1c00adde061ca51711f63068c103e94eef"
			}
		},
        "qemu": {
            "build_date": "2022-10-25 11:39:09",
            "qemu": {
                "repo": "https://github.com/foss-for-synopsys-dwc-arc-processors/qemu",
                "branch": "master",
                "hash": "7e8b35790946799be6884852377373c179434a5a"
            }
        },
        "gcc": {
            "build_date": "2022-10-25 11:47:39",
            "gcc": {
                "repo": "https://github.com/foss-for-synopsys-dwc-arc-processors/gcc.git",
                "branch": "arc64",
                "hash": "94ee2463f3e984d8358c07239a454ad04fc8a9af"
            }
        },
        "toolchain": {
            "build_date": "2022-10-25 11:47:39",
            "toolchain": {
                "repo": "https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain.git",
                "branch": "arc-dev",
                "hash": "5d003ee694dc8df69361243cc14434cf897c3b8e"
            }
        }
    }
}
@abrodkin abrodkin added the bug Something isn't working label Oct 25, 2022
@pavelvkozlov
Copy link

Hi @luiss-synopsys,

I also faced this issue when I configured toolchain without the option--with-cpu=archs.

@cupertinomiranda
Copy link

This is no QEMU issue.
So far, QEMU does not implement hs38 instructions, which is the default cpu on hs toolchain.

If there is something to be done from QEMU on this front is to better verify elf headers to properly bail out.

@luiss-synopsys I already mentioned that the problem here is the ARC_MULTILIB_OPTIONS='cpu=archs' which is not properly setting multilib to compile with archs cpu. If I am not mistaken, it should be ARC_MULTILIB_OPTIONS='-mcpu=archs'.
The alternative is to change the default when building the toolchain to archs, like @pavelvkozlov suggests. However, IMO it makes more sense to use the default untouched and properly set the cpu in DejaGNU environment. This will allow you to switch the cpu target in the testing environment without recompiling the toolchain.

@claziss
Copy link
Contributor

claziss commented Oct 26, 2022

The error due to unsupported instructions. ARC QEMU is qualified to work for next CPU configurations:

  • ARCv2: archs or lower spec
  • ARCv3: hs5x
  • ARCv3: hs6x

Now, when you work with a full system simulation you need to make sure that:

  1. the GNU toolchain is targeted for one of the above CPUs
  2. the Linux image is compiled for one of the above CPUs
  3. the tests are using one of the above CPUs

Most probably, one of the above doesn't match.

@claziss claziss added documentation Improvements or additions to documentation enhancement New feature or request and removed bug Something isn't working labels Oct 26, 2022
@luismgsilva luismgsilva self-assigned this Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants