Re: [hatari-devel] WinUAE and 030 cache hits/misses? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Maybe cleaner would be to move all these variables to a global
struct, e.g. something like this:
/* information about current instrcution */
struct {
int instrCycles;
int waitStateCycles;
bool iCacheMiss;
} CpuState;
I would enjoy this.
I find cleaner to have the same family of informations grouped together.
> Were you thinking of returning a struct instead, or passing
> prefetch functions a pointer to bool which can be updated?
I didn't have a closer look at t he code, but I think there's probably no need to return a structure.
We can access them from the global structure.
If you add it, I can quickly improve the cycles counting by taking into account the hit/miss flag.
I'm sure this would increase the quality of the approximative cycles computing I'm curently doing (and maybe let some timing critic programs run a bit better), especially the programs that deals with the DSP for music.
Laurent
----- Mail original -----
De: "Eero Tamminen" <oak@xxxxxxxxxxxxxx>
À: hatari-devel@xxxxxxxxxxxxxxxxxxx
Envoyé: Lundi 21 Janvier 2013 15:20:39
Objet: Re: [hatari-devel] WinUAE and 030 cache hits/misses?
Hi,
On maanantai 21 tammikuu 2013, laurent.sallafranque@xxxxxxx wrote:
> Yes, this would be fine, also for cycles timings counting.
> I don't know if a global variable is the best way to do it
Hm. At least I could experiment with global variable, to see
whether any misses are reported...
There are already quite a lot of global variables in regards to
current instruction CPU is handling, for example CurrentInstrCycles
and nWaitStateCycles.
Maybe cleaner would be to move all these variables to a global
struct, e.g. something like this:
/* information about current instrcution */
struct {
int instrCycles;
int waitStateCycles;
bool iCacheMiss;
} CpuState;
?
> or changing the functions to return the state, but we need this
> information.
fill_cache*() functions are called by get_word_ce*_prefetch()
functions of which the appropriate one is mapped to x_prefetch()
function pointer and already returns the opcode.
Were you thinking of returning a struct instead, or passing
prefetch functions a pointer to bool which can be updated?
That would then need to be passed in m68k_run_*() functions:
-> do_specialties() -> DebugCpu_Check() -> profiling function
Nothing else in the debugger besides profiler has any use for
this info though.
At this point it would be much better if the passed information
would be a pointer to some struct that contains also the other
required info and that struct would be used & passed to all
functions requiring such info.
> For the cycles counting, in terms of timings, what is the difference
> between an instruction miss and hits ?
Cache miss = Instruction pipeline stall and access to CPU-external RAM...
How much faster CPU internal cache access is to access to RAM?
- Eero