initial commit
This commit is contained in:
13
FIRMWARE/test_rdcycle.c
Normal file
13
FIRMWARE/test_rdcycle.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "perf.h"
|
||||
|
||||
int main() {
|
||||
for(int i=0; i<100; ++i) {
|
||||
uint64_t cycles = rdcycle();
|
||||
uint64_t instret = rdinstret();
|
||||
printf("i=%d cycles=%d instret=%d\n", i, (int)cycles, (int)instret);
|
||||
}
|
||||
uint64_t instret = rdinstret();
|
||||
uint64_t cycles = rdcycle();
|
||||
printf("cycles=%d instret=%d 100CPI=%d\n", (int)cycles, (int)instret, (int)(100*cycles/instret));
|
||||
|
||||
}
|
Reference in New Issue
Block a user