I am trying to measure performance of my app. Starting with a modified hello_world demo, I try to read the rdcycle counter as defined in RISC-V specification:
unsigned long read_cycles(void)
{
unsigned long cycles
asm volatile ("rdcycle %0" : "=r" (cycles));
return cycles;
}
However, the value is always zero. Looking at the CSR registers in my debugger, the csr3072 (0xC00) is zero during the entire run. What am I doing wrong?
Author
Posts
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic. Login here