本文将介绍RISV-V性能测试过程中常用的一些方式
RTC Timer
RISC-V Core中有一个Real time clock timer (mcycle),使用方式如下:1
2
3
4
5
6
7
8
9
10
11
12
13
14/* Defines to access CSR registers within C code */
asm volatile ("csrr %0, " #reg : "=r"(__tmp)); \
__tmp; })
asm volatile ("csrw " #reg ", %0" :: "rK"(val)); })
// Clear timer
write_csr(mcycle, 0);
VVDRV_qtm_setTestResult(result);
// Get MCYCLE