Re: [hatari-devel] New WinUAE core issue with Bad Mood?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 04/12/2014 20:05, Eero Tamminen a écrit :

When I did cross-checking with previous WinUAE CPU core
(from end of September), the behavior differed:
- EmuTOS boots fine also in TT & Falcon mode
- Profiling works fine also in Falcon mode

But switching from Falcon to STE on boot still causes problems
for profiling.   I.e. there's some bug in Falcon -> STE
machine type switching with WinUAE core.


Hi

with new version, I already had to fix some switching problems between cpu options and machine types, but it's possible some cases are still remaining. I will try to reproduce your example.


As to the cycles information provided to the profiler with
previously available methods, that information seems to be
now completely bogus for TT & Falcon.  Values are never sane,
either zeros or in millions, depending on where the profiler
takes them.

This is the profiler code for getting the cycles:
--------- profilecpu.c ------------
/* This is relevant with WinUAE CPU core:
  * - the default cycle exact variant needs this define to be non-zero
  * - non-cycle exact and MMU variants need this define to be 0
  *   for cycle counts to make any sense
  */
#define USE_CYCLES_COUNTER 1
...
#if USE_CYCLES_COUNTER
         /* Confusingly, with DSP enabled, cycle counter is for this
          * instruction, without DSP enabled, it's a monotonically
          * increasing counter.
          */
         if (bDspEnabled) {
                 cycles = Cycles_GetCounter(CYCLES_COUNTER_CPU);
         } else {
                 Uint32 newcycles = Cycles_GetCounter(CYCLES_COUNTER_CPU);
                 cycles = newcycles - cpu_profile.prev_cycles;
                 cpu_profile.prev_cycles = newcycles;
         }
#else
         cycles = CurrentInstrCycles + nWaitStateCycles;
#endif
------------------------------------

You can get debugging info for the values by setting
DEBUG define in profilecpu.c.


I see the problem ; in old winuae code, CYCLES_COUNTER_CPU was used to measure instruction's cycle, but that's not optimal to maintain this counter, as the new core as some variables to store instructions' cycles and don't maintain CYCLES_COUNTER_CPU.

I will give a look to this to replace Cycles_GetCounter(CYCLES_COUNTER_CPU); by other variables.

Nicolas




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/