[ixp1200] SDK 2.01a : Problems in reserving memory for variables
Yannis Haritakis
haritak at ics.forth.gr
Mon Sep 9 13:03:36 EDT 2002
Hi all,
Under SDK 2.01a the following problem occured:
Eventhough the linker is instructed to use addresses above 0x200
for variables (residing in scratch pad), it falsely allocates space
that starts from address 0x0.
That means address 0x0 is handled both for a variable declared in
scratch pad, and by code that explicitly operates on that address.
I have attached the files of a project that demostrate the problem.
It can easily be demostrated if you run the simulation for 100cycles.
Check the references of thread 0.
Below is the code :
Note that :
1) The linker is instructed of which address space to use for
variables via the menu Build->Settings->Linker->Reserved Space for
variables
2) The false assigment occurs only in optimize for speed, and
optimize for size cases.
3) It only allocates falsely the buf array of thread 0
#include "ixp.h"
void main(void) {
__declspec(scratch) unsigned int buf[20];
unsigned int i;
while (1) {
for (i=0; i<20; i=i+1) buf[i] = 1;
ctx_swap();
for (i=0; i<20; i=i+1) if (buf[i] == 1) buf[i] = 2;
}
}
If anyone is interested on reproducing the problem i can send
the whole project files. (I said If! :-) )
Thanks
Yannis Charitakis
haritak at ics.forth.gr
More information about the ixp1200
mailing list