This commit is contained in:
2025-09-23 13:44:14 +03:00
commit a84b8fcfde
91 changed files with 88177 additions and 0 deletions

13
FIRMWARE/test_rdcycle.c Normal file
View 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));
}