ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp
(Generate patch)

Comparing SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp (file contents):
Revision 1.43 by gbeauche, 2004-05-31T10:08:31Z vs.
Revision 1.45 by gbeauche, 2004-06-22T14:18:35Z

# Line 52 | Line 52
52   #include "debug.h"
53  
54   // Emulation time statistics
55 < #define EMUL_TIME_STATS 1
55 > #ifndef EMUL_TIME_STATS
56 > #define EMUL_TIME_STATS 0
57 > #endif
58  
59   #if EMUL_TIME_STATS
60   static clock_t emul_start_time;
61 < static uint32 interrupt_count = 0;
61 > static uint32 interrupt_count = 0, ppc_interrupt_count = 0;
62   static clock_t interrupt_time = 0;
63   static uint32 exec68k_count = 0;
64   static clock_t exec68k_time = 0;
# Line 596 | Line 598 | sheepshaver_cpu::interrupt_context::~int
598   void sheepshaver_cpu::interrupt(uint32 entry)
599   {
600   #if EMUL_TIME_STATS
601 <        interrupt_count++;
601 >        ppc_interrupt_count++;
602          const clock_t interrupt_start = clock();
603   #endif
604  
# Line 988 | Line 990 | void exit_emul_ppc(void)
990          printf("Total emulation time : %.1f sec\n", double(emul_time) / double(CLOCKS_PER_SEC));
991          printf("Total interrupt count: %d (%2.1f Hz)\n", interrupt_count,
992                     (double(interrupt_count) * CLOCKS_PER_SEC) / double(emul_time));
993 +        printf("Total ppc interrupt count: %d (%2.1f %%)\n", ppc_interrupt_count,
994 +                   (double(ppc_interrupt_count) * 100.0) / double(interrupt_count));
995  
996   #define PRINT_STATS(LABEL, VAR_PREFIX) do {                                                             \
997                  printf("Total " LABEL " count : %d\n", VAR_PREFIX##_count);             \
# Line 1067 | Line 1071 | void sheepshaver_cpu::handle_interrupt(v
1071          if (*(int32 *)XLM_IRQ_NEST > 0)
1072                  return;
1073  
1070        // Do nothing if there is no interrupt pending
1071        if (InterruptFlags == 0)
1072                return;
1073
1074          // Current interrupt nest level
1075          static int interrupt_depth = 0;
1076          ++interrupt_depth;
1077 + #if EMUL_TIME_STATS
1078 +        interrupt_count++;
1079 + #endif
1080  
1081          // Disable MacOS stack sniffer
1082          WriteMacInt32(0x110, 0);
# Line 1113 | Line 1116 | void sheepshaver_cpu::handle_interrupt(v
1116                  // 68k emulator active, within EMUL_OP routine, execute 68k interrupt routine directly when interrupt level is 0
1117                  if ((ReadMacInt32(XLM_68K_R25) & 7) == 0) {
1118                          interrupt_context ctx(this, "68k mode");
1119 + #if EMUL_TIME_STATS
1120 +                        const clock_t interrupt_start = clock();
1121 + #endif
1122   #if 1
1123                          // Execute full 68k interrupt routine
1124                          M68kRegisters r;
# Line 1138 | Line 1144 | void sheepshaver_cpu::handle_interrupt(v
1144                                  }
1145                          }
1146   #endif
1147 + #if EMUL_TIME_STATS
1148 +                        interrupt_time += (clock() - interrupt_start);
1149 + #endif
1150                  }
1151                  break;
1152   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines