A
Adi
Hi,
I am writing a code which mimicks the memory accesses of an
application. Lets assume that array a[] contains all the addresses
accessed in sequence, check the for loop in the code given below. Now,
i want to mimick these accesses(not absolutely but atleast
relatively). I could see only one solution to that - writing a for
loop(see the code). But it gives extra memory accesses, accesing
address of index i and a along with the to b mimicked accesses.
main()
{
int a[300]; //stores the addresses
char x[5000]; //character array to mimick the memory accesses
int i;
a[0] = 0;
for(i=1;i<300;i++)
a = a[i-1]+16; //storing the addresses in the
array
x[0] = 0;
for(i=1;i<300;i++)
{
x[a]='0'; //mimick the realtive memory
accesses.
}
}
Is there any other solution to bypass these unwanted accesses like
storing value of i in registers etc... ?
Thanks.
I am writing a code which mimicks the memory accesses of an
application. Lets assume that array a[] contains all the addresses
accessed in sequence, check the for loop in the code given below. Now,
i want to mimick these accesses(not absolutely but atleast
relatively). I could see only one solution to that - writing a for
loop(see the code). But it gives extra memory accesses, accesing
address of index i and a along with the to b mimicked accesses.
main()
{
int a[300]; //stores the addresses
char x[5000]; //character array to mimick the memory accesses
int i;
a[0] = 0;
for(i=1;i<300;i++)
a = a[i-1]+16; //storing the addresses in the
array
x[0] = 0;
for(i=1;i<300;i++)
{
x[a]='0'; //mimick the realtive memory
accesses.
}
}
Is there any other solution to bypass these unwanted accesses like
storing value of i in registers etc... ?
Thanks.