Files
ftmemsim-valgrind/cachegrind/cg_arch.h
Florian Krohm a9b2103cf2 This patch is the first installment of the cache info reorganisation.
It's reorg only. No new cache autodetection stuff has been added.

coregrind
pub_tool_cpuid.h is removed as it is no longer exposed to tools.
Its contents has moved to pub_core_cpuid.h.
New file: coregrind/m_cache.c to contain the autodetect code for
cache configurations and define other cache characteristics that
cannot be autodetected (i.e. icaches_maintain_coherence). Most of 
cg-arch/x86-amd64.c was moved here. The cache detection code for
x86-64 needs to be fixed to properly initialise VexCacheInfo. It
currently has cachegrind bias.
m_cache.c exports a single function (to coregrind): 
   VG_(machine_get_cache_info)(VexArchInfo *vai)
This function is called from VG_(machine_get_hwcaps) after hwcaps have
been detected.

cachegrind
Remove cachegrind/cg-{ppc32,ppc43,arm,mips32,s390x,x86-amd64}.c
With the exception of x86/mamd64 those were only establishing a
default cache configuration and that is so small a code snippet that
a separate file is no longer warranted. So, the code was moved to
cg-arch.c. Code was added to extract the relevant info from 
x86-amd64.
New function maybe_tweak_LLc which captures the code to massage the
LLc cache configuration into something the simulator can handle. This
was originally in cg-x86-amd64.c but should be used to all architectures.
Changed warning message about missing cache auto-detect feature
to be more useful. Adapted filter-stderr scripts accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13028
2012-10-07 19:47:04 +00:00

75 lines
2.8 KiB
C

/*--------------------------------------------------------------------*/
/*--- Arch-specific declarations, cache configuration. cg_arch.h ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Cachegrind, a Valgrind tool for cache
profiling programs.
Copyright (C) 2002-2012 Nicholas Nethercote
njn@valgrind.org
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
The GNU General Public License is contained in the file COPYING.
*/
#ifndef __CG_ARCH_H
#define __CG_ARCH_H
// For cache simulation
typedef struct {
Int size; // bytes
Int assoc;
Int line_size; // bytes
} cache_t;
#define MIN_LINE_SIZE 16
// clo_*c used in the call to VG_(str_clo_cache_opt) should be statically
// initialized to UNDEFINED_CACHE.
#define UNDEFINED_CACHE { -1, -1, -1 }
// If arg is a command line option configuring I1 or D1 or LL cache,
// then parses arg to set the relevant cache_t elements.
// Returns True if arg is a cache command line option, False otherwise.
Bool VG_(str_clo_cache_opt)(Char *arg,
cache_t* clo_I1c,
cache_t* clo_D1c,
cache_t* clo_LLc);
// Checks the correctness of the auto-detected caches.
// If a cache has been configured by command line options, it
// replaces the equivalent auto-detected cache.
// Note that an invalid auto-detected cache will make Valgrind exit
// with an fatal error, except if the invalid auto-detected cache
// will be replaced by a command line defined cache.
void VG_(post_clo_init_configure_caches)(cache_t* I1c,
cache_t* D1c,
cache_t* LLc,
cache_t* clo_I1c,
cache_t* clo_D1c,
cache_t* clo_LLc);
void VG_(print_cache_clo_opts)(void);
#endif // __CG_ARCH_H
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/