Need help for building SPIKE RISC-V simulator with vector extension

37 views
Skip to first unread message

Boul chandra Garai

unread,
Jun 15, 2024, 4:53:32 AM (5 days ago) Jun 15
to RISC-V SW Dev
Hi folks, I am new to the RISC-V community. I am exploring RISC-V vector for my research works. I tried to build riscv-gnu toolchain from https://github.com/riscv-collab/riscv-gnu-toolchain and I used the ../configure --prefix=$RISCV --with-arch=rv64gcv --with-abi=lp64d, but when I am trying to compile a simple .c file containing program for risc-v vector addition as follows: 
'''''''
#include <riscv_vector.h>

int main() {
    vint32m1_t va = vzero_i32m1();
    return 0;
}
'''''''
when I am trying to compile the code using the command $RISCV/bin/riscv64-unknown-elf-gcc -o riscv_vector.o riscv_vector.c -march=rv64gcv -mabi=lp64d,
throwing the following error: 
riscv-vector.c: In function 'main':
riscv-vector.c:4:21: warning: implicit declaration of function 'vzero_i32m1' [-Wimplicit-function-declaration]
    4 |     vint32m1_t va = vzero_i32m1();
      |                     ^~~~~~~~~~~
riscv-vector.c:4:21: error: incompatible types when initializing type 'vint32m1_t' using type 'int'

I am not able to understand if the install is done properly. 
Can you please help me and provide me the steps to follow while building the riscv-gnu-toolchain with vector extension?
Thanking you in antipicipation.

Tommy Murphy

unread,
Jun 15, 2024, 5:33:09 AM (5 days ago) Jun 15
to Boul chandra Garai, RISC-V SW Dev
The error is telling you exactly what is wrong:

> riscv-vector.c:4:21: warning: implicit declaration of function 'vzero_i32m1' [-Wimplicit-function-declaration]

There is no declaration for that function.
In particular there is none in riscv_vector.h

At a glance I can't find any reference to vzero_i32m1() online.
What is it?
Is it part of your own code?
Reply all
Reply to author
Forward
0 new messages