riscv-software-src / riscv-pk

RISC-V Proxy Kernel
Other
596 stars 308 forks source link

errors when building #255

Closed PPParticle closed 2 years ago

PPParticle commented 3 years ago

I want to run riscv isa v extension in my computer. But I have encountered some errors.

riscv-gnu-toolchain

RISCV=/home/qiao_sh_pudong/RISCV/Bin/riscv64/
RISCV_BIN=$RISCV/bin/
RISCV_ELF=$RISCV/riscv64-unknown-elf/
QEMU_BIN=/home/qiao_sh_pudong/RISCV/Bin/qemu/bin/
LLVM_BIN=/home/qiao_sh_pudong/RISCV/Bin/llvm/bin/
PATH=$PATH:$RISCV:$RISCV_BIN:$RISCV_ELF:$RISCV_ELF/bin:$LLVM_BIN:$QEMU_BIN
$ git clone -b rvv-intrinsic https://github.com/riscv-collab/riscv-gnu-toolchain.git
$ git submodule update --init --recursive 
$ mkdir build
$ cd build
$ ../configure --prefix=$RISCV --with-arch=rv64gcv --with-abi=lp64d
$ sudo make -j6

riscv-pk

$ cd riscv-pk/
$ mkdir build
$ cd build/
$ ../configure --prefix=$RISCV --host=riscv64-unknown-elf --with-arch=rv64gcv
$ make
$ sudo make install

There is no something wrong when installing. But when I git riscv-v-spec and try to run the examples in it. Some mistakes occur. $ riscv64-unknown-elf-as --march=rv64gcv -o strcpy.o strcpy.s It shows that

strcpy.s: Assembler messages:
strcpy.s:9: Error: unrecognized opcode `vsetvli x0,t0,e8,m8,ta,ma'
strcpy.s:10: Error: unrecognized opcode `vle8ff.v v8,(a1)'
strcpy.s:11: Error: unknown CSR `vl'
strcpy.s:12: Error: unrecognized opcode `vmseq.vi v1,v8,0'
strcpy.s:13: Error: unrecognized opcode `vfirst.m a3,v1'
strcpy.s:15: Error: unrecognized opcode `vmsif.m v0,v1'
strcpy.s:16: Error: unrecognized opcode `vse8.v v8,(a2),v0.t'

There are several problems I want to know.

  1. Is there something wrong about my installation process?
  2. Do I use the right way to test the "v" extension? If I am wrong, how can I test?
peteralieber commented 2 years ago

I am not an expert, but I do know the GCC toolchain is not up to date for the vector extension. Therefore, most likely your issue is that the code generated by GCC is an old version of RVV and spike is using the latest v1.0