Related articles |
---|
Simulating memory accesses punter_pun@yahoo.com (2004-03-06) |
Re: Simulating memory accesses alex@iliasov.org (2004-03-11) |
Re: Simulating memory accesses vbdis@aol.com (2004-03-11) |
From: | punter_pun@yahoo.com (Adi) |
Newsgroups: | comp.compilers |
Date: | 6 Mar 2004 13:46:49 -0500 |
Organization: | http://groups.google.com |
Keywords: | architecture, question |
Posted-Date: | 06 Mar 2004 13:46:49 EST |
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[i] 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[i] = a[i-1]+16; //storing the addresses in the
array
x[0] = 0;
for(i=1;i<300;i++)
{
x[a[i]]='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.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.