Skip to content

Commit 7f3f33b

Browse files
committed
Print MMU cache hit/miss counters at end
1 parent d9dd4c7 commit 7f3f33b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

main.c

+12-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,18 @@ static int semu_start(int argc, char **argv)
454454
if (emu.vblk.InterruptStatus)
455455
emu_update_vblk_interrupts(&vm);
456456
#endif
457-
if (cycle_limit && vm.insn_count >= cycle_limit) exit(0);
457+
if (cycle_limit && vm.insn_count >= cycle_limit) {
458+
#if MMU_CACHE_STATS
459+
printf("\n");
460+
printf("fetch hits: %12ld, misses: %12ld\n",
461+
vm.mmu_cache_fetch_ctx.hits, vm.mmu_cache_fetch_ctx.misses);
462+
printf(" load hits: %12ld, misses: %12ld\n",
463+
vm.mmu_cache_load_ctx.hits, vm.mmu_cache_load_ctx.misses);
464+
printf("store hits: %12ld, misses: %12ld\n",
465+
vm.mmu_cache_store_ctx.hits, vm.mmu_cache_store_ctx.misses);
466+
#endif
467+
exit(0);
468+
}
458469
}
459470

460471
if (vm.insn_count_hi > emu.timer_hi ||

0 commit comments

Comments
 (0)