Skip to content

RISCV-V RVV Extension Support in Zephyr  #82131

@akifejaz

Description

@akifejaz

Describe the bug

I'm trying to test vector instructions, but it seems to give me error saying zephyr is unable to recognize the vector instructions.
west build -p always -b qemu_riscv64 samples/rvv_demo
image

To Reproduce

Steps to reproduce the behavior:

  1. git checkout afce532
  2. cp -r samples/hello_world/ samples/rvv_demo
  3. add below code in samples/rvv_demo/src/main.c

#include <stdio.h>
int main(void)
{
    // vector instructions 
    uint64_t addr = 256;
     __asm__ volatile (
    "li    x1, 0x200 \n\t"
    "csrs  mstatus, x1\n\t"
    "li    x1, 0x800005000 \n\t"
    "vsetvli x0,%0,e8,m1,ta,mu \n\t"
    "vle32.v v0, (x1)\n\t"
    :: "r"(addr)
    );

	return 0;
}
  1. proj.config as below
CONFIG_BOOT_BANNER=n
CONFIG_GNU_C_EXTENSIONS=y
CONFIG_GEN_IRQ_VECTOR_TABLE=y
CONFIG_GEN_SW_ISR_TABLE=y
CONFIG_RISCV_VECTORED_MODE=y
  1. west build -p always -b qemu_riscv64 samples/rvv_demo

Is there something I'm missing in configuration? I'm not sure but what I could find I tried to enable like mainly CONFIG_RISCV_VECTORED_MODE.
Is there no RISCV-V (vector instructions) support in Zephyr or in Zephyr-SDK ? Since I tried the same for scalar instructions that works fine.

Please help me in this regard, like if its enabled is there anything else I've to configured.
Best,
Akif

Metadata

Metadata

Labels

Feature RequestA request for a new featurearea: RISCVRISCV Architecture (32-bit & 64-bit)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions