Skip to content

Commit

Permalink
Print MMU cache hit/miss counters at end
Browse files Browse the repository at this point in the history
  • Loading branch information
onnokort committed Aug 24, 2023
1 parent a383578 commit 4818412
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,18 @@ static int semu_start(int argc, char **argv)
if (emu.vblk.InterruptStatus)
emu_update_vblk_interrupts(&vm);
#endif
if (cycle_limit && vm.insn_count >= cycle_limit) exit(0);
if (cycle_limit && vm.insn_count >= cycle_limit) {
#if MMU_CACHE_COUNTERS
printf("\n");
printf("fetch hits: %12ld, misses: %12ld\n",
vm.mmu_cache_fetch_ctx.hits, vm.mmu_cache_fetch_ctx.misses);
printf(" load hits: %12ld, misses: %12ld\n",
vm.mmu_cache_load_ctx.hits, vm.mmu_cache_load_ctx.misses);
printf("store hits: %12ld, misses: %12ld\n",
vm.mmu_cache_store_ctx.hits, vm.mmu_cache_store_ctx.misses);
#endif
exit(0);
}
}

if (vm.insn_count_hi > emu.timer_hi ||
Expand Down

0 comments on commit 4818412

Please sign in to comment.