Commit 4364329e authored by Alexander Shabarshin's avatar Alexander Shabarshin

output counters

parent 5ebda7ca
......@@ -1908,11 +1908,13 @@ int main(int argc, char** argv)
return 1;
}
for(uint32_t u=0;u<RAM_SIZE;u++) ram[u]=0;
#ifdef DEBUG_EXTRA
init_stats();
#endif
for(uint32_t u=0;u<RAM_SIZE;u++) ram[u]=0;
/* open ELF file */
elf_version(EV_CURRENT);
......@@ -2018,10 +2020,14 @@ int main(int argc, char** argv)
}
#endif
uint64_t ns1 = get_clock();
/* run program in emulator */
pc = ram_start;
riscv_cpu_interp_x32();
uint64_t ns2 = get_clock();
/* write signature */
if (signature_file) {
FILE* sf = fopen(signature_file, "w");
......@@ -2041,5 +2047,12 @@ int main(int argc, char** argv)
print_stats();
#endif
#if 1
printf("\n");
printf(">>> Instruction count: %llu\n",(long long unsigned)insn_counter);
printf(">>> Execution time: %llu ns\n",(long long unsigned)ns2-ns1);
printf(">>> Instructions per second: %llu\n",(long long)insn_counter*1000000000LL/(ns2-ns1));
printf("\n");
#endif
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment