|
From: <sv...@va...> - 2005-10-10 16:18:08
|
Author: njn
Date: 2005-10-10 17:18:09 +0100 (Mon, 10 Oct 2005)
New Revision: 4898
Log:
Update cache simulator for 64 bit addresses. This probably won't have
caused many inaccuracies so far because it only matters if addresses
above the 4GB line are used. Thanks to Josef W for the patch.
Modified:
trunk/cachegrind/cg_sim.c
Modified: trunk/cachegrind/cg_sim.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cachegrind/cg_sim.c 2005-10-10 11:43:14 UTC (rev 4897)
+++ trunk/cachegrind/cg_sim.c 2005-10-10 16:18:09 UTC (rev 4898)
@@ -48,7 +48,7 @@
int line_size_bits;
int tag_shift;
char desc_line[128];
- int* tags;
+ UWord* tags;
} cache_t2;
=20
/* By this point, the size/assoc/line_size has been checked. */
@@ -74,7 +74,7 @@
c->size, c->line_size, c->assoc);
}
=20
- c->tags =3D VG_(malloc)(sizeof(UInt) * c->sets * c->assoc);
+ c->tags =3D VG_(malloc)(sizeof(UWord) * c->sets * c->assoc);
=20
for (i =3D 0; i < c->sets * c->assoc; i++)
c->tags[i] =3D 0;
@@ -88,7 +88,7 @@
/* Note initialisation and update of 'i'. */
for (i =3D 0, set =3D 0; set < c->sets; set++) {
for (way =3D 0; way < c->assoc; way++, i++) {
- VG_(printf)("%8x ", c->tags[i]);
+ VG_(printf)("%16lx ", c->tags[i]);
}
VG_(printf)("\n");
}
@@ -111,12 +111,12 @@
static /* __inline__ */ =
\
void cachesim_##L##_doref(Addr a, UChar size, ULong* m1, ULong *m2) =
\
{ =
\
- register UInt set1 =3D ( a >> L.line_size_bits) & (L.sets_min=
_1); \
- register UInt set2 =3D ((a+size-1) >> L.line_size_bits) & (L.sets_min=
_1); \
- register UInt tag =3D a >> L.tag_shift; =
\
+ register UInt set1 =3D ( a >> L.line_size_bits) & (L.sets_mi=
n_1); \
+ register UInt set2 =3D ((a+size-1) >> L.line_size_bits) & (L.sets_mi=
n_1); \
+ register UWord tag =3D a >> L.tag_shift; =
\
int i, j; =
\
Bool is_miss =3D False; =
\
- int* set; =
\
+ UWord* set; =
\
=
\
/* First case: word entirely within line. */ =
\
if (set1 =3D=3D set2) { =
\
|