Running QEMU with support for RISC-V Vector Extensions

204 views Asked by At

I am doing research for my thesis on a topic that requires running QEMU with support for the SVE format. My issue is that I cannot figure out how to find the matching versions of the various tools required, in order to even run the official RVV .s samples.

I have installed the gnu-toolchain for RISC-V and installed the Linux cross-compiler, since I am running everything on an Ubuntu 22.04 Linux WSL VM.

I have also followed their instructions on building LLVM so that I can build RISC-V programs. Furthermore, I have downloaded and installed QEMU v.6.2.0 for the riscv64 architecture.

After doing lots of research on the appropriate instructions for compiling an RVV sample and running it using QEMU, (here's the strcpy.s sample), I have landed on the following sequence of commands:

  1. Compiling the example assembly file into an object file using: riscv64-unknown-elf-as -o ~/sample.o ~/rv_strcpy.s -march=rv64gc_zve64x
  2. Generating the executable file to be loaded on QEMU using: riscv64-unknown-elf-ld -o ~/sample ~/sample.o
  3. Finally, running the executable using: qemu-riscv64 -cpu rv64,x-v=true,vlen=256,elen=64,vext_spec=0.7.1 ~/sample

This, however, leads to an “unsupported” spec error after which, I cannot figure out a compatible spec version. After removing the vext_spec argument, the execution terminates with an “Illegal Instruction” error.

Does anyone have any tips on how to proceed from here? Am I missing something, am I on the right track, or am I completely lost in my workflow?

0

There are 0 answers