-
Notifications
You must be signed in to change notification settings - Fork 11
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
Question about RVV instruction throughput #13
Comments
Hi @zhongjuzhe, if you click on "Example measurement code for vadd.vx" you can see an example of what code I use to measure throughput. To use this repo your self you need to:
Since the linux has disabled user level performance counter access in later versions you need to re enable them:
If you are on a more obscure platform you may need to modify I'll try to update the README soon, and add a wiki page for instructions on different configurations. Please tell me if you still run into problems. |
Is is possible to run intructions/rvv in baremetal ? I tried this following command: but failed to compile it with several undefined referenced: undefined reference to 'bench_types'. etc |
Yes it is, you'll have to replace the Your command doesn't work, because you also need to preprocess (with m4) and build main.S, just look at how the Makefile does it. I'll add some examples this weekend, including one for running baremetal on the t1 rtl simulation. That should help. |
I've updated the README, but didn't get to writing the wiki, because the new t1 image doesn't work as expected. I'll create it once that has been fixed. For now, here is how I build the baremetal benchmark for it before. You should already have a linker configuration and entry point if you run on bare metal, so use those instead of the t1 specific ones here. # config.mk
WARN=-Wall -Wextra -Wno-unused-function -Wno-unused-parameter
CC=clang
CFLAGS=--target=riscv32 -march=rv32gc_zve32f -mabi=ilp32 -mno-relax -static -mcmodel=medany -fvisibility=hidden -nostdlib -fno-builtin -ffreestanding -fno-PIC ${WARN} -T /t1.ld /t1_main.S -DCUSTOM_HOST -DREAD_MCYCLE # t1_main.S
# from: https://github.com/chipsalliance/t1/blob/master/tests/t1_main.S
.globl _start
_start:
li a0, 0x2200 # VS&FS
csrs mstatus, a0
csrwi vcsr, 0
#csrwi mcounteren,7
li a0, -8
csrw mcountinhibit,a0
#csrr a0, mcycle
la sp, __stacktop
// no ra to save
call nolibc_start
// exit
li a0, 0x10000000
li a1, -1
sw a1, 4(a0)
csrwi 0x7cc, 0
.p2align 2
// nolibc.h
...
#ifdef CUSTOM_HOST
#define IFHOSTED(...)
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
/* customize me */
// output to t1 uart
static void
memwrite(void const *ptr, size_t len) {
struct uartlite_regs {
unsigned int rx_fifo;
unsigned int tx_fifo;
unsigned int status;
unsigned int control;
};
volatile struct uartlite_regs *const ttyUL0 = (struct uartlite_regs *)0x10000000;
unsigned char *p = ptr;
while (len--) {
while (ttyUL0->status & (1<<3));
ttyUL0->tx_fifo = *p++;
}
}
// static size_t /* only needed for vector-utf/bench.c */
// memread(void *ptr, size_t len) { }
static void
exit(int x) { __asm volatile("unimp\n"); }
int main(void);
void nolibc_start(void) {
int x = main();
flush();
}
#elif __STDC_HOSTED__
... |
Is it possible to disable FP16 vector testcase ? |
Yes, they shouldn't be enabled default. rvv/config.h should exclude them with the mask by default, but maybe I've missed something. Can you share after which instruction you get an illegal instruction/where the problem is? |
Hi, I saw each RVV instruction throughput result here:
https://camel-cdr.github.io/rvv-bench-results/bpi_f3/index.html
If I want to test the execution throughput of each RVV instructions in other RISC-V board, could you give me guides ?
And I wonder whether how you measure the execution throughput ?
Thanks,
The text was updated successfully, but these errors were encountered: